diff --git a/code/TSP_solver.py b/code/TSP_solver.py index 56a5cd3..e620df7 100644 --- a/code/TSP_solver.py +++ b/code/TSP_solver.py @@ -28,7 +28,8 @@ class Solver_TSP: def random_method(self, instance_): n = int(instance_.nPoints) - self.solution = np.random.choice(np.arange(n), size=n, replace=False) + solution = np.random.choice(np.arange(n), size=n, replace=False) + self.solution = np.concatenate([solution, [solution[0]]]) self.solved = True return self.solution