This document summarizes an academic presentation on Ant Colony Optimization given by Adrian Wilke on January 18, 2011. It discusses the history and experiments that inspired Ant Colony Optimization algorithms. It then describes the Ant System algorithm in detail, including how it uses a transition probability formula to select the next node, updates pheromone trails, and provides the full algorithm. Finally, it briefly discusses some results from applying the Ant System to optimization problems and compares it to the later AntNet algorithm.
1. TEMPLATE: ADRIAN WILKE
Ant Colony Optimization
University of Paderborn
Bio-Inspired Networking Seminar
January 18, 2011
Adrian Wilke
2. Ant Colony Optimization
Talk focus: Routing
TEMPLATE: ADRIAN WILKE
Ant Colony Optimization - Adrian Wilke January 18, 2011 2
3. History: Double bridge experiments
[Goss et al., 1989]
TEMPLATE: ADRIAN WILKE
r = ratio of long to short branch
Ant Colony Optimization - Adrian Wilke January 18, 2011 3
4. History: Double bridge experiments
[Deneubourg et al., 1990]
TEMPLATE: ADRIAN WILKE
Analogy
Students on
a campus:
The more a
point is passed,
the more the
vegetation is
trampled.
Ant Colony Optimization - Adrian Wilke January 18, 2011 4
5. From real behaviour to artificial systems
TEMPLATE: ADRIAN WILKE
• Stigmergy: Indirect • Possible fields?
communication through Optimization problems,
modifications in environment routing
[Caro and Dorigo, 1998]
• Routing: Direct data flow
• Where to store pheromone from source to destination
in distributed systems? (Shortest path)
• Evaporation? (Pheromone • Congestion?
decreases over time) (Too much load)
Ant Colony Optimization - Adrian Wilke January 18, 2011 5
6. Introductory example
Positive feedback
TEMPLATE: ADRIAN WILKE
(a) (b) (c) (d)
Exploring Pheromone Additional Shortest
trail node path
Ant Colony Optimization - Adrian Wilke January 18, 2011 6
7. Ant System
[Dorigo et al., 1996]
TEMPLATE: ADRIAN WILKE
“A new general-purpose heuristic algorithm [...]
to solve different optimization problems”
Covered topics
• Path selection: Choice of the next node
• Updating pheromone
• Ant System algorithm
Ant Colony Optimization - Adrian Wilke January 18, 2011 7
8. Ant System: Transition probability
Path selection
TEMPLATE: ADRIAN WILKE
??
Ant Colony Optimization - Adrian Wilke January 18, 2011 8
9. Ant System: Transition probability
Choice of the next node
TEMPLATE: ADRIAN WILKE
α β
[τij (t)] ·[νij ]
α β if j ∈ alloweda
a
pij (t) = [τiy (t)] ·[νiy ] (1)
y ∈alloweda
0 otherwise
Ant Colony Optimization - Adrian Wilke January 18, 2011 9
10. Ant System: Transition probability
Choice of the next node
TEMPLATE: ADRIAN WILKE
α β
[τij (t)] ·[νij ]
α β if j ∈ alloweda
a
pij (t) = [τiy (t)] ·[νiy ] (1)
y ∈alloweda
0 otherwise
τij (t) is the intensity of trail on edge (i, j) at time t.
Ant Colony Optimization - Adrian Wilke January 18, 2011 9
11. Ant System: Transition probability
Choice of the next node
TEMPLATE: ADRIAN WILKE
α β
[τij (t)] ·[νij ]
α β if j ∈ alloweda
a
pij (t) = [τiy (t)] ·[νiy ] (1)
y ∈alloweda
0 otherwise
τij (t) is the intensity of trail on edge (i, j) at time t.
dij is the euclidean distance i − j between two nodes i and j.
1
νij = dij
is called the visibility. Smaller distance → higher visibility.
Ant Colony Optimization - Adrian Wilke January 18, 2011 9
12. Ant System: Transition probability
Choice of the next node
TEMPLATE: ADRIAN WILKE
α β
[τij (t)] ·[νij ]
α β if j ∈ alloweda
a
pij (t) = [τiy (t)] ·[νiy ] (1)
y ∈alloweda
0 otherwise
τij (t) is the intensity of trail on edge (i, j) at time t.
dij is the euclidean distance i − j between two nodes i and j.
1
νij = dij
is called the visibility. Smaller distance → higher visibility.
α is the weight of the trail (Simulation: α = 1).
β is the weight of the visibility (Simulation: β = 5).
Ant Colony Optimization - Adrian Wilke January 18, 2011 9
13. Ant System: Transition probability
Choice of the next node
TEMPLATE: ADRIAN WILKE
α β
[τij (t)] ·[νij ]
α β if j ∈ alloweda
a
pij (t) = [τiy (t)] ·[νiy ] (1)
y ∈alloweda
0 otherwise
τij (t) is the intensity of trail on edge (i, j) at time t.
dij is the euclidean distance i − j between two nodes i and j.
1
νij = dij
is called the visibility. Smaller distance → higher visibility.
α is the weight of the trail (Simulation: α = 1).
β is the weight of the visibility (Simulation: β = 5).
a
Denominator of fraction ensures that pij (t) = 1.
j∈N
Ant Colony Optimization - Adrian Wilke January 18, 2011 9
14. Ant System: Transition probability
Choice of the next node
TEMPLATE: ADRIAN WILKE
α β
[τij (t)] ·[νij ]
α β if j ∈ alloweda
a
pij (t) = [τiy (t)] ·[νiy ] (1)
y ∈alloweda
0 otherwise
τij (t) is the intensity of trail on edge (i, j) at time t.
dij is the euclidean distance i − j between two nodes i and j.
1
νij = dij
is called the visibility. Smaller distance → higher visibility.
α is the weight of the trail (Simulation: α = 1).
β is the weight of the visibility (Simulation: β = 5).
a
Denominator of fraction ensures that pij (t) = 1.
j∈N
tabua is the tabu list of nodes, which were alredy visited by the ath ant.
alloweda N − tabua is the list of nodes, which were not visited by the ath ant.
Ant Colony Optimization - Adrian Wilke January 18, 2011 9
15. Ant System: Transition probability
Choice of the next node
TEMPLATE: ADRIAN WILKE
α β
[τij (t)] ·[νij ]
... = α β
α=1
[τiy (t)] ·[νiy ]
y ∈alloweda
β=5
Greedy:
??
Ant Colony Optimization - Adrian Wilke January 18, 2011 10
16. Ant System: Transition probability
Choice of the next node
TEMPLATE: ADRIAN WILKE
α β
[τij (t)] ·[νij ]
... = α β
α=1
[τiy (t)] ·[νiy ]
y ∈alloweda
β=5
Greedy:
??
(Image source: [Dorigo et al., 1996])
Ant Colony Optimization - Adrian Wilke January 18, 2011 10
17. Ant System
Updating pheromone
TEMPLATE: ADRIAN WILKE
S S
?
? S
D D D
Ant Colony Optimization - Adrian Wilke January 18, 2011 11
18. Ant System
Updating pheromone
TEMPLATE: ADRIAN WILKE
Q
a La if ath ant uses edge (i, j) in its tour
∆τij = (2)
0 otherwise
Q is a constant, “its influence was found to be negligible.”
La is the length of the tour of the ath ant.
Ant Colony Optimization - Adrian Wilke January 18, 2011 12
19. Ant System
Updating pheromone
TEMPLATE: ADRIAN WILKE
Q
a La if ath ant uses edge (i, j) in its tour
∆τij = (2)
0 otherwise
Q is a constant, “its influence was found to be negligible.”
La is the length of the tour of the ath ant.
m
a
∆τij = ∆τij (3)
a=1
Ant Colony Optimization - Adrian Wilke January 18, 2011 12
20. Ant System
Updating pheromone
TEMPLATE: ADRIAN WILKE
Q
a La if ath ant uses edge (i, j) in its tour
∆τij = (2)
0 otherwise
Q is a constant, “its influence was found to be negligible.”
La is the length of the tour of the ath ant.
m
a
∆τij = ∆τij (3)
a=1
τij (t + n) = ρ · τij (t) + ∆τij (4)
ρ ρ < 1 is a constant , which represents the evaporation of trail.
Ant Colony Optimization - Adrian Wilke January 18, 2011 12
21. Ant System
Algorithm: All together
TEMPLATE: ADRIAN WILKE
Require: NCMAX
NC ← 0 and t ← 0 and s ← 1
∆τij ← 0
τij (t) ← c
shortestTour ← ∞
for all ants a = 1 to m do
tabua (s) = choose start node
end for
Ant Colony Optimization - Adrian Wilke January 18, 2011 13
22. Ant System
Algorithm: All together
TEMPLATE: ADRIAN WILKE
Require: NCMAX
NC ← 0 and t ← 0 and s ← 1
∆τij ← 0
τij (t) ← c
shortestTour ← ∞
for all ants a = 1 to m do
tabua (s) = choose start node
end for
repeat { // Each cycle
repeat
s ←s +1
for all ants a = 1 to m do
a
move a to next node j by pij (t)
insert node j in tabua (s)
end for
until s = n
Ant Colony Optimization - Adrian Wilke January 18, 2011 13
23. Ant System
Algorithm: All together
TEMPLATE: ADRIAN WILKE
Require: NCMAX for all ants a = 1 to m do
NC ← 0 and t ← 0 and s ← 1 compute length La of tabua
∆τij ← 0 shortestTour ← update(tabua , La )
τij (t) ← c end for
shortestTour ← ∞
for all edges (i, j) and all ants a = 1 to m do
for all ants a = 1 to m do compute ∆τij a
tabua (s) = choose start node compute ∆τij
end for end for
repeat { // Each cycle for all edges (i, j) do
compute τij (t + n)
repeat ∆τij ← 0
s ←s +1 end for
for all ants a = 1 to m do
a
move a to next node j by pij (t)
insert node j in tabua (s)
end for
until s = n
Ant Colony Optimization - Adrian Wilke January 18, 2011 13
24. Ant System
Algorithm: All together
TEMPLATE: ADRIAN WILKE
Require: NCMAX for all ants a = 1 to m do
NC ← 0 and t ← 0 and s ← 1 compute length La of tabua
∆τij ← 0 shortestTour ← update(tabua , La )
τij (t) ← c end for
shortestTour ← ∞
for all edges (i, j) and all ants a = 1 to m do
for all ants a = 1 to m do compute ∆τij a
tabua (s) = choose start node compute ∆τij
end for end for
repeat { // Each cycle for all edges (i, j) do
compute τij (t + n)
repeat ∆τij ← 0
s ←s +1 end for
for all ants a = 1 to m do
a
move a to next node j by pij (t) NC ← NC + 1 and t ← t + n
insert node j in tabua (s) move a to tabua (1) and clear tabua (2 . . . n)
end for
until s = n } until NC < NCMAX and no stagnation
return shortestTour
Ant Colony Optimization - Adrian Wilke January 18, 2011 13
25. Ant System
Some results
TEMPLATE: ADRIAN WILKE
• Oliver30 problem
(30 nodes TSP)
• Columns: basic
heuristic and
improvements
• Entries: Solutions
• Ant System outperformed 2-opt
But: Longer computational time
• Best-known solution in less than 400 cycles,
100 cycles for values under 430
• As effective or better than some general-purpose heuristics
Ant Colony Optimization - Adrian Wilke January 18, 2011 14
26. From Ant System to AntNet
TEMPLATE: ADRIAN WILKE
Ant System AntNet
• Focus: General-purpose • Focus: Internet Protocol
heuristic with irregular topology
• Global data structure • Routing table
Ant Colony Optimization - Adrian Wilke January 18, 2011 15
27. AntNet: Data structures
[Caro and Dorigo, 1998]
TEMPLATE: ADRIAN WILKE
Routing table Traffic model Queues
destinations destinations low priority
mean
neighbours
variance - data packets
time - forward ants
high priority
probabilistic
traffic distribution
desirability backward ants
node identifiers s k x
elapsed time 0 5 8 x
Ant Colony Optimization - Adrian Wilke January 18, 2011 16
28. AntNet
Algorithm in short
TEMPLATE: ADRIAN WILKE
• At time intervals: Forward ant is launched to a destination
Choice of destination: Data flow to possible targets
• Next node on a tour is chosen by
the routing table entries and queue lengths of neighbours
• At nodes on path, forward ant memorizes
the current node ID and the time from source node
• At a destination the forward ant is destroyed and a
backward ant is launched
• Backward ants use the known paths back and
update the routing table entries and
the traffic model on path nodes
Ant Colony Optimization - Adrian Wilke January 18, 2011 17
29. From AntNet to Mobile ad hoc networks
TEMPLATE: ADRIAN WILKE
AntNet
• Introduced: Routing tables
• Approach works for IP
• What about dynamic networks
with leaving nodes
Ant Colony Optimization - Adrian Wilke January 18, 2011 18
30. From AntNet to Mobile ad hoc networks
TEMPLATE: ADRIAN WILKE
AntNet MANETs
• Introduced: Routing tables • Mobile ad hoc networks
• Approach works for IP • Restriction:
Limited bandwidth
• No central component,
no fixed infractructure
• Dynamic structure:
Nodes are joining
and leaving
→ Paths can
become useless
• What about dynamic networks
with leaving nodes
Ant Colony Optimization - Adrian Wilke January 18, 2011 18
31. AntHocNet
[Di Caro et al., 2005]
TEMPLATE: ADRIAN WILKE
An approach for MANETs
• Hybrid approach:
• Reactive path setup phase
• Proactive maintenance
• Also of interest:
• Pheromone updates
Ant Colony Optimization - Adrian Wilke January 18, 2011 19
32. AntHocNet
Reactive path setup
TEMPLATE: ADRIAN WILKE
• Node s wants to reach d • Same generation: only best
• Unicast, if pheromone • First hop different:
available. Else: broadcast Acceptance factor 0.9
Ant Colony Optimization - Adrian Wilke January 18, 2011 20
33. AntHocNet
Pheromone updates
TEMPLATE: ADRIAN WILKE
Pheromone calculated by backward ants
using a known Path P
Mathematical Informal
ˆi ˆi i
Tmac = α · Tmac + (1 − α) · tmac Time to send a packet form a
node i (Running average)
ˆi i ˆi
Ti+1 = (Qmac + 1) · Tmac Time for packets in queue (+1)
ˆ n−1 ˆ i
TP = i=1 Ti+1 Time for whole path
ˆ
T i +h·T
i
τd = d 2 hop Consider unloaded conditions
i i
Tnd = γ · Tnd + i
(1 − γ) · τd Final routing table entry
(Running average)
Ant Colony Optimization - Adrian Wilke January 18, 2011 21
34. AntHocNet
Proactive probing & exploration
TEMPLATE: ADRIAN WILKE
• No broadcast:
• Probe of path
• Broadcast:
• Improve paths
• Path variations
Ant Colony Optimization - Adrian Wilke January 18, 2011 22
35. AntHocNet
Proactive maintenance
TEMPLATE: ADRIAN WILKE
HelloMessages Link failures
• Every 1 sec: HelloMessage • Neighbors which lost best
(Just senders address) path: Also broadcast
• Received HelloMessage LinkFailureNotification
→ Add in routing table Failed transmission
Link failures • Broadcast PathRepairAnt
• 2 HelloMessages missing: (like reactive forward ant)
• Remove from routing table • But: Max. 2 broadcasts
• Broadcast
LinkFailureNotification
• LinkFailureNotification: List
of destinations to which best
path lost & new best delay
Ant Colony Optimization - Adrian Wilke January 18, 2011 23
36. AntHocNet
Proactive maintenance
TEMPLATE: ADRIAN WILKE
HelloMessages Link failures
• Every 1 sec: HelloMessage • Neighbors which lost best
(Just senders address) path: Also broadcast
• Received HelloMessage LinkFailureNotification
→ Add in routing table Failed transmission
Link failures • Broadcast PathRepairAnt
• 2 HelloMessages missing: (like reactive forward ant)
• Remove from routing table • But: Max. 2 broadcasts
• Broadcast
LinkFailureNotification Task for you:
• LinkFailureNotification: List • Count the broadcasts
of destinations to which best on this page!
path lost & new best delay
Ant Colony Optimization - Adrian Wilke January 18, 2011 23
37. From AntHocNet to HOPNET
TEMPLATE: ADRIAN WILKE
AntHocNet HOPNET
• Reactive path setup phase • Hybrid approach
• Proactive maintenance • Avoid overhead and
• Results: Better than AODVa achieve scalability
except for overhead • Idea: Use Zones
• Inside zones:
Proactively maintained
• Between zones:
Reactive part, on demand
a
AODV: Ad-hoc on-demand distance vector routing,
“reference algorithm in area”
Ant Colony Optimization - Adrian Wilke January 18, 2011 24
38. HOPNET: Routing tables
[Wang et al., 2009]
TEMPLATE: ADRIAN WILKE
Intrazone routing table Interzone routing table
• Inside zones • Between zones
• Proactively maintained • Reactive part, on demand
• Size: Nodes in zone × • Used, if destination not in
Node degree (neighbours) Intrazone routing table
Pheromone Destination
Visited times Sequence number
Hops Between node and Path
nodes in zone Expire
Sequence number
Incremented each time
f./b.-ants are generated
Ant Colony Optimization - Adrian Wilke January 18, 2011 25
39. HOPNET example
TEMPLATE: ADRIAN WILKE
S wants to send data to T.
(Reworked example from paper)
Ant Colony Optimization - Adrian Wilke January 18, 2011 26
40. HOPNET example
TEMPLATE: ADRIAN WILKE
T not in zone.
S sends external forward ant to pheripheral nodes.
Ant Colony Optimization - Adrian Wilke January 18, 2011 27
41. HOPNET example
TEMPLATE: ADRIAN WILKE
D sends external forward ant to K and M,
the other ants are destroyed.
Ant Colony Optimization - Adrian Wilke January 18, 2011 28
42. HOPNET example
TEMPLATE: ADRIAN WILKE
M sends external forward ant to pheripheral nodes,
except of S and A.
Ant Colony Optimization - Adrian Wilke January 18, 2011 29
43. HOPNET example
TEMPLATE: ADRIAN WILKE
T is in intrazone routing tables.
Two paths were found.
A backward ant is launched.
Ant Colony Optimization - Adrian Wilke January 18, 2011 30
44. HOPNET: Pheromone updates I
Source update algorithm
TEMPLATE: ADRIAN WILKE
Internal forward ants update pheromone during movement
vs
Vs Vi Vj vi
vl
ϕ(vi , vs ) = ϕ(vi , vs ) +
T (vs , vi ) + w (vi , vj )
constant
Pheromone(neighbor , source)+ =
time(vs , vi ) + timeOnLink
ϕ(vl , vs ) = ϕ(vl , vs ) · (1 − E ), ∀ l = i
Ant Colony Optimization - Adrian Wilke January 18, 2011 31
45. HOPNET: Pheromone updates II
Updates by backward ants
TEMPLATE: ADRIAN WILKE
Backward ants update pheromone
vD
vb VS Vk Vb VD
vl
ϕ(vb , vD ) = ϕ(vb , vD ) +
T (vS , vD ) − T (vS , vk )
ϕ(vl , vD ) = ϕ(vl , vD ) · (1 − E ), ∀ l = b
Ant Colony Optimization - Adrian Wilke January 18, 2011 32
46. HOPNET
Results: Overhead and Scalability
TEMPLATE: ADRIAN WILKE
Ant Colony Optimization - Adrian Wilke January 18, 2011 33
47. Ant Colony Optimization
Summary
TEMPLATE: ADRIAN WILKE
Overview
• History: Double bridge experiments
• Ant System: First approach
• AntNet: Wired IP networks
• AntHocNet: First MANET approach
• HOPNET: MANET with zones
To take away
• Stigmergy: Indirect communication through
modifications in environment
• Routing table for pheromone
• Proactive and reactive parts
Ant Colony Optimization - Adrian Wilke January 18, 2011 34
48. Thank you for your attention
TEMPLATE: ADRIAN WILKE
1
1
Source: http://xkcd.com/638/, Found: http://www.idsia.ch/˜gianni/
Ant Colony Optimization - Adrian Wilke January 18, 2011 35
49. References I
TEMPLATE: ADRIAN WILKE
[Bonabeau et al., 1999] Bonabeau, E., Dorigo, M., and Theraulz, G. (1999).
Swarm Intelligence.
Oxford University Prress.
[Caro and Dorigo, 1998] Caro, G. D. and Dorigo, M. (1998).
AntNet: Distributed Stigmergetic Control for Communications Networks.
Journal of Artificial Intelligence Research, 9:317–365.
[Deneubourg et al., 1990] Deneubourg, J.-L., Aron, S., Goss, S., and Pasteels, J. M. (1990).
The Self-Organizing Exploratory Pattern of the Argentine Ant.
Journal of lnsect Behavior, 3(2).
[Di Caro et al., 2005] Di Caro, G., Ducatelle, F., and Gambardella, L. M. (2005).
AntHocNet: an adaptive nature-inspired algorithm for routing in mobile ad hoc networks.
European Transactions on Telecommunications, 16(5):443–455.
[Dorigo et al., 1996] Dorigo, M., Maniezzo, V., and Colorni, A. (1996).
Ant system: optimization by a colony of cooperating agents.
Systems, Man, and Cybernetics, Part B: Cybernetics, IEEE Transactions on, 26(1):29–41.
[Dorigo and Stutzle, 2004] Dorigo, M. and Stutzle, T. (2004).
¨ ¨
Ant Colony Optimization.
MIT press.
Ant Colony Optimization - Adrian Wilke January 18, 2011 36
50. References II
TEMPLATE: ADRIAN WILKE
[Dressler and Akan, 2010] Dressler, F. and Akan, O. B. (2010).
A survey on bio-inspired networking.
Computer Networks, 54(6):881–900.
[Goss et al., 1989] Goss, S., Aron, S., Deneubourg, J. L., and Pasteels, J. M. (1989).
Self-organized Shortcuts in the Argentine Ant.
Naturwissenschaften, 76:579–581.
[Wang et al., 2009] Wang, J., Osagie, E., Thulasiraman, P., and Thulasiram, R. K. (2009).
HOPNET: A hybrid ant colony optimization routing algorithm for mobile ad hoc network.
Ad Hoc Networks, 7(4):690–705.
Ant Colony Optimization - Adrian Wilke January 18, 2011 37