Transcript Document

Genetic Algorithms and Other
Nature-Inspired Metaheuristic Algorithms
Solving the Euclidean TSP
by Ant-Cycle Algorithm
Reporters:
9834502 李彥儀 9834504 鄒永珊
9834511 黃衍善 9834513 傅俊源
授課老師: 陳茂生 教授
1
2010/5/25
Agenda
•
•
•
•
•
Euclidean TSP
Ant-Cycle Algorithm
MATLAB Code & Test
Experiments Study
Experimental Results
2
Euclidean TSP
• Problem type: 5 × 5 grid problem
• Number of cities: 25-city
• Two different distances:
– 10 unit distance
– 14.142 unit distance
3
Ant-Cycle Algorithm
Initialization
Place m ants on different cities
Calculate (update) the transition probability
NO
Tabu list is full (size:n)
YES
Calculate (update) the pheromone
Empty the Tabu list
Stopping rule
NO
YES
Stop
4
MATLAB Code—
Initialization (1/2)
5
MATLAB Code—
Initialization (2/2)
6
MATLAB Code—
Place m ants on different cities
Subprogram
randperm (n)
3
Tabu list
(m × n matrix)
3
9
16
1
......
......
......
9
20
7
...
MATLAB Code—
Transition Probability
Subprogram
…
ant i
Visited cities
Unvisited cities
j-1
n-(j-1)
8
MATLAB Code—
Transition Probability
Subprogram
把未拜訪城市的index
存入J
…
ant i
Visited cities
Unvisited cities
j-1
n-(j-1)
9
MATLAB Code—
Record
Subprogram
10
MATLAB Code—
Update the Pheromone
Subprogram
11
MATLAB Code—
Print Results
Shortest_Route =
9 8 7 6 1 2 3 4 5 10 15 20 25 24 19
18 23 22 21 16 11 12 17 13 14
Shortest_Length =254.1421
cpu_time =22.9844
Subprogram
12
MATLAB Test
13
Experimental Design
辨認控制參數及其水準
設計實驗
執行實驗,收集數據
資料分析
確認實驗
14
Experiments Study (1/4)
• 選定因子:α, β, ρ, Q
• 因子水準:
• 其他參數設定: n=25, m=9, c=1, max=400
α
實驗編號
1
2
3
4
5
6
7
8
9
0
0
0
1
1
1
2
2
2
因子
β
0.1
0.5
1
0.1
0.5
1
0.1
0.5
1
ρ
0.1
0.5
0.9
0.5
0.9
0.1
0.9
0.1
0.5
Q
1
100
10000
10000
1
100
100
10000
115
Experiments Study (2/4)
value
α
1
β
1
ρ
0.9
Q
1
最佳組合
16
Experiments Study (3/4)
因子
實驗編號
1
2
3
4
5
6
7
8
9
β
1
5
10
1
5
10
1
5
10
Q
0
0
0
0.1
0.1
0.1
1
1
1
17
Experiments Study (4/4)
最佳組合
value
α
1
β
10
ρ
0.9
Q
1
18
Experimental Results
Shortest_Route =
8 9 14 13 19 18 23 24
25 20 15 10 5 4 3 2
1 6 11 16 21 22 17 12
7
Shortest_Length =254.1421
Optimal=22/25
Shortest_Route =
9 8 7 6 1 2 3 4 5 10
15 20 25 24 19 18 23 22 21
16 11 12 17 13 14
Shortest_Length =254.1421
Optimal=25/25
Thanks for your attention!!
20
References
• http://www.ooopic.com/vector/2009-224/453933.html
• http://zh.wikipedia.org/zh/MATLAB
21