Skip to main content
QUICK REVIEW

[Paper Review] In-Place Longest Common Extensions.

Nicola Prezza|arXiv (Cornell University)|Aug 17, 2016
Algorithms and Data CompressionComputer Science26 references5 citations
TL;DR

This paper presents an in-place data structure that replaces a text of size $n\lceil\log_2|\Sigma|\rceil$ bits while supporting optimal-time text extraction and $\mathcal{O}(\log n)$-time LCE queries—exponentially faster than using the plain text. The structure enables the first in-place algorithms for computing the LCP array in $\mathcal{O}(n\log n)$ expected time and suffix-sorting $b$ suffixes in $\mathcal{O}(n + b\log^2 n)$ expected time, significantly improving over prior in-place methods.

ABSTRACT

Longest Common Extension (LCE) queries are a fundamental sub-routine in several string-processing algorithms, including (but not limited to) suffix-sorting, string matching, compression, and identification of repeats and palindrome factors. A LCE query takes as input two positions $i,j$ in a text $T\in\Sigma^n$ and returns the length $\ell$ of the longest common prefix between $T$'s $i$-th and $j$-th suffixes. In this paper, we present the following result: we can replace the (plain) text with a data structure of the \emph{exact same size}---$n\lceil\log_2|\Sigma| ceil$ bits---supporting text extraction in optimal time and LCE queries in logarithmic time---i.e. \emph{exponentially} faster than what can be achieved using the plain text alone. Our structure can be built in $\mathcal O(n\log n)$ expected time and linear space. We show that our result is a powerful tool that can be used to efficiently solve in-place a wide variety of string processing problems: we provide the first in-place algorithms to compute the LCP array in $\mathcal O(n\log n)$ expected time (the previous fastest in-place algorithm runs in $\mathcal O(n^2)$ time) and to suffix-sort---with high probability of success---any set of $b$ text suffixes in $\mathcal O(n+b\log^2 n)$ expected time (the previous fastest in-place algorithm runs in $\mathcal O(nb)$ time).

Motivation & Objective

  • To design a data structure that supports efficient LCE queries within the same space as the original text.
  • To enable in-place computation of the LCP array in $\mathcal{O}(n\log n)$ expected time, improving upon the previous $\mathcal{O}(n^2)$ in-place bound.
  • To develop an in-place suffix-sorting algorithm that runs in $\mathcal{O}(n + b\log^2 n)$ expected time, surpassing the prior $\mathcal{O}(nb)$ bound.
  • To demonstrate that the same data structure can be used to solve a broad class of string-processing problems efficiently in-place.

Proposed method

  • The data structure replaces the original text with a compressed, in-place representation that supports both text extraction and LCE queries in $\mathcal{O}(\log n)$ time.
  • It uses a succinct representation of the text using $n\lceil\log_2|\Sigma|\rceil$ bits, matching the size of the plain text.
  • The structure is constructed in $\mathcal{O}(n\log n)$ expected time using a randomized construction process.
  • LCE queries are answered by traversing a wavelet tree-like structure built over the suffix array and LCP array.
  • The method leverages the fact that the data structure supports both rank and select operations on the text, enabling efficient suffix comparisons.
  • The in-place algorithms for LCP array and suffix sorting are built on top of this structure, exploiting its ability to simulate access to suffixes and their LCEs.

Experimental results

Research questions

  • RQ1Can an in-place data structure be designed that supports LCE queries in $\mathcal{O}(\log n)$ time while using only $n\lceil\log_2|\Sigma|\rceil$ bits?
  • RQ2Can this data structure enable the first in-place algorithm for computing the LCP array in $\mathcal{O}(n\log n)$ expected time?
  • RQ3Can the structure support efficient in-place suffix sorting of $b$ suffixes in $\mathcal{O}(n + b\log^2 n)$ expected time?
  • RQ4How does the performance of in-place string algorithms improve when using this structure compared to previous in-place methods?

Key findings

  • The proposed data structure supports LCE queries in $\mathcal{O}(\log n)$ time, which is exponentially faster than the $\mathcal{O}(n)$ time achievable using the plain text alone.
  • The LCP array can be computed in $\mathcal{O}(n\log n)$ expected time using an in-place algorithm, a significant improvement over the previous $\mathcal{O}(n^2)$ bound.
  • Suffix sorting of $b$ suffixes is achieved in $\mathcal{O}(n + b\log^2 n)$ expected time, improving upon the prior $\mathcal{O}(nb)$ in-place method.
  • The data structure uses exactly $n\lceil\log_2|\Sigma|\rceil$ bits, matching the size of the original text, enabling true in-place operation.
  • The construction of the data structure takes $\mathcal{O}(n\log n)$ expected time and linear space, making it practical for large texts.
  • The framework enables a wide range of string-processing problems to be solved efficiently in-place, demonstrating broad applicability.

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.