String 2-Covers with No Length Restrictions
Abstract
A -cover of a string is a set of strings such that every index in is contained in an occurrence of at least one string . The existence of a -cover defines a well-known class of quasi-periodic strings. Quasi-periodicity can be decided in linear time, and all -covers of a string can be reported in linear time plus the size of the output. Since in general it is NP-complete to decide whether a string has a -cover, the natural next step is the development of efficient algorithms for -covers. Radoszewski and Straszy\'nski [ESA 2020] analysed the particular case where the strings in a -cover must be of the same length. They provided an algorithm that reports all such -covers of in time near-linear in and in the size of the output. In this work, we consider -covers in full generality. Since every length- string has trivial -covers (every prefix and suffix of total length at least constitute such a -cover), we state the reporting problem as follows: given a string and a number , report all -covers of with length upper bounded by . We present an time algorithm solving this problem, with Output being the size of the output. This algorithm admits a simpler modification that finds a -cover of minimum length. We also provide an time construction of a -cover oracle which, given two substrings of , reports in poly-logarithmic time whether is a -cover of .
Cite
@article{arxiv.2405.11475,
title = {String 2-Covers with No Length Restrictions},
author = {Itai Boneh and Shay Golan and Arseny Shur},
journal= {arXiv preprint arXiv:2405.11475},
year = {2024}
}
Comments
31 pages