Skip to main content

modularity

Function modularity 

Source
pub fn modularity<T, S>(graph: &S, communities: &[usize]) -> SparseResult<T>
where T: Float + SparseElement + Debug + Copy + Sum + 'static, S: SparseArray<T>,
Expand description

Calculate modularity of a community partition

Modularity measures the quality of a community structure.

§Arguments

  • graph - The sparse adjacency matrix representing the graph
  • communities - Community assignment for each vertex

§Returns

Modularity value (typically between -0.5 and 1.0)