English

Grammar Index By Induced Suffix Sorting

Data Structures and Algorithms 2021-05-31 v1

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. 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 PP, certain substrings of PP, called cores, that are similarly parsed in the text grammar whenever these occurrences are extensible to occurrences of PP. Supported by the cores, given a pattern of length mm, we can locate all its occocc occurrences in a text TT of length nn within O(mlgS+occClgSlgn+occ)O(m \lg |\mathcal{S}| + occ_C \lg|\mathcal{S}| \lg n + occ) time, where S\mathcal{S} is the set of all characters and non-terminals, occocc is the number of occurrences, and occCocc_C is the number of occurrences of a chosen core CC of PP in the right hand side of all production rules of the grammar of TT. Our grammar index requires O(g)O(g) words of space and can be built in O(n)O(n) time using O(g)O(g) working space, where gg 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.

Keywords

Cite

@article{arxiv.2105.13744,
  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},
  journal= {arXiv preprint arXiv:2105.13744},
  year   = {2021}
}

Comments

Our implementation is available at https://github.com/TooruAkagi/GCIS_Index

R2 v1 2026-06-24T02:34:02.475Z