iduedu.multi_source_dijkstra_path_length

iduedu.multi_source_dijkstra_path_length(urban_graph, *, source_nodes=None, gdf_sources=None, graph_node_column='graph_node_id', weight='time_min', cutoff=None, reverse=False, dtype=<class 'numpy.float32'>)[source]

Compute distance from the nearest source to each reachable graph node.

All sources are inserted into one Dijkstra queue, so each node receives only the best distance to the closest source. Use multi_source_dijkstra_nearest_source() when the winning source id is also needed.

Parameters:
  • urban_graph (UrbanGraph) – Urban graph with node and edge tables.

  • source_nodes (Optional[Iterable[Any]]) – Source node ids. Pass either this argument or gdf_sources.

  • gdf_sources (DataFrame | None) – DataFrame or GeoDataFrame with source objects. If it contains graph_node_column, those node ids are used directly; otherwise GeoDataFrame geometries are matched to nearest graph nodes.

  • graph_node_column (str) – Column containing graph node ids in gdf_sources.

  • weight (Literal['length_meter', 'time_min']) – Edge weight column.

  • cutoff (float | None) – Optional maximum path cost.

  • reverse (bool) – If True and the graph is directed, run on the reversed adjacency matrix.

  • dtype (dtype) – Floating dtype for the returned sparse series.

Return type:

Series

Returns:

Sparse Series indexed by reachable graph node ids. The normalized source mapping is stored in result.attrs["source_nodes"].