Skip to main content
QUICK REVIEW

[Paper Review] Finger Search, Random Access, and Longest Common Extensions in Grammar-Compressed Strings.

Philip Bille, Anders Roy Christiansen|arXiv (Cornell University)|Jul 10, 2015
Algorithms and Data CompressionComputer Science33 references3 citations
TL;DR

This paper introduces novel grammar-based data structures that enable efficient finger search, random access, and longest common extension (LCE) queries on grammar-compressed strings. By leveraging a new van Emde Boas-style decomposition for grammars, it achieves sublinear finger search time, constant-time random access with sublinear space, and efficient LCE queries, significantly improving prior bounds in all cases.

ABSTRACT

Grammar-based compression, where one replaces a long string by a small context-free grammar that generates the string, is a simple and powerful paradigm that captures many popular compression schemes. In this paper, we present new representations of grammars that supports efficient finger search style access, random access, and longest common extensions queries. Let $S$ be a string of length $N$ compressed into a context-free grammar $\mathcal{S}$ of size $n$. We present the following. - An $O(n)$ space representation that supports setting a finger at any position $f$ in $O(\log N)$ time, and subsequently supporting access to any position $i$ in time $O(\log |f - i|)$. - An $O(N^\epsilon n^{1-\epsilon})$ space representation that supports random access to any position in constant time. - Two representations that support longest common extensions queries in either $O(N^{\frac{1}{2}+\epsilon} n^{\frac{1}{2}-\epsilon})$ space and $O(1)$ time or $O(n)$ space and $O(\log N + \log^2 \ell)$ time where $\ell$ is the length of the longest common extension. All of the above bounds significantly improve the currently best known results. To achieve the bounds we introduce several new data structural techniques of independent interest, including a new van Emde Boas style decomposition for grammars.

Motivation & Objective

  • To design efficient data structures for accessing and comparing grammar-compressed strings.
  • To support finger search with time complexity dependent on distance from the finger position.
  • To enable constant-time random access with sublinear space overhead.
  • To support longest common extension queries with improved time and space trade-offs.
  • To introduce novel data structural techniques applicable beyond grammar compression.

Proposed method

  • Introducing a new van Emde Boas-style decomposition tailored for context-free grammars to enable hierarchical access and decomposition.
  • Designing an $O(n)$ space representation that supports finger search in $O(\log |f - i|)$ time from any finger position $f$.
  • Constructing an $O(N^\epsilon n^{1-\epsilon})$ space representation for constant-time random access to any position in the string.
  • Developing two alternative LCE query representations: one with $O(N^{\frac{1}{2}+\epsilon} n^{\frac{1}{2}-\epsilon})$ space and $O(1)$ query time, and another with $O(n)$ space and $O(\log N + \log^2 \ell)$ query time.
  • Using the grammar's hierarchical structure to support efficient rank and select operations over parse trees.
  • Applying path-label compression and range queries on grammar-derived trees to accelerate access and extension operations.

Experimental results

Research questions

  • RQ1Can finger search in grammar-compressed strings be accelerated to depend logarithmically on the distance from the finger?
  • RQ2Is it possible to achieve constant-time random access in grammar-compressed strings with sublinear space?
  • RQ3Can longest common extension queries be supported in constant time with sublinear space?
  • RQ4What novel data structural techniques can be developed to exploit the hierarchical nature of grammar-compressed strings?
  • RQ5How can van Emde Boas-style decomposition be adapted to context-free grammars for efficient string operations?

Key findings

  • The paper achieves $O(\log |f - i|)$ finger search time from any finger position $f$ using only $O(n)$ space, improving on prior results.
  • It presents a random access structure with $O(N^\epsilon n^{1-\epsilon})$ space and $O(1)$ query time, offering a significant space-time trade-off.
  • Two LCE query structures are introduced: one with $O(N^{\frac{1}{2}+\epsilon} n^{\frac{1}{2}-\epsilon})$ space and $O(1)$ query time, and another with $O(n)$ space and $O(\log N + \log^2 \ell)$ query time.
  • The proposed van Emde Boas-style decomposition for grammars enables efficient hierarchical navigation and is a key enabler of the improved bounds.
  • All proposed data structures significantly improve upon the best-known time and space complexities for their respective operations in grammar-compressed strings.
  • The techniques introduced are of independent interest and may be applicable to other compressed data structures.

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.