trimesh icon indicating copy to clipboard operation
trimesh copied to clipboard

trimesh's usage of NetworkX: API usage and slowdowns

Open nv-rliu opened this issue 10 months ago • 2 comments

Hi. I would like to understand what parts of trimesh depend on algorithms from Networkx. What nx API calls it uses the most, for what purposes, and if you've ever experienced any slowdowns when scaling up graph sizes?

I did a quick search for previous issues related to NetworkX Usage, but I was wondering if you had any more insight into this topic. Thank you

nv-rliu avatar Jan 17 '25 14:01 nv-rliu

Hey, actually connected components are used a lot for some reason, and the existing implementation supports and benchmarks multiple graph backends (networkx and scipy.sparse.csgraph): https://github.com/mikedh/trimesh/blob/2fcb2b2ea8085d253e692ecd4f71b8f450890d51/trimesh/graph.py#L376-L476

If you were looking at adding another backend that would be a great place to benchmark!

mikedh avatar Jan 19 '25 18:01 mikedh

Connected components is supported in a zero code change GPU accelerated backend to NetworkX called nx-cugraph.

Are you interested in integrating that as one of the engine options for that function?

nv-rliu avatar Jan 22 '25 16:01 nv-rliu