You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Schieber-Vishkin algorithm allows us to compute the MRCA of two nodes u and v in constant time, given a O(n) preprocessing step and O(n) extra storage space. If someone is computing a lot of MRCAs, then it can be quite a bit speedup over just computing each one directly.
It would be nice to have an implementation of the mrca function that does something like this:
defmrca(ds, u, v):
if"sv_tau"inds:
return_sv_mrca(ds, u, v)
else:
return_mrca(ds, u, v)
There's an implementation of the SV algorithm the tskit test suite here. This is a direct implementation of Knuth's version, which uses 1-based arrays instead of 0-based. I never got around to properly updating it to use 0-based, and just did a quick hack to get it converted. It would be nice to do this properly.
The text was updated successfully, but these errors were encountered:
The Schieber-Vishkin algorithm allows us to compute the MRCA of two nodes u and v in constant time, given a O(n) preprocessing step and O(n) extra storage space. If someone is computing a lot of MRCAs, then it can be quite a bit speedup over just computing each one directly.
It would be nice to have an implementation of the mrca function that does something like this:
There's an implementation of the SV algorithm the tskit test suite here. This is a direct implementation of Knuth's version, which uses 1-based arrays instead of 0-based. I never got around to properly updating it to use 0-based, and just did a quick hack to get it converted. It would be nice to do this properly.
The text was updated successfully, but these errors were encountered: