GP - Ant Colony Optimization
GP - Ant Colony Optimization
Presentation Flow
Introduction
Numerical Examples
Conclusions
References
Introduction
Soft computing
Introduction Contd
Ant Colony Algorithm (ACA)
Application Areas
Vehicle Routing,
Sequential Ordering,
Graph Coloring,
Routing Communication Networks etc.
Introduction Contd
What do Foraging ants and long distance truck drivers have in
common??
But while ants invariably take the shortest path to their destinations, human
counterparts often choose a more circuitous route.
So, thanks to the new algorithm ACA (Ant Colony Algorithm) that imitates
insect behavior, trucks can be as efficient as ants.
Introduction Contd
Insects that live in colonies - ants, bees, wasps, termites have long
fascinated everyone from naturalists to artists.
Each insect in a colony seems to have its own agenda and yet the group as
a whole is highly organized.
Ants behavior is unsophisticated and they collectively perform complex
tasks. Ants have highly developed sophisticated sign based stigmergy.
Introduction Contd
When a food source is found, the ant that discovered it communicate this
information to its peers, who thus follow that insects pheromone trail.
As more and more ants travel to the food source the pheromone track
becomes thicker and thicker attracting more and more ants who in turn
deposit their own pheromone and so on.
When confronted to the obstacle (Fig.1) on the preferred path, the ants
quickly switch to the next most efficient line to the food.
A high level of pheromone on the right path gives the ant stronger stimulus
and has higher probability to turn right.
Introduction Contd
Introduction Contd
Consider A is the food source, E is the nest and an obstruction HBCD. The
distances of various points are shown in Fig.2.
Introduction Contd
At T = 0,
60 ants at B and 60 at D on the average 30 ants from each node will go
towards H and 30 towards C.
At T=1,
The new 60 ants that come to B from A find a trail of intensity 30 on the
path that leaves to H laid by 30 ants that went the way from B and trail of
intensity 30 on path to C obtained as sum of trail laid by 30 ants that went
all way from B and 30 ants coming from D via C.
The probability of choosing the path is based so that expected number of
ants going towards C is double towards it.
The process continues like all the ants will eventually choose the shortest
path.
10
Each are assigned a value dij, which is the length of the arc (i, j) A in the
distance between cities i, j with (i, j) N.
The TSP is the problem of finding a minimal length Hamiltonian circuit of the
graph, where an Hamiltonian circuit is a closed tour visiting exactly once
each of the n N nodes of G.
11
TSP Contd
For symmetric TSPs, the distances between the cities are independent of
the direction of traversing the arcs, that is dij=dji for every pair of nodes.
And in asymmetric TSP (ATSP) at least for one pair of node i, j,
we have, dij dji.
12
TSP Contd
Maximize the linear objective function
X ij d ij
n
(1)
j 1
Subject to
X ij 1
n
i 1,i j
X ij 1
n
i 1,i j
X ij 0
(2)
(3)
(4)
13
14
ACA Contd
If the ant K has visited some cities already, this memory is called tabu list.
The ant decision table [aij(t)]/i of node i' is given by
t t
t
t
aij
ij
i i
ij
ij
(5)
ij
ACA Contd
The probability with which ant K chooses to go from city i to city j
while building its tour at the tth iteration is
p t
k
ij
aij t
k ail t
(6)
l i
where
ik i
16
ACA Contd
After ants have completed the tour, pheromone evaporation of arcs is
triggered and then each ant K deposits a quantity of pheromone ijk t on
each arc it has used as
1 Lk t
t
0
k
ij
if i, j T k t
if i, j T k t
(7)
ij 1 ij t ij t
(8)
17
ACA Contd
Where
ij t ijk t
m
k 1
(9)
= 1 and = 2 to 5.
18
GA Contd
A
20
GA Contd
If the mth ant produces Tk shortest path and two cross-sites are selected at
random and the cities in between the cross-sites are inverted (Fig.3).
All the bits are compressed and the bits between the two cross-sites are
written at the end (Fig.4).
Once the shortest path is obtained by the above three methods, each city is
chosen and positioned at different locations without changing the order of
the other cities and the shortest path is found.
21
22
23
24
Step-8:
Once the shortest path is obtained by the above three methods, each city
is chosen and positioned at different locations without changing the order
of the other cities and the shortest path is found
25
Numerical Examples
Examples
Problem 1 Un symmetric TSP (dij dji)
Five cities 1,2,3,4,5 and the distances between are given in table.
Answer 15
Cities
26
Examples Contd
Step 1
27
Examples Contd
Step 2
s=1; k=1. Place the ant 1 at node 1 the probabilities of choosing the
shortest path by that ant is shown below
1
since p15 is the highest and 1 moves to 5 and tabu list is
5
28
Examples Contd
Step 3
Place the ant at 5 and let us calculate the probability matrix as shown
below
Now p53 is the highest and the ant moves from city 5 to 3 and the tabu
1
list, is 5
3
29
Examples Contd
Place the ant at 3 and calculate the probabilities to the paths and the
matrix is shown below
Now p34 is the highest and the ant at 3 moves to 2 and the tabu list is
1
5
3
4
Place the ant at 4 and it can go to only city 2 and the path is 1 - 5 - 3 - 4 2 - 1 and the distance of the path taken by the ant is
1 + 2 + 4 + 4 + 6 = 17
30
Examples Contd
ij
Step 4
is calculated from (7) as 1/17=0.06
ij
31
Examples Contd
Step 5
Now is updated using (8) as
32
Examples Contd
If the bits are compressed between the cross sites we get 5 1 4 2
3 5 and the length of the route 1 + 7 + 4 + 3 + 7 = 22.
The shortest of all the three in the first iteration is 17 and if it goes for
many iterations this converges to 15 and the path is given as 5-1-2-3-4-5
and the shortest length is 15.
33
Examples Contd
Problem 2: answer 179
net
179
34
Examples Contd
Problem 3: answer 45 1-7-2-6-4-3-5-1 (un symmetric tsp) using ants
net
42 3-5-2-6-4-1-7-3
35
Examples Contd
Problem 4: answer 190 2-3-1-4-7-6-5-2 (symmetric tsp) using ants net
190 2-3-1-4-7-6-5-2
36
Examples Contd
Problem 5: answer 73.07
net
73.07
37
Examples Contd
Problem 6: answer 33.8
using ants net
33.8
38
Examples Contd
TABLE. 1 EXAMPLE PROBLEMS FROM TSPLIB95
(Values given in brackets are given in TSPLIB95)
39
Conclusions
40
References
1.
2.
3.
4.
Reinelt,G.,
http://www.iwr.uni-heidelberg.de/groups/comopt/software/TSPLIB95,
1994.
41