arXiv:2610.23698cs.DSOct 2026

Manuscript Offprint

arXiv:2610.23698

Approximating the Girth of an Undirected, Weighted Graph for Larger Approximation Factors

Eliyahu Yablon

Abstract

The girth of a weighted undirected graph is defined as the length of a shortest cycle in the graph. In this paper, we give a randomized O(m1+2/(k−1)n1/(k−1))O\left(m^{1+2/(k-1)}n^{1/(k-1)}\right) algorithm to approximate the girth of a graph with nn vertices and mm edges to within a factor of kk for any real kk. We assume that all edge weights are non-negative. For sufficiently high approximation factors, our algorithm outperforms the state of the art by polylogarithmic factors. Specifically, for approximation factors k=clog⁡nlog⁡log⁡nk = c\frac{\log n}{\log \log n} where c>5c > 5, our algorithm gives a runtime of O(m(log⁡n)5/c)O\left(m(\log n)^{5/c}\right), while instantiating the previous best kk-approximation algorithms with k=clog⁡nlog⁡log⁡nk = c\frac{\log n}{\log \log n} yields a running time of O(cn(log⁡n)2+4/(3c)log⁡log⁡n+mlog⁡n)O\left(\frac{cn(\log n)^{2+4/(3c)}}{\log \log n} + m \log n\right) [6]. Furthermore, the algorithm presented here is conceptually simple, has relatively small constants, eschews single-source shortest path and sparse spanner algorithms, and employs a new technique, which we call “random filtering.” That being said, the basic algorithm returns only a numerical estimate for the girth, rather than a witness cycle.

1 Introduction

The girth of a graph is defined as the length of a shortest cycle. It is a fundamental graph parameter that has been studied algorithmically as far back as the 1970s. A foundational algorithmic treatment of the problem was given by Itai and Rodeh in 1978 [4] in which they gave an O(min⁡(mn,nω))O(\min(mn, n^\omega)) algorithm to compute the girth of an unweighted, undirected graph, where ω\omega is the matrix multiplication exponent. Since then, many advances have been made in computing graph girth. In 2016, Orlin and Sedeno-Noda gave an O(mn)O(mn) algorithm for computing the girth of a weighted, directed graph [9]. However, the difficulty of exact girth computation and the inability to break the cubic runtime barrier for combinatorial algorithms have prompted researchers to instead explore approximation algorithms.

The first truly subquadratic multiplicative approximation for unweighted, undirected graphs was given by Lingas and Lundell, whose randomized O~(n3/2)\widetilde{O}(n^{3/2})-time algorithm achieves an 8/3-approximation [8]. Roditty and Vassilevska Williams later obtained the first subquadratic 2-approximation: their deterministic algorithm runs in O~(n5/3)\widetilde{O}(n^{5/3}) time [13]. For directed graphs, Pachocki, Roditty, Sidford, Tov, and Vassilevska Williams showed that, for every integer k≥1k \geq 1, the girth of a directed graph with nonnegative integer edge lengths can be approximated within a factor of O(klog⁡n)O(k \log n) in

O(mn1/klog⁡5n)O\Big(m n^{1/k}\log^{5}n\Big)

time with high probability [10].

Most recently, Kadria, Roditty, and Vassilevska Williams obtained the currently best general time-approximation trade-off for weighted undirected graphs with nonnegative real edge lengths [6]. For every integer k≥2k \geq 2, their algorithm computes a (2k/3)(2k/3)-approximation in

O(kn1+2/klog⁡n+m(k+log⁡n))O\Big(kn^{1+2/k}\log n+m(k+\log n)\Big)

time. This matches, up to polylogarithmic factors, the corresponding trade-off previously known for unweighted graphs [5, 12].

Lastly, our algorithm is randomized and works by repeatedly drawing randomly sampled subgraphs of our graph. Our algorithm draws inspiration from other well-known randomized graph algorithms, such as Karger's algorithm [7] and Alon-Yuster-Zwick's color-coding [2]. Indeed, some of these randomized sampling techniques have even been used as subroutines in cycle algorithms before, such as in [1] where they make use of the observation that if each vertex is retained with probability p, then a given triangle is more likely to be in a subgraph than a 4-cycle (by precisely a factor of p).