test efficiency of graphblas in straightness #562
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is more of an exploration than anything. I am curious if
graphblas_algorithms
engine for networkx can help us with our stuff, so I reimplementedstraigtness_centrality
on top of it. For now only the core part. Using the network from our docs, I am able to get it from 1min 50s down to 17s, which means it is 6.5x faster. There's nothing to shave from our overhead as 98% of time is now spent onall_pairs_bellman_ford_path_length
. I was expecting a bit more from this, given the speedups in benchmarks in their Readme are in hundreds, but better than nothing :).The code for networkx and graphblas is similar but not the same. Networkx-compatible code is possible but much slower than this. So having graphblas as optional dependency (like numba elsewhere in PySAL) would mean having two implementations, which I am not a fan of. But as @jGaboardi pointed out, graphblas is not installable on Apple Silicon under Python 3.12 at the moment. If there'll be delays of this sort, we I am not sure I like depending on it. (Though it is installable from PyPI...).