A simpler sublinear algorithm for approximating the triangle count

C. SeshadhriarXiv 2015

Abstract

A recent result of Eden, Levi, and Ron (ECCC 2015) provides a sublinear time algorithm to estimate the number of triangles in a graph. Given an undirected graph $G$, one can query the degree of a vertex, the existence of an edge between vertices, and the $i$th neighbor of a vertex. Suppose the graph has $n$ vertices, $m$ edges, and $t$ triangles. In this model, Eden et al. provided a $O(\text{poly}(\epsilon^{-1}\log n)(n/t^{1/3} + m^{3/2}/t))$ time algorithm to get a $(1+\epsilon)$-multiplicative approximation for $t$, the triangle count. This paper provides a simpler algorithm with the same running time (up to differences in the $\text{poly}(\epsilon^{-1}\log n)$ factor) that has a substantially simpler analysis.

Introduction

In the study of complex networks—ranging from social media graphs to biological protein-interaction maps—the triangle count is a fundamental metric. Triangles, or sets of three mutually connected nodes, serve as the building blocks for community detection and network clustering. However, as modern datasets scale to billions of edges, traditional algorithms that require reading the entire graph become computationally prohibitive.

To address this, researchers focus on sublinear algorithms: methods that provide a $(1+\epsilon)$ approximation of the total triangle count $t$ by querying only a tiny fraction of the graph. While a breakthrough by Eden, Levi, and Ron (ELR 2015) established that this was theoretically possible, their approach relied on complex "vertex bucketing" and intricate combinatorial proofs. This paper presents a refined algorithm that achieves the same near-optimal complexity through a more intuitive sampling framework and a significantly simpler analysis.

The Sublinear Query Model

The algorithm operates within a standard query model for graph analysis, where the graph $G$ is accessed through three specific operations:

  1. Degree queries: Retrieve the degree $d(v)$ of a vertex $v$.
  2. Neighbor queries: Retrieve the $i$-th neighbor of a vertex $v$.
  3. Edge queries: Determine if an edge exists between vertices $u$ and $v$.

The goal is to estimate $t$ while minimizing the total number of these queries, ideally staying well below the total number of edges $m$ or vertices $n$.

Methodology: Simplified Sampling

The core of the proposed algorithm is a transition from complex bucketing to a direct sampling strategy. The approach builds on the classic exact counting technique by Chiba and Nishizeki, which iterates through edges and intersects neighbor lists. To make this sublinear, the author introduces an "Edge-Neighbor" sampling routine.

The Sampling Process

Instead of examining every edge, the algorithm performs the following steps:

  1. Vertex Selection: Pick a vertex $v$ at random.
  2. Edge Selection: Pick a random edge $(u, v)$ incident to that vertex.
  3. Neighbor Selection: Pick a random neighbor $w$ of the lower-degree endpoint of the edge $(u, v)$.
  4. Verification: Use an edge query to check if $(u, w)$ or $(v, w)$ completes a triangle.

Variance Reduction and Weighting

A critical challenge in sublinear estimation is handling "high-variance" components—edges that participate in a disproportionately large number of triangles. The algorithm manages this by classifying vertices as "heavy" or "light" based on their degrees and adaptively increasing the number of samples for vertices that could skew the estimate.

To ensure the final estimate is unbiased, the paper employs a specific weighting scheme ($1/2\ell$), where $\ell$ represents the number of light vertices in a given triangle. This allows the algorithm to count each triangle with a consistent probability without needing to know the full graph structure.

Key Insights

The Lower-Degree Advantage

A recurring insight in graph theory is that when checking for a triangle $(u, v, w)$, it is computationally more efficient to iterate through the neighbor list of the vertex with the smallest degree. The author adapts this into a sampling framework, ensuring that the "search space" for the third vertex of a triangle is always restricted to the smallest possible neighborhood, which drastically reduces the variance of the estimator.

Analytical Simplicity

By moving away from the vertex bucketing used in ELR 2015, the author demonstrates that triangle counting can be treated as a direct sampling problem. This shift allows the proof of correctness to rely on standard probabilistic tools, such as Chernoff and Chebyshev bounds, rather than the custom, highly specific combinatorial arguments required by previous iterations.

Results and Complexity

The algorithm achieves a running time of $O(\text{poly}(\epsilon^{-1} \log n)(n/t^{1/3} + m^{3/2}/t))$. This matches the ELR result, which is known to be near-optimal for this query model. Specifically, the algorithm provides a $(1 \pm \epsilon)$ multiplicative approximation with a success probability of at least 2/3. This probability can be further boosted to $1 - \delta$ by repeating the process and taking the median of the estimates.

Furthermore, the paper provides a standalone, simpler proof for sublinear average degree estimation as a secondary contribution, illustrating the versatility of the analytical approach.

Conclusion and Future Work

This work bridges the gap between theoretical possibility and algorithmic simplicity. While the paper is purely theoretical and does not provide empirical benchmarks on real-world datasets, it simplifies the "hidden constants" of sublinear triangle counting.

Future research may focus on the "Heavy Vertex Bottleneck"—the fact that identifying high-degree vertices still requires a significant number of queries. Additionally, exploring how this simplified analysis might apply to other subgraph counting problems (such as 4-cliques or cycles) remains an open and promising area of study.

Summary updated

BibTeX
@misc{seshadhri2015simpler,
  author = {C. Seshadhri},
  title = {{A simpler sublinear algorithm for approximating the triangle count}},
  year = {2015},
  eprint = {1505.01927},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1505.01927},
}
Figure