本文へ移動

@eightkk/vue-weave / core / detectGraphCommunities

Function: detectGraphCommunities() ​

detectGraphCommunities(nodes, edges, options?): GraphCommunityResult

Defined in: src/core/graphAnalysis.ts:302

Louvain community detection: local moving of nodes to the neighbouring community with the best modularity gain, then aggregation of communities into super-nodes, repeated until no node moves. Edge direction is ignored, parallel edges and self-loops add their weights. Deterministic: nodes are visited in input order and ties keep the current community. Modularity is Q = Σ_c [ in_c / 2m − γ (tot_c / 2m)² ]. Expect roughly O(E log V) time on typical graphs.

Parameters ​

nodes ​

readonly IdentifiedNode[]

edges ​

readonly GraphEdge<unknown>[]

options? ​

GraphCommunityOptions = {}

Returns ​

GraphCommunityResult

MIT ライセンスで公開しています。