arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1001.1565cs.DS
收藏

随机访问语法压缩字符串

Random Access to Grammar Compressed Strings

Philip Bille, Gad M. Landau, Rajeev Raman, Kunihiko Sadakane, Srinivasa Rao Satti, Oren Weimann

摘要:

基于语法的压缩是一种简单而强大的范例,它可以捕获许多流行的压缩方案,其中一个人用生成字符串的小型上下文无关语法替换长字符串。在本文中,我们提出了一种新的语法表示,允许有效的随机访问任何字符或子串,而不解压字符串。令$S$为长度为$N$的字符串,该字符串被压缩为大小为$n$的上下文无关语法$\mathcal{S}$。我们提出了两种表示的$\mathcal{S}$实现$O(\log N)$随机访问时间,或$O(n\cdot α_k(n))$建设时间和空间上的指针机器模型,或$O(n)$建设时间和空间上的RAM。这里,$α_k(n)$是阿克曼函数的$k^{th}$行的逆。我们的表示也有效地支持解压缩的任何子串在$S$:我们可以在相同的复杂性作为一个单一的随机访问查询和额外的$O(m)$时间的长度$m$的任何子串。结合这些结果与快速算法的未压缩近似字符串匹配导致几个有效的算法近似字符串匹配的语法压缩字符串不解压。例如,我们可以找到模式$P$在时间$O(n(\min\{|P|k, k^4 + |P|\} + \log N) + occ)$上的所有近似出现,其中$occ$是$P$在$S$中出现的次数。最后,我们将我们的结果推广到导航和语法压缩有序树的其他操作。所有上述界限显着改善目前最知名的结果。为了实现这些界限,我们引入了几个新的技术和数据结构的独立利益,包括前身的数据结构,两个“有偏见的”加权祖先的数据结构,和一个紧凑的表示语法中的重路径。

英文摘要:

Grammar based compression, where one replaces a long string by a small context-free grammar that generates the string, is a simple and powerful paradigm that captures many popular compression schemes. In this paper, we present a novel grammar representation that allows efficient random access to any character or substring without decompressing the string. Let $S$ be a string of length $N$ compressed into a context-free grammar $\mathcal{S}$ of size $n$. We present two representations of $\mathcal{S}$ achieving $O(\log N)$ random access time, and either $O(n\cdot α_k(n))$ construction time and space on the pointer machine model, or $O(n)$ construction time and space on the RAM. Here, $α_k(n)$ is the inverse of the $k^{th}$ row of Ackermann's function. Our representations also efficiently support decompression of any substring in $S$: we can decompress any substring of length $m$ in the same complexity as a single random access query and additional $O(m)$ time. Combining these results with fast algorithms for uncompressed approximate string matching leads to several efficient algorithms for approximate string matching on grammar-compressed strings without decompression. For instance, we can find all approximate occurrences of a pattern $P$ with at most $k$ errors in time $O(n(\min\{|P|k, k^4 + |P|\} + \log N) + occ)$, where $occ$ is the number of occurrences of $P$ in $S$. Finally, we generalize our results to navigation and other operations on grammar-compressed ordered trees. All of the above bounds significantly improve the currently best known results. To achieve these bounds, we introduce several new techniques and data structures of independent interest, including a predecessor data structure, two "biased" weighted ancestor data structures, and a compact representation of heavy paths in grammars.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑