Skip to main content
QUICK REVIEW

[论文解读] Practical and Effective Re-Pair Compression

Philip Bille, Inge Li Gørtz|arXiv (Cornell University)|Apr 27, 2017
Algorithms and Data Compression参考文献 2被引用 6
一句话总结

本文提出了一种实用且空间高效的 Re-Pair 压缩实现,将工作空间减少至 (1.5+ε)n 个字词(包括文本本身),同时保持线性时间复杂度。此外,该工作提出了一种新颖的语法编码策略,实现了接近最优的压缩率,平均仅比信息论最小值多出 2.8% 的比特数,且在一半测试案例中优于 7-Zip。

ABSTRACT

Re-Pair is an efficient grammar compressor that operates by recursively replacing high-frequency character pairs with new grammar symbols. The most space-efficient linear-time algorithm computing Re-Pair uses $(1+ε)n+\sqrt n$ words on top of the re-writable text (of length $n$ and stored in $n$ words), for any constant $ε>0$; in practice however, this solution uses complex sub-procedures preventing it from being practical. In this paper, we present an implementation of the above-mentioned result making use of more practical solutions; our tool further improves the working space to $(1.5+ε)n$ words (text included), for some small constant $ε$. As a second contribution, we focus on compact representations of the output grammar. The lower bound for storing a grammar with $d$ rules is $\log(d!)+2d\approx d\log d+0.557 d$ bits, and the most efficient encoding algorithm in the literature uses at most $d\log d + 2d$ bits and runs in $\mathcal O(d^{1.5})$ time. We describe a linear-time heuristic maximizing the compressibility of the output Re-Pair grammar. On real datasets, our grammar encoding uses---on average---only $2.8\%$ more bits than the information-theoretic minimum. In half of the tested cases, our compressor improves the output size of 7-Zip with maximum compression rate turned on.

研究动机与目标

  • 设计一种实用的 Re-Pair 压缩算法,将工作空间减少至现有技术水平以下,同时不牺牲线性时间复杂度。
  • 通过利用 Re-Pair 替换过程中产生的结构特性,提升输出语法的可压缩性。
  • 实现一种接近信息论下限 d log d + 0.557d 比特的语法表示。
  • 在真实数据集中评估压缩率、工作空间与运行时间之间的权衡。
  • 证明在重复性高、结构化的数据上,语法压缩可优于通用压缩器如 7-Zip。

提出的方法

  • 该算法使用一种新颖且实用的整数聚类过程,以高效管理 Re-Pair 递归配对替换过程中的频率计数。
  • 通过维护一个动态结构来跟踪高频相邻配对,借助摊销成本控制实现线性时间处理。
  • 提出一种新的语法编码技术,利用替换时刻的唯一配对频率数量 M,将表示压缩至 d(log d + log M + 1) + M log(d/M) + o(d log d) 比特。
  • 通过利用 Re-Pair 过程中规则创建顺序与频率分布的特性,该编码可在 O(d) 时间内计算完成。
  • 实现采用空间优化的数据结构,将工作空间减少至 (1.5+ε)n 个字词,包含输入文本。
  • 该方法包含摊销结构重建机制,以在确保线性时间性能的同时维持空间边界。

实验结果

研究问题

  • RQ1能否使 Re-Pair 压缩既实用又空间高效,将工作空间减少至 (1.5+ε)n 个字词,同时保持线性时间复杂度?
  • RQ2能否通过利用替换过程中配对的频率分布,最大化 Re-Pair 语法输出的可压缩性?
  • RQ3在实际应用中,语法表示能多接近信息论下限 d log d + 0.557d 比特?
  • RQ4所提出的语法编码是否在重复性数据集上优于通用压缩器如 7-Zip?
  • RQ5唯一配对频率数量 M 与最终语法表示可压缩性之间存在何种关系?

主要发现

  • 所提出的 Re-Pair 实现仅使用 (1.5+ε)n 个字词的工作空间,将现有技术水平降低了两倍。
  • 语法编码平均仅比信息论最小值多出 2.8% 的比特数,且在不同数据集间方差极低。
  • 在一半测试数据集中,该压缩器在最大压缩模式下优于 7-Zip,尤其在重复性文件如 'english'、'boost' 和 'fib41' 上表现突出。
  • 替换时刻的唯一频率数量 M 通常比 d 小一到三个数量级,验证了新编码设计的合理性。
  • 解压缩速度具有竞争力——快于 bzip2,且与 NAV 和 7-Zip 相当——但在高度重复的文件上慢约一个数量级。
  • 压缩率在可压缩性较低的文件上最为有效,此时语法表示实现了更好的相对压缩效果。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。