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 with np.inf for 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 call eliminate_zeros. Use .tocoo() for triples. The default "frame" returns a pandas table. Array formats preserve input order and duplicates. With target_nodes=None, column j corresponds to nodes_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 prefer path_storage="lazy" for individual route lookups.

Return type:

Series | DataFrame | ShortestPathResult | ndarray | csr_array

Parameters: