iduedu.dijkstra_parallel¶
- iduedu.dijkstra_parallel(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'>, max_workers=None, batch_size=None, distance_format='frame')[source]¶
Run independent searches, sharing work for sources mapped to the same node.
Returns one row per input source. The default frame format uses columns for target_nodes, or the union of reachable nodes when target_nodes is None. Source object labels and repeated node ids are preserved. Other options follow single_source_dijkstra. max_workers caps the worker threads (default: one per CPU). batch_size limits searches in flight; retained results and lazy trees still consume memory across all batches.
With
output="distances"or"both",distance_format="dense"uses a NumPy array withnp.inffor unreachable or out-of-cutoff pairs."sparse"returns a SciPy CSR array storing reachable pairs, including explicit zeros. An absent entry means unreachable, so never calleliminate_zeros. Use.tocoo()for triples. The default"frame"returns a pandas table. Array formats preserve input order and duplicates. Withtarget_nodes=None, columnjcorresponds tonodes_gdf.index[j]in the distance array and its path table. Dense distances allocate one row per source across all nodes. The eager path table also spans all nodes, so preferpath_storage="lazy"for individual route lookups.- Return type:
Series|DataFrame|ShortestPathResult|ndarray|csr_array- 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)
max_workers (int | None)
batch_size (int | None)
distance_format (Literal['frame', 'dense', 'sparse'])