Skip to content

Commit

Permalink
Fix run_tsp
Browse files Browse the repository at this point in the history
  • Loading branch information
itskalvik committed Dec 18, 2024
1 parent 259096a commit 51100dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sgptools/utils/tsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ def run_tsp(nodes,

# Get start and end node indices for ortools
if start_nodes is None:
start_idx = [0]*num_vehicles
start_idx = np.zeros(num_vehicles, dtype=int)
num_start_nodes = 0
else:
start_idx = np.arange(num_vehicles)+int(trim_paths)
num_start_nodes = len(start_nodes)

if end_nodes is None:
end_idx = [0]*num_vehicles
end_idx = np.zeros(num_vehicles, dtype=int)
else:
end_idx = np.arange(num_vehicles)+num_start_nodes+int(trim_paths)

Expand Down

0 comments on commit 51100dc

Please # to comment.