Rank, select and access in grammar-compressed strings
Abstract
Given a string of length on a fixed alphabet of symbols, a grammar compressor produces a context-free grammar of size that generates and only . In this paper we describe data structures to support the following operations on a grammar-compressed string: (return the number of occurrences of symbol before position in ); (return the position of the th occurrence of in ); and (return substring ). For rank and select we describe data structures of size bits that support the two operations in time. We propose another structure that uses bits and that supports the two queries in , where is an arbitrary constant. To our knowledge, we are the first to study the asymptotic complexity of rank and select in the grammar-compressed setting, and we provide a hardness result showing that significantly improving the bounds we achieve would imply a major breakthrough on a hard graph-theoretical problem. Our main result for access is a method that requires bits of space and time to extract consecutive symbols from . Alternatively, we can achieve query time using bits of space. This matches a lower bound stated by Verbin and Yu for strings where is polynomially related to .
Keywords
Cite
@article{arxiv.1408.3093,
title = {Rank, select and access in grammar-compressed strings},
author = {Djamal Belazzougui and Simon J. Puglisi and Yasuo Tabei},
journal= {arXiv preprint arXiv:1408.3093},
year = {2014}
}
Comments
16 pages