Approximate Counting of
k
-Paths: Simpler, Deterministic, and in Polynomial Space
Recently, Brand et al. [STOC 2018] gave a randomized mathcal O(4 k m ε -2 -time exponential-space algorithm to approximately compute the number of paths on k vertices in a graph G up to a multiplicative error of 1 ± ε based on exterior algebra. Prior to our work, this has been the state-of-the-art. In this article, we revisit the algorithm by Alon and Gutner [IWPEC 2009, TALG 2010], and obtain the following results: • We present a deterministic 4 k + O (√ k (log k +log 2 ε -1 )) m -time polynomial-space algorithm. This matches the running time of the best known deterministic polynomial-space algorithm for deciding whether a given graph G has a path on k vertices. • Additionally, we present a randomized 4 k +mathcal O(log k (log k +logε -1 )) m -time polynomial-space algorithm. Our algorithm is simple—we only make elementary use of the probabilistic method. Here, n and m are the number of vertices and the number of edges, respectively. Additionally, our approach extends to approximate counting of other patterns of small size (such as q -dimensional p -matchings).