netotz / alpha-neighbor-p-center-problem

Heuristic algorithms for the alpha-neighbor p-center problem.
MIT License
5 stars 0 forks source link

Fix largest values of same neighbors in `move` method #14

Closed netotz closed 1 year ago

netotz commented 1 year ago

Context

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.