Time-Space Trade-Offs for Longest Common Extensions

  • Philip Bille
  • Inge Li Gørtz
  • Benjamin Sach
  • Hjalte Wedel Vildhøj
Conference paper

DOI: 10.1007/978-3-642-31265-6_24

Part of the Lecture Notes in Computer Science book series (LNCS, volume 7354)
Cite this paper as:
Bille P., Gørtz I.L., Sach B., Vildhøj H.W. (2012) Time-Space Trade-Offs for Longest Common Extensions. In: Kärkkäinen J., Stoye J. (eds) Combinatorial Pattern Matching. CPM 2012. Lecture Notes in Computer Science, vol 7354. Springer, Berlin, Heidelberg

Abstract

We revisit the longest common extension (LCE) problem, that is, preprocess a string T into a compact data structure that supports fast LCE queries. An LCE query takes a pair (i,j) of indices in T and returns the length of the longest common prefix of the suffixes of T starting at positions i and j. 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 n be the length of T. Given a parameter τ, 1 ≤ τ ≤ n, we show how to achieve either \(O({n}/{\sqrt{\tau}})\) space and O(τ) query time, or O(n/τ) space and \(O(\tau \log({|\ensuremath{\mathrm{LCE}} (i,j)|}/{\tau}))\) query time, where \(|\ensuremath{\mathrm{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 or τ = 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. Finally, we also present an efficient technique to reduce LCE queries on two strings to one string.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Philip Bille
    • 1
  • Inge Li Gørtz
    • 1
  • Benjamin Sach
    • 2
  • Hjalte Wedel Vildhøj
    • 1
  1. 1.Technical University of Denmark, DTU InformaticsDenmark
  2. 2.Department of Computer ScienceUniversity of WarwickUK

Personalised recommendations