Approximately Counting Subgraphs in Data Streams

Hendrik Fichtenberger, Pan Peng

This paper, "Approximately Counting Subgraphs in Data Streams" by Hendrik Fichtenberger and Pan Peng, presents a significant leap in our ability to analyze massive graphs. By building a bridge between two different worlds of algorithm design—query-based sublinear algorithms and streaming algorithms—the authors provide new, more efficient ways to count complex patterns in data that is too large to store in memory.

TL;DR

The authors introduce a generic framework that transforms "round-adaptive" query algorithms into multi-pass streaming algorithms. Using this, they achieve a state-of-the-art 3-pass algorithm for counting any arbitrary subgraph in "turnstile" streams (where edges can be both added and deleted) and resolve a standing conjecture regarding clique counting in low-degeneracy graphs.

What Problem Does This Paper Address?

Counting subgraphs—like triangles, cliques, or cycles—is a cornerstone of network science, used for everything from social network analysis to biological motif detection. However, modern graphs are often so massive that they must be processed as data streams: edges arrive one by one, and the algorithm has very limited memory (sublinear in the number of edges $m$).

The challenge is twofold:

  1. Generality: Most existing streaming algorithms are "one-trick ponies," designed specifically for triangles or cliques. Counting an arbitrary subgraph $H$ is much harder.
  2. Model Complexity: Many algorithms only work in "insertion-only" streams. Real-world databases often require "turnstile" streams, where edges can be deleted, making it significantly harder to maintain accurate counts.

Methods

The paper’s core contribution is a generic transformation.

In the query access model, an algorithm "asks" the graph questions (e.g., "What is the degree of vertex $v$?" or "Give me a random neighbor of $u$"). If an algorithm can be organized into $k$ rounds—where all queries in a round are independent but can depend on results from previous rounds—the authors prove it can be converted into a $k$-pass streaming algorithm.

To make this work for the difficult turnstile model (with deletions), they use $\ell_0$-samplers. These are sophisticated data structures that allow the algorithm to "sample" an edge or a neighbor even when the underlying graph is constantly changing due to deletions. They also introduce a "relaxed" version of the query model that accounts for the fact that streaming samplers aren't always perfectly uniform.

Datasets

Not discussed in the paper. This is a theoretical work focused on proving mathematical bounds and algorithm complexity rather than empirical evaluation on specific datasets.

Key Insights and Ideas

  • Adaptivity equals Passes: The "aha moment" is the formal link between round-adaptivity in query models and pass complexity in streaming. If you can solve a problem by looking at a graph in $k$ batches of queries, you can solve it by streaming over the data $k$ times.
  • Fractional Edge-Cover ($\rho(H)$): The authors show that the space complexity of counting a subgraph $H$ is naturally tied to its fractional edge-cover number. This is a mathematical property representing the "densest" way to cover the vertices of $H$ with its edges.
  • Settling the Clique Conjecture: By applying their framework to a known query algorithm for cliques (the ERS algorithm), they proved that cliques can be counted in constant passes in graphs with low degeneracy (a measure of how "sparse" a graph is). This resolved a conjecture from PODS 2020.

Key Results

  • Arbitrary Subgraphs: They provide a 3-pass turnstile algorithm to $(1 \pm \epsilon)$-approximate the count of any subgraph $H$. The space complexity is $\tilde{O}(\frac{m^{\rho(H)}}{\epsilon^2 \#H})$. This matches the best known insertion-only results but works in the much harder turnstile model.
  • Low-Degeneracy Cliques: They developed a $5r$-pass algorithm (where $r$ is the size of the clique) for graphs with degeneracy $\lambda$. The space used is $\tilde{O}(\frac{m \lambda^{r-2}}{\epsilon^2 \#K_r})$. This is the first constant-pass algorithm to achieve this specific space bound, which is much more efficient for sparse, real-world networks.

Limitations and Future Work

While the 3-pass result is a major improvement, the authors leave open whether a 2-pass algorithm is possible for arbitrary subgraphs with the same space complexity.

Additionally, for the clique counting result, the number of passes ($5r$) still grows with the size of the clique. A promising future direction is determining if a "universal" constant number of passes (independent of $r$) can be achieved for counting cliques in low-degeneracy graphs. Finally, like most streaming algorithms, the space efficiency degrades if the subgraph being searched for is extremely rare (i.e., $\#H$ is very small).

Summary updated

BibTeX
@inproceedings{fichtenberger2022approximately,
  author = {Hendrik Fichtenberger and Pan Peng},
  title = {{Approximately Counting Subgraphs in Data Streams}},
  booktitle = {PODS},
  year = {2022},
  url = {https://openreview.net/forum?id=kMRPbSrRf7},
}
Figure