pub fn modularity<N>(
nodes: &[N],
edges: &[(N, N, f32)],
assignment: &[(N, usize)],
resolution: f64,
) -> f64Expand description
Public modularity helper over the abstract graph for a given node→community
labelling (as produced by louvain). Exposed for tests and callers that
want to score a partition. Edges are treated as undirected; resolution is
the γ parameter. Returns 0.0 for an edgeless graph.