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

树编辑距离:近线性时间近似、亚线性及动态算法

Tree Edit Distance: Near-Linear-Time Approximate, Sublinear, and Dynamic

University of California, San Diego(加州大学圣地亚哥分校);Max Planck Institute for Informatics(马克斯·普朗克信息学研究所);Massachusetts Institute of Technology(麻省理工学院)

Bingbing Hu, Tomasz Kociumaka, Jakob Nogler, Barna Saha

AI总结:

针对树编辑距离,该研究通过新的分层树分解框架,在近线性时间近似、亚线性算法及动态算法领域缩小了其与字符串编辑距离的多项式差距,取得了优于前人的算法结果并建立了跨领域算法思想的迁移框架。

摘要:

树编辑距离(TED)是字符串编辑距离(ED)在分层数据中的对应概念,指将一个带标签的有根有序树转换为另一个所需的最小节点插入、删除和替换操作次数。我们在近线性时间近似、亚线性算法及动态算法领域缩小了TED与ED之间的多项式差距。我们在$O(n)$时间内实现了$n^{o(1)}$近似,且对于每个$0<\delta<1$,在$O(n^{1+\delta})$时间内实现了$(\log n)^{O(1/\delta)}$近似。这改进了之前近线性时间内$O(\sqrt n)$近似的结果[Boroujeni等人,STOC'19],并在该领域将TED与ED的差距缩小到仅多对数因子的程度。通过对输入树的平衡括号(欧拉环游)表示进行查询访问,我们提出了首个亚线性时间的TED算法:对于每个$\tau\in[1,n]$,该算法在$O(n/\tau)$时间内计算$1+\mathrm{ted}$的$\tau n^{o(1)}$近似。对于动态TED,我们提出了一种精确算法,其摊销更新时间为$\tilde{O}(k^7)$,以及一种$(1+\varepsilon)$近似算法,其摊销更新时间为$\tilde{O}_{\varepsilon}(k)$,其中$k$是必须报告的距离上限。该精确算法是首个在非平凡参数范围内优于重新计算的算法。该近似结果改进了之前的动态保证[Das等人,FOCS'25],且在任何参数范围内,若不对静态ED的$(1+\varepsilon)$近似取得突破,该近似结果无法得到显著改进。所有结果均基于一种新的分层树分解进行动态规划,类似于将字符串划分为几何递减大小的块。该分解结合了此前仅单独实现的结构特性,提供了将算法思想从ED迁移到TED的框架,并包含了针对每种计算场景中障碍的额外组件。

英文摘要:

Tree edit distance (TED), the analog of string edit distance (ED) for hierarchical data, is the minimum number of node insertions, deletions, and substitutions transforming one labeled rooted ordered tree into another. We narrow polynomial gaps between TED and ED in near-linear-time approximation, sublinear algorithms, and dynamic algorithms. We give an $n^{o(1)}$-approximation in $O(n)$ time and, for every $0<δ<1$, a $(\log n)^{O(1/δ)}$-approximation in $O(n^{1+δ})$ time. This improves the previous near-linear-time $O(\sqrt n)$-approximation [Boroujeni et al., STOC'19] and brings TED to parity with ED in this regime up to polylogarithmic factors. With query access to the balanced-parentheses (Euler-tour) representation of the input trees, we give the first sublinear-time TED algorithm: for every $τ\in[1,n]$, it computes a $τn^{o(1)}$-approximation of $1+\mathrm{ted}$ in $O(n/τ)$ time. For dynamic TED, we give an exact algorithm with amortized update time $\tilde{O}(k^7)$ and a $(1+\varepsilon)$-approximation with amortized update time $\tilde{O}_{\varepsilon}(k)$, where $k$ caps the distance that must be reported. The exact algorithm is the first to beat recomputation in a nontrivial parameter regime. The approximation improves prior dynamic guarantees [Das et al., FOCS'25] and cannot be significantly improved in any parameter regime without a breakthrough for static $(1+\varepsilon)$-approximation of ED. All results use dynamic programming on a new hierarchical tree decomposition, analogous to partitioning strings into blocks of geometrically decreasing sizes. It combines structural properties previously achieved only in isolation, providing a framework for transferring algorithmic ideas from ED to TED, with additional ingredients addressing the obstacles in each computational setting.

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

↑