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 paper, we present a worst-case O(n 3)-time algorithm for this problem, improving the previous best O(n 3logn)-time algorithm [7]. 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 2log2 n) [4] to Ω(n 3), matching our algorithm’s running time. Furthermore, we obtain matching upper and lower bounds of \(\Theta(n m^2 (1 + \log \frac{n}{m}))\) when the two trees have sizes m and n where m < n.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Apostolico, A., Galil, Z. (eds.): Pattern matching algorithms. Oxford University Press, Oxford, UK (1997)
Bille, P.: A survey on tree edit distance and related problems. Theoretical computer science 337, 217–239 (2005)
Chawathe, S.S.: Comparing hierarchical data in external memory. In: Proceedings of the 25th International Conference on Very Large Data Bases, pp. 90–101. Edinburgh, Scotland, U.K (1999)
Dulucq, S., Touzet, H.: Analysis of tree edit distance algorithms. In: Baeza-Yates, R.A., Chávez, E., Crochemore, M. (eds.) CPM 2003. LNCS, vol. 2676, pp. 83–95. Springer, Heidelberg (2003)
Gusfield, D.: Algorithms on strings, trees and sequences: computer science and computational biology. Cambridge University Press, Cambridge (1997)
Harel, D., Tarjan, R.E.: Fast algorithms for finding nearest common ancestors. SIAM Journal of Computing 13(2), 338–355 (1984)
Klein, P.N.: Computing the edit-distance between unrooted ordered trees. In: Bilardi, G., Pietracaprina, A., Italiano, G.F., Pucci, G. (eds.) ESA 1998. LNCS, vol. 1461, pp. 91–102. Springer, Heidelberg (1998)
Klein, P.N., Tirthapura, S., Sharvit, D., Kimia, B.B.: A tree-edit-distance algorithm for comparing simple, closed shapes. In: SODA. Proceedings of the 11th ACM-SIAM Symposium on Discrete Algorithms, pp. 696–704. ACM Press, New York (2000)
Moore, P.B.: Structural motifs in RNA. Annual review of biochemistry 68, 287–300 (1999)
Selkow, S.M.: The tree-to-tree editing problem. Information Processing Letters 6(6), 184–186 (1977)
Shasha, D., Zhang, K.: Simple fast algorithms for the editing distance between trees and related problems. SIAM Journal of Computing 18(6), 1245–1262 (1989)
Shasha, D., Zhang, K.: Fast algorithms for the unit cost editing distance between trees. Journal of Algorithms 11(4), 581–621 (1990)
Tai, K.: The tree-to-tree correction problem. Journal of the Association for Computing Machinery (JACM) 26(3), 422–433 (1979)
Valiente, G.: Algorithms on Trees and Graphs. Springer, Heidelberg (2002)
Wagner, R.A., Fischer, M.J.: The string-to-string correction problem. Journal of the ACM 21(1), 168–173 (1974)
Waterman, M.S.: Introduction to computational biology: maps, sequences and genomes. chapters 13,14 Chapman and Hall (1995)
Zhang, K.: Algorithms for the constrained editing distance between ordered labeled trees and related problems. Pattern Recognition 28(3), 463–474 (1995)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2007 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Demaine, E.D., Mozes, S., Rossman, B., Weimann, O. (2007). An Optimal Decomposition Algorithm for Tree Edit Distance. In: Arge, L., Cachin, C., Jurdziński, T., Tarlecki, A. (eds) Automata, Languages and Programming. ICALP 2007. Lecture Notes in Computer Science, vol 4596. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-73420-8_15
Download citation
DOI: https://doi.org/10.1007/978-3-540-73420-8_15
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-73419-2
Online ISBN: 978-3-540-73420-8
eBook Packages: Computer ScienceComputer Science (R0)