Skip to main content

detect_communities

Function detect_communities 

Source
pub fn detect_communities(
    colony: &Colony,
    max_iterations: usize,
) -> CommunityResult
Expand description

Run label propagation community detection.

Each node starts with its own label. In each iteration, each node adopts the label most common among its neighbors (weighted by edge weight). Converges when no labels change.

Uses edge weight thresholding: only edges above the median weight are considered during neighbor voting. This prunes weak cross-topic edges and preserves within-topic clusters, improving NMI.