Open clbarnes opened 5 years ago
the "classic" algorithm should be much faster
It's not.
I have not looked into the algo itself, so I can't tell. Maybe this is useful regarding faster implementations https://stackoverflow.com/questions/938338/what-is-the-fastest-dijkstra-implementation-you-know-in-c Maybe @ceesem can also comment.
Just a thought - this might be at least in part because the reference implementation constrains the maximum length of a path, where I'm not currently doing that in the ArborNX implementation.
Using networkx's shortest_path_length is extremely slow for this data; the "classic" algorithm should be much faster (but the current implementation is incorrect).
I believe that the problem with the python implementation of the classic distance_map algorithm is the sorting of the partitions. The JS docs say that they should be sorted in order of length, but I think they should actually be ordered topologically.
partitions_sorted
should return the root-containing partition last.