Search Results

Documents authored by Trabelsi, Plia


Document
New Algorithms for Girth and Cycle Detection

Authors: Liam Roditty and Plia Trabelsi

Published in: LIPIcs, Volume 370, 20th Scandinavian Symposium on Algorithm Theory (SWAT 2026)


Abstract
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 Õ(𝓁 ⋅ n^{1 + 1/(𝓁-ε)}) that returns a cycle of length at most 2𝓁 ⌈g/2⌉ - 2 ⌊ε⌈g/2⌉⌋, 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 4 ⌈g/2⌉ - 2 ⌊ε⌈g/2⌉⌋ in Õ(n^{1 + 1/(2 - ε)}) time. Kadria et al. presented also an algorithm that finds a cycle of length at most 2𝓁 ⌈g/2⌉ in Õ(n^{1 + 1/(𝓁)}) 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 Õ(𝓁⋅ m^{1+ 1/(𝓁-ε)}) time randomized algorithm that returns a cycle of length at most 2𝓁(⌊(g-1)/2⌋) - 2(⌊ε⌊(g-1)/2⌋⌋+1), 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 Õ(m^{2-2/(⌈g/2⌉+1))-time, (+1)-approximation of g. The second is used to obtain our Õ(𝓁⋅ n^{1+ 1/(𝓁-ε)})-time and Õ(𝓁⋅ m^{1+ 1/(𝓁-ε)})-time approximation algorithms.

Cite as

Liam Roditty and Plia Trabelsi. New Algorithms for Girth and Cycle Detection. In 20th Scandinavian Symposium on Algorithm Theory (SWAT 2026). Leibniz International Proceedings in Informatics (LIPIcs), Volume 370, pp. 38:1-38:17, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2026)


Copy BibTex To Clipboard

@InProceedings{roditty_et_al:LIPIcs.SWAT.2026.38,
  author =	{Roditty, Liam and Trabelsi, Plia},
  title =	{{New Algorithms for Girth and Cycle Detection}},
  booktitle =	{20th Scandinavian Symposium on Algorithm Theory (SWAT 2026)},
  pages =	{38:1--38:17},
  series =	{Leibniz International Proceedings in Informatics (LIPIcs)},
  ISBN =	{978-3-95977-421-5},
  ISSN =	{1868-8969},
  year =	{2026},
  volume =	{370},
  editor =	{Fraigniaud, Pierre},
  publisher =	{Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
  address =	{Dagstuhl, Germany},
  URL =		{https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.SWAT.2026.38},
  URN =		{urn:nbn:de:0030-drops-260742},
  doi =		{10.4230/LIPIcs.SWAT.2026.38},
  annote =	{Keywords: Graph algorithms, All pairs shortest path, Girth, Cycle approximation}
}
Any Issues?
X

Feedback on the Current Page

CAPTCHA

Thanks for your feedback!

Feedback submitted to Dagstuhl Publishing

Could not send message

Please try again later or send an E-mail