Linear-time Hierarchical Community Detection

Ryan A. Rossi, Nesreen K. Ahmed, Eunyee Koh, Sungchul KimarXiv 2019

Abstract

Modern network analysis requires algorithms that can identify community structures across multiple scales while maintaining computational efficiency for massive datasets. This paper introduces hLP (hierarchical Label Propagation), a novel algorithm that achieves hierarchical community detection in linear time $O(M)$ relative to the number of edges. By alternating between iterative label propagation and super-graph construction, hLP uncovers the multi-scale organization of networks—from localized clusters to global structures—outperforming traditional methods in both speed and modularity.

Introduction

In network science, communities are defined as groups of nodes with dense internal connections and sparse external connections. Identifying these structures is critical for biological modeling, social network analysis, and infrastructure planning. However, existing algorithms typically face a trade-off between scalability and depth. High-quality algorithms often suffer from non-linear time complexities, making them unsuitable for "big data" graphs. Furthermore, most methods provide a "flat" partition, failing to capture the inherent hierarchical nature of real-world systems (e.g., families within neighborhoods, neighborhoods within cities).

Methodology: The hLP Algorithm

The proposed hLP approach operates through a recursive two-step process that progressively coarsens the graph:

  1. Label Propagation (LP): Initially, every node is assigned a unique community label. In each iteration, a node adopts the label most frequent among its immediate neighbors. This continues until assignments stabilize. To enhance convergence, a "stability" hyperparameter ($\delta$) is used to freeze nodes whose labels remain unchanged over multiple iterations.
  2. Super-Graph Construction: Once communities are identified, the algorithm "shrinks" the graph. Each community is collapsed into a single "super-node" in a new, coarser graph. Edges are drawn between super-nodes if any members of their respective original communities were connected.
Hierarchical community detection levels showing the progression from 40 to 2 communities.

This cycle repeats, generating a hierarchy of increasingly coarse graphs ($G_1, G_2, \dots, G_L$) until the network is reduced to a minimal number of nodes. Because the graph size shrinks drastically at each level, the total computational work remains linear ($O(M)$).

Experimental Evaluation

The authors evaluated hLP against five baseline methods (including Louvain and Spectral Clustering) across diverse real-world datasets from the Network Repository, ranging from social networks (soc-yahoo-msg) to infrastructure (road-luxem).

Key Results

  • Modularity Superiority: hLP achieved the highest modularity scores across all tested datasets. The hierarchical process acts as a multi-scale filter, allowing the algorithm to escape local optima that often trap standard flat label propagation methods.
  • Computational Efficiency: On the Luxembourg road network (~114k nodes, ~239k edges), a serial Python implementation identified the first layer of ~9,500 communities in just 10.2 seconds. Subsequent layers were processed in under a second as the graph collapsed.
  • Complexity: Formal analysis confirms a time complexity of $O(M)$ and space complexity of $O(N)$, where $M$ is edges and $N$ is nodes.
Multi-scale representation of a large network at levels $C^4$ and $C^5$, demonstrating the algorithm's ability to condense complex structures for human interpretation.

Discussion and Future Work

hLP treats visualization as a primary utility, allowing researchers to "zoom" through different levels of a network's hierarchy. For instance, a complex road network can be condensed into meaningful "regions" for easier interpretation.

Despite its strengths, the authors identify several areas for future research. While the LP step is inherently parallelizable, current experiments utilized serial implementations. Additionally, like many modularity-based methods, hLP may face a "resolution limit" where very small communities are merged into larger ones too rapidly. Future work will also focus on extending hLP to dynamic or streaming graphs, where localized updates could provide significant efficiency gains over re-running the algorithm from scratch.

Summary updated

BibTeX
@misc{rossi2019linear,
  author = {Ryan A. Rossi and Nesreen K. Ahmed and Eunyee Koh and Sungchul Kim},
  title = {{Linear-time Hierarchical Community Detection}},
  year = {2019},
  eprint = {1906.06432},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1906.06432},
}
Figure