Simulated Annealing: TSP

Step-by-Step Interactive Demonstration

Simulated Annealing for TSP

Simulated Annealing is a metaheuristic algorithm inspired by the physical process of annealing in metallurgy. For the Traveling Salesman Problem, it can escape local optima by accepting worse moves with a probability that decreases over time.

Key Concepts:
  • Temperature (T): Controls exploration vs exploitation behavior
  • Acceptance Probability: P = e(ΔE/T) where ΔE = (New Distance - Current Distance)
  • Cooling Schedule: Temperature decreases over time (T = T × cooling_rate)
  • 2-opt Moves: Generate neighbors by reversing tour segments

Current Tour State

0
Current Distance
1
Step Number
0
Accepted Moves
0
Rejected Moves
🌡️ Temperature Schedule
Cold (0°) Hot (100°)
100.0
Current Temperature

Algorithm Controls

°
Range: 1-500°. Higher = more exploration.
×
Range: 0.8-0.99. Lower = faster cooling.
Set initial temperature and click "Next Step" to see the first move attempt and acceptance probability calculation.
Algorithm Execution
Step 1: Initial Configuration

Starting with initial tour. Temperature = 100.0°

0
Initial Distance
Current Move Analysis

Click "Next Step" to see move analysis and acceptance probability calculations.