Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indexing histories #3

Closed
willdumm opened this issue Mar 11, 2022 · 3 comments
Closed

Indexing histories #3

willdumm opened this issue Mar 11, 2022 · 3 comments

Comments

@willdumm
Copy link
Collaborator

Right now, the only sort of index we have for histories in the DAG are Newick strings. Since the DAG can be trimmed to express only histories with a given Newick string, this works as an index.
However, finding Newick strings of all histories in the DAG is slow.

We should implement a numeric index based on node-clade pair target indices.

@willdumm
Copy link
Collaborator Author

willdumm commented Apr 5, 2022

Here's a little more on the idea that I had in mind for this.

It's a little silly, but if you're given a binary tree with N leaves, you can find any leaf by its index (an integer between 1 and N) by doing the algorithm outlined in the attached pdf.

This can be generalized to multifurcating trees (in which a node may have any number of children, not just two) without much modification.

Can we use this idea as inspiration for finding a tree in a history DAG given an integer index? The algorithm may be much more complicated, but I think it can be done.

History DAG 4.pdf

@willdumm
Copy link
Collaborator Author

willdumm commented Apr 5, 2022

Here's that pdf as an image, so it shows up on the comment
hdag

@willdumm
Copy link
Collaborator Author

willdumm commented Apr 7, 2022

The next step towards being able to do something similar in the history DAG is, perhaps, coming up with an analogous way to index sub-trees of this structure which have exactly one black and one red edge descending from each node:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant