Skip to main content
QUICK REVIEW

[论文解读] Compression by Contracting Straight-Line Programs

Moses Ganardi|arXiv (Cornell University)|Jan 1, 2021
Algorithms and Data CompressionComputer Science参考文献 16被引用 1
一句话总结

本文引入了压缩直线程序(contracting straight-line programs, SLPs),这是一种新型的平衡SLP,其中规则右部每个变量的字符串长度相比其父节点严格按常数因子缩小。作者提出了一种线性时间算法,可将任意SLP转换为大小为O(g)的等价压缩SLP,从而在压缩字符串中实现高效的导航与前向查找,时间复杂度为O(log d + log^(t) N),优于以往的O(log d + log log N)界。

ABSTRACT

In grammar-based compression a string is represented by a context-free grammar, also called a straight-line program (SLP), that generates only that string. We refine a recent balancing result stating that one can transform an SLP of size g in linear time into an equivalent SLP of size 𝒪(g) so that the height of the unique derivation tree is 𝒪(log N) where N is the length of the represented string (FOCS 2019). We introduce a new class of balanced SLPs, called contracting SLPs, where for every rule A → β₁ … β_k the string length of every variable β_i on the right-hand side is smaller by a constant factor than the string length of A. In particular, the derivation tree of a contracting SLP has the property that every subtree has logarithmic height in its leaf size. We show that a given SLP of size g can be transformed in linear time into an equivalent contracting SLP of size 𝒪(g) with rules of constant length. This result is complemented by a lower bound, proving that converting SLPs into so called α-balanced SLPs or AVL-grammars can incur an increase by a factor of Ω(log N). We present an application to the navigation problem in compressed unranked trees, represented by forest straight-line programs (FSLPs). A linear space data structure by Reh and Sieber (2020) supports navigation steps such as going to the parent, left/right sibling, or to the first/last child in constant time. We extend their solution by the operation of moving to the i-th child in time 𝒪(log d) where d is the degree of the current node. Contracting SLPs are also applied to the finger search problem over SLP-compressed strings where one wants to access positions near to a pre-specified finger position, ideally in 𝒪(log d) time where d is the distance between the accessed position and the finger. We give a linear space solution for the dynamic variant where one can set the finger in 𝒪(log N) time, and then access symbols or move the finger in time 𝒪(log d + log^(t) N) for any constant t where log^(t) N is the t-fold logarithm of N. This improves a previous solution by Bille, Christiansen, Cording, and Gørtz (2018) with access/move time 𝒪(log d + log log N).

研究动机与目标

  • 为解决现有平衡SLP(如α-平衡SLP和AVL-语法)在转换过程中产生Ω(log N)大小膨胀的局限性。
  • 设计一种新型平衡机制——压缩SLPs,确保子树叶节点大小的对数高度,从而支持在压缩字符串中高效导航。
  • 提供一种线性空间数据结构,支持在语法压缩字符串中高效进行前向查找与导航,优于以往的访问与移动时间复杂度。
  • 证明一个下界,表明将SLP转换为α-平衡SLP或AVL-语法时,必然产生Ω(log N)的大小增加,凸显压缩SLPs的优势。
  • 将现有压缩数据结构扩展,以支持在无序树中高效访问第i个子节点,并支持具有改进时间复杂度的动态前向查找。

提出的方法

  • 定义压缩SLPs,使得对于每个规则A → β₁…βₖ,每个βᵢ的字符串长度至多为|A|的常数倍,从而确保子树叶节点大小的对数高度。
  • 设计一种从任意大小为g的SLP到等价压缩SLP的线性时间转换算法,大小为O(g),并控制推导树的深度,保持其结构不变。
  • 使用带前缀和的加速路径,分别对左权重和右权重进行预处理,以支持推导树中的快速导航,同时维护动态前驱数据结构以高效查询路径。
  • 在左、右边的森林上应用加权祖先数据结构,以支持推导树中的长步长导航,通过短步长与长步长的结合实现效率优化。
  • 利用压缩SLPs的路径平衡结构,将任意路径中的短步长数量限制在O(log d)以内,从而实现O(log d + log^(t) N)的前向查找时间。
  • 证明对于(α, β)-路径平衡SLPs,可通过在边的森林上使用加权祖先查询,在O(log d)时间内完成边缘访问,从而实现高效导航。

实验结果

研究问题

  • RQ1能否设计一种更高效的SLP平衡机制,避免α-平衡SLP和AVL-语法在转换过程中出现的Ω(log N)大小膨胀?
  • RQ2能否从任意SLP在线性时间内构造出等价的压缩SLP,同时保持等价性并实现O(g)的大小?
  • RQ3能否通过新型SLP结构,将压缩字符串中的导航与前向查找操作加速至优于O(log d + log log N)的时间复杂度?
  • RQ4是否存在一个下界证明,表明α-平衡SLP或AVL-语法在转换过程中必然产生Ω(log N)的大小增加?
  • RQ5所提出的结构能否支持在压缩无序树中高效访问第i个子节点,从而扩展此前关于森林SLP的工作?

主要发现

  • 提出一种线性时间算法,可将任意大小为g的SLP转换为等价的压缩SLP,其大小为O(g),且规则长度为常数。
  • 压缩SLPs确保每个子树的高度与其叶节点数量的对数成正比,从而支持高效导航与前向查找。
  • 本文证明了一个下界,表明将SLP转换为α-平衡SLP或AVL-语法时,大小必然增加Ω(log N),凸显了压缩SLPs的效率优势。
  • 实现了动态前向查找数据结构,访问与移动操作的时间复杂度为O(log d + log^(t) N),优于以往的O(log d + log log N)界。
  • 该方法支持在压缩无序树中以O(log d)时间访问第i个子节点,扩展了Reh与Sieber(2020)的导航数据结构。
  • 对于(α, β)-路径平衡SLPs,可通过加权祖先查询在O(log d)时间内完成边缘访问,展示了新平衡模型的强大能力。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。