New algorithms for girth and cycle detection
Abstract
Let be an unweighted undirected graph with vertices and edges. Let be the girth of , that is, the length of a shortest cycle in . We present a randomized algorithm with a running time of that returns a cycle of length at most where is an integer and , for every graph with . Our algorithm generalizes an algorithm of Kadria \etal{} [SODA'22] that computes a cycle of length at most in time. Kadria \etal{} presented also an algorithm that finds a cycle of length at most in time, where must be an integer. Our algorithm generalizes this algorithm, as well, by replacing the integer parameter in the running time exponent with a real-valued parameter , thereby offering greater flexibility in parameter selection and enabling a broader spectrum of combinations between running times and cycle lengths. We also show that for sparse graphs a better tradeoff is possible, by presenting an time randomized algorithm that returns a cycle of length at most , where is an integer and , for every graph with . To obtain our algorithms we develop several techniques and introduce a formal definition of hybrid cycle detection algorithms. [...]
Cite
@article{arxiv.2507.02061,
title = {New algorithms for girth and cycle detection},
author = {Liam Roditty and Plia Trabelsi},
journal= {arXiv preprint arXiv:2507.02061},
year = {2025}
}