Skip to main content
. 2016 Jun 28;4:e2172. doi: 10.7717/peerj.2172

Algorithm 1. Strict Consensus Merger.

1: function scm (tree T1, tree T2)
2: XLT1LT2
3: if |X| ≥ 3 thenOtherwise, the merged tree will be unresolved.
4: calculate T1|X and T2|X
5: TXstrictConsensus (T1|X, T2|X)
6: for all removed subtrees of T1 and T2 do
7: if collision thenSubtrees of T1 and T2 attach to the same edge e in TX (Fig. 1)
8: insert all colliding subtrees at the same point on e by generating a polytomy.
9: else
10: Reinsert subtree into TX without violating any of the bipartitions in T1 or T2.
11: end if
12: end for
13: return TX
14: end if
15: end function