Abstract
Analyzing massive, high-velocity graph data requires algorithms that are both memory-efficient and computationally fast. This paper presents a parallel, cache-oblivious streaming algorithm for approximate triangle counting. By coordinating parallel tasks to process edges in batches, the proposed method achieves near-linear speedups on multicore systems while maintaining the small memory footprint characteristic of streaming methods.
Introduction
Triangle counting is a fundamental metric in social network analysis, used for community detection, spam identification, and recommendation engines. However, modern graph datasets present a "double whammy" of difficulty: they are often too large to fit in the RAM of a single machine and are highly dynamic, with edges arriving in a continuous stream. Existing solutions have historically been bifurcated into memory-efficient but slow sequential streaming algorithms and fast parallel algorithms designed for static graphs. This work bridges the gap with a "coordinated bulk parallel" algorithm that is both fast and memory-light.
Methodology
The algorithm is built on three core pillars: neighborhood sampling, a bulk arrival model, and coordinated parallelism.
Neighborhood Sampling and Bulk Arrival
The algorithm maintains a set of "estimators" that track random edges ($f_1$) and their neighbors ($f_2$) to detect "closing edges" ($f_3$) that complete triangles. To minimize overhead, the algorithm processes edges in large batches (e.g., 16 million edges) rather than one by one.
Coordinated Parallelism
The key innovation is the Coordinated Bulk Parallel approach. Instead of processors working independently, they collaborate to build a shared data structure for each batch. This coordination utilizes highly optimized parallel primitives—specifically sorting, merging, and prefix scans—to update all estimators simultaneously. This design is cache-oblivious, ensuring efficiency across memory hierarchies without hardware-specific tuning.
The Rank Concept
To facilitate uniform sampling from a batch in parallel without expensive random memory accesses, the authors introduced a "rank" function. This function maps edges to estimators using simple, cache-friendly sequential scans. This allows the algorithm to avoid the "share-nothing" trap where total work increases linearly with the number of processors.
Experimental Results
The algorithm was evaluated on several large-scale graphs, including Friendster (1.8 billion edges) and a 167GB synthetic power-law graph. Key findings include:
- Significant Speedups: On a 12-core machine, the algorithm achieved speedups between 7.5x and 11.24x compared to sequential versions.
- High Throughput: The 167GB synthetic graph was processed in roughly 1,000 seconds, translating to millions of edges per second.
- Accuracy: With 20 million estimators, the algorithm achieved less than 4% mean deviation from the true triangle count, even on graphs with billions of edges.
- Hardware Efficiency: The coordinated approach resulted in significantly fewer L3 cache and TLB misses compared to traditional hash-table-based sequential approaches.
Conclusion and Future Work
This framework provides a scalable solution for real-time graph analysis on single multicore machines. While highly effective, future work remains in extending this coordinated bulk logic to distributed-memory clusters and addressing edge deletions, as the current model assumes an insertion-only stream.
Summary updated