TL;DR
This paper introduces the first space-optimal streaming algorithms for counting triangles in graphs where edges can repeat or be retroactively deleted (the "Right-to-be-Forgotten" model). By deploying a clever non-monotone dynamic sampling technique, the authors match the theoretical space-complexity lower bounds of idealized, single-arrival graph streams without any asymptotic penalty.
What Problem Does This Paper Address?
Most graph streaming algorithms operate under a perfect assumption: each edge in a graph arrives exactly once. However, real-world data streams—like financial transaction logs, communication networks, or social media interactions—are messy. They are inherently multigraphs, where the same edge can appear thousands of times. Naively applying standard triangle-counting algorithms to these streams introduces massive statistical bias because edge frequency and arrival order distort standard estimators.
Furthermore, modern privacy regulations (like GDPR) mandate a "Right to be Forgotten," meaning systems must be able to completely erase an item's history. In a graph stream, a "forget" operation retroactively deletes all prior occurrences of an edge.
This paper tackles the challenge of computing an $(\varepsilon, \delta)$-approximation of the number of triangles in the underlying simple graph under two realistic models:
- Repeated-Edge Arrival Model: Edges can repeat arbitrarily.
- Right to be Forgotten Graph Streaming (RFGS) Model: Edges can repeat and be abruptly wiped from history.
Methods
The core algorithmic challenge is that repeated edges skew uniform sampling probabilities. To fix this, the authors introduce several novel techniques:
- Dynamic, Non-Monotone Triangle Sampling: Instead of monotonically counting triangles as they appear, the algorithm maintains a sample cache dynamically. When an edge arrives, the algorithm deletes all existing triangles in its cache that contain this edge, and then flips a coin to re-sample the triangle. This counterintuitive "delete-then-insert" strategy ensures that every triangle is sampled with uniform probability based strictly on the final occurrence of its last arriving edge.
- Consistent Hashing: The algorithms use 4-wise independent hash functions to ensure that repeated occurrences of the same edge are sampled consistently throughout the stream.
- Clipped-KMV Estimator: For multi-pass algorithms, the authors modify the classic $k$-minimum values (KMV) distinct-elements estimator. Standard KMV sketches can occasionally yield wildly high estimates, ruining variance bounds. The authors introduce a "clipped" version that truncates the output to a deterministic maximum possible vertex degree ($2U$), stabilizing the variance analysis.
- $\ell_0$-Samplers: Used in the multi-pass variants to sample edges uniformly at random from the stream of distinct elements.
Datasets
This is a purely theoretical and algorithmic paper, so no experimental datasets were used for empirical training or evaluation.
However, the authors cite the CollegeMsg Temporal network from the Stanford Large Network Dataset Collection (SNAP) as real-world motivation. They note that it contains over 59K edge events but only around 20K unique edges in its underlying simple graph, illustrating the prevalence of edge repetition.
Key Insights and Ideas
- The Last-Edge Trick: The ultimate "aha!" moment of the paper is realizing that you can handle arbitrary edge repetitions by forcing the algorithm to only care about the very last time a triangle's final edge appears. Deleting cached triangles upon edge re-arrival completely neutralizes the historical bias of stream ordering.
- No Space Penalty for Complexity: The authors prove that handling repeated arrivals and retroactively deleting data does not make the problem asymptotically harder. Their single-pass algorithm matches the space complexity of the absolute best single-arrival algorithms up to polylogarithmic factors.
Key Results
The paper delivers optimal space bounds across the board (where $m$ is edges, $T$ is triangles, $\Delta_E$ is max triangles per edge, and $\Delta_V$ is max triangles per vertex):
- Optimal Single-Pass (Repeated Edges): Achieves an $(\varepsilon, \delta)$-approximation using $\tilde{O}\left(\frac{m}{\varepsilon^2 T}(\Delta_E + \sqrt{\Delta_V})\right)$ space, matching the best-known single-arrival algorithms.
- Optimal Single-Pass (RFGS Model): Solves the forget-operation model using $\tilde{O}\left(m_{max}\left(\frac{\Delta_E}{T} + \frac{\sqrt{\Delta_V}}{T}\right) + \frac{T_{max}}{T}\right)$ space, where $m_{max}$ and $T_{max}$ are the maximum edges and triangles present at any single point in time. They also provide a matching lower bound proving this cannot be improved.
- Optimal Multi-Pass Algorithms: They present a 2-pass algorithm for scarce-triangle regimes ($T \le m$) using $\tilde{O}\left(\frac{m}{\varepsilon^2 \sqrt{T}}\right)$ space, and a 4-pass algorithm for abundant-triangle regimes ($T > m$) using $\tilde{O}\left(\frac{m^{3/2}}{\varepsilon^2 T}\right)$ space.
Limitations and Future Work
While the authors successfully extend their multi-pass algorithms to count larger subgraphs like $k$-cliques, their single-pass optimal algorithms are strictly limited to triangles. Designing a single-pass, space-optimal algorithm capable of counting general cliques or other complex network motifs in repeated-edge or forgettable streams remains an open and challenging question for future research.
Summary updated