Class TspMove

java.lang.Object
edu.cnu.mdi.sim.simanneal.tspdemo.TspMove
All Implemented Interfaces:
AnnealingMove<TspSolution>, DeltaEnergyMove<TspSolution>, ReversibleAnnealingMove<TspSolution>

public class TspMove extends Object implements DeltaEnergyMove<TspSolution>
A 2-opt move for TSP that supports O(1) ΔE computation.

The move reverses a contiguous segment [i..k] in-place. It is parameterized by the endpoints i < k chosen in prepare(TspSolution). The same prepared parameters are used by deltaE(TspSolution) and apply(TspSolution).

Undo is performed by reversing the same segment again.