iduedu.edge_betweenness

iduedu.edge_betweenness(urban_graph, *, cutoffs=None, weight='length_meter', node_weights=None, sample=None, seed=0, max_workers=None)[source]

Betweenness of the edges of a graph: how many shortest paths within a threshold run along each edge.

Paths are counted as in centrality(). An edge that can be travelled both ways carries the paths of both directions. Among parallel edges only the cheapest one carries paths; equally cheap ones share them.

Parameters:
  • urban_graph (UrbanGraph) – Graph to measure.

  • cutoffs (Union[float, Iterable[float], None]) – Threshold or thresholds in the units of weight; None for no limit.

  • weight (Literal['length_meter', 'time_min']) – Edge cost column: length_meter (metres, the default) or time_min (minutes).

  • node_weights (str | Series | ndarray | None) – Weights of the path ends, see centrality().

  • sample (int | None) – Number of randomly chosen source nodes; the result is scaled up to all nodes.

  • seed (int | None) – Seed of the sample.

  • max_workers (int | None) – Number of threads; None uses all cores.

Return type:

DataFrame

Returns:

DataFrame indexed like edges_gdf with one column betweenness_<cutoff> per threshold.