paper

Efficient Algorithms to Compute Closed Substrings

arXiv:2506.06452

Abstract

A closed string is either of length one or contains a border that occurs only as a prefix and as a suffix in and nowhere else within . In this paper, we present fast time algorithms to compute all closed substrings by introducing a compact representation for all closed substrings of a string , using only 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 () in a Fibonacci word , for , is , where is the golden ratio.

Submitted to TOCS 2026

Efficient Algorithms to Compute Closed Substrings · wovepaper