Add a perturbation step to the VNS engine #305

Merged
bustikiller merged 11 commits from vns-perturbations into main 2025-07-24 12:21:02 +00:00
Showing only changes of commit b1df5d2f53 - Show all commits

View File

@ -12,8 +12,9 @@ module Tables
def call def call
new_solution = @initial_solution.deep_dup new_solution = @initial_solution.deep_dup
selected_guests = new_solution.tables.map(&:pop).cycle.tap(&:next) selected_guests = new_solution.tables.map(&:pop).shuffle.cycle
new_solution.tables.each { |table| table << selected_guests.next } new_solution.tables.each { |table| table << selected_guests.next }
new_solution.tables.each(&:reset)
new_solution new_solution
end end