Skip to main content
QUICK REVIEW

[Paper Review] Approximate Triangle Counting

Charalampos E. Tsourakakis, Mihail N. Kolountzakis|ArXiv.org|Apr 24, 2009
Complex Network Analysis TechniquesPhysics and Astronomy34 references17 citations
TL;DR

This paper presents a rigorous analysis of a sampling-based triangle counting algorithm that enables significant speedups—up to 70,000×—while maintaining high accuracy in large-scale graphs. By deriving optimal sampling rates (sparsification parameters) through theoretical concentration bounds, the method ensures reliable estimation with minimal computational overhead, validated on real-world networks with millions of nodes and edges.

ABSTRACT

Triangle counting is an important problem in graph mining. Clustering coefficients of vertices and the transitivity ratio of the graph are two metrics often used in complex network analysis. Furthermore, triangles have been used successfully in several real-world applications. However, exact triangle counting is an expensive computation. In this paper we present the analysis of a practical sampling algorithm for counting triangles in graphs. Our analysis yields optimal values for the sampling rate, thus resulting in tremendous speedups ranging from \emph{2800}x to \emph{70000}x when applied to real-world networks. At the same time the accuracy of the estimation is excellent. Our contributions include experimentation on graphs with several millions of nodes and edges, where we show how practical our proposed method is. Finally, our algorithm's implementation is a part of the \pegasus library (Code and datasets are available at (http://www.cs.cmu.edu/~ctsourak/).) a Peta-Graph Mining library implemented in Hadoop, the open source version of Mapreduce.

Motivation & Objective

  • To address the computational infeasibility of exact triangle counting in large graphs by developing a practical, scalable approximation method.
  • To determine the optimal sampling rate (sparsification parameter) that ensures concentration of the estimated triangle count around the true value with high probability.
  • To provide a practitioner’s guide for deploying the algorithm efficiently in real-world graph workloads.
  • To validate the method on large-scale networks with millions of nodes and edges, demonstrating both speed and accuracy.

Proposed method

  • Applies edge sparsification by independently retaining each edge with probability $ p $, reducing the graph size while preserving triangle count estimation properties.
  • Uses concentration inequalities to derive theoretical bounds on the sampling rate $ p $, ensuring the estimated triangle count is tightly concentrated around the true value.
  • Employs the node-iterator algorithm on the sparsified graph to count triangles efficiently, leveraging reduced memory and computation.
  • Derives an optimal $ p^* $ value that minimizes variance and maximizes speedup, balancing accuracy and performance.
  • Introduces a practical strategy of running multiple trials at increasing $ p $ values until concentration is observed, enabling early termination.
  • Extends the method to weighted graphs with reweighting, though notes limitations in cases with high-weight edges.

Experimental results

Research questions

  • RQ1What is the optimal sampling rate $ p $ that ensures the estimated number of triangles is concentrated around the true value with high probability?
  • RQ2How can the sparsification parameter $ p $ be chosen to maximize speedup while maintaining estimation accuracy in real-world graphs?
  • RQ3What is the empirical performance of the algorithm on large-scale graphs with millions of nodes and edges?
  • RQ4How does the method behave in edge cases such as graphs with linear triangle counts or weighted graphs with high-weight edges?
  • RQ5Can the algorithm be practically deployed with minimal trial runs, given that the optimal $ p $ depends on unknown graph properties?

Key findings

  • The proposed method achieves speedups of up to 70,000× compared to exact triangle counting on real-world networks, with high accuracy.
  • At $ p = 0.02 $, the algorithm achieves an average speedup of 2,880× with a stable estimate of $ 4.3 imes 10^7 $ triangles, demonstrating strong concentration.
  • For $ p = 0.01 $, the variance in estimates is high (ranging from 4.3M to 6.0M), indicating poor concentration and unreliable results.
  • The sparsification step takes approximately 8–9 seconds regardless of $ p $, with runtime increasing slightly due to I/O overhead as $ p $ increases.
  • The method is robust in practice: even with unknown triangle counts, only a few trials are needed to identify a concentration-prone $ p $, enabling efficient deployment.
  • Theoretical analysis shows that the method fails in pathological cases such as graphs with linear triangle counts or high-weight edges, where edge deletion can cause large estimation errors.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.