NetworkX

Previous topic

networkx.single_source_shortest_path_length

Next topic

networkx.all_pairs_shortest_path_length

Quick search

networkx.all_pairs_shortest_path

all_pairs_shortest_path(G, cutoff=None)

Return dictionary of shortest paths between all nodes.

The dictionary only has keys for reachable node pairs.

cutoff is optional integer depth to stop the search - only paths of length <= cutoff are returned.

See also floyd_warshall.