Skip to content

Neighborhoods

Neighborhoods: neighbor(solution, rng) -> new solution.

Shared across families (SA moves, GA mutations); they never mutate their input.

swap_neighbor(solution, rng)

Permutation move: swap two random positions.

two_opt_neighbor(solution, rng)

Permutation move: reverse a random segment (2-opt).

bit_flip_neighbor(solution, rng)

Binary move: flip one random bit.

gaussian_neighbor(solution, rng, sigma=0.1)

Continuous move: add N(0, sigma) to one random coordinate. Bounds are left to Problem.feasible (infeasible moves are redrawn).