Fully Dynamic Algorithm for Top-k Densest Subgraphs

Muhammad Anis Uddin Nasir, Aristides Gionis, Gianmarco De Francisci Morales, Sarunas Girdzijauskas

Abstract

Identifying the densest regions within a network is a fundamental task in graph mining, with applications ranging from community detection to fraud prevention. However, real-world graphs are often massive and highly dynamic, making traditional global re-computation methods infeasible. This paper presents a novel fully dynamic algorithm for finding the top-$k$ densest subgraphs. By utilizing a "Bag of Snowballs" data structure and a local update strategy, the proposed method achieves up to a 100,000x speedup over state-of-the-art baselines while maintaining high subgraph quality.

Introduction

Finding the "densest" part of a graph—defined as the subgraph with the highest average degree—is a cornerstone of network analysis. In practice, analysts rarely require just a single dense spot; they need the top-$k$ densest subgraphs to identify multiple distinct communities or anomalies.

Modern graph data, such as social media interactions or financial transactions, arrives as a continuous stream. In a "sliding window" model, where only the most recent $N$ edges are considered, every update (edge arrival or expiration) can potentially shift the top-$k$ results. The challenge is twofold: finding $k$ disjoint densest subgraphs is NP-hard, and re-running static algorithms for every update is computationally prohibitive for high-velocity streams.

Decomposition of a graph (a) into disjoint dense subgraphs (b).

The "Bag of Snowballs" Framework

The core innovation of this work is the shift from global computation to a local update strategy. The authors observe that most updates in a massive graph only affect a small, localized region. To exploit this, they introduce the Bag of Snowballs data structure.

Key Components:

  • The "Snowball": An incremental data structure storing a strongly connected subgraph. It maintains a specific invariant: every vertex within the snowball has a core number equal to the "main core" of that specific subgraph. This leverages the fact that the main core of a graph provides a 2-approximation of the densest subgraph.
  • The Bag: The algorithm maintains a "bag" of these vertex-disjoint snowballs. Instead of monitoring the entire graph, it tracks only high-degree vertices that are viable candidates for the top-$k$ densest subgraphs.
The 'Bag of Snowballs' data structure maintaining disjoint candidate subgraphs $D_1$ and $D_2$.

Local Update Logic

When an edge is added or removed, the algorithm identifies which snowballs are affected.

  1. Pruning: If a vertex's degree drops below the density of the current $k$-th densest subgraph, it is pruned from the bag. This is particularly effective in real-world graphs that follow a power-law distribution, as most nodes have low degrees and can never be part of a top-$k$ result.
  2. Merging and Growth: If a new edge increases the density of a region, snowballs may grow or merge.
  3. Independence: By treating dense regions as independent "snowballs," the algorithm prevents a change in one community from triggering redundant calculations in unrelated parts of the graph.

Experimental Evaluation

The researchers evaluated the algorithm (referred to as GR) on seven large-scale public datasets, including social networks like Friendster (1.8 billion edges) and co-authorship networks like DBLP. They simulated streaming behavior using both Breadth-First Search (BFS) and Depth-First Search (DFS) edge arrival orderings.

Key Results:

  • Efficiency: GR outperformed state-of-the-art competitors, such as Charikar’s greedy algorithm and Epasto’s dynamic algorithm, by three to five orders of magnitude in update time.
  • Quality: Surprisingly, the local update strategy often produced denser subgraphs than global heuristics. On the Amazon dataset, subgraphs were 1.5x denser than those found by existing baselines.
  • Scalability: Average update time remained nearly constant even as the sliding window size scaled from 10,000 to 10 million edges.
  • Memory Footprint: The approach is significantly more memory-efficient than "pipeline" methods because it avoids replicating the graph $k$ times.

Conclusion and Future Work

This work demonstrates that local updates and core-decomposition proxies can effectively solve the top-$k$ densest subgraph problem in dynamic environments. While the current algorithm focuses on node-disjoint subgraphs, future research could extend this framework to handle overlapping dense regions or implement strict space bounds on the "bag" for extremely memory-constrained environments. The current $2k$-approximation for the sum of densities provides a strong theoretical foundation for an algorithm that already shows exceptional empirical performance.

Summary updated

BibTeX
@inproceedings{nasir2017fully,
  author = {Muhammad Anis Uddin Nasir and Aristides Gionis and Gianmarco De Francisci Morales and Sarunas Girdzijauskas},
  title = {{Fully Dynamic Algorithm for Top-k Densest Subgraphs}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2017},
  doi = {10.1145/3132847.3132966},
}
Figure