基于统一压缩的编辑距离加速计算
Unified Compression-Based Acceleration of Edit-Distance Computation
摘要:
编辑距离问题是计算机科学中的一个经典的基本问题,特别是在组合模式匹配中。这个问题的标准动态规划解决方案计算总长度为O(N)的一对字符串之间的编辑距离,时间复杂度为O(N^2)。到目前为止,这个二次上界对于一般的字符串从未有过实质性的改进。然而,在已知字符串在特定压缩方案下压缩良好的情况下,存在用于打破该界限的已知技术。基本思想是首先压缩字符串,然后计算压缩字符串之间的编辑距离。事实证明,几乎所有已知的o(N^2)编辑距离算法在某种意义上都是在上述相同的范式下工作的。因此,很自然地会问,是否有一个单一的编辑距离算法,适用于在任何压缩方案下压缩的字符串。这个问题的另一种说法是问一个单一的算法是否可以在任何压缩方法下利用字符串的可压缩性,即使每个字符串使用不同的压缩方法压缩。在本文中,我们开始回答这个问题,使用直线程序。这些提供了一个通用平台,用于表示许多流行的压缩方案,包括LZ系列、行程长度编码、字节对编码和字典方法。对于两个总长度为N的字符串,其程序表示的总长度为n,我们给出了一个在任意有理评分函数下计算这两个字符串的编辑距离的时间复杂度为O(nNlog(N/n))的算法,以及一个在任意评分函数下的时间复杂度为O(n^{2/3}N^{4/3})的算法.我们的新结果,虽然提供了一个显着的速度为高度可压缩字符串,不超过二次的时间界限,即使在最坏的情况下。
英文摘要:
The edit distance problem is a classical fundamental problem in computer science in general, and in combinatorial pattern matching in particular. The standard dynamic programming solution for this problem computes the edit-distance between a pair of strings of total length O(N) in O(N^2) time. To this date, this quadratic upper-bound has never been substantially improved for general strings. However, there are known techniques for breaking this bound in case the strings are known to compress well under a particular compression scheme. The basic idea is to first compress the strings, and then to compute the edit distance between the compressed strings. As it turns out, practically all known o(N^2) edit-distance algorithms work, in some sense, under the same paradigm described above. It is therefore natural to ask whether there is a single edit-distance algorithm that works for strings which are compressed under any compression scheme. A rephrasing of this question is to ask whether a single algorithm can exploit the compressibility properties of strings under any compression method, even if each string is compressed using a different compression. In this paper we set out to answer this question by using straight line programs. These provide a generic platform for representing many popular compression schemes including the LZ-family, Run-Length Encoding, Byte-Pair Encoding, and dictionary methods. For two strings of total length N having straight-line program representations of total size n, we present an algorithm running in O(nN log(N/n)) time for computing the edit-distance of these two strings under any rational scoring function, and an O(n^{2/3}N^{4/3}) time algorithm for arbitrary scoring functions. Our new result, while providing a signi cant speed up for highly compressible strings, does not surpass the quadratic time bound even in the worst case scenario.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。