Testing Quasiperiodicity
摘要
A cover (or quasiperiod) of a string S is a shorter string C such that every position of S is contained in some occurrence of C as a substring. The notion of cover was introduced by Apostolico and Ehrenfeucht over 30 years ago [Theor. Comput. Sci. 1993] and it has received significant attention from the combinatorial pattern matching community. In this note, we show how to efficiently test whether S admits a cover. We design an algorithm that, given \(n=|S|\) , \(q \in [n]\) , \(\epsilon \in \mathbb {R}^+\) , and oracle access to S, uses \(\mathcal {O}(q^3 \epsilon ^{-1}\log q )\) letter queries to test whether S has a cover C of length at most q or is \(\epsilon \) -far from having such a cover. Our insights also lead to a simple streaming algorithm for short covers.