pub fn cluster(graph: &KnowledgeGraph) -> HashMap<usize, Vec<String>>Expand description
Run community detection on the graph. Returns {community_id: [node_ids]}.
Uses the Leiden algorithm: greedy modularity optimization (Louvain phase) followed by a refinement phase that ensures communities are internally well-connected.