Skip to main content
[Preprint]. 2023 Dec 3:2023.12.03.569785. [Version 1] doi: 10.1101/2023.12.03.569785

Algorithm 2.

Conservative Maximum Parsimony Reconstruction

1: procedure CMPR𝒯,x
2: x˜VMPR𝒯,x
3: for v in preorder traversal of internal nodes of 𝒯 do
4: if v is the root, or 0x(v), or x(v) contains two distinct positive states, or x(v)={-1} then
5: VMPR_cond_5[v]False
6: CMPR_cond_5[v]False
7: else
8: VMPR_cond_5[v]True
9: Let s be the unique positive state in xv
10: if u:uchildofv,sx(u)2 then
11: CMPR_cond_5[v]True
12: else
13: pparentv
14: CMPR_cond_5[v]CMPR_cond_5[p]
15: for v in the internal nodes of 𝒯 do
16: if VMPR_cond_5[v] is True and CMPR_cond_5[v] is False then
17: x˜vNONE
18: return x˜