def compute_min_dist(digr, n, nodes_explored, dist):
 min = float('inf')
 for v in nodes_explored:
  if digr.has_edge((v, n)):
   d = (dist[v] + digr.get_edge_weight((v, n)))
   if (d < min):
    min = d
 return min

def compute_min_dist ( digr , n , nodes_explored , dist ) : min = float ( 'inf' ) for v in nodes_explored : if digr . has_edge ( ( v , n ) ) : d = ( dist [ v ] + digr . get_edge_weight ( ( v , n ) ) ) if ( d < min ) : min = d return min
computes the min dist of node n from a set of nodes explored in digr .