Papers › A general purpose algorithm for counting simple cycles and simple paths of any length
A general purpose algorithm for counting simple cycles and simple paths of any length
Pierre-Louis Giscard, Nils Kriege, Richard C. Wilson
The archive published only this paper's code-link row. Authors, date and abstract are from arXiv's metadata (CC0), read from the Kaggle arXiv metadata snapshot of 2026-09-12 where its title matched the archive's; the title is the archive's.
We describe a general purpose algorithm for counting simple cycles and simple paths of any length ℓ on a (weighted di)graph on N vertices and M edges, achieving a time complexity of O(N+M+(ℓ^ω+ℓΔ) |S_ℓ|). In this expression, |S_ℓ| is the number of (weakly) connected induced subgraphs of G on at most ℓ vertices, Δ is the maximum degree of any vertex and ω is the exponent of matrix multiplication. We compare the algorithm complexity both theoretically and experimentally with most of the existing algorithms for the same task. These comparisons show that the algorithm described here is the best general purpose algorithm for the class of graphs where (ℓ^(ω-1)Δ⁻¹+1) |S_ℓ|≤|Cycle_ℓ|, with |Cycle_ℓ| the total number of simple cycles of length at most ℓ, including backtracks and self-loops. On Erd\H{o}s-R\'enyi random graphs, we find empirically that this happens when the edge probability is larger than circa 4/N. In addition, we show that some real-world networks also belong to this class. Finally, the algorithm permits the enumeration of simple cycles and simple paths on networks where vertices are labeled from an alphabet on n letters with a time complexity of O(N+M+(n^ℓℓ^ω+ℓΔ) |S_ℓ|). A Matlab implementation of the algorithm proposed here is available for download.
Code
Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.
Code Syntology ran Syntology
Not run by Syntology. Nothing on this page verifies that the listed code works.
Results from the paper archive 2025-07-28
No leaderboard rows for this paper in the archive.
Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections