Matrices¶
Shortest-path workflows¶
IduEdu shortest-path helpers work on UrbanGraph objects and reuse the
graph adjacency cache when possible. Distances use the units of the selected
edge weight:
time_minTravel time in minutes.
length_meterNetwork distance in meters.
See Shortest paths and OD matrices for runnable examples of every function listed below.
Choosing a helper¶
Use single_source_dijkstra_path_length() when one source node should be
expanded to reachable graph nodes.
Use multi_source_dijkstra_path_length() when several sources should act
as one combined source set and each reachable node needs only the best distance
to the closest source.
Use multi_source_dijkstra_nearest_source() when the closest source id is
needed together with the distance.
Use dijkstra_path_length_parallel() when every source needs its own sparse
distance row, for example for per-origin accessibility profiles.
Use od_matrix() when you need an origin-destination table between two
sets of graph nodes or object tables.
GeoDataFrame inputs¶
Several helpers accept GeoDataFrames through gdf_sources,
gdf_origins, or gdf_destinations. If the table already contains
graph_node_id (or the column configured through graph_node_column), that
mapping is used directly. Otherwise objects are matched to nearest graph nodes.
For object-to-edge projection before OD calculations, see
Objects, nearest nodes, and graph projection.
Compute shortest-path distances from one source node to graph nodes. |
|
Compute distance from the nearest source to each reachable graph node. |
|
Find the nearest source and its distance for each reachable graph node. |
|
Run independent Dijkstra searches for each source. |
|
Compute an origin-destination shortest-path matrix on an |