You are on page 1of 30

Department of Computer Science & Engineering, RGMCET Department of Computer Science & Engineering, RGMCET

An Ant Colony Algorithm


Optimization
By
Natural behavior of ants have inspired scientists to mimic insect
operational methods to solve real-life complex problems
By observing ant behavior, scientists have begun to understand
their means of communication
Ant-based behavioral patterns to address combinatorial
problems - first proposed by Marco Dorigo
REAL ANT BEHAVIOR
Ants secrete pheromone while
traveling from the nest to food,
and vice versa in order to
communicate with one another to
find the shortest path
EXPERIMENTAL STUDY OF ANTS
The more ants follow a trail, the more attractive that trail
becomes for being followed
NEST FOOD
NEST FOOD NEST FOOD
ANT Behavior
The more ants follow a trail, the more attractive that trail
becomes for being followed
ANT Behavior
Even when the tracks are equal the behavior will encourage one
over the other--convergence (Deneubourg et al)
ROUTE SELECTION
Ants are forced to decide whether they should go left or right, and
the choice that is made is a random decision
Pheromone accumulation is faster on the shorter path
The difference in pheromone content between the two paths over
time makes the ants choose the shorter path
Positive feedback mechanism to arrive at the shortest route while
foraging
Stygmergy or stigmergetic model of communication
Different optimization problems have been explored using a
simulation of this real ant behavior
REAL vs. ARTIFICIAL ANTS
Discrete time steps
Memory Allocation
Quality of Solution
Time of Pheromone
deposition
Distance Estimation
REAL ANT ARTIFICIAL ANT
Department of Computer Science &
Engineerig, RGMCET
THE ANT COLONY
OPTIMIZATION
METAHEURISTIC
GOAL OF ACO HEURISTIC
Artificial ants form a multi-agent system performing the
functions as observed in the real ant system
Exploit stigmergistic communication
The ACO meta-heuristic relies on the co-operation of a
group of artificial ants to obtain a good solution to a
discrete optimization problem such as the TSP
Artificial ants are mutants of a real ant system
The resulting shortest route mapping determined by the agents
can be applied to the optimization problem
ACO CHARACTERISTICS
Exploit a positive feedback mechanism
Demonstrate a distributed computational architecture
Exploit a global data structure that changes dynamically as
each ant transverses the route
Has an element of distributed computation to it involving the
population of ants
Involves probabilistic transitions among states or rather
between nodes
Department of Computer Science &
Engineerig, RGMCET
FLOWCHART OF ACO
Have all
cities been
visited
Have the
maximum
Iterations been
performed
START ACO
Locate ants randomly
in cities across the
grid and store the
current city
in a tabu list
Determine probabilistically
as to which city to visit next
Move to next city and
place this city in the
tabu list
Record the length of
tour and clear tabu list
Determine the shortest
tour till now and
update pheromone
NO
YES
STOP
ACO
YES NO
Department of Computer Science &
Engineerig, RGMCET
KEY PARAMETERS
Trail intensity is given by value of X
ij
which indicates the intensity of
the pheromone on the trail segment, (ij)
Trail visibility is L
ij
= 1/d
ij
The importance of the intensity in the probabilistic transition is E
The importance of the visibility of the trail segment is F
The trail persistence or evaporation rate is given as V
Q is a constant and the amount of peromone laid on a trail
segment employed by an Ant; this amount may be modified in
various manners
Department of Computer Science &
Engineerig, RGMCET
PROBABILISTIC CITY SELECTION
Helps determine the city to visit next while the ant is in a tour
Determined by variables such as the pheromone content in an
edge (i,j) at time instant t, heuristic function of the desirability of
adding edge, and their control parameters
? A ? A
? A ? A
) (
) (
0
) (
) (
) (
) (
i J j f
i J j if
t
t
t p
k
k
il il
ij ij
k
ij
i
k
J l
Z

,
|
=

o
o
g X
g X
Department of Computer Science &
Engineerig, RGMCET
PHEROMONE UPDATING
Using the tour length for the k-th Ant, L
k
, the quantity of pheromone
added to each edge belonging to the completed tour is given by


t T j i edge if
t T j i edge where
L
Q
t
k
k
k
k
ij

,
A
) , (
) , (
0
X
) ( ) ( ) 1 ( ) 1 ( t t t
ij ij ij
X X V X A + +
The pheromone decay in each edge of a tour is given by
Department of Computer Science &
Engineerig, RGMCET
Ant Colony Optimization
An adaptative nature inspired algorithm
explaination
Concretely implementation
Department of Computer Science &
Engineerig, RGMCET
The ants
The double bridge experiment
From biological ants to agents
Java Implementation
Demonstration 1
The different moves of the ants
Demonstration 2
Adaptation of the Ants-based algorithm to routing protocols
ACO compared to RIP and OSPF
Examples of effective implementations
Results of the analysed reports
Questions
Plan
Department of Computer Science &
Engineerig, RGMCET
The ants
Can explore vast areas without global view of the
ground.
Can find the food and bring it back to the nest.
Will converge to the shortest path.
Department of Computer Science &
Engineerig, RGMCET
How can they manage such great
tasks?
By leaving pheromones behind them.
Wherever they go, they let pheromones behind here, marking
the area as explored and communicating to the other ants that
the way is known stigmergistic communication.
Double Bridge experiment
Department of Computer Science &
Engineerig, RGMCET
From biological ants to ant-agent
Distributed process:
local decision-taking
Autonomous
Simultaneous
Macroscopic development from microscopic probabilistic
decisions
Problem: adaptation to reality
Department of Computer Science &
Engineerig, RGMCET
From biological ants to ant-agent
Solution:
Pheromone upgrade: evaporation.
Ant aging: after a given time, ants are tired and have to
come back to the nest.
2 different pheromones : away (from nest) and back (from
source of food).
Department of Computer Science &
Engineerig, RGMCET
Java Implementation
Object modeling:
Definition of the objects:
Ant
Playground
Traces
Playground: central object, contains a list of ants, an array
of traces. Manages the processes and the graphical output.
Ant: can move by itself, according to the traces around it
and a random decision.
Traces: amount of pheromones of 2 types, Away and Back.
Department of Computer Science &
Engineerig, RGMCET
Demonstration 1
2-Bridge Experiment
Interesting Convergence
Department of Computer Science &
Engineerig, RGMCET
Double Bridge experiment
Food
Department of Computer Science &
Engineerig, RGMCET
Possible moves of Ants
Four types:
From home to food
Goal has never been reached: moveStraightAwayFromAway();
Goal reached: moveTowardAway();
Back to home
Goal has never been reached: moveFromFoodToHome();
Goal reached: moveFromHomeToFood();
Idea: generates several random moves and see which one is the best among
them.
Department of Computer Science &
Engineerig, RGMCET
Demonstration 2
A difficult playground
Department of Computer Science &
Engineerig, RGMCET
Adaptation of the Ants-based
algorithm to routing protocols
E
D
B
A
F
C
Nest
Food
Ants will start from A the nest and look for D the food. At every step, they
will upgrade the routing tables and as soon as the first one reaches the food,
the best path will be known, thus allowing communication from D to A.
Department of Computer Science &
Engineerig, RGMCET
ACO Compared to RIP and OSPF
RIP / OSPF:
Transmit routing table or flood LSPs at regular interval
High routing overhead
Update the entire table
Based on transmission time / delay
ACO algorithm:
Can be attached to data
Frequent transmissions of ants
Low routing overhead
Update an entry in a pheromone table independently
Department of Computer Science &
Engineerig, RGMCET
Questions ?
Department of Computer Science &
Engineerig, RGMCET
Thank you !