def min_cost_flow(G, demand='demand', capacity='capacity', weight='weight'):
 return nx.network_simplex(G, demand=demand, capacity=capacity, weight=weight)[1]

def min_cost_flow ( G , demand = 'demand' , capacity = 'capacity' , weight = 'weight' ) : return nx . network_simplex ( G , demand = demand , capacity = capacity , weight = weight ) [ 1 ]
return a minimum cost flow satisfying all demands in digraph g .