iduedu.single_source_dijkstra_path

iduedu.single_source_dijkstra_path(urban_graph, source_node, target_node, *, weight='time_min', cutoff=None, reverse=False)[source]

Return one shortest path as an ordered list of graph node ids.

The search stops when target_node settles. If reverse is true, the transposed directed graph is searched and the returned path is reversed back into the original graph direction.

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

  • source_node (Any) – Search origin node id.

  • target_node (Any) – Search destination node id.

  • weight (Literal['length_meter', 'time_min']) – Edge weight column to minimize.

  • cutoff (float | None) – Optional maximum path cost.

  • reverse (bool) – Search the transposed adjacency matrix on directed graphs.

Return type:

list[Any]

Returns:

Ordered node ids for one shortest path. Returns an empty list when the destination is unreachable or beyond cutoff.