execute

open override fun execute(candidate: BinarySolution): BinarySolution

Executes a single-bit flip on the candidate solution with probability probability.

Implementation notes:

  • Assumes candidate is a BestSubsetSolution (cast is unchecked and will throw if not).

  • Chooses a random index in [0, n) and toggles the bit.

  • Resets incremental evaluation state and mutation flags, since this is not a fixed‑K swap.

Return

the same instance after potential mutation.

Parameters

candidate

input solution (expected: BestSubsetSolution).

Throws