String Indexing with Compressed Patterns
Philip Bille, Inge Li Gørtz, Teresa Anna Steiner
TL;DR
This work tackles string indexing when the query pattern is given in compressed form, focusing on patterns compressed by LZ77. It introduces a progression of data-structure techniques culminating in a linear-space solution that answers queries in $O(z+\log m+\mathrm{occ})$ time for LZ77-compressed patterns (and extends to LZ78), with near-optimal bounds and practical preprocessing strategies. Central ideas include the phrase trie, a LIS-like LCP decomposition for LZ77, and a slice-tree approach using Karp–Rabin fingerprints and ART decomposition to reduce search depth to $O(\log m)$. Together, these components enable efficient, scalable pattern search on long indexed strings in compressed form, with potential applicability to other compression schemes and fully compressed scenarios. The results have practical significance for client-server settings where queries are transmitted in compressed form, enabling direct processing without decompression and leveraging pattern repetitiveness for speed and space efficiency.
Abstract
Given a string $S$ of length $n$, the classic string indexing problem is to preprocess $S$ into a compact data structure that supports efficient subsequent pattern queries. In this paper we consider the basic variant where the pattern is given in compressed form and the goal is to achieve query time that is fast in terms of the compressed size of the pattern. This captures the common client-server scenario, where a client submits a query and communicates it in compressed form to a server. Instead of the server decompressing the query before processing it, we consider how to efficiently process the compressed query directly. Our main result is a novel linear space data structure that achieves near-optimal query time for patterns compressed with the classic Lempel-Ziv compression scheme. Along the way we develop several data structural techniques of independent interest, including a novel data structure that compactly encodes all LZ77 compressed suffixes of a string in linear space and a general decomposition of tries that reduces the search time from logarithmic in the size of the trie to logarithmic in the length of the pattern.
