local
This commit is contained in:
parent
2e9910d324
commit
6be767267d
2 changed files with 3 additions and 3 deletions
|
@ -43,7 +43,7 @@ class Solver_TSP:
|
||||||
start = t()
|
start = t()
|
||||||
self.solution = self.available_initializers[self.methods[0]](instance_)
|
self.solution = self.available_initializers[self.methods[0]](instance_)
|
||||||
assert self.check_if_solution_is_valid(self.solution), "Error the solution is not valid"
|
assert self.check_if_solution_is_valid(self.solution), "Error the solution is not valid"
|
||||||
print("init ok")
|
# print("init ok")
|
||||||
for i in range(1, len(self.methods)):
|
for i in range(1, len(self.methods)):
|
||||||
self.solution = self.available_improvements[self.methods[i]](self.solution, self.instance)
|
self.solution = self.available_improvements[self.methods[i]](self.solution, self.instance)
|
||||||
print(len(self.solution))
|
print(len(self.solution))
|
||||||
|
|
|
@ -64,7 +64,7 @@ class TwoOpt:
|
||||||
if new_reward < new_len:
|
if new_reward < new_len:
|
||||||
new_len = new_reward
|
new_len = new_reward
|
||||||
else:
|
else:
|
||||||
return new_tsp_sequence.tolist(), new_len, uncross
|
return new_tsp_sequence.tolist()
|
||||||
|
|
||||||
# return new_tsp_sequence.tolist(), new_len, uncross
|
# return new_tsp_sequence.tolist(), new_len, uncross
|
||||||
return new_tsp_sequence.tolist()
|
return new_tsp_sequence.tolist()
|
||||||
|
@ -156,7 +156,7 @@ class TwoDotFiveOpt:
|
||||||
if new_len < actual_len:
|
if new_len < actual_len:
|
||||||
actual_len = new_len
|
actual_len = new_len
|
||||||
else:
|
else:
|
||||||
return new_tsp_sequence.tolist(), actual_len, uncross
|
return new_tsp_sequence.tolist()
|
||||||
|
|
||||||
# return new_tsp_sequence.tolist(), actual_len, uncross
|
# return new_tsp_sequence.tolist(), actual_len, uncross
|
||||||
return new_tsp_sequence.tolist()
|
return new_tsp_sequence.tolist()
|
||||||
|
|
Reference in a new issue