arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2306.17461cs.DScs.DC
收藏

高效并行输出敏感编辑距离

Efficient Parallel Output-Sensitive Edit Distance

Xiangyun Ding, Xiaojun Dong, Yan Gu, Youzhe Liu, Yihan Sun

AI总结:

本文提出并实现了四种输出敏感的并行编辑距离算法(三种基于BFS,一种基于分治),在合成与真实数据上优于现有实现,是首个系统性研究并行编辑距离理论与实践的工作。

摘要:

给定两个字符串 $A[1..n]$ 和 $B[1..m]$,以及一组允许编辑字符串的操作,$A$ 与 $B$ 之间的编辑距离是将 $A$ 转换为 $B$ 所需的最小操作数。顺序地,标准动态规划(DP)算法以 $Θ(nm)$ 代价求解编辑距离。在许多实际应用中,待比较的字符串相似且编辑距离较小。为了实现高度实用的实现,我们专注于输出敏感的并行编辑距离算法,即当编辑距离较小时,实现渐近优于标准 $Θ(nm)$ 算法的代价界。本文研究了四种算法,包括三种基于广度优先搜索(BFS)的算法和一种基于分治(DaC)的算法。我们的基于BFS的解决方案基于Landau-Vishkin算法。我们实现了三种不同的数据结构用于算法中所需的最长公共前缀(LCP)查询:使用并行后缀数组的经典解决方案,以及本文提出的两种基于哈希的解决方案。我们的基于DaC的解决方案受到Apostolico等人提出的输出不敏感解决方案的启发,我们提出了一种非平凡的改编使其输出敏感。我们所有的算法都有良好的理论保证,并且它们在工作量(操作总数)、跨度(计算中最长依赖链)和空间之间实现了不同的权衡。我们在合成数据和真实数据上测试并比较了我们的算法。我们的基于BFS的算法在所有测试案例中均优于ParlayLib中现有的并行编辑距离实现。通过比较我们的算法,我们还为不同输入模式下的算法选择提供了更好的理解。我们相信我们的论文是并行编辑距离理论与实践中的第一个系统性研究。

英文摘要:

Given two strings $A[1..n]$ and $B[1..m]$, and a set of operations allowed to edit the strings, the edit distance between $A$ and $B$ is the minimum number of operations required to transform $A$ into $B$. Sequentially, a standard Dynamic Programming (DP) algorithm solves edit distance with $Θ(nm)$ cost. In many real-world applications, the strings to be compared are similar and have small edit distances. To achieve highly practical implementations, we focus on output-sensitive parallel edit-distance algorithms, i.e., to achieve asymptotically better cost bounds than the standard $Θ(nm)$ algorithm when the edit distance is small. We study four algorithms in the paper, including three algorithms based on Breadth-First Search (BFS) and one algorithm based on Divide-and-Conquer (DaC). Our BFS-based solution is based on the Landau-Vishkin algorithm. We implement three different data structures for the longest common prefix (LCP) queries needed in the algorithm: the classic solution using parallel suffix array, and two hash-based solutions proposed in this paper. Our DaC-based solution is inspired by the output-insensitive solution proposed by Apostolico et al., and we propose a non-trivial adaption to make it output-sensitive. All our algorithms have good theoretical guarantees, and they achieve different tradeoffs between work (total number of operations), span (longest dependence chain in the computation), and space. We test and compare our algorithms on both synthetic data and real-world data. Our BFS-based algorithms outperform the existing parallel edit-distance implementation in ParlayLib in all test cases. By comparing our algorithms, we also provide a better understanding of the choice of algorithms for different input patterns. We believe that our paper is the first systematic study in the theory and practice of parallel edit distance.

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

↑