Skip to content

@graphty/algorithms / index / labelPropagation

Function: labelPropagation() ​

labelPropagation(graph, options): LabelPropagationResult

Defined in: algorithms/community/label-propagation.ts:378

Label Propagation Algorithm Each node adopts the most frequent label among its neighbors

Parameters ​

graph ​

Graph

Undirected graph (can be weighted)

options ​

LabelPropagationOptions = {}

Algorithm options

Returns ​

LabelPropagationResult

Community assignments

Time Complexity: O(m) per iteration, typically O(km) for k iterations Space Complexity: O(n)