greedy_modularity_optimization

Function greedy_modularity_optimization 

Source
pub fn greedy_modularity_optimization<N, E, Ix>(
    graph: &Graph<N, E, Ix>,
    max_iterations: usize,
) -> CommunityStructure<N>
where N: Node + Clone + Hash + Eq + Debug, E: EdgeWeight + Into<f64> + Copy, Ix: IndexType,
👎Deprecated since 0.1.0-beta.2: Use greedy_modularity_optimization_result instead for standardized community detection API
Expand description

Greedy modularity optimization algorithm

This is a simplified version of modularity optimization that uses a greedy approach without simulated annealing. It’s faster but may get stuck in local optima.

§Arguments

  • graph - The graph to analyze
  • max_iterations - Maximum number of iterations

§Returns

  • A community structure with optimized modularity

§Time Complexity

O(k * n * d) where k is the number of iterations, n is the number of nodes, and d is the average degree. Each iteration involves finding the best community for each node based on local modularity improvements.

§Space Complexity

O(n) for storing community assignments and tracking modularity gains.