Algorithm 2.
Conservative Maximum Parsimony Reconstruction
1: procedure |
2: |
3: for in preorder traversal of internal nodes of do |
4: if is the root, or , or contains two distinct positive states, or then |
5: |
6: |
7: else |
8: |
9: Let be the unique positive state in |
10: if then |
11: |
12: else |
13: |
14: |
15: for in the internal nodes of do |
16: if is True and is False then |
17: |
18: return |