NetworkX

Previous topic

networkx.all_pairs_shortest_path_length

Next topic

networkx.dijkstra_path_length

Quick search

networkx.dijkstra_path

dijkstra_path(G, source, target)

Returns the shortest path from source to target in a weighted graph G.

Uses a bidirectional version of Dijkstra’s algorithm.

Edge data must be numerical values for XGraph and XDiGraphs. The weights are assigned to be 1 for Graphs and DiGraphs.

See also bidirectional_dijkstra for more information about the algorithm.