← Back to LK docs

teeline · algorithms/lk

Lin-Kernighan ILS — interactive explainer

Local Search shows simplified 2-opt edge swaps. ILS adds double-bridge kicks to escape local optima.

TourCandidate pairAccepted swap
Scanning candidate pair — no improvement yet, step further
Distance
1164.8
Swaps accepted
0
Step
1 / 5

This shows simplified 2-opt local search: scan candidate pairs, swap when one improves the tour, repeat until no gain is found. The actual LK solver chains deeper moves — see the docs.

TourCandidate pairAccepted swapBest tourBridge cut
LK pass
Running 2-opt local search...
Current dist
1164.8
Best dist
1164.8
Epoch
0
Plateau (limit 5)
0
Step
1 / 47

Gold tour = new best found. Red dashed circles mark the double-bridge cut points.

cities: 15algorithm: 2-opt + double-bridge ILS