Abstract
Identifying the most heavily weighted triangles in massive graphs is a critical task for understanding community structures and social ties. Traditional brute-force methods are computationally prohibitive for graphs with billions of edges. This paper introduces a suite of "heavy-light" algorithms that leverage the power-law distribution of edge weights to achieve speedups of up to 2,000x. By dynamically partitioning edges and focusing on the strongest connections, the proposed Dynamic Heavy-Light (DHL) algorithm can process billions of edges in seconds on a single server with 100% accuracy.
Introduction
In network science, a "triangle" (a 3-clique) is a fundamental building block used to understand community structures, social ties, and predict future interactions. While tools for counting triangles in unweighted graphs are well-established, real-world data is typically weighted—representing message volume, traffic, or co-authorship frequency.
The primary challenge is scale. In graphs with billions of edges, the number of triangles is astronomically high. When only the "top-k" triangles (those with the highest average edge weights) are required, traditional brute-force enumeration is inefficient, wasting resources on weak, irrelevant connections. This research addresses the problem of efficiently retrieving these "heavy" triangles without exhaustive search.
Methodology
The authors propose two main algorithmic families:
Deterministic "Heavy-Light" Algorithms
The core strategy involves partitioning edges into "heavy" and "light" categories based on weight.
- Dynamic Heavy-Light (DHL): The flagship algorithm uses two moving pointers to dynamically adjust edge classifications (super-heavy, heavy, or light) during execution. It employs a mathematical model based on weight distributions to optimize the weight threshold reduction.
- Auto-HL: A distribution-oblivious variant that estimates optimal parameters on the fly, ensuring robustness across various graph types without prior knowledge of weight distributions.
Random Sampling Algorithms
- Weighted Edge Sampling (ES): Samples edges with probability proportional to weight. While approximate, it is highly parallelizable.
- Weighted Wedge/Path Sampling: Generalizes unweighted sampling techniques to the weighted regime.
Triangle weight is defined using the generalized $p$-mean, allowing flexibility to represent arithmetic mean, geometric mean, or min/max edge weights.
Key Insights: The Power of Pruning
The fundamental insight is that edge weights in most real-world networks follow a heavy-tailed (power-law) distribution. A small fraction of edges typically accounts for the majority of the total weight.
By intelligently ignoring "light" edges, the DHL algorithm can guarantee finding the top triangles while bypassing 99% of the graph. Interestingly, the deterministic DHL algorithm often outperforms sampling methods because it avoids the overhead of random trials while maintaining 100% accuracy.
Experimental Results
The algorithms were evaluated on eight large-scale datasets, including reddit-reply, Wikipedia-clickstream, and a Spotify co-occurrence graph with 1.9 billion edges.
Performance and Accuracy
The DHL algorithm demonstrated massive speedups, performing 1,000x faster than brute-force on the reddit-reply dataset. On the Spotify dataset, where brute-force failed to finish within 24 hours, DHL retrieved the top 1,000 triangles in just 31.8 seconds.
As shown in the evaluation, the accuracy of retrieval increases sharply as the threshold for "heavy" edges is adjusted, allowing for high precision even when processing a fraction of the total edge set.
Discussion and Limitations
While highly effective, the approach has limitations:
- Sorting Bottleneck: The most time-consuming step is the initial sorting of edges by weight, rather than the graph traversal itself.
- Memory Constraints: The current implementation requires the graph to reside in RAM, which may limit scalability on consumer-grade hardware for the largest datasets.
- Complexity of Motifs: Extending the heavy-light logic to larger cliques (4-cliques or 5-cliques) increases algorithmic complexity significantly.
Conclusion
The Dynamic Heavy-Light approach provides a powerful framework for analyzing weighted structures in massive networks. By exploiting the inherent power-law nature of edge weights, these algorithms enable the analysis of billions of connections in seconds, providing a scalable solution for modern network science applications.
Summary updated