有界加权编辑距离的最优算法
Optimal Algorithms for Bounded Weighted Edit Distance
AI总结:
本文针对有界加权编辑距离问题提出了改进的 $\tilde O(n+\sqrt{nk^3})$ 时间算法,并基于 APSP 假设给出了匹配的下界,首次证明了加权与无权编辑距离问题的复杂度分离。
摘要:
两个字符串的编辑距离是指将一个字符串转换为另一个所需的最少字符插入、删除和替换次数。教科书式的动态规划算法可在 $O(n^2)$ 时间内计算出两个长度为 $n$ 的字符串的编辑距离,在 SETH 假设下,该复杂度在不考虑次多项式因子的情况下是最优的。规避此计算硬度的一种成熟方法是考虑有界设置,其运行时间由编辑距离 $k$ 参数化。Landau 和 Vishkin (JCSS '88) 提出的著名算法实现了 $O(n + k^2)$ 的时间复杂度,作为 $n$ 和 $k$ 的函数是最优的。大多数实际应用依赖于更一般的加权编辑距离,其中每次编辑的权重取决于其类型和字母表 $Σ$ 中涉及的字符。这通过权重函数 $w : Σ\cup\{\varepsilon\}\timesΣ\cup\{\varepsilon\}\to\mathbb{R}$ 形式化,并归一化使得对于所有 $a,b \in Σ\cup\{\varepsilon\}$ 且 $a \neq b$,有 $w(a,a)=0$ 和 $w(a,b)\geq 1$;目标是找到两个字符串的对齐方式以最小化编辑的总权重。$O(n^2)$ 时间算法无缝支持此设置,但直到最近,Das, Gilbert, Hajiaghayi, Kociumaka, 和 Saha (STOC '23) 才给出了有界版本的第一个非平凡算法,实现了 $O(n + k^5)$ 的时间复杂度。虽然此运行时间在 $k\le n^{1/5}$ 时是线性的,但仍远未达到无界设置中可实现的 $O(n+k^2)$ 界限。本文通过展示改进的 $\tilde O(n+\sqrt{nk^3})$ 时间算法以及更令人惊讶的匹配下界,本质上填补了这一空白:在 All-Pairs Shortest Paths (APSP) 假设下,对于 $\sqrt{n}\le k\le n$,我们的运行时间是最优的(不考虑次多项式因子)。这是加权与无权编辑距离问题复杂度之间的首次分离。
英文摘要:
The edit distance of two strings is the minimum number of insertions, deletions, and substitutions of characters needed to transform one string into the other. The textbook dynamic-programming algorithm computes the edit distance of two length-$n$ strings in $O(n^2)$ time, which is optimal up to subpolynomial factors under SETH. An established way of circumventing this hardness is to consider the bounded setting, where the running time is parameterized by the edit distance $k$. A celebrated algorithm by Landau and Vishkin (JCSS '88) achieves time $O(n + k^2)$, which is optimal as a function of $n$ and $k$. Most practical applications rely on a more general weighted edit distance, where each edit has a weight depending on its type and the involved characters from the alphabet $Σ$. This is formalized through a weight function $w : Σ\cup\{\varepsilon\}\timesΣ\cup\{\varepsilon\}\to\mathbb{R}$ normalized so that $w(a,a)=0$ and $w(a,b)\geq 1$ for all $a,b \in Σ\cup\{\varepsilon\}$ with $a \neq b$; the goal is to find an alignment of the two strings minimizing the total weight of edits. The $O(n^2)$-time algorithm supports this setting seamlessly, but only very recently, Das, Gilbert, Hajiaghayi, Kociumaka, and Saha (STOC '23) gave the first non-trivial algorithm for the bounded version, achieving time $O(n + k^5)$. While this running time is linear for $k\le n^{1/5}$, it is still very far from the bound $O(n+k^2)$ achievable in the unweighted setting. In this paper, we essentially close this gap by showing both an improved $\tilde O(n+\sqrt{nk^3})$-time algorithm and, more surprisingly, a matching lower bound: Conditioned on the All-Pairs Shortest Paths (APSP) hypothesis, our running time is optimal for $\sqrt{n}\le k\le n$ (up to subpolynomial factors). This is the first separation between the complexity of the weighted and unweighted edit distance problems.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。