Closed Repeats
Abstract
Much research in stringology focuses on structures that can, in a way, ``grasp'' repeats (substrings that occur multiple times) as, for example, the so-called runs, a.k.a. maximal repetitions, compactly describe all tandem repeats. In this paper we introduce closed repeats: given a string , its non-empty substring is a right (left) closed repeat if its closest occurrence with cannot be ``extended'' to the right (respectively, left) matching (respectively, ); the repeat is closed if it is both left and right closed. We note that the closed repeats correspond to the maximal closed substrings recently proposed by Badkobeh et al. and they include all runs as a special case. We prove that the number of right/left closed repeats is , where is the length of , and we show that this bound is tight. The (right/left) closed repeats can be computed in the optimal time ; as we prove, the computation time cannot be lower than over a general ordered alphabet of size even when the number of the closed repeats is . As an application, we describe data structures using the closed repeats for a number of substring queries: finding the period of the substring provided it is ``periodic'', finding the longest repeat in the substring, computing the rightmost LZ77 parsing of the substring.
Cite
@article{arxiv.2410.00209,
title = {Closed Repeats},
author = {Dmitry Kosolobov},
journal= {arXiv preprint arXiv:2410.00209},
year = {2024}
}
Comments
11 pages, 1 figure