Algorithm 1. Strict Consensus Merger.
| 1: | function scm (tree T1, tree T2) |
| 2: | |
| 3: | if |X| ≥ 3 then ▹Otherwise, the merged tree will be unresolved. |
| 4: | calculate T1|X and T2|X |
| 5: | TX←strictConsensus (T1|X, T2|X) |
| 6: | for all removed subtrees of T1 and T2 do |
| 7: | if collision then ▹Subtrees 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 |