iduedu.multi_source_dijkstra¶
- iduedu.multi_source_dijkstra(urban_graph, *, source_nodes=None, gdf_sources=None, graph_node_column='graph_node_id', target_nodes=None, weight='time_min', cutoff=None, reverse=False, output='both', path_storage='eager', dtype=<class 'numpy.float32'>, distance_format='frame')[source]¶
Search from the nearest member of one combined source set.
Options and Series results follow single_source_dijkstra. Supply either source_nodes or gdf_sources; geometries without graph_node_column are matched to nearest graph nodes. A combined result also exposes
nearest_sourcesas a pandas Series in distance order, with target node labels in every format and None for unreachable targets. Ties choose the source appearing first in graph node order. This differs from dijkstra_parallel, which runs an independent search for each source.With
output="distances"or"both",distance_format="dense"uses a one-dimensional NumPy array withnp.inffor unreachable or out-of-cutoff nodes. Withtarget_nodes=None, it covers all nodes innodes_gdforder. The default"frame"returns a Series."sparse"is available only for matrix results.- Return type:
- Parameters:
urban_graph (UrbanGraph)
gdf_sources (DataFrame | None)
graph_node_column (str)
weight (Literal['length_meter', 'time_min'])
cutoff (float | None)
reverse (bool)
output (Literal['distances', 'paths', 'both'])
path_storage (Literal['eager', 'lazy'])
dtype (dtype)
distance_format (Literal['frame', 'dense', 'sparse'])