This commit is contained in:
UmbertoJr 2019-10-31 16:00:34 +01:00
parent 29dc605f6a
commit 856ff4015e
1 changed files with 2 additions and 1 deletions

View File

@ -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