[Paper Review] WRS: Waiting Room Sampling for Accurate Triangle Counting in Real Graph Streams
This paper proposes Waiting-Room Sampling (WRS), a single-pass streaming algorithm that improves triangle counting accuracy in dynamic graphs by prioritizing storage of recent edges in a 'waiting room' while using reservoir sampling for the rest. WRS reduces estimation error by up to 47% compared to state-of-the-art methods by exploiting temporal locality, ensuring unbiased, low-variance estimates with linear scalability.
If we cannot store all edges in a graph stream, which edges should we store to estimate the triangle count accurately? Counting triangles (i.e., cycles of length three) is a fundamental graph problem with many applications in social network analysis, web mining, anomaly detection, etc. Recently, much effort has been made to accurately estimate global and local triangle counts in streaming settings with limited space. Although existing methods use sampling techniques without considering temporal dependencies in edges, we observe temporal locality in real dynamic graphs. That is, future edges are more likely to form triangles with recent edges than with older edges. In this work, we propose a single-pass streaming algorithm called Waiting-Room Sampling (WRS) for global and local triangle counting. WRS exploits the temporal locality by always storing the most recent edges, which future edges are more likely to form triangles with, in the waiting room, while it uses reservoir sampling for the remaining edges. Our theoretical and empirical analyses show that WRS is: (a) Fast and 'any time': runs in linear time, always maintaining and updating estimates while new edges arrive, (b) Effective: yields up to 47% smaller estimation error than its best competitors, and (c) Theoretically sound: gives unbiased estimates with small variances under the temporal locality.
Motivation & Objective
- To address the challenge of accurately estimating global and local triangle counts in large-scale graph streams with limited memory.
- To exploit temporal locality—where future edges are more likely to form triangles with recent edges—by designing a memory-aware sampling strategy.
- To develop a streaming algorithm that maintains unbiased, low-variance estimates at any point during data ingestion, not just at the end.
- To outperform existing sampling-based triangle counting methods in accuracy, especially under real-world temporal dynamics.
Proposed method
- WRS partitions the memory budget into two components: a 'waiting room' that stores the most recently arrived edges and a 'reservoir' that uses standard reservoir sampling for the remaining edges.
- The waiting room increases the probability that edges forming triangles with incoming edges are already in memory, improving sampling efficiency.
- The algorithm maintains global and local triangle count estimates by checking all pairs of edges in the waiting room and the reservoir for triangle formation with each new edge.
- Estimates are computed using a weighted combination of triangle counts from sampled edges, with weights derived from the probability of inclusion in the waiting room or reservoir.
- Theoretical analysis proves that WRS produces unbiased estimators with small variance under the assumption of temporal locality.
- The method is designed to be 'any time', meaning it continuously maintains and updates estimates as new edges arrive, with linear time complexity per edge.
Experimental results
Research questions
- RQ1How can we improve the accuracy of triangle counting in graph streams by leveraging temporal locality in edge arrivals?
- RQ2Can a hybrid sampling strategy that prioritizes recent edges outperform i.i.d. or reservoir sampling in real-world dynamic graphs?
- RQ3Does a two-tiered memory structure—waiting room for recent edges and reservoir for older ones—yield lower estimation error than existing methods?
- RQ4To what extent does WRS maintain unbiased estimates with low variance under temporal locality?
- RQ5How does WRS scale in terms of time performance across different graph sizes and memory budgets?
Key findings
- WRS achieved up to 47% smaller local error and 40% smaller global error than the best competing method on the ArXiv dataset, particularly benefiting from strong temporal locality.
- WRS discovered up to 2.9 times more triangles than its competitors while processing the same graph streams, directly contributing to improved accuracy.
- The algorithm's running time scaled linearly with the number of edges, confirming its efficiency and 'any time' property across all tested datasets.
- Empirical results showed that WRS estimates had smaller variance and were closer to the true triangle count than competitors, validating Theorem 1 and Lemma 2 on unbiasedness and low variance.
- The waiting room mechanism significantly improved sampling efficiency, especially in datasets like ArXiv and Patent, where temporal locality was most pronounced.
- The method remained robust across different memory budgets, with consistent performance gains observed even at low memory allocations.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.