Function: modularity()
ts
function modularity(graph, communities, options?): number;Modularity of a partition (Newman and Girvan): the share of link weight inside communities minus what a random graph with the same degrees would have. Between −0.5 and 1; 0 for one community holding everything.
Parameters
| Parameter | Type |
|---|---|
graph | GraphLike |
communities | ArrayLike<number> |
options | CommunityOptions |
Returns
number