Hill Climbing: Traveling Salesman

Complete Algorithm Execution with 2-Opt Neighbors

Watch ALL neighbor evaluations and the complete search process

Hill Climbing Strategy

🎯 Goal:

Find shortest tour visiting all cities

🔄 Each Step:

Try all 2-opt swaps, choose the best improvement

Key Insight: 2-opt neighbors are created by removing 2 edges and reconnecting in the only other way possible. This reverses a segment of the tour.
Important: Hill climbing finds local optima! The algorithm stops when no 2-opt swap improves the tour, even if better solutions exist.
Utility Function
U = -distance
Higher utility = Shorter tour

Step 1: Initial Tour

Current tour state
-0
Current Utility
0
Tour Distance
1
Step Number
0
2-Opts Checked
Algorithm Status:

Starting with initial tour. Ready to evaluate all possible 2-opt swaps.

2-Opt Neighbor Evaluation

Showing ALL possible 2-opt swaps - systematic evaluation of tour improvements

Click "Next Step" to see 2-opt neighbor evaluation and selection