diff --git a/run.py b/run.py index d09753e..238a88a 100644 --- a/run.py +++ b/run.py @@ -33,6 +33,7 @@ def run(show_plots=False): solver.plot_solution() if instance.exist_opt: + print(instance.optimal_tour) solver.solution = np.concatenate([instance.optimal_tour, [instance.optimal_tour[0]]]) solver.method = "optimal" solver.plot_solution() diff --git a/src/io_tsp.py b/src/io_tsp.py index 6ab9477..26f19d5 100644 --- a/src/io_tsp.py +++ b/src/io_tsp.py @@ -48,7 +48,7 @@ class Instance: self.optimal_tour = np.zeros(self.nPoints) for i in range(self.nPoints): line_i = lines[5 + i].split(' ') - self.optimal_tour[0] = int(line_i[0]) - 1 + self.optimal_tour[i] = int(line_i[0]) - 1 def print_info(self): print('name: ' + self.name)