2. 2
Outline
1. Biological inspiration of ACO
2. Solving NP-hard combinatorial problems
3. The ACO metaheuristic
4. ACO for the Traveling Salesman Problem
3. 3
Outline
1. Biological inspiration of ACO
2. Solving NP-hard combinatorial problems
3. The ACO metaheuristic
4. ACO for the Traveling Salesman Problem
12. 12
Outline
1. Biological inspiration of ACO
2. Solving NP-hard combinatorial problems
3. The ACO metaheuristic
4. ACO for the Traveling Salesman Problem
15. 15
Combinatorial optimization
Π = (S, f, Ω) – problem instance
• S – set of candidate solutions
• f – objective function
• Ω – set of constraints
• – set of feasible solutions (with
respect to Ω)
• Find globally optimal feasible solution s*
SS ⊆
~
16. 16
NP-hard combinatorial problems
• Cannot be exactly solved in polynomial
time
• Approximate methods – generate near-
optimal solutions in reasonable time
• No formal theoretical guarantees
• Approximate methods = heuristics
18. 18
Constructive algorithms
• Add components to solution incrementally
• Example – greedy heuristics:
add solution component with best heuristic
estimate
19. 19
Local search
• Explore neighborhoods of complete
solutions
• Improve current solution by local changes
– first improvement
– best improvement
20. 20
What is a metaheuristic?
• A set of algorithmic concepts
• Can be used to define heuristic methods
• Applicable to a wide set of problems
21. 21
Examples of metaheuristics
• Simulated annealing
• Tabu search
• Iterated local search
• Evolutionary computation
• Ant colony optimization
• Particle swarm optimization
• etc.
22. 22
Outline
1. Biological inspiration of ACO
2. Solving NP-hard combinatorial problems
3. The ACO metaheuristic
4. ACO for the Traveling Salesman Problem
24. 24
ACO metaheuristic
• A colony of artificial ants cooperate in
finding good solutions
• Each ant – simple agent
• Ants communicate indirectly using
stigmergy
25. 25
Combinatorial optimization
problem mapping (1)
• Combinatorial problem (S, f, Ω(t))
• Ω(t) – time-dependent constraints
Example – dynamic problems
• Goal – find globally optimal feasible
solution s*
• Minimization problem
• Mapped on another problem…
26. 26
Combinatorial optimization
problem mapping (2)
• C = {c1, c2, …, cNc} – finite set of
components
• States of the problem:
X = {x = <ci, cj, …, ch, …>, |x| < n < +∞}
• Set of candidate solutions:
XS ⊆
27. 27
Combinatorial optimization
problem mapping (3)
• Set of feasible states:
• We can complete into a solution
satisfying Ω(t)
• Non-empty set of optimal solutions:
XX ⊆
~
Xx
~
∈
SXS
~*
⊆
29. 29
Combinatorial optimization
problem mapping (5)
• Cost g(s, t) for each
• In most cases – g(s, t) ≡ f(s, t)
• GC = (C, L) – completely connected graph
• C – set of components
• L – edges fully connecting the
components (connections)
• GC – construction graph
Ss∈
Ss
~
∈∀
31. 31
Construction graph
• Each component ci or connection lij have
associated:
heuristic information
pheromone trail
32. 32
Heuristic information
• A priori information about the problem
• Does not depend on the ants
• On components ci – ηi
• On connections lij – ηij
• Meaning:
cost of adding a component to the current
solution
33. 33
Pheromone trail
• Long-term memory about the entire
search process
• On components ci – τi
• On connections lij – τij
• Updated by the ants
34. 34
Artificial ant (1)
• Stochastic constructive procedure
• Builds solutions by moving on GC
• Has finite memory for:
– Implementing constraints Ω(t)
– Evaluating solutions
– Memorizing its path
35. 35
Artificial ant (2)
• Has a start state x
• Has termination conditions ek
• From state xr moves to a node from the
neighborhood – Nk
(xr)
• Stops if some ek are satisfied
36. 36
Artificial ant (3)
• Selects a move with a probabilistic rule
depending on:
Pheromone trails and heuristic information of
neighbor components and connections
Memory
Constraints Ω
37. 37
Artificial ant (4)
• Can update pheromone on visited
components (nodes)
• and connections (edges)
• Ants act:
Concurrently
Independently
44. 44
ACO applications
• Traveling salesman
• Quadratic assignment
• Graph coloring
• Multiple knapsack
• Set covering
• Maximum clique
• Bin packing
• …
45. 45
Outline
1. Biological inspiration of ACO
2. Solving NP-hard combinatorial problems
3. The ACO metaheuristic
4. ACO for the Traveling Salesman
Problem
47. 47
Traveling salesman problem
• N – set of nodes (cities), |N| = n
• A – set of arcs, fully connecting N
• Weighted graph G = (N, A)
• Each arc has a weight dij – distance
• Problem:
Find minimum length Hamiltonian circuit
48. 48
TSP: construction graph
• Identical to the problem graph
• C = N
• L = A
• states = set of all possible partial tours
49. 49
TSP: constraints
• All cities have to be visited
• Each city – only once
• Enforcing – allow ants only to go to new
nodes
55. 55
Ant System: Tour construction
• Ant k is located in city i
• is the neighborhood of city i
• Probability to go to city :
∑
∈
⋅
⋅
=
k
iNl
ilil
ijijk
ijp βα
βα
ητ
ητ
k
iN
k
iNj ∈
56. 56
Tour construction:
comprehension
• α = 0 – greedy algorithm
• β = 0 – only pheromone is at work
quickly leads to stagnation
∑
∈
⋅
⋅
=
k
iNl
ilil
ijijk
ijp βα
βα
ητ
ητ
57. 57
Ant System: update pheromone
trails – evaporation
Evaporation for all connections∀(i, j) ∈ L:
τij ← (1 – ρ) τij,
ρ ∈[0, 1] – evaporation rate
Prevents convergence to suboptimal solutions
58. 58
Ant System: update pheromone
trails – deposit
• Tk
– path of ant k
• Ck
– length of path Tk
• Ants deposit pheromone on visited arcs:
( ) Lji
m
k
k
ijijij ∈∀∆+← ∑=
,,
1
τττ
( )
∈
=∆
otherwise
TjiC kk
k
ij
,0
,,/1
τ
59. 59
Elitist Ant System
• Best-so-far ant deposits pheromone on each
iteration:
best
ij
m
k
k
ijijij e ττττ ∆+∆+← ∑=1
( )
∈
=∆
otherwise
TjiC bestbest
best
ij
,0
,,/1
τ
60. 60
Rank-based Ant System
• Rank all ants
• Each ant deposits amounts of pheromone
proportional to its rank
61. 61
MAX-MIN Ant System
1. Only iteration-best or best-so-far ant
deposits pheromone
2. Pheromone trails are limited to the
interval [τmin, τmax]
62. 62
Ant Colony System
• Differs from Ant System in three points:
More aggressive tour construction rule
Only best ant evaporates and deposits
pheromone
Local pheromone update
63. 63
Ant Colony System
{ }
≤
= ∈
otherwiseSystemAntlike
qqif
j
ililNl k
i
,
,maxarg 0
β
ητ
1.Tour Construction
2. Local pheromone update:
τij ← (1 – ξ)τij + ξτ0,
65. 65
State of the art in TSP
• CONCORDE http://www.tsp.gatech.edu/
concorde.html
• Solved an instance of 85900 cities
• Computation took 286-2719 CPU days!
69. 69
Thank you!
Any questions?
This presentation is available at:
http://rain.ifmo.ru/~chivdan/presentations/
Daniel Chivilikhin [mailto: chivdan@gmail.com]