Professional Documents
Culture Documents
10.d Ant
10.d Ant
10.d Ant
Outline :
http://www.scs.carleton.ca/~arpwhite/courses/95590Y/notes/SI%20Lecture%203.pdf
http://www.scs.carleton.ca/~arpwhite/courses/95590Y/notes/SI%20Lecture%203.pdf
http://www.scs.carleton.ca/~arpwhite/courses/95590Y/notes/SI%20Lecture%203.pdf
http://www.scs.carleton.ca/~arpwhite/courses/95590Y/notes/SI%20Lecture%203.pdf
http://www.scs.carleton.ca/~arpwhite/courses/95590Y/notes/SI%20Lecture%203.pdf
http://www.scs.carleton.ca/~arpwhite/courses/95590Y/notes/SI%20Lecture%203.pdf
Natural behavior of an ant
Foraging modes
to each link, (i, j), of the corresponding path; Lk(t) is the length of the path
constructed by ant k at time step t.
Travelling Salesman Problem (TSP)
• Problem is NP-hard
• Classical combinatorial
optimization problem to
test.
ACO for the Traveling Salesman Problem
Discrete Graph
Ant move from one city i to the next j with some transition probability.
B
A
C
Ant Systems Algorithm for TSP
Initialize
No
Update pheromone level using the tour cost for each ant
No
Stopping
criteria
yes
K ij (t ) for each edge that it has used. depends on how well the ant
has performed.
•Pheromone: k
i,j
•Memory: MK or TabuK
[]
A
B
2
[]
C
3
[]
4
D
E []
[A] [B]
2
1
A
B
[C]
[D] [E]
4 D 5
E
How to build next sub-solution?
[A]
1
A
[A]
B
[A]
[ ij ( t )] [ ijC ]
if j allowed k
pijk ( t ) 1 [A,D]
[ ik ( t )] [ ik ]
kallowed
[A] k
0 1 otherwise
1
D
E
Iteration 2
[E,A] [C,B]
5
3
A
B
[B,C]
2
C
[A,D]
[D,E]
D 4
E
Iteration 3
[D,E,A] [E,A,B]
4
5
A
B
[A,D,C]
1
C
[B,C,D]
[C,B,E]
2
D 3
E
Iteration 4
[B,C,D,A] [D,E,A,B]
2 4
A
B
[E,A,B,C]
5
C
[C,B,E,D]
[A,DCE]
3
D 1
E
Iteration 5
[C,B,E,D,A] [A,D,C,E,B]
1
3
A
B
[D,E,A,B,C]
4
C
[E,A,B,C,D]
[B,C,D,A,E]
5
D
E 2
Path and Pheromone Evaluation
[A,D,C,E,B]
Q
if ( i , j ) tour
L1 =300 ik, j Lk
0
1 otherwise
[B,C,D,A,E]
L2 =450
2
[C,B,E,D,A]
total
3 A ,B
1
A ,B
L3 =2602
A ,B 3
A ,B 4
A ,B 5
A ,B
[D,E,A,B,C]
L4 =280
4
[E,A,B,C,D]
L5 =420
5
End of First Run
[ ij (Update t )]tabu [(s)ij ]
allowed k
k
Tabu list management
if j
pijk ( t ) [[ ( tik
)] ([t
)]
] [ ik ]
Choose the city j to move
ij ij
kallowed
if j allowed
to. Use probability
p ( t ) [ k ( t )] [ ]
k
k
ij ik ik
kallowedk
0
Move k-th ant to town j.
0 otherwise otherwise
Insert town j in tabu (s) k
ij ( t n ) ij ( t ) ij
For every =edge (i,j)
Compute ij ( t n ) ij ( t ) ij
For k:=1 to m do
Q
if ( i , j ) tour described by tabuk
k
i, j Lk
0
Q otherwise
k
i,j Lk
Yes
0
Set t = t + n; NC=NC+1; ∆τij=0 NC<NCmax
&& not
otherwise stagn.
No
End
Stopping Criteria
• Stagnation
• Max Iterations
General ACO