Densest Subgraph in Streaming and MapReduce

Bahman Bahmani, Ravi Kumar, Sergei Vassilvitskii

Abstract

Finding the densest subgraph is a core task in graph mining, with applications ranging from community detection to spam identification. However, traditional exact and greedy algorithms fail to scale to modern "internet-sized" graphs. This paper presents a novel class of pass-efficient algorithms that achieve near-optimal density approximations in a logarithmic number of passes. By relaxing the greedy node-removal process, these algorithms enable large-scale computation on graphs with billions of edges using streaming and MapReduce frameworks.

Introduction

The Densest Subgraph Problem (DSP) aims to identify a subset of nodes in a graph that maximizes the ratio of edges to nodes. This density metric is a powerful indicator of structural significance; for instance, it can reveal tightly-knit communities in social networks or "link farms" used by web spammers.

While exact solutions using max-flow exist, they are computationally prohibitive for massive datasets. Charikar’s well-known greedy algorithm provides a 2-approximation but requires $O(n)$ passes, making it impractical for graphs with millions or billions of nodes. This research addresses the need for algorithms that are both accurate and efficient in terms of data passes.

Methods: The Relaxed Greedy Approach

The authors introduce a "relaxed" greedy approach designed for high-performance computing environments like MapReduce and streaming systems.

  1. Batch Removal: Unlike the standard greedy algorithm that removes one node at a time, this approach removes all nodes whose degree falls below a threshold—specifically, less than $2(1+\epsilon)$ times the current density.
  2. Pass Efficiency: This batching strategy reduces the number of required passes from $O(n)$ to $O(\log_{1+\epsilon} n)$. For a graph with millions of nodes, this translates to a reduction from thousands of passes to just a handful.
  3. Theoretical Bounds: The authors prove that this approach maintains a $2(1+2\epsilon)$-approximation of the optimal density.
  4. Extensions and Implementation: The logic is extended to directed graphs and "large" densest subgraphs (minimum $k$ nodes). Implementation details include using MapReduce for distributed degree counting and node filtering, and Count-Sketch for memory-efficient streaming.

Datasets

The algorithms were evaluated on several massive real-world datasets, ranging from undirected social networks to massive directed follower graphs.

Table of datasets used in the evaluation, showing node and edge counts for Flickr, IM, LiveJournal, and Twitter.

Key Results and Insights

The primary insight of this work is that perfect greediness is not required for high-quality results. Removing large batches of low-quality nodes significantly accelerates the process with minimal impact on accuracy.

Trade-off between the parameter epsilon, approximation quality, and the number of passes for the Flickr and IM datasets.
  • Speed and Scalability: The algorithm successfully processed the Yahoo! Messenger (IM) graph, containing 6.1 billion edges, in under 260 minutes using MapReduce.
  • Empirical Accuracy: While the theoretical bound is $2(1+2\epsilon)$, the algorithm performs much better in practice. On SNAP datasets, the empirical approximation factor stayed between 1.0 and 1.4. For the Flickr graph, setting $\epsilon=1$ reduced passes from 11 to 5 while maintaining approximately 90% accuracy.
  • Graph Shrinkage: A key observation was that graph size decreases rapidly in the initial passes, meaning the most significant filtering occurs early in the computation.

Limitations and Future Work

Despite its efficiency, the algorithm still generally requires $O(n)$ space to track node degrees, which may challenge memory limits for trillion-node graphs even with sketching. For directed graphs, the algorithm currently assumes the ratio of the sizes of the two node sets is known, requiring multiple runs with different estimates. Future work may explore how heavy-tailed degree distributions in social networks contribute to the algorithm's superior empirical performance compared to theoretical worst-case bounds.

Summary updated

BibTeX
@article{bahmani2012densest,
  author = {Bahman Bahmani and Ravi Kumar and Sergei Vassilvitskii},
  title = {{Densest Subgraph in Streaming and MapReduce}},
  journal = {Proc. VLDB Endow.},
  year = {2012},
  doi = {10.14778/2140436.2140442},
}
Figure