Fast Approximate Counting of Cycles

Keren Censor-Hillel,Tomer Even,Virginia Vassilevska Williams
2024-09-28
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^\omega/t^{\omega-2})$ time, where $t$ is the unknown number of triangles in the given $n$ node graph and $\omega<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.
Data Structures and Algorithms
What problem does this paper attempt to address?
The problem that this paper attempts to solve is to quickly approximate the counting of triangles and other fixed - length cycles in a directed graph. Specifically, the authors focus on how to estimate the number of cycles of a specific length in a directed graph with a relatively low time complexity. For triangles (i.e., cycles formed by 3 nodes), existing algorithms can give a $(1\pm\epsilon)$ - approximate solution within $\tilde{O}(n^\omega/t^{\omega - 2})$ time, where $t$ is the unknown number of triangles, $n$ is the number of nodes in the graph, and $\omega< 2.372$ is the matrix multiplication exponent. ### Main contributions of the paper 1. **Improved triangle - counting algorithm**: - The authors propose a new algorithm whose running time is the same as that required to multiply two matrices, specifically $\tilde{O}(\text{MM}(n, n/t^{1/(\omega - 2)}, n))$. - This improvement makes the new algorithm faster than the best existing algorithm when the number of triangles $t$ is between $\Omega(1)$ and $O(n)$. 2. **Approximate counting of cycles of arbitrary length**: - The authors extend their framework to cycles of any constant length $h\geq3$ and obtain the first non - trivial $(1\pm\epsilon)$ - approximate algorithm. - For a cycle of length $h$, the running time of the algorithm is $\tilde{O}(\text{MM}(n, n/t^{1/(h - 2)}, n))$. 3. **Proof of conditional optimality**: - The authors also show that under the popular fine - grained hypothesis, the above - mentioned running time is conditionally optimal. ### Formula explanation - $\text{MM}(a, b, c)$ represents the time complexity required to multiply two matrices with dimensions $a\times b$ and $b\times c$ respectively. - $\omega$ is the exponent of matrix multiplication, and the currently known best value is $\omega\leq2.371552$. - $t$ represents the number of specific sub - graphs (such as triangles or cycles) in the graph. - $\epsilon$ is a small positive number used to control the approximation accuracy. ### Summary The core problem of the paper is to develop more efficient algorithms to approximately calculate the number of triangles and other fixed - length cycles in a directed graph. By introducing new recursive templates and optimizing the application of matrix multiplication, the authors not only improve the speed of triangle counting, but also generalize this method to cycles of arbitrary length, while providing a theoretical optimality proof.