Returns the shortest path from source to target in a weighted graph G.
Uses a bidirectional version of Dijkstra’s algorithm.
Parameters: | G : NetworkX graph source : node label
target : node label
|
---|
See also
Notes
Edge data must be numerical values for Graph and DiGraphs.
Examples
>>> G=nx.path_graph(5)
>>> print nx.dijkstra_path(G,0,4)
[0, 1, 2, 3, 4]