Skip to content

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 ​

ParameterType
graphGraphLike
communitiesArrayLike<number>
optionsCommunityOptions

Returns ​

number

Released under the MIT License.