iduedu.single_source_dijkstra_path_length

iduedu.single_source_dijkstra_path_length(urban_graph, source_node, *, weight='time_min', cutoff=None, reverse=False, dtype=<class 'numpy.float32'>)[source]

Compute shortest-path distances from one source node to graph nodes.

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

  • source_node (Any) – Existing node id from graph.nodes_gdf.index.

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

  • cutoff (float | None) – Optional maximum path cost. Nodes beyond the cutoff are omitted from the sparse result and are interpreted as np.inf.

  • reverse (bool) – If True and the graph is directed, run on the reversed adjacency matrix. This is useful for coverage queries such as “which nodes can reach this destination”.

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

Return type:

Series

Returns:

Sparse Series indexed by reachable graph node ids with path distances from source_node.