Affiliation:
1. Massachusetts Institute of Technology, Cambridge, MA
2. Brown University, Providence, RI
Abstract
The
edit distance
between two ordered rooted trees with vertex labels is the minimum cost of transforming one tree into the other by a sequence of elementary operations consisting of deleting and relabeling existing nodes, as well as inserting new nodes. In this article, we present a worst-case
O
(
n
3
)-time algorithm for the problem when the two trees have size
n
, improving the previous best
O
(
n
3
log
n
)-time algorithm. Our result requires a novel adaptive strategy for deciding how a dynamic program divides into subproblems, together with a deeper understanding of the previous algorithms for the problem. We prove the optimality of our algorithm among the family of
decomposition strategy
algorithms—which also includes the previous fastest algorithms—by tightening the known lower bound of Ω(
n
2
log
2
n
) to Ω(
n
3
), matching our algorithm's running time. Furthermore, we obtain matching upper and lower bounds for decomposition strategy algorithms of Θ(
nm
2
(1 + log
n
/
m
)) when the two trees have sizes
m
and
n
and
m
<
n
.
Publisher
Association for Computing Machinery (ACM)
Subject
Mathematics (miscellaneous)
Cited by
101 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. X-TED: Massive Parallelization of Tree Edit Distance;Proceedings of the VLDB Endowment;2024-03
2. Subtree Similarity Search Based on Structure and Text;Lecture Notes in Computer Science;2024
3. A multi-threaded virtual DOM difference method based on web worker;Sixth International Conference on Computer Information Science and Application Technology (CISAT 2023);2023-10-11
4. iASTMapper: An Iterative Similarity-Based Abstract Syntax Tree Mapping Algorithm;2023 38th IEEE/ACM International Conference on Automated Software Engineering (ASE);2023-09-11
5. Capturing the characteristics of mis/disinformation propagation over the Internet;Disruptive Technologies in Information Sciences VII;2023-06-15