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 orgdf_sources.gdf_sources (
DataFrame|None) – DataFrame or GeoDataFrame with source objects. If it containsgraph_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 ingdf_sources.weight (
Literal['length_meter','time_min']) – Edge weight column.reverse (
bool) – IfTrueand the graph is directed, run on the reversed adjacency matrix.dtype (
dtype) – Floating dtype for the returned sparse series.
- Return type:
- Returns:
Sparse
Seriesindexed by reachable graph node ids. The normalized source mapping is stored inresult.attrs["source_nodes"].