Abstract
Modern network analysis often involves graphs with billions of edges, posing a significant challenge for traditional community detection algorithms that require the entire graph to be stored in memory. This paper introduces a highly efficient, one-pass streaming algorithm (STR) for community detection. By storing only three integers per node and processing edges as they arrive, the algorithm achieves a 10x speedup over state-of-the-art methods while maintaining competitive accuracy on massive datasets.
Introduction
Graph clustering, or community detection, identifies groups of nodes with dense internal connections and sparse external connections. As datasets like social networks and web crawls scale to billions of edges, traditional algorithms such as the Louvain method or spectral clustering hit a "memory wall." These methods often require dozens of gigabytes of RAM, making them impractical for standard hardware. The proposed algorithm addresses this by operating in an edge streaming setting, where each edge is processed exactly once without the need to store the full adjacency list.
Methodology
The algorithm employs a novel greedy strategy based on local modularity optimization. For each node $i$, the system maintains:
- Community Index ($c_i$): The current group assignment.
- Current Degree ($d_i$): The number of edges connected to node $i$ seen so far.
- Community Volume ($v_k$): The sum of degrees of all nodes in community $k$.
When a new edge $(i, j)$ arrives, the algorithm updates degrees and volumes. If the volumes of both communities are below a threshold parameter $v_{max}$, the node in the smaller community joins the larger one. This $v_{max}$ parameter prevents the formation of a "giant component" and ensures a granular community structure. The approach is memory-efficient, requiring only $O(n)$ space, where $n$ is the number of nodes.
Experimental Evaluation
The algorithm was evaluated using datasets from the Stanford Large Network Dataset Collection (SNAP), ranging from co-purchasing networks (Amazon) to massive social networks (Friendster with 1.8 billion edges).
Performance and Accuracy
The primary advantage of the STR algorithm is its speed. On the Friendster dataset, it completed processing in just 241 seconds, whereas the next fastest competitor (SCD) took nearly 4 hours. In terms of memory, STR required only 1.6 GB of RAM for Friendster, compared to the ~29 GB required just to store the edge list.
Despite its simplicity and streaming nature, the algorithm maintains competitive accuracy. As shown in the performance metrics, its F1-scores and Normalized Mutual Information (NMI) are comparable to non-streaming, more complex algorithms, particularly on the largest datasets.
Conclusion
The proposed streaming algorithm offers a scalable solution for community detection in massive graphs. Its $O(n)$ memory footprint and one-pass processing make it ideal for real-time analysis of billion-edge networks. While currently limited to disjoint communities and sensitive to the $v_{max}$ parameter, it sets a new benchmark for efficiency in large-scale graph analysis.
Summary updated