tusc.graph.distance¶
- graph.distance.shortest_path(G, u, v, method='Dijkstra')¶
Calculates the shortest path between nodes u and v in G.
- Parameters
G (networkx graph) – source graph
u (int or str - whatever type the labels of the graph are) – source node
v (int or str - whatever type the labels of the graph are) – destination node
method (str) –
the shortest path method you want to use. Currently implemented:
”Dijkstra”
:raises NotImplementedError : if selected method is not Dijkstra’s algorithm:
- graph.distance.single_source_shortest_paths(G, u, method='Dijkstra')¶
Calculates all shortest paths from node u and v in G.
- Parameters
G (networkx graph) – source graph
u (int or str - whatever type the labels of the graph are) – source node
method (str) –
the shortest path method you want to use. Currently implemented:
”Dijkstra”