solver
This commit is contained in:
parent
29dc605f6a
commit
856ff4015e
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Reference in a new issue