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

基于LZ77语法分析的AVL文法的快速高效构造

Fast and Space-Efficient Construction of AVL Grammars from the LZ77 Parsing

Dominik Kempa, Ben Langmead

摘要:

语法压缩是仅次于Lempel-Ziv(LZ 77)和游程Burrows-Wheeler变换(RLBWT)的表示和处理高度可压缩字符串的最灵活的方法之一。其主要思想是将文本表示为上下文无关文法,其语言正是输入字符串。这就是所谓的直线文法(straight-line grammar,SLG)。一个AVL文法,由Rytter [Theor. Comput.科学,2003]是一种额外满足AVL属性的SLG类型:每个非终结符的子节点的解析树的高度最多相差1。与其他SLG结构相比,AVL语法可以在压缩时间内从LZ 77解析中构造:$\mathcal{O}(z \log n)$其中$z$是LZ 77解析的大小,$n$是输入文本的长度。尽管有这些优点,AVL文法被认为太大而不实用。我们提出了一种新技术,用于从LZ 77或类似LZ 77的解析快速构建小型AVL语法。我们的算法产生的文法总是比原始算法产生的文法小至少五倍,并且永远不会超过实际重新配对压缩器产生的文法大小的两倍[Larsson和Moffat,Proc. IEEE,2000]。我们的算法还实现了低峰值RAM使用。通过将该算法与LZ 77解析的最新进展相结合,我们表明,我们的方法有可能在其他方法所需的时间和峰值RAM的三分之一左右从LZ 77解析构建一个游程长度BWT。总的来说,我们表明,AVL语法是令人惊讶的实用,打开大门,更快地建设的关键压缩数据结构。

英文摘要:

Grammar compression is, next to Lempel-Ziv (LZ77) and run-length Burrows-Wheeler transform (RLBWT), one of the most flexible approaches to representing and processing highly compressible strings. The main idea is to represent a text as a context-free grammar whose language is precisely the input string. This is called a straight-line grammar (SLG). An AVL grammar, proposed by Rytter [Theor. Comput. Sci., 2003] is a type of SLG that additionally satisfies the AVL-property: the heights of parse-trees for children of every nonterminal differ by at most one. In contrast to other SLG constructions, AVL grammars can be constructed from the LZ77 parsing in compressed time: $\mathcal{O}(z \log n)$ where $z$ is the size of the LZ77 parsing and $n$ is the length of the input text. Despite these advantages, AVL grammars are thought to be too large to be practical. We present a new technique for rapidly constructing a small AVL grammar from an LZ77 or LZ77-like parse. Our algorithm produces grammars that are always at least five times smaller than those produced by the original algorithm, and never more than double the size of grammars produced by the practical Re-Pair compressor [Larsson and Moffat, Proc. IEEE, 2000]. Our algorithm also achieves low peak RAM usage. By combining this algorithm with recent advances in approximating the LZ77 parsing, we show that our method has the potential to construct a run-length BWT from an LZ77 parse in about one third of the time and peak RAM required by other approaches. Overall, we show that AVL grammars are surprisingly practical, opening the door to much faster construction of key compressed data structures.

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

↑