Professional Documents
Culture Documents
Meta Heuristics: Traveling Salesman
Meta Heuristics: Traveling Salesman
1
SA FOR TSP
Problem:
Given n cities,
Find a complete tour with minimal length.
Search space is BIG: for 30 cities there are 30! 1032 possible tours.
Sol 1, 2, 3, .., n
Several choices exist for generating the required neighbourhood.
The new solution could be generated by performing a predetermined number of
swaps on the current solution,
d12=4
2
1 d23=7 d25=5
d15=12
d13=2 d14=9 d24=5
5
d35=10
3 d45=3
d34=4
4
Sol 1, 3, 4, 2, 5
For a closed
The total distance would be: tour
n 1
total _ dist d Sol i Sol i 1 d Sol nSol1
i 1
total _ dist 2 4 5 5 12 28
To generate a candidate solution, select two random cities and swap them:
Sol 1, 2, 4, 3, 5 d12=4 2
1 d23=7 d25=5
d14=9
The tour length of the candidate solution is: d15=12
total _ dist 4 5 4 10 12 35 d13=2 d24=5
5
d35=10
3 d45=3
d34=4
4
P e 7 / t
d12=4 2
• Assuming the new solution was not accepted, we
generate a different one starting from the initial 1 d23=7 d25=5
solution: d14=9
d15=12
d24=5
Sol 1, 3, 4, 5, 2
d13=2 5
d35=10
3 d45=3
d34=4
4
total _ dist 2 4 3 5 4 18
Since this solution has a shorter tour length, it will get accepted,
d12=4 2
The search continues …
1 d23=7 d25=5
d14=9
d15=12
d13=2 d24=5
5
d35=10
3 d45=3
d34=4
4
T_Final = 0.1,
= 0.85,
1 8861
5 13180
10 17124
15 18900
4
x 10
3.5
Swaps=1
Swaps=5
3 Swaps=10
Swaps=15
2.5
Tour length
1.5
Low temperature,
lower probability
1
of selecting worse
High temperature, solutions
higher probability 0.5
of selecting worse 0 1 2 3 4 5 6 7 8
4
solutions Iterations x 10
T is “Temperature”
function
value
x
ECE 457A Adaptive and Cooperative Algorithms
SIMULATED ANNEALING
T = Very
High
Random Step
function
value
x
ECE 457A Adaptive and Cooperative Algorithms
SIMULATED ANNEALING
T = Very
High
function
value
x
ECE 457A Adaptive and Cooperative Algorithms
SIMULATED ANNEALING
T = Very
High
function
value
x
ECE 457A Adaptive and Cooperative Algorithms
SIMULATED ANNEALING
T = Very
High
function
value
x
ECE 457A Adaptive and Cooperative Algorithms
SIMULATED ANNEALING
T = High
function
value
x
ECE 457A Adaptive and Cooperative Algorithms
SIMULATED ANNEALING
T = High
function
value
x
ECE 457A Adaptive and Cooperative Algorithms
SIMULATED ANNEALING
T = Medium
function
value
x
ECE 457A Adaptive and Cooperative Algorithms
SIMULATED ANNEALING
T = Medium
function
value
x
ECE 457A Adaptive and Cooperative Algorithms
SIMULATED ANNEALING
T = Medium
function
value
x
ECE 457A Adaptive and Cooperative Algorithms
SIMULATED ANNEALING
T = Low
function
value
x
ECE 457A Adaptive and Cooperative Algorithms
SIMULATED ANNEALING
T = Low
function
value
x
ECE 457A Adaptive and Cooperative Algorithms
SIMULATED ANNEALING
T = Low
function
value
x
ECE 457A Adaptive and Cooperative Algorithms
SIMULATED ANNEALING
T = Low
function
value
x
ECE 457A Adaptive and Cooperative Algorithms