arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.02701cs.DS
收藏

低距离区间下有界树编辑距离的更快算法

Faster Algorithm for Bounded Tree Edit Distance in the Low-Distance Regime

Tomasz Kociumaka, Ali Shahali

AI总结:

本文研究低距离区间下有界树编辑距离的加速计算问题,提出一种在加权和无权设置下均达到 O(n + k^6 log k) 时间的算法,通过利用输入树中的周期性结构并改进通用核,显著优于此前最佳运行时间。

摘要:

树编辑距离是根有序树之间的一种自然差异度量,其中节点在字母表 $Σ$ 上带有标签。它被定义为将一棵树转换为另一棵树所需的最少节点编辑次数(插入、删除和重新标记)。在加权变体中,编辑操作具有相关代价(取决于所涉及的节点标签),并经过归一化使得每个代价至少为 1,目标是使编辑总代价最小。\n两棵总大小为 $n$ 的树之间的无权树编辑距离可以在 $O(n^{2.6857})$ 时间内计算;相比之下,确定加权树编辑距离在细粒度上与全对最短路径问题等价,并且需要 $n^3/2^{Ω(\sqrt{\log n})}$ 时间 [Nogler et al.; STOC'25]。这些超二次运行时间对于大型但非常相似的树来说并不理想,这促使人们研究该问题的有界版本,其中运行时间以计算出的距离 $k$ 为参数,从而可能在 $k\ll n$ 时产生更快的算法。\n此前针对有界无权设置的最佳算法运行时间为 $O(nk^2\log n)$ [Akmal & Jin; ICALP'21] 和 $O(n + k^7\log k)$ [Das et al.; STOC'23]。对于加权变体,唯一已知的运行时间为 $O(n + k^{15})$。\n我们提出了一种 $O(n + k^6\log k)$ 时间算法,用于在加权和无权两种设置下计算有界树编辑距离。我们的方法首先给出一个替代的 $O(nk^2\log n)$ 时间算法,该算法能够处理权重,并且比现有对应算法显著更易于分析。随后我们引入一种新颖的优化方法,利用输入树中的周期性结构。为了利用该结构,我们修改了大小为 $O(k^5)$、时间为 $O(n)$ 的通用核(universal kernel)——这是先前 $O(n + k^{O(1)})$ 时间算法的核心组件——使其生成包含这些周期性结构的实例。

英文摘要:

The tree edit distance is a natural dissimilarity measure between rooted ordered trees whose nodes are labeled over an alphabet $Σ$. It is defined as the minimum number of node edits (insertions, deletions, and relabelings) required to transform one tree into the other. In the weighted variant, the edits have associated costs (depending on the involved node labels) normalized so that each cost is at least one, and the goal is to minimize the total cost of edits. The unweighted tree edit distance between two trees of total size $n$ can be computed in $O(n^{2.6857})$ time; in contrast, determining the weighted tree edit distance is fine-grained equivalent to the All-Pairs Shortest Paths problem and requires $n^3/2^{Ω(\sqrt{\log n})}$ time [Nogler et al.; STOC'25]. These super-quadratic running times are unattractive for large but very similar trees, which motivates the bounded version of the problem, where the runtime is parameterized by the computed distance $k$, potentially yielding faster algorithms for $k\ll n$. Previous best algorithms for the bounded unweighted setting run in $O(nk^2\log n)$ time [Akmal & Jin; ICALP'21] and $O(n + k^7\log k)$ time [Das et al.; STOC'23]. For the weighted variant, the only known running time has been $O(n + k^{15})$. We present an $O(n + k^6\log k)$-time algorithm for computing the bounded tree edit distance in both the weighted and unweighted settings. Our approach begins with an alternative $O(nk^2\log n)$-time algorithm that handles weights and is significantly easier to analyze than the existing counterpart. We then introduce a novel optimization that leverages periodic structures within the input trees. To utilize it, we modify the $O(k^5)$-size $O(n)$-time universal kernel, the central component of the prior $O(n + k^{O(1)})$-time algorithms, so that it produces instances containing these periodic structures.

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

↑