Searching of gapped repeats and subrepetitions in a word
Authors:
- Roman KolpakovRKRoman Kolpakov
- Mikhail PodolskiyMPMikhail Podolskiy
- Mikhail PosypkinMikhail Posypkin
- Nickolay KhrapovNKNickolay Khrapov
Preprint
Abstract
A gapped repeat is a factor of the form $uvu$ where $u$ and $v$ are nonempty words. The period of the gapped repeat is defined as $|u|+|v|$. The gapped repeat is maximal if it cannot be extended to the left or to the right by at least one letter with preserving its period. The gapped repeat is called $\alpha$-gapped if its period is not greater than $\alpha |v|$. A $\delta$-subrepetition is a factor which exponent is less than 2 but is not less than $1+\delta$ (the exponent of the factor is the quotient of the length and the minimal period of the factor). The $\delta$-subrepetition is maximal if it cannot be extended to the left or to the right by at least one letter with preserving its minimal period. We reveal a close relation between maximal gapped repeats and maximal subrepetitions. Moreover, we show that in a word of length $n$ the number of maximal $\alpha$-gapped repeats is bounded by $O(\alpha^2n)$ and the number of maximal $\delta$-subrepetitions is bounded by $O(n/\delta^2)$. Using the obtained upper bounds, we propose algorithms for finding all maximal $\alpha$-gapped repeats and all maximal $\delta$-subrepetitions in a word of length $n$. The algorithm for finding all maximal $\alpha$-gapped repeats has $O(\alpha^2n)$ time complexity for the case of constant alphabet size and $O(n\log n + \alpha^2n)$ time complexity for the general case. For finding all maximal $\delta$-subrepetitions we propose two algorithms. The first algorithm has $O(\frac{n\log\log n}{\delta^2})$ time complexity for the case of constant alphabet size and $O(n\log n +\frac{n\log\log n}{\delta^2})$ time complexity for the general case. The second algorithm has $O(n\log n+\frac{n}{\delta^2}\log \frac{1}{\delta})$ expected time complexity.
Keywords
All Related Versions
This publication has 10 references indexed in Scilit:
- On primary and secondary repetitions in wordsTheoretical Computer Science, 2012
- On maximal repetitions of arbitrary exponentInformation Processing Letters, 2010
- Linear time algorithms for finding and representing all the tandem repeats in a stringJournal of Computer and System Sciences, 2004
- Algorithms on Strings, Trees, and Sequences: Computer Science and Computational BiologyJournal of the American Statistical Association, 1999
- Finding Maximal Pairs with Bounded Gap1999
- On maximal repetitions in words1999
- Squares, cubes, and time-space efficient string searchingAlgorithmica, 1995
- Time-space-optimal string matchingJournal of Computer and System Sciences, 1983
- An optimal algorithm for computing the repetitions in a wordInformation Processing Letters, 1981
- Design and implementation of an efficient priority queueTheory of Computing Systems, 1976