English

Time-Space Trade-Offs for Longest Common Extensions

Data Structures and Algorithms 2013-04-23 v2

Abstract

We revisit the longest common extension (LCE) problem, that is, preprocess a string TT into a compact data structure that supports fast LCE queries. An LCE query takes a pair (i,j)(i,j) of indices in TT and returns the length of the longest common prefix of the suffixes of TT starting at positions ii and jj. We study the time-space trade-offs for the problem, that is, the space used for the data structure vs. the worst-case time for answering an LCE query. Let nn be the length of TT. Given a parameter τ\tau, 1τn1 \leq \tau \leq n, we show how to achieve either O(\infracnτ)O(\infrac{n}{\sqrt{\tau}}) space and O(τ)O(\tau) query time, or O(\infracnτ)O(\infrac{n}{\tau}) space and O(τlog(\LCE(i,j)/τ))O(\tau \log({|\LCE(i,j)|}/{\tau})) query time, where \LCE(i,j)|\LCE(i,j)| denotes the length of the LCE returned by the query. These bounds provide the first smooth trade-offs for the LCE problem and almost match the previously known bounds at the extremes when τ=1\tau=1 or τ=n\tau=n. We apply the result to obtain improved bounds for several applications where the LCE problem is the computational bottleneck, including approximate string matching and computing palindromes. We also present an efficient technique to reduce LCE queries on two strings to one string. Finally, we give a lower bound on the time-space product for LCE data structures in the non-uniform cell probe model showing that our second trade-off is nearly optimal.

Keywords

Cite

@article{arxiv.1211.0270,
  title  = {Time-Space Trade-Offs for Longest Common Extensions},
  author = {Philip Bille and Inge Li Goertz and Benjamin Sach and Hjalte Wedel Vildhøj},
  journal= {arXiv preprint arXiv:1211.0270},
  year   = {2013}
}

Comments

A preliminary version of this paper appeared in the proceedings of the 23rd Annual Symposium on Combinatorial Pattern Matching (CPM 2012)

R2 v1 2026-06-21T22:31:46.084Z