Skip to main content

An Optimal Decomposition Algorithm for Tree Edit Distance

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 4596))

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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Apostolico, A., Galil, Z. (eds.): Pattern matching algorithms. Oxford University Press, Oxford, UK (1997)

    MATH  Google Scholar 

  2. Bille, P.: A survey on tree edit distance and related problems. Theoretical computer science 337, 217–239 (2005)

    Article  MATH  MathSciNet  Google Scholar 

  3. 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)

    Google Scholar 

  4. 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)

    Chapter  Google Scholar 

  5. Gusfield, D.: Algorithms on strings, trees and sequences: computer science and computational biology. Cambridge University Press, Cambridge (1997)

    MATH  Google Scholar 

  6. Harel, D., Tarjan, R.E.: Fast algorithms for finding nearest common ancestors. SIAM Journal of Computing 13(2), 338–355 (1984)

    Article  MATH  MathSciNet  Google Scholar 

  7. 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)

    Chapter  Google Scholar 

  8. 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)

    Google Scholar 

  9. Moore, P.B.: Structural motifs in RNA. Annual review of biochemistry 68, 287–300 (1999)

    Article  Google Scholar 

  10. Selkow, S.M.: The tree-to-tree editing problem. Information Processing Letters 6(6), 184–186 (1977)

    Article  MATH  MathSciNet  Google Scholar 

  11. 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)

    Article  MATH  MathSciNet  Google Scholar 

  12. Shasha, D., Zhang, K.: Fast algorithms for the unit cost editing distance between trees. Journal of Algorithms 11(4), 581–621 (1990)

    Article  MATH  MathSciNet  Google Scholar 

  13. Tai, K.: The tree-to-tree correction problem. Journal of the Association for Computing Machinery (JACM) 26(3), 422–433 (1979)

    MATH  MathSciNet  Google Scholar 

  14. Valiente, G.: Algorithms on Trees and Graphs. Springer, Heidelberg (2002)

    MATH  Google Scholar 

  15. Wagner, R.A., Fischer, M.J.: The string-to-string correction problem. Journal of the ACM 21(1), 168–173 (1974)

    Article  MATH  MathSciNet  Google Scholar 

  16. Waterman, M.S.: Introduction to computational biology: maps, sequences and genomes. chapters 13,14 Chapman and Hall (1995)

    Google Scholar 

  17. Zhang, K.: Algorithms for the constrained editing distance between ordered labeled trees and related problems. Pattern Recognition 28(3), 463–474 (1995)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Lars Arge Christian Cachin Tomasz Jurdziński Andrzej Tarlecki

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics