Beruflich Dokumente
Kultur Dokumente
optimizAtion
1
SwArm intelligenCe
2
ChArACteriStiCS of SwArmS
3
4
5
Ant Colony optimizAtion
6
nAturAl behAvior of Ant
7
how CAn they mAnAge SuCh
greAt tASkS ?
Ants are ,
essentially blind, deaf and dumb.
social creatures – behavior directed to survival of colony
Question: how can ants find the short path to food sources?
8
ShorteSt pAth
Answer:
9
AppliCAtion
• Traveling Salesman Problem
• Vehicle routing
• Graph coloring
10
ACo SyStem -pSeuDoCoDe
Often applied to TSP (Travelling Salesman Problem): shortest
path between n nodes
Algorithm in Pseudocode:
– Initialize Trail
– Do While (Stopping Criteria Not Satisfied) – Cycle Loop
• Do Until (Each Ant Completes a Tour) – Tour Loop
• Local Trail Update
• End Do
• Analyze Tours
• Global Trail Update
– End Do
11
Algorithm
• Ant Colony Algorithms are typically use to solve minimum
cost problems.
• We may usually have N nodes and A undirected arcs
• There are two working modes for the ants: either forwards or
backwards
• The ants memory allows them to retrace the path it has
followed while searching for the destination node
• Before moving backward on their memorized path, they
eliminate any loops from it. While moving backwards, the ants
leave pheromones on the arcs they traversed.
12
Algorithm
• At the beginning of the search process, a constant amount of
pheromone is assigned to all arcs. When located at a node i an
ant k uses the pheromone trail to compute the probability of
choosing j as the next node:
τijα
if j ∈N k
=∑ τα i
pijk l∈N ik il
0 if j ∉ N i
k
13
Algorithm
• When the arc (i,j) is traversed , the pheromone value changes
as follows:
τ ij ← τ ij + ∆τ k
τ ij ← (1 − p )τ ij , ∀(i, j ) ∈ A
14
StepS for Solving A
problem by ACo
2. Represent the problem in the form of sets of components
and transitions, or by a set of weighted graphs, on which
ants can build solutions
3. Define the meaning of the pheromone trails
4. Define the heuristic preference for the ant while
constructing a solution
5. If possible implement a efficient local search algorithm for
the problem to be solved.
6. Choose a specific ACO algorithm and apply to problem
being solved
7. Tune the parameter of the ACO algorithm.
15
A simple TSP example []
[]
B C
2
[]
3
A
[]
D
C
B 3
2
[A]
A
[D]
D 4
17
How to build next sub-solution?
[A] B C
18
Iteration 2
[A,B] [B,C]
1 C 2
B
[D,A]
A
[C,D]
D 3
19
Iteration 3
[A,B,C]
[D,A,B]
C 1
B 4
[B,C,A]
3
A
[B,C,D]
2
D
20
Iteration 4
[D,A,B,C]
[C,D,A,B]
C 4
B 3
[B,C,D,A]
2
A
[A,B,C,D]
1
D
21
Path and Pheromone Evaluation
[A,B,C,D
L1 =27
1
[B,C,D,A]
L2 =25
2
[C,D,A,B]
L3 =29
3
[D,A,B,C]
4
L4 =18 Best tour
22
End of First Run
23
ADvAntAgeS AnD
DiSADvAntAgeS
For TSPs (Traveling Salesman Problem), relatively efficient
for a small number of nodes, TSPs can be solved by
exhaustive search
for a large number of nodes, TSPs are very computationally
difficult to solve exponential time to convergence
Performs better against other global optimization techniques
such as neural net, genetic algorithms, simulated annealing
Can be used in dynamic applications (adapts to changes such
as new distances, etc.)
Convergence is guaranteed, but time to convergence uncertain
24