Skip to main content
QUICK REVIEW

[Paper Review] Bayan Algorithm: Detecting Communities in Networks Through Exact and Approximate Optimization of Modularity

Samin Aref, Mahdi Mostajabdaveh|arXiv (Cornell University)|Sep 10, 2022
Complex Network Analysis TechniquesPhysics and Astronomy6 citations
TL;DR

The Bayan algorithm is a specialized exact and approximate method for community detection that uses a branch-and-cut integer programming approach to optimize modularity, guaranteeing globally optimal or near-optimal partitions. It outperforms existing methods by solving previously intractable instances—up to 4500 edges—on standard hardware, with a publicly available Python implementation (bayanpy).

ABSTRACT

Community detection is a classic network problem with extensive applications in various fields. Its most common method is using modularity maximization heuristics which rarely return an optimal partition or anything similar. Partitions with globally optimal modularity are difficult to compute, and therefore have been underexplored. Using structurally diverse networks, we compare 30 community detection methods including our proposed algorithm that offers optimality and approximation guarantees: the Bayan algorithm. Unlike existing methods, Bayan globally maximizes modularity or approximates it within a factor. Our results show the distinctive accuracy and stability of maximum-modularity partitions in retrieving planted partitions at rates higher than most alternatives for a wide range of parameter settings in two standard benchmarks. Compared to the partitions from 29 other algorithms, maximum-modularity partitions have the best medians for description length, coverage, performance, average conductance, and well clusteredness. These advantages come at the cost of additional computations which Bayan makes possible for small networks (networks that have up to 3000 edges in their largest connected component). Bayan is several times faster than using open-source and commercial solvers for modularity maximization, making it capable of finding optimal partitions for instances that cannot be optimized by any other existing method. Our results point to a few well performing algorithms, among which Bayan stands out as the most reliable method for small networks. A Python implementation of the Bayan algorithm (bayanpy) is publicly available through the package installer for Python.

Motivation & Objective

  • To address the lack of guaranteed optimality in heuristic modularity maximization algorithms, which often fail to recover ground-truth communities.
  • To develop a method that provides either exact optimal partitions or high-quality approximations within a known optimality gap.
  • To push the boundary of exact modularity maximization beyond previous limits, especially for mid-sized real-world networks.
  • To create a practical, efficient, and reliable tool for researchers needing provably optimal or near-optimal community detection results.
  • To demonstrate the superiority of specialized algorithms over general-purpose heuristics in recovering ground-truth community structures.

Proposed method

  • The algorithm uses an integer programming (IP) formulation of the modularity maximization problem, with binary variables representing node assignments to communities.
  • It applies a branch-and-cut scheme that iteratively adds valid inequalities (triangular constraints) to tighten the LP relaxation and eliminate fractional solutions.
  • The method uses a combination of upper bounds (from LP relaxation) and lower bounds (from heuristic solutions, e.g., Combo algorithm) to guide the search.
  • At each node of the branch-and-bound tree, cuts are added based on violated triple constraints (x_ij + x_ik + x_jk = 0 or ≥ 2), partitioning the feasible space.
  • For lower bounds in subproblems, the algorithm modifies the modularity matrix by subtracting a tuned delta value δ to discourage certain node triples from coalescing.
  • Termination occurs when the incumbent (best feasible solution) and best bound converge (gap = 0) for exact solutions, or when a time/optimality gap threshold is met for approximate solutions.

Experimental results

Research questions

  • RQ1Can a specialized algorithm achieve exact modularity maximization for real-world networks beyond the limits of prior exact solvers?
  • RQ2How does the performance of Bayan compare to 30 existing community detection methods in recovering ground-truth community structures?
  • RQ3To what extent does Bayan improve upon the scalability and reliability of exact modularity optimization compared to commercial and open-source solvers?
  • RQ4Can the branch-and-cut approach with tailored cuts and bound tightening achieve optimal or near-optimal solutions for networks with up to 4500 edges?
  • RQ5What is the impact of using a heuristic-based lower bound with dynamic δ-tuning on convergence speed and solution quality?

Key findings

  • Bayan successfully computes globally optimal partitions for networks with up to 4500 edges in the largest connected component, a scale beyond any prior exact method.
  • The algorithm is several times faster than open-source and commercial solvers (e.g., Gurobi) on equivalent instances, enabling exact solutions on previously intractable problems.
  • In benchmark tests on synthetic and real networks, Bayan demonstrated superior accuracy and stability in retrieving ground-truth communities compared to 30 alternative methods.
  • The approximate version of Bayan achieves high-quality solutions within a controlled optimality gap, making it suitable for larger networks where exact optimization is impractical.
  • The Python library bayanpy, available via pip, enables widespread access and integration into existing research workflows for community detection.
  • The study confirms that heuristic algorithms like Louvain, Leiden, and Combo often fail to approach optimal partitions, with dissimilarity scores to optimal solutions exceeding 0.5 in adjusted mutual information.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.