From ed1adfb11ab71bca1b5ec3692e5d14cef19ccf41 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Mon, 7 Oct 2024 08:28:37 +0200 Subject: [PATCH] graph: cleanup assignment_min_cost_flow --- ortools/graph/samples/assignment_min_flow.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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)