Skip to main content
QUICK REVIEW

[Paper Review] Optimal searching of gapped repeats in a word

Maxime Crochemore, Roman Kolpakov|arXiv (Cornell University)|Sep 3, 2015
Algorithms and Data CompressionComputer Science30 references6 citations
TL;DR

This paper presents an optimal $O(\alpha n)$-time algorithm for finding all maximal $\alpha$-gapped repeats in a string of length $n$, improving the previous bound of $O(\alpha^2 n)$. The key contribution is proving that the number of such repeats is bounded by $O(\alpha n)$, which also implies an $O(n/\delta)$ bound on the number of maximal $\delta$-subrepetitions, improving prior results by a $\log n$ factor.

ABSTRACT

Following (Kolpakov et al., 2013; Gawrychowski and Manea, 2015), we continue the study of {\em $α$-gapped repeats} in strings, defined as factors $uvu$ with $|uv|\leq α|u|$. Our main result is the $O(αn)$ bound on the number of {\em maximal} $α$-gapped repeats in a string of length $n$, previously proved to be $O(α^2 n)$ in (Kolpakov et al., 2013). For a closely related notion of maximal $δ$-subrepetition (maximal factors of exponent between $1+δ$ and $2$), our result implies the $O(n/δ)$ bound on their number, which improves the bound of (Kolpakov et al., 2010) by a $\log n$ factor. We also prove an algorithmic time bound $O(αn+S)$ ($S$ size of the output) for computing all maximal $α$-gapped repeats. Our solution, inspired by (Gawrychowski and Manea, 2015), is different from the recently published proof by (Tanimura et al., 2015) of the same bound. Together with our bound on $S$, this implies an $O(αn)$-time algorithm for computing all maximal $α$-gapped repeats.

Motivation & Objective

  • To establish a tighter upper bound on the number of maximal $\alpha$-gapped repeats in a string of length $n$.
  • To design an optimal $O(\alpha n)$-time algorithm for computing all such repeats.
  • To improve the bound on the number of maximal $\delta$-subrepetitions (factors with exponent in $[1+\delta, 2)$) from $O(n \log n / \delta)$ to $O(n / \delta)$.
  • To generalize insights from gapped repeats to gapped palindromes and explore the broader conjecture on $\alpha$-gapped repeats for $\alpha > 0$.

Proposed method

  • The algorithm uses a divide-and-conquer approach based on segmenting the string into intervals of controlled length.
  • It applies a linear-time procedure to find all maximal $\alpha$-gapped repeats within each segment, leveraging the fact that the number of distinct segments is bounded by $O(\sigma^{12\log^2 \log n})$ for a constant alphabet.
  • The method exploits the structural properties of $\alpha$-gapped repeats, particularly their periodicity and overlap constraints, to avoid redundant computation.
  • It combines the segment-based search with a global aggregation step that ensures no repeat is missed, maintaining the $O(\alpha n)$ time complexity.
  • The proof technique differs from prior work, notably from Tanimura et al. (2015), and relies on bounding the number of distinct segment types and their repeat content.
  • The analysis uses the concept of maximal $\alpha$-gapped repeats and their containment in intervals of length $O(\Delta^{\prime\prime})$, where $\Delta^{\prime\prime}$ is logarithmically bounded.

Experimental results

Research questions

  • RQ1What is the maximum number of maximal $\alpha$-gapped repeats that can exist in a string of length $n$?
  • RQ2Can the number of maximal $\delta$-subrepetitions be bounded more tightly than $O(n \log n / \delta)$?
  • RQ3Is there an $O(\alpha n)$-time algorithm to compute all maximal $\alpha$-gapped repeats in a string?
  • RQ4Can the bound on $\alpha$-gapped repeats be extended to $\alpha \leq 1$, including the case $\alpha = 1$?
  • RQ5Is the $O(n/\delta)$ bound on $\delta$-subrepetitions asymptotically tight for constant alphabets?

Key findings

  • The number of maximal $\alpha$-gapped repeats in a string of length $n$ is bounded by $O(\alpha n)$, improving the prior bound of $O(\alpha^2 n)$.
  • An $O(\alpha n)$-time algorithm exists for computing all maximal $\alpha$-gapped repeats in a string over a constant alphabet, which is asymptotically optimal.
  • The number of maximal $\delta$-subrepetitions (factors with exponent in $[1+\delta, 2)$) is bounded by $O(n / \delta)$, improving the previous bound by a $\log n$ factor.
  • The bound on $\alpha$-gapped repeats extends to maximal $\alpha$-gapped palindromes, which are also bounded by $O(\alpha n)$ and can be computed in $O\big(\alpha n\big)$ time.
  • The paper conjectures that for any $\alpha > 0$, the number of maximal $\alpha$-gapped repeats in a string of length $n$ is less than $\alpha n$, generalizing the 'runs conjecture'.
  • The number of maximal $1$-gapped repeats (overlapping or adjacent copies) is strictly less than $n$, and this bound holds even when considering runs with high exponents.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.