TL;DR
The paper introduces STEP, a novel streaming algorithm that leverages the "algorithms with predictions" framework to count temporal triangles in massive graphs using sublinear memory. By combining a simple randomized sampling strategy with a lightweight predictor, STEP achieves up to 19× memory savings and 200× speedups over state-of-the-art methods, making it the first algorithm capable of handling graphs with billions of edges in a single pass.
What Problem Does This Paper Address?
Many real-world systems—like social networks, financial transaction logs, and e-commerce platforms—are best modeled as temporal graphs, where edges represent interactions associated with a specific timestamp. Analyzing these graphs often requires counting temporal triangles: triplets of edges that occur close together in time ($\delta$-proximity) and follow a specific chronological order.
Because massive networks generate millions of nodes and billions of edges, storing the entire graph in memory is impractical. While streaming algorithms exist for static graphs, counting temporal triangles in a single pass over a data stream is significantly harder due to the added constraints of time and ordering. Existing exact methods fail to scale, and approximate methods require prohibitive amounts of memory because they must prepare for worst-case data distributions.
Methods
The authors propose STEP (Streaming-based temporal Triangles counts Estimation with Predictions). STEP integrates the emerging learning-augmented algorithms framework into a single-pass streaming setting.
Its core mechanics are straightforward yet powerful:
- Edge Classification: As each temporal edge arrives, a predictor $Q(\cdot)$ classifies it as either "heavy" (likely to participate in many triangles) or "light."
- Hybrid Storage: "Heavy" edges are stored deterministically in a reservoir ($H$). "Light" edges are sampled probabilistically with a fixed probability $p$ and stored in a separate reservoir ($S_L$). Edges outside the current time window $\delta$ are automatically purged to save space.
- Unbiased Estimation: When a new edge arrives, STEP counts the triangles it forms with the existing mixtures of heavy and sampled light edges, scaling the counters appropriately to ensure the final estimate is mathematically unbiased.
What makes STEP practical is its temporal min-degree predictor. Instead of relying on an expensive or omniscient machine learning model, it simply tracks the degree of an edge's endpoints within a sliding time window. This proxy effectively captures local temporal activity in a single pass without needing to count triangles beforehand.
Datasets
The authors evaluated STEP on four massive, publicly available temporal datasets:
- Stackoverflow (SO): 2.6M nodes, 63.5M edges (interactions over 7.6 years).
- Bitcoin (BI): 48.1M nodes, 113.1M edges (transaction network over 7.08 years).
- Reddit (RE): 8.4M nodes, 636.3M edges (comment interactions over 10.06 years).
- EquinixChicago (EC): A massive semi-synthetic graph built from real network traffic data, boasting 3.3 billion temporal edges and 11.1M nodes.
Key Insights and Ideas
- Immunity to Bad Predictions: A major theoretical triumph of STEP is that its estimates remain completely unbiased regardless of the predictor's quality. If the predictor is highly accurate, the variance of the estimate plummets; if the predictor is noisy or completely wrong, the algorithm still outputs a correct estimate, though it may require slightly more memory or time to achieve the same confidence.
- Static Predictors Fail on Temporal Data: The authors conducted an ablation study proving that predictors utilizing static graph features (like total node degree) perform poorly. To successfully sample temporal streams, the predictor must account for the temporal density of interactions within the active time window ($\delta$).
- Simultaneous Tracking: Unlike some baseline methods that must track different triangle types independently, STEP estimates all eight temporal triangle configurations simultaneously from the same underlying sample sets.
Key Results
STEP consistently outperformed both exact and approximate state-of-the-art baselines in accuracy, memory footprint, and runtime.
- The Billion-Edge Barrier: On the 3.3-billion-edge EquinixChicago dataset, every single state-of-the-art baseline ran out of memory (OOM) on a machine with 200GB of RAM. STEP was the only algorithm capable of processing it, finishing in under 10 minutes using less than 65GB of RAM while maintaining a Mean Absolute Error (MAE) below 0.1.
- Speed and Memory: Compared to EWS (the leading approximate streaming baseline), STEP reduced memory usage by up to 19× and accelerated execution times by up to 200× while delivering tighter error bounds and lower variance.
Limitations and Future Work
While the temporal min-degree predictor works exceptionally well on standard social and interaction networks, its performance degrades slightly on specific graph topologies, such as those derived from bipartite structures (like the EC dataset). In these cases, the predictor's rankings align less perfectly with actual triangle counts, leading to a higher execution time to maintain accuracy.
For future work, the authors suggest exploring more sophisticated, domain-specific online learning models to predict edge weights dynamically. They also plan to extend the STEP framework to count other complex temporal motifs, such as "butterflies" in bipartite graphs.
Summary updated