This commit is contained in:
UmbertoJr 2019-10-31 14:25:43 +01:00
parent 48fcd8738b
commit 8e6fa8eff9

View file

@ -53,7 +53,7 @@ class Solver_TSP:
plt.plot(ordered_points[:, 1], ordered_points[:, 2], 'b-') plt.plot(ordered_points[:, 1], ordered_points[:, 2], 'b-')
def check_if_solution_is_valid(self, solution): def check_if_solution_is_valid(self, solution):
rights_values = np.sum([self.check_validation(i, solution) for i in np.arange(self.instance.nPoints)]) rights_values = np.sum([self.check_validation(i, solution[:-1]) for i in np.arange(self.instance.nPoints)])
if rights_values == self.instance.nPoints: if rights_values == self.instance.nPoints:
return True return True
else: else: