arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2404.06401cs.DS
收藏

有界编辑距离:面向小整数权重的最优静态与动态算法

Bounded Edit Distance: Optimal Static and Dynamic Algorithms for Small Integer Weights

Egor Gorbachev, Tomasz Kociumaka

AI总结:

针对动态有界编辑距离问题,本文基于加权编辑距离工具,提出了时间复杂度为 $\tilde O(W^2k)$ 的动态更新算法和 $\tilde O(n+Wk^2)$ 的静态算法,解决了实现 $\tilde O(k)$ 更新时间的开放问题。

摘要:

两个字符串的编辑距离是将一个字符串转换为另一个字符串所需的最少插入、删除和替换次数。教科书算法在 $O(n^2)$ 时间内确定长度为 $n$ 的字符串的编辑距离,在正交向量假设下,这在次多项式因子范围内是最优的。在该问题的有界版本中,以编辑距离 $k$ 为参数,Landau 和 Vishkin [JCSS'88] 的算法实现了 $O(n+k^2)$ 的时间复杂度,作为 $n$ 和 $k$ 的函数这是最优的。\n 该问题的动态版本要求维护动态变化的两个字符串的编辑距离,每次更新被建模为一次编辑。一种民间方法支持 $\tilde O(k^2)$ 的更新时间,其中 $\tilde O(\cdot)$ 隐藏了对数多项式因子。最近,Charalampopoulos、Kociumaka 和 Mozes [CPM'20] 提出了一种更新时间为 $\tilde O(n)$ 的算法,在 OVH 下就 $n$ 而言是最优的。$\tilde O(\min\{n,k^2\})$ 的更新时间引出了一个引人关注的开放问题:$\tilde O(k)$ 是否可能;我们对之给出了肯定回答。\n 我们的解决方案依赖于源自加权编辑距离的工具,其中每次编辑的权重取决于编辑类型和涉及的字符。教科书算法支持权重,但 Landau-Vishkin 方法不支持,一个简单的 $O(nk)$ 时间过程长期以来一直是有界加权编辑距离的最快算法。直到最近,Das 等人 [STOC'23] 提供了 $O(n+k^5)$ 时间的算法,而 Cassis、Kociumaka 和 Wellnitz [FOCS'23] 提出了 $\tilde O(n+\sqrt{nk^3})$ 时间的解决方案以及匹配的条件下界。在本文中,我们证明,对于介于 $0$ 和 $W$ 之间的整数编辑权重,加权编辑距离可以在 $\tilde O(n+Wk^2)$ 时间内计算,并在每次更新中以 $\tilde O(W^2k)$ 的时间动态维护。我们的静态算法也可以在 $\tilde O(n+k^{2.5})$ 时间内实现。

英文摘要:

The edit distance of two strings is the minimum number of insertions, deletions, and substitutions needed to transform one string into the other. The textbook algorithm determines the edit distance of length-$n$ strings in $O(n^2)$ time, which is optimal up to subpolynomial factors under Orthogonal Vectors Hypothesis. In the bounded version of the problem, parameterized by the edit distance $k$, the algorithm of Landau and Vishkin [JCSS'88] achieves $O(n+k^2)$ time, which is optimal as a function of $n$ and $k$. The dynamic version of the problem asks to maintain the edit distance of two strings that change dynamically, with each update modeled as an edit. A folklore approach supports updates in $\tilde O(k^2)$ time, where $\tilde O(\cdot)$ hides polylogarithmic factors. Recently, Charalampopoulos, Kociumaka, and Mozes [CPM'20] showed an algorithm with update time $\tilde O(n)$, which is optimal under OVH in terms of $n$. The update time of $\tilde O(\min\{n,k^2\})$ raised an exciting open question of whether $\tilde O(k)$ is possible; we answer it affirmatively. Our solution relies on tools originating from weighted edit distance, where the weight of each edit depends on the edit type and the characters involved. The textbook algorithm supports weights, but the Landau-Vishkin approach does not, and a simple $O(nk)$-time procedure long remained the fastest for bounded weighted edit distance. Only recently, Das et al. [STOC'23] provided an $O(n+k^5)$-time algorithm, whereas Cassis, Kociumaka, and Wellnitz [FOCS'23] presented an $\tilde O(n+\sqrt{nk^3})$-time solution and a matching conditional lower bound. In this paper, we show that, for integer edit weights between $0$ and $W$, weighted edit distance can be computed in $\tilde O(n+Wk^2)$ time and maintained dynamically in $\tilde O(W^2k)$ time per update. Our static algorithm can also be implemented in $\tilde O(n+k^{2.5})$ time.

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

↑