
Graphology Communities Louvain
Louvain method for community detection to be used with graphology
.
Installation
npm install graphology-communities-louvain
Usage
Detect the communities of the given graph using Louvain's method.
import louvain from 'graphology-communities-louvain';
const communities = louvain(graph);
louvain.assign(graph);
louvain.assign(graph, {
attributes: {
weight: 'myCustomWeight',
community: 'myCustomCommunity'
}
});
Arguments
- graph Graph: graph to which you want to get the best partitioning.
- options ?object: options:
- attributes ?object: attributes' names:
- weight ?string [
weight
]: name of the edges' weight attribute. - community ?string [
community
]: name of the node attribute holding community information