Skip to content

Commit cf94c2d

Browse files
committed
routing: Fix tsp_cities and tsp_circuit_board output
1 parent c869dd1 commit cf94c2d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ortools/routing/samples/tsp_circuit_board.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ def print_solution(manager, routing, solution):
115115
index = solution.Value(routing.NextVar(index))
116116
route_distance += routing.GetArcCostForVehicle(previous_index, index, 0)
117117
plan_output += f" {manager.IndexToNode(index)}\n"
118+
plan_output += f"Route distance: {route_distance}m\n"
118119
print(plan_output)
119-
plan_output += f"Objective: {route_distance}m\n"
120120
# [END solution_printer]
121121

122122

ortools/routing/samples/tsp_cities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def print_solution(manager, routing, solution):
5959
index = solution.Value(routing.NextVar(index))
6060
route_distance += routing.GetArcCostForVehicle(previous_index, index, 0)
6161
plan_output += f" {manager.IndexToNode(index)}\n"
62-
print(plan_output)
6362
plan_output += f"Route distance: {route_distance}miles\n"
63+
print(plan_output)
6464
# [END solution_printer]
6565

6666

0 commit comments

Comments
 (0)