Springer Nature is making SARS-CoV-2 and COVID-19 research free. View research | View latest news | Sign up for updates

From Constrained to Unconstrained Maximum Agreement Subtree in Linear Time

  • 68 Accesses

  • 3 Citations


We propose and study the Maximum Constrained Agreement Subtree (MCAST) problem, which is a variant of the classical Maximum Agreement Subtree (MAST) problem. Our problem allows users to apply their domain knowledge to control the construction of the agreement subtrees in order to get better results. We show that the MCAST problem can be reduced to the MAST problem in linear time and thus we have algorithms for MCAST with running times matching the fastest known algorithms for MAST.

This is a preview of subscription content, log in to check access.


  1. 1.

    Amenta, K., Clarke, F.: A linear-time majority tree algorithm. In: Proceedings of the 3rd International Workshop on Algorithms in Bioinformatics, pp. 216–227 (2003)

  2. 2.

    Berger-Wolf, T.Y.: Online consensus and agreement of phylogenetic trees. In: Proceedings of the 4th International Workshop on Algorithms in Bioinformatics, pp. 350–361 (2004)

  3. 3.

    Cole, R., Farach, M., Hariharan, R., Przytycka, T., Thorup, M.: An O(nlog n) algorithm for the maximum agreement subtree problem for binary trees. SIAM J. Comput. 30(5), 1385–1404 (2000)

  4. 4.

    Dong, S., Kraemer, E.: Calculation, visualization and manipulation of MASTs (maximum agreement subtrees). In: Proceedings of the IEEE Computational Systems Bioinformatics Conference, pp. 1–10 (2004)

  5. 5.

    Farach, M., Thorup, M.: Optimal evolutionary tree comparison by sparse dynamic programming. In: Proceedings of the 35th Annual IEEE Symposium on Foundations of Computer Science, pp. 770–779 (1994)

  6. 6.

    Farach, M., Thorup, M.: Fast comparison of evolutionary trees. In: Proceedings of the 5th Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 481–488 (1995)

  7. 7.

    Gusfield, D.: Efficient algorithms for inferring evolutionary trees. Networks 21, 19–28 (1991)

  8. 8.

    Kao, M.Y.: Tree contractions and evolutionary trees. SIAM J. Comput. 27, 1592–1616 (1998)

  9. 9.

    Kao, M.Y., Lam, T.W., Sung, W.K., Ting, H.F.: A decomposition theorem for maximum weight bipartite matchings with applications in evolution trees. In: Proceedings of the 7th Annual European Symposium on Algorithms, pp. 438–449 (1999)

  10. 10.

    Kao, M.Y., Lam, T.W., Sung, W.K., Ting, H.F.: An even faster and more unifying algorithm comparing trees via unbalanced bipartite matchings. J. Algorithms 20(2), 212–233 (2001)

  11. 11.

    Keselman, D., Amir, A.: Maximum agreement subtree in a set of evolutionary trees—metrics and efficient algorithms. In: Proceedings of 35th Annual Symposium on the Foundations of Computer Sciences, pp. 758–769 (1994)

  12. 12.

    Kubicka, E., Kubicki, G., McMorris, F.: An algorithm to find agreement subtrees. J. Classif. 12, 91–99 (1995)

  13. 13.

    Messmark, A., Jansson, J., Lingas, A., Lundell, E.: Polynomial-time algorithms for the ordered maximum agreement subtree problem. In: Proceedings of the 15th Annual Symposium on Combinatorial Pattern Matching, pp. 220–229 (2004)

  14. 14.

    Peng, Z.S., Ting, H.F.: An O(nlog n)-time algorithm for the maximum constrained agreement subtree problem for binary trees. In: Proceedings of the 15th Symposium on Algorithms and Computations, pp. 754–765 (2004)

  15. 15.

    Przytycka, T.: Sparse dynamic programming for maximum agreement subtree problem. In: Mathematical Hierarchies and Biology. DIMACS Series in Discrete Mathematics and Theoretical Computer Science, pp. 249–264 (1997)

  16. 16.

    Steel, M., Warnow, T.: Kaikoura tree theorems: computing the maximum agreement subtree. Inf. Process. Lett. 48(2), 77–82 (1994)

  17. 17.

    Steele, J.M.: The Cauchy-Schwarz Master Class: An Introduction to the Art of Mathematical Inequalities. Cambridge University Press, Cambridge (2004)

  18. 18.

    Warnow, T.J.: Tree compatibility and inferring evolutionary history. J. Algorithms 16(3), 388–407 (1994)

Download references

Author information

Correspondence to H. F. Ting.

Additional information

A preliminary version of this paper appears in the Proceedings of the Fifth Workshop on Algorithms in Bioinformatics (WABI 2005).

Research of H.F. Ting is supported in part by Hong Kong RGC Grant HKU-7172/06E.

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Berry, V., Peng, Z.S. & Ting, H.F. From Constrained to Unconstrained Maximum Agreement Subtree in Linear Time. Algorithmica 50, 369–385 (2008). https://doi.org/10.1007/s00453-007-9084-8

Download citation


  • Maximum agreement subtrees
  • Constrained maximum agreement subtrees
  • Consensus
  • Reduction
  • Bioinformatics
  • Evolutionary trees