Email updates

Keep up to date with the latest news and content from BMC Bioinformatics and BioMed Central.

This article is part of the supplement: Selected articles from the Eleventh Asia Pacific Bioinformatics Conference (APBC 2013): Bioinformatics

Open Access Proceedings

A practical O(n log2 n) time algorithm for computing the triplet distance on binary trees

Andreas Sand12, Gerth Stølting Brodal23, Rolf Fagerberg4, Christian NS Pedersen125 and Thomas Mailund1*

Author Affiliations

1 Bioinformatics Research Center, Aarhus University, Denmark

2 Department of Computer Science, Aarhus University, Denmark

3 MADALGO, Center for Massive Data Algorithms, a Center of the Danish National Research Foundation, Denmark

4 Department of Mathematics and Computer Science, University of Southern Denmark, Denmark

5 PUMPKIN, Center for Membrane Pumps in Cells and Disease, a Center of the Danish National Research Foundation, Denmark

For all author emails, please log on.

BMC Bioinformatics 2013, 14(Suppl 2):S18  doi:10.1186/1471-2105-14-S2-S18

Published: 21 January 2013


The triplet distance is a distance measure that compares two rooted trees on the same set of leaves by enumerating all sub-sets of three leaves and counting how often the induced topologies of the tree are equal or different. We present an algorithm that computes the triplet distance between two rooted binary trees in time O (n log2 n). The algorithm is related to an algorithm for computing the quartet distance between two unrooted binary trees in time O (n log n). While the quartet distance algorithm has a very severe overhead in the asymptotic time complexity that makes it impractical compared to O (n2) time algorithms, we show through experiments that the triplet distance algorithm can be implemented to give a competitive wall-time running time.