Abstract
Exact triangle counting in massive graphs is a computationally prohibitive task essential for network analysis. This paper analyzes the Doulion algorithm, an edge sparsification technique that approximates triangle counts through biased coin flipping. We provide a rigorous mathematical analysis using the Kim-Vu theorem to determine optimal sampling rates. Our evaluation on real-world networks shows that this method achieves speedups of up to 70,000x while maintaining accuracy above 94%.
Introduction
Graphs serve as fundamental models for diverse systems, from social networks to biological interactions. Within these structures, the "triangle"—a set of three mutually connected nodes—is a critical building block. Counting triangles is necessary for calculating the clustering coefficient and transitivity ratio, metrics vital for community detection, thematic structure discovery, and spammer identification.
However, exact triangle counting scales poorly. Naive algorithms are $O(n^3)$, and while matrix-multiplication approaches offer theoretical improvements ($O(n^{2.371})$), their memory requirements are impractical for large-scale data. Standard listing algorithms like node-iterator run in $O(mn)$ time, which remains too slow for modern networks with millions or billions of edges. This paper addresses the need for efficient, accurate approximation methods with strong theoretical guarantees.
Methodology: The Doulion Algorithm
The authors analyze Doulion, an elegant sparsification technique designed to reduce the computational burden of triangle counting. The algorithm proceeds in four primary steps:
- Coin Flipping: For every edge in the graph $G$, a biased coin is flipped. The edge is retained with probability $p$ and discarded with probability $1-p$.
- Reweighting: Each surviving edge is assigned a weight of $1/p$.
- Counting: A standard exact counting algorithm is executed on the resulting sparsified graph.
- Estimating: Since a triangle consists of three edges, each surviving triangle in the sparsified graph represents $1/p^3$ triangles in the original graph. The sum of these weights provides an unbiased estimate $T$ of the total triangles $t$.
The novel contribution of this work is the rigorous mathematical analysis of the sampling probability $p$. Utilizing the Kim-Vu theorem for the concentration of boolean polynomials, the authors prove how aggressively a graph can be sampled while ensuring the estimate $T$ remains tightly concentrated around the true value $t$.
Experimental Evaluation
The method was evaluated on several large-scale real-world networks, including web graphs (WB-EDU), Wikipedia page networks, and social networks (Flickr, Youtube). These datasets ranged up to 9.8 million nodes and 46.2 million edges.
Key Results
- Massive Speedups: The algorithm achieved speedups between 2,769x and 70,090x when comparing counting time on sparsified versus original graphs. Even including the overhead for sparsification and finding the optimal $p$, end-to-end speedups reached 370x.
- High Accuracy: Across all datasets, the mean accuracy of the estimated triangle counts remained remarkably high, between 94.7% and 97.7%.
- The Doubling Heuristic: To overcome the challenge of selecting an optimal $p$ without knowing $t$ beforehand, the authors introduced a "doubling" heuristic. By starting with a very small $p$ and doubling it until the estimate stabilizes, the algorithm quickly finds an effective sampling rate with minimal overhead.
Discussion and Limitations
While highly effective for most real-world graphs, the algorithm faces challenges in specific pathological cases. In graphs where a large number of triangles depend on a single "hub" edge, deleting that edge leads to a total failure of the estimate. Similarly, in weighted graphs, the loss of a high-weight edge can significantly skew results. Future research may involve more sophisticated sampling techniques, such as those based on effective resistances, to mitigate these risks.
Conclusion
The Doulion algorithm, backed by rigorous concentration bounds, provides a powerful tool for analyzing massive networks. By enabling extreme sparsification without sacrificing accuracy, it allows researchers to compute fundamental graph metrics on scales previously considered computationally infeasible.
Summary updated