Compute shortest path length and predecessors on shortest paths in weighted graphs.
Parameters : | G : NetworkX graph source : node label
weight: string, optional (default=’weight’) :
cutoff : integer or float, optional
|
---|---|
Returns : | pred,distance : dictionaries
|
Notes
Edge weight attributes must be numerical. Distances are calculated as sums of weighted edges traversed.
The list of predecessors contains more than one element only when there are more than one shortest paths to the key node.