TY - GEN
T1 - New Algorithms for Girth and Cycle Detection
AU - Roditty, Liam
AU - Trabelsi, Plia
N1 - Publisher Copyright: © Liam Roditty and Plia Trabelsi.
PY - 2026/6/8
Y1 - 2026/6/8
N2 - Let G = (V, E) be an unweighted undirected graph with n vertices and m edges. Let g be the girth of G, that is, the length of a shortest cycle in G. We present a randomized algorithm with a running time of (Equation presented) that returns a cycle of length at most (Equation presented), where ℓ ≥ 2 is an integer and ε ∈ [0, 1], for every graph with g = polylog(n). Our algorithm generalizes an algorithm of Kadria et al. [SODA'22] that computes a cycle of length at most (Equation presented) time. Kadria et al. presented also an algorithm that finds a cycle of length at most (Equation presented) 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 (Equation presented) time randomized algorithm that returns a cycle of length at most (Equation presented), where ℓ ≥ 3 is an integer and ε ∈ [0, 1), for every graph with g = polylog(n). To obtain our algorithms we develop several techniques and introduce a formal definition of hybrid cycle detection algorithms. Both may prove useful in broader contexts, including other cycle detection and approximation problems. Among our techniques is a new cycle searching technique, in which we search for a cycle from a given vertex and possibly all its neighbors in linear time. Using this technique together with more ideas we develop two hybrid algorithms. The first allows us to obtain an (Equation presented)-time, (+1)-approximation of g. The second is used to obtain our (Equation presented)-time and (Equation presented)-time approximation algorithms.
AB - Let G = (V, E) be an unweighted undirected graph with n vertices and m edges. Let g be the girth of G, that is, the length of a shortest cycle in G. We present a randomized algorithm with a running time of (Equation presented) that returns a cycle of length at most (Equation presented), where ℓ ≥ 2 is an integer and ε ∈ [0, 1], for every graph with g = polylog(n). Our algorithm generalizes an algorithm of Kadria et al. [SODA'22] that computes a cycle of length at most (Equation presented) time. Kadria et al. presented also an algorithm that finds a cycle of length at most (Equation presented) 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 (Equation presented) time randomized algorithm that returns a cycle of length at most (Equation presented), where ℓ ≥ 3 is an integer and ε ∈ [0, 1), for every graph with g = polylog(n). To obtain our algorithms we develop several techniques and introduce a formal definition of hybrid cycle detection algorithms. Both may prove useful in broader contexts, including other cycle detection and approximation problems. Among our techniques is a new cycle searching technique, in which we search for a cycle from a given vertex and possibly all its neighbors in linear time. Using this technique together with more ideas we develop two hybrid algorithms. The first allows us to obtain an (Equation presented)-time, (+1)-approximation of g. The second is used to obtain our (Equation presented)-time and (Equation presented)-time approximation algorithms.
KW - All pairs shortest path
KW - Cycle approximation
KW - Girth
KW - Graph algorithms
UR - https://www.scopus.com/pages/publications/105042421344
U2 - 10.4230/LIPIcs.SWAT.2026.38
DO - 10.4230/LIPIcs.SWAT.2026.38
M3 - Conference contribution
T3 - Leibniz International Proceedings in Informatics, LIPIcs
BT - 20th Scandinavian Symposium on Algorithm Theory, SWAT 2026
A2 - Fraigniaud, Pierre
PB - Schloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing
T2 - 20th Scandinavian Symposium on Algorithm Theory, SWAT 2026
Y2 - 17 June 2026 through 19 June 2026
ER -