This commit is contained in:
UmbertoJr 2019-10-31 16:00:34 +01:00
parent 29dc605f6a
commit 856ff4015e

View file

@ -28,7 +28,8 @@ class Solver_TSP:
def random_method(self, instance_): def random_method(self, instance_):
n = int(instance_.nPoints) 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 self.solved = True
return self.solution return self.solution