dasi.utils.networkx.shortest_path¶
Functions
|
Return shortest path through nodes. |
|
Computes the shortest path distance and path for a graph using an arbitrary function. |
|
|
|
Functions
|
Return shortest path through nodes. |
|
Computes the shortest path distance and path for a graph using an arbitrary function. |
-
dasi.utils.networkx.shortest_path.
multipoint_shortest_path
(graph, nodes, weight_key, cyclic=False, cyclic_sort_key=None)[source]¶ Return shortest path through nodes. If cyclic, will return the cycle sorted with the ‘lowest’ node at index 0. Self cycles are not supported.
- Parameters
graph (
DiGraph
) – the graphnodes (
List
[str
]) – list of nodes to find pathweight_key (
str
) – weight keycyclic – whether the path is cyclic
cyclic_sort_key – the key function to use to sort the cycle (if cyclic)
- Returns