How do I efficiently find the grand MRCA in a tree? #1490
-
We often assume that the oldest MRCA is the root, but we can have unary nodes above the root. So what's the best way to find the grand MRCA? There are a few options: simply(keep_unary=False) then get the root, find the root and descend down until you find a non unary node, or tree.mrca(all_samples) when #1340 is addressed. I wonder what the best option is likely to be? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Unless the tree has a very large number of unary nodes above the root, then traversing down will be more efficient:
(This will break in some corner cases, but should be the right option most of the time) |
Beta Was this translation helpful? Give feedback.
Unless the tree has a very large number of unary nodes above the root, then traversing down will be more efficient:
(This will break in some corner cases, but should be the right option most of the time)