Time-Space Trade-Offs for Lempel-Ziv Compressed Indexing
arXiv:1706.10094 · doi:10.1016/j.tcs.2017.12.021
Abstract
Given a string , the \emph{compressed indexing problem} is to preprocess into a compressed representation that supports fast \emph{substring queries}. The goal is to use little space relative to the compressed size of while supporting fast queries. We present a compressed index based on the Lempel--Ziv 1977 compression scheme. We obtain the following time-space trade-offs: For constant-sized alphabets; (i) time using space, or (ii) time using space. For integer alphabets polynomially bounded by ; (iii) time using space, or (iv) time using space, where and are the length of the input string and query string respectively, is the number of phrases in the LZ77 parse of the input string, is the number of occurrences of the query in the input and is an arbitrarily small constant. In particular, (i) improves the leading term in the query time of the previous best solution from to at the cost of increasing the space by a factor . Alternatively, (ii) matches the previous best space bound, but has a leading term in the query time of . However, for any polynomial compression ratio, i.e., , for constant , this becomes . Our index also supports extraction of any substring of length in time. Technically, our results are obtained by novel extensions and combinations of existing data structures of independent interest, including a new batched variant of weak prefix search.