Getting roots from tree sequence #2299
-
Hello, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @haono! |
Beta Was this translation helpful? Give feedback.
-
In special cases you might be able to look at the oldest edges and reason about them, but it would be quite tricky I think. As @benjeffery says though, going through the trees should be quite a quick way to do this unless you've got a large number of roots. |
Beta Was this translation helpful? Give feedback.
Hi @haono!
Thanks for your question. The TreeSequence doesn't store any cached information about roots, so to find them you have to work through the trees. Are you finding this to be a bottleneck? It shouldn't be that slow to go through the trees. Feel free to paste some code of how you're doing this if you want us to have a look.