A Faster and Unifying Algorithm for Comparing Trees

  • Ming -Yang Kao
  • Tak -Wah Lam
  • Wing -Kin Sung
  • Hing -Fung Ting
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1848)


A widely-used method for determining the similarity of two labeled trees is to compute a maximum agreement subtree of the two trees. Previous work on this similarity measure only concerns with the comparison of labeled trees of two special kinds, namely, uniformly labeled trees (i.e., trees with all their nodes labeled by the same symbol) and evolutionary trees (i.e., leaf-labeled trees with distinct symbols for distinct leaves). This paper presents an algorithm for comparing trees that are labeled in an arbitrary manner. In addition to the generalization, our algorithm is faster than the previous algorithms in many cases.


Bipartite Graph Node Pair Label Tree Matching Computation Unify Algorithm 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    M. J. Chung. O(n 2.5) time algorithms for the subgraph homeomorphism problem on trees. Journal of Algorithms, 8:106–112, 1987.zbMATHCrossRefMathSciNetGoogle Scholar
  2. 2.
    R. Cole and R. Hariharan. An O(n log n) algorithm for the maximum agreement subtree problem for binary trees. In Proceedings of the 7th Annual ACM-SIAM Symposium on Discrete Algorithms, pages 323–332, 1996.Google Scholar
  3. 3.
    T. H. Cormen, C. L. Leiserson, and R. L. Rivest. Introduction to Algorithms. MIT Press, Cambridge, MA, 1991.Google Scholar
  4. 4.
    M. Farach, T. M. Przytycka, and M. Thorup. Computing the agreement of trees with bounded degrees. In P. Spirakis, editor, Lecture Notes in Computer Science 979: Proceedings of the 3rd Annual European Symposium on Algorithms, pages 381–393. Springer-Verlag, New York, NY, 1995.Google Scholar
  5. 5.
    M. Farach and M. Thorup. Sparse dynamic programming for evolutionary-tree comparison. SIAM Journal on Computing, 26:210–230, 1997.zbMATHCrossRefMathSciNetGoogle Scholar
  6. 6.
    C. R. Finden and A. D. Gordon. Obtaining common pruned trees. Journal of Classification, 2:255–276, 1985.CrossRefGoogle Scholar
  7. 7.
    J. Friedman. Expressing logical formulas in natural languages. In J. Groenendijk, T. Janssen, and M. Stokhof, editors, Formal methods in the study of language, pages 113–130. Mathmatical Centre, Amsterdam, 1981.Google Scholar
  8. 8.
    H. N. Gabow and R. E. Tarjan. Faster scaling algorithms for network problems. SIAM Journal on Computing, 18:1013–1036, 1989.zbMATHCrossRefMathSciNetGoogle Scholar
  9. 9.
    A. Gupta and N. Nishimura. Finding largest subtrees and smallest supertrees. Algorithmica, 21(2): 183–210, 1998.zbMATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    D. M. Hillis, C. Moritz, and B. K. Mable, editors. Molecular Systematics. Sinauer Associates, Sunderland, Ma, 2nd edition, 1996.Google Scholar
  11. 11.
    M. Y. Kao. Tree contractions and evolutionary trees. SIAM Journal on Computing, 27:1592–1616, 1998.zbMATHCrossRefMathSciNetGoogle Scholar
  12. 12.
    M. Y. Kao, T. W. Lam, W. K. Sung, and H. F. Ting. All-cavity maximum matchings. In Lecture Notes in Computer Science 1350: Proceedings of the 8th Annual International Symposium on Algorithms and Computation, pages 364–373, 1997.Google Scholar
  13. 13.
    M. Y. Kao, T. W. Lam, W. K. Sung, and H. F. Ting. A decomposition theorem for maximum weight bipartite matchings with applications to evolutionary trees. In Lecture Notes in Computer Science: Proceedings of the 8th Annual European Symposium on Algorithms, pages 438–449. Springer-Verlag, New York, NY, 1999.Google Scholar
  14. 14.
    P. Kilpeläinen and H. Mannila. Retrieval from hierarchical texts by partial patterns. In Proceedings of the 16th Annual International ACM-SIGIR Conference on Research and Development in Information Retrieval, pages 214–222, 1991.Google Scholar
  15. 15.
    P. Kilpeläinen and H. Mannila. Grammatical tree matching. In A. Apostolico, M. Crochemore, Z. Galil, and U. Manber, editors, Lecture Notes in Computer Science 644: Proceedings of the 3rd Annual Symposium on Combinatorial Pattern Matching, pages 162–174. Springer-Verlag, New York, NY, 1992.Google Scholar
  16. 16.
    B. Kimia, A. Tannenbaum, and S. W. Zucker. Shapes, shocks, and deformations, I. International Journal of Computer Vision, pages 189–224, 1995.Google Scholar
  17. 17.
    E. Kubicka, G. Kubicki, and F. McMorris. An algorithm to find agreement subtrees. Journal of Classification, 12:91–99, 1995.zbMATHCrossRefGoogle Scholar
  18. 18.
    S. Y. Le, J. Owens, R. Nussinov, J. H. Chen, B. Shapiro, and J. V. Maizel. RNA secondary structures: comparison and determination of frequently recurring substructures by consensus. Computer Application in Bioscience, 5:205–210, 1989.Google Scholar
  19. 19.
    H. Mannila and K. J. Räihä. On query languages for the p-string data model. In H. Kangassalo, S. Ohsuga, and H. Jaakkola, editors, Information Modelling and Knowledge Bases, pages 469–482. IOS Press, Amsterdam, 1990.Google Scholar
  20. 20.
    P. Materna, P. Sgall, and Z. Hajicova. Linguistic constructions in transparent intensional logic. Prague Bulletin on Mathematical Linguistics, pages 27–32, 1985.Google Scholar
  21. 21.
    T. Przytycka. Sparse dynamic programming for maximum agreement subtree problem. In B. Mirkin, F. R. McMorris, F. S. Roberts, and A. Rzhetsky, editors, Mathematical Hierarchies and Biology, DIMACS Series in Discrete Mathematics and Theoretical Computer Science, pages 249–264, Providence, RI, 1997. American Mathematical Society.Google Scholar
  22. 22.
    B. Shapiro and K. Zhang. Comparing multiple RNA secondary structures using tree comparisons. Compter Applications in Bioscience, pages 309–318, 1990.Google Scholar
  23. 23.
    F. Y. Shih. Object representation and recognition using mathematical morphology model. Journal of Systems Integration, pages 235–256, 1991.Google Scholar
  24. 24.
    F. Y. Shih and O. R. Mitchell. Threshold decomposition of grayscale morphology into binary morphology. IEEE Transactions on Pattern Analysis and Machine Intelligence, 11:31–42, 1989.zbMATHCrossRefGoogle Scholar
  25. 25.
    M. Steel and T. Warnow. Kaikoura tree theorems: Computing the maximum agreement subtree. Information Processing Letters, 48:77–82, 1993.zbMATHCrossRefMathSciNetGoogle Scholar
  26. 26.
    Y. Takahashi, Y. Satoh, H. Suzuki, and S. Sasaki. Recognition of largest common structural fragment among a variety of chemical structures. Analytical Science, pages 23–28, 1987.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2000

Authors and Affiliations

  • Ming -Yang Kao
    • 1
  • Tak -Wah Lam
    • 2
  • Wing -Kin Sung
    • 3
  • Hing -Fung Ting
    • 2
  1. 1.Department of Computer ScienceYale UniversityNew HavenUSA
  2. 2.Department of Computer Science and Information SystemsUniversity of Hong KongHong Kong
  3. 3.E-Business Technology InstituteUniversity of Hong KongHong Kong

Personalised recommendations