diff --git a/ortools/graph/samples/assignment_min_flow.py b/ortools/graph/samples/assignment_min_flow.py index 381a75da5f..e418367997 100755 --- a/ortools/graph/samples/assignment_min_flow.py +++ b/ortools/graph/samples/assignment_min_flow.py @@ -51,10 +51,10 @@ def main(): # [START constraints] # Add each arc. - for idx, _ in enumerate(start_nodes): - smcf.add_arc_with_capacity_and_unit_cost( - start_nodes[idx], end_nodes[idx], capacities[idx], costs[idx] - ) + for start_node, end_node, capacity, cost in zip( + start_nodes, end_nodes, capacities, costs + ): + smcf.add_arc_with_capacity_and_unit_cost(start_node, end_node, capacity, cost) # Add node supplies. for idx, supply in enumerate(supplies): smcf.set_node_supply(idx, supply)