pub fn modularity<T>(
graph: &SparseGraph<T>,
labels: &[usize],
resolution: f64,
) -> f64Expand description
Modularity of a partition.
Q = 1/2m * sum_c (e_c - gamma * K_c^2 / 2m), with e_c twice the internal
edge weight and K_c the summed degree of cluster c. Self-loops count
once per CSR entry, as in igraph.
§Params
graph- UndirectedSparseGraphlabels- Community per noderesolution- Resolution parameter (gamma)
§Returns
The modularity