Fast Approximate Counting of Cycles
Keren Censor-Hillel, Tomer Even, Virginia Vassilevska Williams
TL;DR
The paper presents a fast, approximate counting framework for fixed-length cycles in directed graphs, achieving a running time of $ ilde{O}( extsf{MM}(n, n/t^{1/(h-2)}, n))$ to estimate the number of $h$-cycles for any constant $h≥3$ and fixed accuracy. It introduces a simplified, path-like Recursive Template that relies on two black boxes: Find-Heavy and Count-Heavy, enabling a robust single-path recursion and a doubling variant to adapt to unknown counts. The heavy-vertex identification leverages nonuniform sampling and rectangular matrix multiplication, while counting heavy copies uses color-coding and careful avoidance of double counting to attain a $(1±ε)$-approximation with additive polylog factors. A tight conditional lower bound based on fine-grained hypotheses shows the proposed running times are essentially optimal for both triangles and general $h$-cycles, with extensions to directed and odd cycles. Overall, the work advances both triangle counting and general $h$-cycle counting, offering nearly optimal, t-dependent runtimes and practical strategies for sparse graphs via matrix-multiplication-based techniques.
Abstract
We consider the problem of approximate counting of triangles and longer fixed length cycles in directed graphs. For triangles, Tětek [ICALP'22] gave an algorithm that returns a $(1 \pm \eps)$-approximation in $\tilde{O}(n^ω/t^{ω-2})$ time, where $t$ is the unknown number of triangles in the given $n$ node graph and $ω<2.372$ is the matrix multiplication exponent. We obtain an improved algorithm whose running time is, within polylogarithmic factors the same as that for multiplying an $n\times n/t$ matrix by an $n/t \times n$ matrix. We then extend our framework to obtain the first nontrivial $(1 \pm \eps)$-approximation algorithms for the number of $h$-cycles in a graph, for any constant $h\geq 3$. Our running time is \[\tilde{O}(\mathsf{MM}(n,n/t^{1/(h-2)},n)), \textrm{the time to multiply } n\times \frac{n}{t^{1/(h-2)}} \textrm{ by } \frac{n}{t^{1/(h-2)}}\times n \textrm{ matrices}.\] Finally, we show that under popular fine-grained hypotheses, this running time is optimal.
