Grammar Index By Induced Suffix Sorting

Tooru Akagi, Dominik Köppl, Yuto Nakashima, Shunsuke Inenaga, Hideo Bannai +1 more
5/28/2021
cs.DS

Official code: TooruAkagi/GCIS_Index (6 stars, C++, last commit 2025-12-25).

Abstract

Pattern matching is the most central task for text indices. Most recent indices leverage compression techniques to make pattern matching feasible for massive but highly-compressible datasets.

Show full abstract

Within this kind of indices, we propose a new compressed text index built upon a grammar compression based on induced suffix sorting [Nunes et al., DCC'18]. We show that this grammar exhibits a locality sensitive parsing property, which allows us to specify, given a pattern $P$, certain substrings of $P$, called cores, that are similarly parsed in the text grammar whenever these occurrences are extensible to occurrences of $P$. Supported by the cores, given a pattern of length $m$, we can locate all its $occ$ occurrences in a text $T$ of length $n$ within $O(m \lg |\mathcal{S}| + occ_C \lg|\mathcal{S}| \lg n + occ)$ time, where $\mathcal{S}$ is the set of all characters and non-terminals, $occ$ is the number of occurrences, and $occ_C$ is the number of occurrences of a chosen core $C$ of $P$ in the right hand side of all production rules of the grammar of $T$. Our grammar index requires $O(g)$ words of space and can be built in $O(n)$ time using $O(g)$ working space, where $g$ is the sum of the right hand sides of all production rules. We underline the strength of our grammar index with an exhaustive practical evaluation that gives evidence that our proposed solution excels at locating long patterns in highly-repetitive texts.

View on arXivView PDF

Code Implementations(1)

60C++, MakefileMay 26, 202111 months ago

Similar Papers

Cite this paper

@article{akagi2021grammar,
  title  = {Grammar Index By Induced Suffix Sorting},
  author = {Tooru Akagi and Dominik Köppl and Yuto Nakashima and Shunsuke Inenaga and Hideo Bannai and Masayuki Takeda},
  year   = {2021},
  eprint = {2105.13744},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2105.13744}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2105.13744.svg)](https://codeofpaper.com/paper/2105.13744)

Discussion