Generic SA Algorithm for Minimization Problem
Step 1
Obtain an initial solution S.
Step 2
Acquire an initial temperature T = Tα > 0.
Step 3
Do the following whereas not yet frozen.
Step 3.1
Perform the following loop L times.
Step 3.1.1
Select a random number S′ neighbor of S.
Step 3.1.2
Assume Δ = F (S′) - F (S)
Step 3.1.3
IF (Δ ≤ 0) (down hill move) set S = S′.
Step 3.1.4
IF (Δ > 0) (uphill move), set S = S′ with probability exp (- Δ/Tα).
Step 3.2
Set Tα = r × Tα (reduced temperature).
Step 4
Return S.
where F (S′) = fitness function value of S′.
F (S) = fitness function value of S