This feature request proposes adding a sampling mechanism to the centrality calculation functions (local_node_centrality_shortest, local_node_centrality_simplest, and local_segment_centrality).
By introducing a sample_probability parameter, users can opt to run the expensive centrality computations on a random subset of nodes. Additionally, a weighted_sample parameter allows this sampling to be biased by node weights (e.g., population or trip generation potential).
This functionality allows for significantly faster approximate centrality calculations, which is particularly useful for large networks or iterative workflows where exact precision for every node is not initially required.
I have implemented this in the Rust backend and exposed it via the Python API.
This feature request proposes adding a sampling mechanism to the centrality calculation functions (
local_node_centrality_shortest,local_node_centrality_simplest, andlocal_segment_centrality).By introducing a
sample_probabilityparameter, users can opt to run the expensive centrality computations on a random subset of nodes. Additionally, aweighted_sampleparameter allows this sampling to be biased by node weights (e.g., population or trip generation potential).This functionality allows for significantly faster approximate centrality calculations, which is particularly useful for large networks or iterative workflows where exact precision for every node is not initially required.
I have implemented this in the Rust backend and exposed it via the Python API.