Skip to content

Feature: Add sampling parameters to centrality metrics for faster computation #153

Description

@Robinlovelace

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions