Efficient Algorithms to Compute Closed Substrings
Abstract
A closed string u is either of length one or contains a border that occurs only as a prefix and as a suffix in u and nowhere else within u. In this paper, we present fast O(n n) time algorithms to compute all O(n2) closed substrings by introducing a compact representation for all closed substrings of a string w[1..n], using only O(n n) space. These simple and space-efficient algorithms also compute maximal closed strings. Furthermore, we compare the performance of these algorithms and identify classes of strings where each performs best. Finally, we show that the exact number of MCSs (M(fn)) in a Fibonacci word fn , for n ≥ 5, is ≈ (1 + 1φ2) Fn ≈ 1.382 Fn, where φ is the golden ratio.
Turn this paper into a full lesson
ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.