We present a data structure that stores a sequence $s[1..n]$ over alphabet $[1..σ]$ in $n\Ho(s) + o(n)(\Ho(s){+}1)$ bits, where $\Ho(s)$ is the zero-order entropy of $s$. This structure supports the queries \access, \rank\ and \select, which are fundamental building blocks for many other compressed data structures, in worst-case time $\Oh{\lg\lgσ}$ and average time $\Oh{\lg \Ho(s)}$. The worst-case complexity matches the best previous results, yet these had been achieved with data structures using $n\Ho(s)+o(n\lgσ)$ bits. On highly compressible sequences the $o(n\lgσ)$ bits of the redundancy may be significant compared to the the $n\Ho(s)$ bits that encode the data. Our representation, instead, compresses the redundancy as well. Moreover, our average-case complexity is unprecedented. Our technique is based on partitioning the alphabet into characters of similar frequency. The subsequence corresponding to each group can then be encoded using fast uncompressed representations without harming the overall compression ratios, even in the redundancy. The result also improves upon the best current compressed representations of several other data structures. For example, we achieve $(i)$ compressed redundancy, retaining the best time complexities, for the smallest existing full-text self-indexes; $(ii)$ compressed permutations $π$ with times for $π()$ and $\pii()$ improved to loglogarithmic; and $(iii)$ the first compressed representation of dynamic collections of disjoint sets. We also point out various applications to inverted indexes, suffix arrays, binary relations, and data compressors. ...
Faster fully compressed pattern matching by recompression
本文研究了一个完全压缩的模式匹配问题。压缩由直线程序(SLP)表示,即一种上下文无关文法,只生成一个字符串;该术语完全意味着模式和文本都以压缩形式给出。使用最近开发的局部再压缩技术来处理这个问题:重构SLP,使得模式和文本的子串以相同的方式在两个SLP中编码。为此,SLP被本地解压缩,然后以统一的方式重新压缩。该技术产生用于压缩模式匹配的O((n+m)log M)算法,假设M适合O(1)机器字,其中n(m)是文本(模式)的压缩表示的大小,而M是解压缩模式的大小。如果只有m+n适合O(1)机器字,则运行时间增加到O((n+m)log M log(n+m))。算法复杂度为O(n^2m)。