From 202f7f1c38c6b7a98f6ed42d2a69d03e3b1300dc Mon Sep 17 00:00:00 2001 From: UmbertoJr Date: Mon, 4 Nov 2019 06:56:13 +0100 Subject: [PATCH] io --- run.py | 1 + src/io_tsp.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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)