In Solver.move() method, the largest two values of same_neighbors dictionary are updated in the loop to retrieve them in constant time when calculating the objective function (best_out).
Bug
There's a missing condition to replace the second largest value when some value is less than the largest but greater than the second largest.
Context
In
Solver.move()
method, the largest two values ofsame_neighbors
dictionary are updated in the loop to retrieve them in constant time when calculating the objective function (best_out
).Bug
There's a missing condition to replace the second largest value when some value is less than the largest but greater than the second largest.