clbarnes / arbor-rs

MIT License
0 stars 1 forks source link

Look into alternative tree implementations #13

Open clbarnes opened 5 years ago

clbarnes commented 5 years ago

For possible improved performance, memory size, safety, readability.

Some results for "tree" on cargo:

Wants

clbarnes commented 4 years ago

Implementation review

rosetree

outils

synctree

id_tree

slab_tree

note also

pathfinding

aschampion commented 4 years ago

Very tangentially related thing that might be useful for debugging if you stick with a petgraph-based tree lib: plotting petgraphs in jupyter

clbarnes commented 4 years ago

Ah, yeah, that could be handy.

I'm considering rescoping this attempt to just manage morphology-related stuff for now - dict lookups could be quicker in python, so traversal based on them isn't a great idea, which becomes a problem for looking at large numbers of skeletons. Immutable graph which gets cloned for rerooting, pruning etc. Remains to be seen whether the overhead of converting into a rust data structure would be made back from the algorithm speed, but i suspect it would.

clbarnes commented 4 years ago

Adding to the pile:

ego_tree

trees

read_tree

I'm leaning towards slab-tree. It has stable indices through both insertions and deletions (essential for e.g. caching branch points), it's safe, and has good traversal options. However, it's not widely used, and can't store edge weights.

These mainly require knowing the tree structure before you build it (i.e. not from a bag of edges), so I'll probably need to keep some of the hashmap-based algorithms anyway just to build it.

At a minimum, we'd need to store:

Then we could additionally cache:

I think these could all be initialised on construction at little CPU cost if we're willing to spare the memory.

clbarnes commented 4 years ago

indextree