An Optimal Decomposition Algorithm for Tree Edit Distance

被引:96
作者
Demaine, Erik D. [1 ]
Mozes, Shay [2 ]
Rossman, Benjamin
Weimann, Oren
机构
[1] MIT, Comp Sci & Artificial Intelligence Lab, Cambridge, MA 02139 USA
[2] Brown Univ, Providence, RI 02912 USA
关键词
Decomposition strategy; dynamic programming; edit distance; ordered trees; tree edit distance;
D O I
10.1145/1644015.1644017
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
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 Omega(n(2) log(2) n) to Omega(n(3)), matching our algorithm's running time. Furthermore, we obtain matching upper and lower bounds for decomposition strategy algorithms of Theta(nm(2)(1+ log n/m) when the two trees have sizes m and n and m < n.
引用
收藏
页数:19
相关论文
共 20 条
[1]  
[Anonymous], 2002, ALGORITHMS TREES GRA
[2]  
[Anonymous], 1997, ACM SIGACT NEWS
[3]  
Apostolico A, 1997, PATTERN MATCHING ALG
[4]   A survey on tree edit distance and related problems [J].
Bille, P .
THEORETICAL COMPUTER SCIENCE, 2005, 337 (1-3) :217-239
[5]  
Chawathe SS, 1999, PROCEEDINGS OF THE TWENTY-FIFTH INTERNATIONAL CONFERENCE ON VERY LARGE DATA BASES, P90
[6]   New algorithm for ordered tree-to-tree correction problem [J].
Chen, WM .
JOURNAL OF ALGORITHMS-COGNITION INFORMATICS AND LOGIC, 2001, 40 (02) :135-158
[7]  
Demaine ED, 2007, LECT NOTES COMPUT SC, V4596, P146
[8]  
Dulucq S, 2003, LECT NOTES COMPUT SC, V2676, P83
[9]   FAST ALGORITHMS FOR FINDING NEAREST COMMON ANCESTORS [J].
HAREL, D ;
TARJAN, RE .
SIAM JOURNAL ON COMPUTING, 1984, 13 (02) :338-355
[10]  
Klein P, 2000, PROCEEDINGS OF THE ELEVENTH ANNUAL ACM-SIAM SYMPOSIUM ON DISCRETE ALGORITHMS, P696