def dijkstra_predecessor_and_distance(G, source, cutoff=None, weight='weight'):
 weight = _weight_function(G, weight)
 pred = {source: []}
 return (pred, _dijkstra(G, source, weight, pred=pred, cutoff=cutoff))

def dijkstra_predecessor_and_distance ( G , source , cutoff = None , weight = 'weight' ) : weight = _weight_function ( G , weight ) pred = { source : [ ] } return ( pred , _dijkstra ( G , source , weight , pred = pred , cutoff = cutoff ) )
compute weighted shortest path length and predecessors .