SlideShare a Scribd company logo
1 of 47
Biologically Inspired
Computation
Ant Colony Optimisation
Swarm Algorithms
Inspiration from swarm intelligence has led to
some highly successful optimisation algorithms.
– Ant Colony (-based) Optimisation – a way to solve
optimisation problems based on the way that ants
indirectly communicate directions to each other.
– Particle Swarm Optimisation — a different way to
solve optimisation problems, based on the swarming
behaviour of several kinds of organisms.
This lecture is about Ant Colony Optimisation
(PSO next week)
Ant Colony Optimization
Note:
My starting point for these slides was
some excellent ppt by Tony White
(tony@sce.carleton.ca)
Emergent Problem Solving in
Lasius Niger ants,
For Lasius Niger ants, [Franks, 89] observed:
– regulation of nest temperature within 1 degree celsius range;
– forming bridges;
– raiding specific areas for food;
– building and protecting nest;
– sorting brood and food items;
– cooperating in carrying large items;
– emigration of a colony;
– finding shortest route from nest to food source;
– preferentially exploiting the richest food source available.
These are swarm behaviours – beyond what any individual can do.
A living bridge
Clustered by ants
Co-operative carrying
Explainable (arguably) as emergent property of
many individuals operating simple rules?
For Lasius Niger ants, [Franks, 89] observed:
– regulation of nest temperature within 1 degree celsius range;
– forming bridges;
– raiding specific areas for food;
– building and protecting nest;
– sorting brood and food items;
– cooperating in carrying large items;
– emigration of a colony;
– finding shortest route from nest to food source;
– preferentially exploiting the richest food source available.
The ACO algorithm is inspired by this:
A key concept: Stigmergy
Stigmergy is:
indirect communication via interaction with the environment [Gassé, 59]
• A problem gets solved bit by bit ..
• Individuals communicate with each other in the above way,
affecting what each other does on the task.
E.g. sorting things into piles, as we did in the Introductory
Swarm Intelligence lecture
• Individuals leave markers or messages – these don’t solve
the problem in themselves, but they affect other individuals
in a way that helps them solve the problem …
• E.g. as we will see, this is how ants find shortest paths.
Stigmergy in Ants
Ants are behaviorally unsophisticated, but
collectively they can perform complex tasks.
Ants have highly developed sophisticated sign-based
stigmergy
– They communicate using pheromones;
– They lay trails of pheromone that can be followed by
other ants.
• If an ant has a choice of two pheromone trails to
follow, one to the NW, one to the NE, but the NW
one is stronger – which one will it follow?
Individual ants lay pheromone trails while travelling
from the nest, to the nest or possibly in both
directions.
The pheromone trail gradually evaporates over time.
But pheromone trail strength accumulate with
multiple ants using path.
Pheromone Trails
Food source
Nest
Pheromone Trails continued
D
E
H C
A
B
d=0.5
d=0.5
d=1.0
d=1.0
E
H
E
D
H C
A
B
30 ants
D
C
A
B
30 ants
15
ants
15
ants
15
ants
15
ants
30
ants
10
ants
20
ants
20
ants
10
ants
30
ants
T =
0
T =
1
Ant Colony Optimisation
Algorithms: Basic Ideas
Ants are agents that:
Move along between nodes in a graph.
They choose where to go based on pheromone strength (and maybe other
things)
An ant’s path represents a specific candidate solution.
When an ant has finished a solution, pheromone is laid on its path, according
to quality of solution.
This pheromone trail affects behaviour of other ants by `stigmergy’ …
E.g. A 4-city TSP
A B
C
D
Pheromone
Ant
AB: 10, AC: 10, AD, 30, BC, 40, CD 20
Initially, random levels of pheromone are scattered on the edges
E.g. A 4-city TSP
A B
C
D
Pheromone
Ant
AB: 10, AC: 10, AD, 30, BC, 40, CD 20
An ant is placed at a random node
E.g. A 4-city TSP
A B
C
D
Pheromone
Ant
AB: 10, AC: 10, AD, 30, BC, 40, CD 20
The ant decides where to go from that node,
based on probabilities
calculated from:
- pheromone strengths,
- next-hop distances.
Suppose this one chooses BC
E.g. A 4-city TSP
A B
C
D
Pheromone
Ant
AB: 10, AC: 10, AD, 30, BC, 40, CD 20
The ant is now at C, and has a `tour memory’ = {B, C} – so he cannot
visit B or C again.
Again, he decides next hop
(from those allowed) based
on pheromone strength
and distance;
suppose he chooses
CD
E.g. A 4-city TSP
A B
C
D
Pheromone
Ant
AB: 10, AC: 10, AD, 30, BC, 40, CD 20
The ant is now at D, and has a `tour memory’ = {B, C, D}
There is only one place he can go now:
E.g. A 4-city TSP
A B
C
D
Pheromone
Ant
AB: 10, AC: 10, AD, 30, BC, 40, CD 20
So, he has nearly finished his tour, having gone over the links:
BC, CD, and DA.
E.g. A 4-city TSP
A B
C
D
Pheromone
Ant
AB: 10, AC: 10, AD, 30, BC, 40, CD 20
So, he has nearly finished his tour, having gone over the links:
BC, CD, and DA. AB is added to complete the round trip.
Now, pheromone on the tour
is increased, in line with the
fitness of that tour.
E.g. A 4-city TSP
A B
C
D
Pheromone
Ant
AB: 10, AC: 10, AD, 30, BC, 40, CD 20
Next, pheromone everywhere
is decreased a little, to model
decay of trail strength over
time
E.g. A 4-city TSP
B
C
D
Pheromone
Ant
AB: 10, AC: 10, AD, 30, BC, 40, CD 20
We start again, with another ant in a random position.
Where will he go?
Next , the actual algorithm
and variants.
A
The ACO algorithm for the TSP
[a simplified version with all essential details]
We have a TSP, with n cities.
1. We place some ants at each city. Each ant then does this:
• It makes a complete tour of the cities, coming back to its starting city,
using a transition rule to decide which links to follow. By this rule,
it chooses each next-city stochastically, biased partly by the pheromone
levels existing at each path, and biased partly by heuristic information.
The ACO algorithm for the TSP
[a simplified version with all essential details]
We have a TSP, with n cities.
1. We place some ants at each city. Each ant then does this:
• It makes a complete tour of the cities, coming back to its starting city,
using a transition rule to decide which links to follow. By this rule, it
chooses each next-city at random, but biased partly by the pheromone
levels existing at each path, and biased partly by heuristic information.
2. When all ants have completed their tours.
Global Pheromone Updating occurs.
• The current pheromone levels on all links are reduced (I.e. pheromone
levels decay over time).
• Pheromone is lain (belatedly) by each ant as follows: it places pheromone
on all links of its tour, with strength depending on how good the tour was.
The ACO algorithm for the TSP
[a simplified version with all essential details]
We have a TSP, with n cities.
1. We place some ants at each city. Each ant then does this:
• It makes a complete tour of the cities, coming back to its starting city,
using a transition rule to decide which links to follow. By this rule, it
chooses each next-city at random, but biased partly by the pheromone
levels existing at each path, and biased partly by heuristic information.
2. When all ants have completed their tours.
Global Pheromone Updating occurs.
• The current pheromone levels on all links are reduced (I.e. pheromone
levels decay over time).
• Pheromone is lain (belatedly) by each ant as follows: it places pheromone
on all links of its tour, with strength depending on how good the tour was.
Then we go back to 1 and repeat the whole process many
times, until we reach a termination criterion.
A very common variation, which gives the best results
We have a TSP, with n cities.
1. We place some ants at each city. Each ant then does this:
• It makes a complete tour of the cities, coming back to its starting city, using a transition
rule to decide which links to follow. By this rule, it chooses each next-city at random, but
biased partly by the pheromone levels existing at each path, and biased partly by heuristic
information.
2. When all ants have completed their tours.
Apply some iterations of LOCAL SEARCH to the completed tour; this finds a
better solution, which is now treated as the ant’s path. Then continue the
next steps as normal.
Global Pheromone Updating occurs.
• The current pheromone levels on all links are reduced (I.e. pheromone levels decay over
time).
• Pheromone is lain (belatedly) by each ant as follows: it places pheromone on all links of its
tour, with strength depending on how good the tour was.
Then we go back to 1 and repeat the whole process many times, until we reach a
termination criterion.
The transition rule
T(r,s) is the amount of pheromone currently on the path that goes
directly from city r to city s.
H(r,s) is the heuristic value of this link – in the classic TSP
application, this is chosen to be 1/distance(r,s) -- I.e. the shorter
the distance, the higher the heuristic value.
is the probability that ant k will choose the link that goes
from r to s
is a parameter that we can call the heuristic strength
)
,
( s
r
pk
The rule is:
Where our ant is at city r, and s is a city as yet unvisited on its
tour, and the summation is over all of k’s unvisited cities

 


c
k
c
r
H
c
r
T
s
r
H
s
r
T
s
r
p
cities
unvisited
)
,
(
)
,
(
)
,
(
)
,
(
)
,
(


Global pheromone update
Ak(r,s) is amount of pheromone added to the (r, s) link by ant k.
m is the number of ants
is a parameter called the pheromone decay rate.
Lk is the length of the tour completed by ant k
T(r, s) at the next iteration becomes:
Where





m
k
k s
r
A
s
r
T
1
)
,
(
)
,
(

k
k L
s
r
A /
1
)
,
( 
Study these – they’re not that hard.
How do you think the parameters m, beta, rho etc … affect the search?
Not just for TSP of course
ACO is naturally applicable to any
sequencing problem, or indeed any problem
All you need is some way to represent
solutions to the problem as paths in a
network.
E.g.
Single machine scheduling with due-dates
These jobs have to be done; their length
represents the time they will take.
A
B
C
D
E
E.g.
Single machine scheduling with due-dates
These jobs have to be done; their length
represents the time they will take.
A
B
C
D
E
Each has a `due date’, when it needs to be finished
3pm
3:30pm
5pm
4pm
4:30pm
E.g.
Single machine scheduling with due-dates
These jobs have to be done; their length
represents the time they will take.
A
B
C
D
E
Each has a `due date’, when it needs to be finished
3pm
3:30pm
5pm
4pm
4:30pm
Only one `machine’ is
available to process these jobs,
so can do just one at a time.
[e.g. machine might be
human tailor, photocopier,
Hubble Space Telescope,
Etc …]
An example schedule
A due 3pm B – 3:30 C - 5pm D – 4pm E -4:30
2 pm 3 pm 5 pm
4 pm 6 pm
A is 10min late Fitness might be average lateness;
B is 40min late in this case 46min
C is 20min early (lateness = 0)
D is 90min late or fitness could be Max lateness,
E is 90min late in this case 90min
Another schedule
A due 3pm
B – 3:30 C - 5pm
D – 4pm E -4:30
2 pm 3 pm 5 pm
4 pm 6 pm
A is 70min late Fitness might be average lateness;
B is 30min early (0 lateness) in this case again 46min
C is 60min late
D is 50min late or fitness could be Max lateness,
E is 50min late in this case 70min
Applying ACO to this problem
Just like with the TSP, each ant finds paths in
a network, where, in this case, each job is a
node. Also, no need to return to start node –
path is complete when every node is visited.
A B
C D
Initially, random levels of pheromone are scattered on the edges,
an ant starts at a Start node (so the first link it chooses defines
the first task to schedule on the machine); as before it uses a
transition ruleto take one step at a time, biased by pheromone levels,
and also a heuristic score, each time choosing the next machine
to schedule. What heuristic might you use in this case?
E Start
Why is it sensible to have a Start node for this problem
Example table from a research paper comparing ACO with
other things on some scheduling problems
• http://iridia.ulb.ac.be/dorigo/ACO/ACO.html
See here if you’re very interested in ACO:
ACO is a thriving and maturing research area – it has its own
conferences. It gets very good results on some difficult problems.
Following the above link will help you find examples.
ACO research and practice tends to concentrate on:
• hybridisation with other methods; e.g. it is common to
improve an individual ant’s solution by local search, and then
lay pheromone.
• New and adaptive ways to control the relative influence of
heuristics, pheromone strength and pheromone decay.
Self-study material: Thinking
about Emergence
These are to help you think about
“emergence” and “emergent properties”.
The following slides list the interesting
behaviours Franks observed in ants, and
tries to characterize the “emergent property”
that each relates to.
What is the emergent property of the individual
actions in each of these cases?
• regulation of nest temperature
• forming bridges;
• raiding specific areas for food;
• building and protecting nest;
• sorting brood and food items;
• cooperating in carrying large items;
• emigration of a colony;
• finding shortest route from nest to food source;
• preferentially exploiting the richest food source available.
Solving an online/dynamic control problem
What is the emergent property of the individual
actions in each of these cases?
• regulation of nest temperature
• forming bridges;
• raiding specific areas for food;
• building and protecting nest;
• sorting brood and food items;
• cooperating in carrying large items;
• emigration of a colony;
• finding shortest route from nest to food source;
• preferentially exploiting the richest food source available.
A useful physical structure is built
What is the emergent property of the individual
actions in each of these cases?
• regulation of nest temperature
• forming bridges;
• raiding specific areas for food;
• building and protecting nest;
• sorting brood and food items;
• cooperating in carrying large items;
• emigration of a colony;
• finding shortest route from nest to food source;
• preferentially exploiting the richest food source available.
Exhibiting learning and memory
What is the emergent property of the individual
actions in each of these cases?
• regulation of nest temperature
• forming bridges;
• raiding specific areas for food;
• building and protecting nest;
• sorting brood and food items;
• cooperating in carrying large items;
• emigration of a colony;
• finding shortest route from nest to food source;
• preferentially exploiting the richest food source available.
Useful physical structure, plus online control
What is the emergent property of the individual
actions in each of these cases?
• regulation of nest temperature
• forming bridges;
• raiding specific areas for food;
• building and protecting nest;
• sorting brood and food items;
• cooperating in carrying large items;
• emigration of a colony;
• finding shortest route from nest to food source;
• preferentially exploiting the richest food source available.
Good housekeeping, better sanitation, etc …
What is the emergent property of the individual
actions in each of these cases?
• regulation of nest temperature
• forming bridges;
• raiding specific areas for food;
• building and protecting nest;
• sorting brood and food items;
• cooperating in carrying large items;
• emigration of a colony;
• finding shortest route from nest to food source;
• preferentially exploiting the richest food source available.
`Co-operation’itself is maybe an emergent property.
Plus, large items get relocated to a `better’place.
What is the emergent property of the individual
actions in each of these cases?
• regulation of nest temperature
• forming bridges;
• raiding specific areas for food;
• building and protecting nest;
• sorting brood and food items;
• cooperating in carrying large items;
• emigration of a colony;
• finding shortest route from nest to food source;
• preferentially exploiting the richest food source available.
Emigration of colony is possibly emergent property environmental
factors plus something like Reynold’s rules …
What is the emergent property of the individual
actions in each of these cases?
• regulation of nest temperature
• forming bridges;
• raiding specific areas for food;
• building and protecting nest;
• sorting brood and food items;
• cooperating in carrying large items;
• emigration of a colony;
• finding shortest route from nest to food
source;
• preferentially exploiting the richest food source available.
SOLVING AN OPTIMISATION PROBLEM. How???

More Related Content

Similar to bic10_ants.ppt

Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimization
Abdul Rahman
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimization
vk1dadhich
 
Ant_Colony_Optimization
Ant_Colony_OptimizationAnt_Colony_Optimization
Ant_Colony_Optimization
Neha Reddy
 
Lecture 9 aco
Lecture 9 acoLecture 9 aco
Lecture 9 aco
mcradc
 
antcolonyoptimization-130619020831-phpapp01.pdf
antcolonyoptimization-130619020831-phpapp01.pdfantcolonyoptimization-130619020831-phpapp01.pdf
antcolonyoptimization-130619020831-phpapp01.pdf
nrusinhapadhi
 
Neural nw ant colony algorithm
Neural nw   ant colony algorithmNeural nw   ant colony algorithm
Neural nw ant colony algorithm
Eng. Dr. Dennis N. Mwighusa
 

Similar to bic10_ants.ppt (20)

Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimization
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimization
 
ant colony algorithm
ant colony algorithmant colony algorithm
ant colony algorithm
 
ANT-presentation.ppt
ANT-presentation.pptANT-presentation.ppt
ANT-presentation.ppt
 
Ant colony algorithm
Ant colony algorithm Ant colony algorithm
Ant colony algorithm
 
Ant Colony Optimization for Load Balancing in Cloud
Ant  Colony Optimization for Load Balancing in CloudAnt  Colony Optimization for Load Balancing in Cloud
Ant Colony Optimization for Load Balancing in Cloud
 
Swarm Optimization Techniques_ACO.pdf
Swarm Optimization Techniques_ACO.pdfSwarm Optimization Techniques_ACO.pdf
Swarm Optimization Techniques_ACO.pdf
 
cs621-lect7-SI-13aug07.ppt
cs621-lect7-SI-13aug07.pptcs621-lect7-SI-13aug07.ppt
cs621-lect7-SI-13aug07.ppt
 
Cs621 lect7-si-13aug07
Cs621 lect7-si-13aug07Cs621 lect7-si-13aug07
Cs621 lect7-si-13aug07
 
ant colony optimization
ant colony optimizationant colony optimization
ant colony optimization
 
Bio-inspired computing Algorithms.pptx
Bio-inspired computing Algorithms.pptxBio-inspired computing Algorithms.pptx
Bio-inspired computing Algorithms.pptx
 
Ant_Colony_Optimization
Ant_Colony_OptimizationAnt_Colony_Optimization
Ant_Colony_Optimization
 
Lecture 9 aco
Lecture 9 acoLecture 9 aco
Lecture 9 aco
 
Ant colony optimization
Ant colony optimizationAnt colony optimization
Ant colony optimization
 
antcolonyoptimization-130619020831-phpapp01.pdf
antcolonyoptimization-130619020831-phpapp01.pdfantcolonyoptimization-130619020831-phpapp01.pdf
antcolonyoptimization-130619020831-phpapp01.pdf
 
aco-3a.ppt
aco-3a.pptaco-3a.ppt
aco-3a.ppt
 
aco-3a.ppt
aco-3a.pptaco-3a.ppt
aco-3a.ppt
 
aco-3a.ppt
aco-3a.pptaco-3a.ppt
aco-3a.ppt
 
Classification with ant colony optimization
Classification with ant colony optimizationClassification with ant colony optimization
Classification with ant colony optimization
 
Neural nw ant colony algorithm
Neural nw   ant colony algorithmNeural nw   ant colony algorithm
Neural nw ant colony algorithm
 

Recently uploaded

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Introduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxIntroduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptx
hublikarsn
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
pritamlangde
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 

Recently uploaded (20)

HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Introduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptxIntroduction to Robotics in Mechanical Engineering.pptx
Introduction to Robotics in Mechanical Engineering.pptx
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor
 
Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata Model
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 

bic10_ants.ppt

  • 2. Swarm Algorithms Inspiration from swarm intelligence has led to some highly successful optimisation algorithms. – Ant Colony (-based) Optimisation – a way to solve optimisation problems based on the way that ants indirectly communicate directions to each other. – Particle Swarm Optimisation — a different way to solve optimisation problems, based on the swarming behaviour of several kinds of organisms. This lecture is about Ant Colony Optimisation (PSO next week)
  • 3. Ant Colony Optimization Note: My starting point for these slides was some excellent ppt by Tony White (tony@sce.carleton.ca)
  • 4. Emergent Problem Solving in Lasius Niger ants, For Lasius Niger ants, [Franks, 89] observed: – regulation of nest temperature within 1 degree celsius range; – forming bridges; – raiding specific areas for food; – building and protecting nest; – sorting brood and food items; – cooperating in carrying large items; – emigration of a colony; – finding shortest route from nest to food source; – preferentially exploiting the richest food source available. These are swarm behaviours – beyond what any individual can do.
  • 8. Explainable (arguably) as emergent property of many individuals operating simple rules? For Lasius Niger ants, [Franks, 89] observed: – regulation of nest temperature within 1 degree celsius range; – forming bridges; – raiding specific areas for food; – building and protecting nest; – sorting brood and food items; – cooperating in carrying large items; – emigration of a colony; – finding shortest route from nest to food source; – preferentially exploiting the richest food source available. The ACO algorithm is inspired by this:
  • 9. A key concept: Stigmergy Stigmergy is: indirect communication via interaction with the environment [Gassé, 59] • A problem gets solved bit by bit .. • Individuals communicate with each other in the above way, affecting what each other does on the task. E.g. sorting things into piles, as we did in the Introductory Swarm Intelligence lecture • Individuals leave markers or messages – these don’t solve the problem in themselves, but they affect other individuals in a way that helps them solve the problem … • E.g. as we will see, this is how ants find shortest paths.
  • 10. Stigmergy in Ants Ants are behaviorally unsophisticated, but collectively they can perform complex tasks. Ants have highly developed sophisticated sign-based stigmergy – They communicate using pheromones; – They lay trails of pheromone that can be followed by other ants. • If an ant has a choice of two pheromone trails to follow, one to the NW, one to the NE, but the NW one is stronger – which one will it follow?
  • 11. Individual ants lay pheromone trails while travelling from the nest, to the nest or possibly in both directions. The pheromone trail gradually evaporates over time. But pheromone trail strength accumulate with multiple ants using path. Pheromone Trails Food source Nest
  • 12. Pheromone Trails continued D E H C A B d=0.5 d=0.5 d=1.0 d=1.0 E H E D H C A B 30 ants D C A B 30 ants 15 ants 15 ants 15 ants 15 ants 30 ants 10 ants 20 ants 20 ants 10 ants 30 ants T = 0 T = 1
  • 13. Ant Colony Optimisation Algorithms: Basic Ideas Ants are agents that: Move along between nodes in a graph. They choose where to go based on pheromone strength (and maybe other things) An ant’s path represents a specific candidate solution. When an ant has finished a solution, pheromone is laid on its path, according to quality of solution. This pheromone trail affects behaviour of other ants by `stigmergy’ …
  • 14. E.g. A 4-city TSP A B C D Pheromone Ant AB: 10, AC: 10, AD, 30, BC, 40, CD 20 Initially, random levels of pheromone are scattered on the edges
  • 15. E.g. A 4-city TSP A B C D Pheromone Ant AB: 10, AC: 10, AD, 30, BC, 40, CD 20 An ant is placed at a random node
  • 16. E.g. A 4-city TSP A B C D Pheromone Ant AB: 10, AC: 10, AD, 30, BC, 40, CD 20 The ant decides where to go from that node, based on probabilities calculated from: - pheromone strengths, - next-hop distances. Suppose this one chooses BC
  • 17. E.g. A 4-city TSP A B C D Pheromone Ant AB: 10, AC: 10, AD, 30, BC, 40, CD 20 The ant is now at C, and has a `tour memory’ = {B, C} – so he cannot visit B or C again. Again, he decides next hop (from those allowed) based on pheromone strength and distance; suppose he chooses CD
  • 18. E.g. A 4-city TSP A B C D Pheromone Ant AB: 10, AC: 10, AD, 30, BC, 40, CD 20 The ant is now at D, and has a `tour memory’ = {B, C, D} There is only one place he can go now:
  • 19. E.g. A 4-city TSP A B C D Pheromone Ant AB: 10, AC: 10, AD, 30, BC, 40, CD 20 So, he has nearly finished his tour, having gone over the links: BC, CD, and DA.
  • 20. E.g. A 4-city TSP A B C D Pheromone Ant AB: 10, AC: 10, AD, 30, BC, 40, CD 20 So, he has nearly finished his tour, having gone over the links: BC, CD, and DA. AB is added to complete the round trip. Now, pheromone on the tour is increased, in line with the fitness of that tour.
  • 21. E.g. A 4-city TSP A B C D Pheromone Ant AB: 10, AC: 10, AD, 30, BC, 40, CD 20 Next, pheromone everywhere is decreased a little, to model decay of trail strength over time
  • 22. E.g. A 4-city TSP B C D Pheromone Ant AB: 10, AC: 10, AD, 30, BC, 40, CD 20 We start again, with another ant in a random position. Where will he go? Next , the actual algorithm and variants. A
  • 23. The ACO algorithm for the TSP [a simplified version with all essential details] We have a TSP, with n cities. 1. We place some ants at each city. Each ant then does this: • It makes a complete tour of the cities, coming back to its starting city, using a transition rule to decide which links to follow. By this rule, it chooses each next-city stochastically, biased partly by the pheromone levels existing at each path, and biased partly by heuristic information.
  • 24. The ACO algorithm for the TSP [a simplified version with all essential details] We have a TSP, with n cities. 1. We place some ants at each city. Each ant then does this: • It makes a complete tour of the cities, coming back to its starting city, using a transition rule to decide which links to follow. By this rule, it chooses each next-city at random, but biased partly by the pheromone levels existing at each path, and biased partly by heuristic information. 2. When all ants have completed their tours. Global Pheromone Updating occurs. • The current pheromone levels on all links are reduced (I.e. pheromone levels decay over time). • Pheromone is lain (belatedly) by each ant as follows: it places pheromone on all links of its tour, with strength depending on how good the tour was.
  • 25. The ACO algorithm for the TSP [a simplified version with all essential details] We have a TSP, with n cities. 1. We place some ants at each city. Each ant then does this: • It makes a complete tour of the cities, coming back to its starting city, using a transition rule to decide which links to follow. By this rule, it chooses each next-city at random, but biased partly by the pheromone levels existing at each path, and biased partly by heuristic information. 2. When all ants have completed their tours. Global Pheromone Updating occurs. • The current pheromone levels on all links are reduced (I.e. pheromone levels decay over time). • Pheromone is lain (belatedly) by each ant as follows: it places pheromone on all links of its tour, with strength depending on how good the tour was. Then we go back to 1 and repeat the whole process many times, until we reach a termination criterion.
  • 26. A very common variation, which gives the best results We have a TSP, with n cities. 1. We place some ants at each city. Each ant then does this: • It makes a complete tour of the cities, coming back to its starting city, using a transition rule to decide which links to follow. By this rule, it chooses each next-city at random, but biased partly by the pheromone levels existing at each path, and biased partly by heuristic information. 2. When all ants have completed their tours. Apply some iterations of LOCAL SEARCH to the completed tour; this finds a better solution, which is now treated as the ant’s path. Then continue the next steps as normal. Global Pheromone Updating occurs. • The current pheromone levels on all links are reduced (I.e. pheromone levels decay over time). • Pheromone is lain (belatedly) by each ant as follows: it places pheromone on all links of its tour, with strength depending on how good the tour was. Then we go back to 1 and repeat the whole process many times, until we reach a termination criterion.
  • 27. The transition rule T(r,s) is the amount of pheromone currently on the path that goes directly from city r to city s. H(r,s) is the heuristic value of this link – in the classic TSP application, this is chosen to be 1/distance(r,s) -- I.e. the shorter the distance, the higher the heuristic value. is the probability that ant k will choose the link that goes from r to s is a parameter that we can call the heuristic strength ) , ( s r pk The rule is: Where our ant is at city r, and s is a city as yet unvisited on its tour, and the summation is over all of k’s unvisited cities      c k c r H c r T s r H s r T s r p cities unvisited ) , ( ) , ( ) , ( ) , ( ) , (  
  • 28. Global pheromone update Ak(r,s) is amount of pheromone added to the (r, s) link by ant k. m is the number of ants is a parameter called the pheromone decay rate. Lk is the length of the tour completed by ant k T(r, s) at the next iteration becomes: Where      m k k s r A s r T 1 ) , ( ) , (  k k L s r A / 1 ) , (  Study these – they’re not that hard. How do you think the parameters m, beta, rho etc … affect the search?
  • 29. Not just for TSP of course ACO is naturally applicable to any sequencing problem, or indeed any problem All you need is some way to represent solutions to the problem as paths in a network.
  • 30. E.g. Single machine scheduling with due-dates These jobs have to be done; their length represents the time they will take. A B C D E
  • 31. E.g. Single machine scheduling with due-dates These jobs have to be done; their length represents the time they will take. A B C D E Each has a `due date’, when it needs to be finished 3pm 3:30pm 5pm 4pm 4:30pm
  • 32. E.g. Single machine scheduling with due-dates These jobs have to be done; their length represents the time they will take. A B C D E Each has a `due date’, when it needs to be finished 3pm 3:30pm 5pm 4pm 4:30pm Only one `machine’ is available to process these jobs, so can do just one at a time. [e.g. machine might be human tailor, photocopier, Hubble Space Telescope, Etc …]
  • 33. An example schedule A due 3pm B – 3:30 C - 5pm D – 4pm E -4:30 2 pm 3 pm 5 pm 4 pm 6 pm A is 10min late Fitness might be average lateness; B is 40min late in this case 46min C is 20min early (lateness = 0) D is 90min late or fitness could be Max lateness, E is 90min late in this case 90min
  • 34. Another schedule A due 3pm B – 3:30 C - 5pm D – 4pm E -4:30 2 pm 3 pm 5 pm 4 pm 6 pm A is 70min late Fitness might be average lateness; B is 30min early (0 lateness) in this case again 46min C is 60min late D is 50min late or fitness could be Max lateness, E is 50min late in this case 70min
  • 35. Applying ACO to this problem Just like with the TSP, each ant finds paths in a network, where, in this case, each job is a node. Also, no need to return to start node – path is complete when every node is visited.
  • 36. A B C D Initially, random levels of pheromone are scattered on the edges, an ant starts at a Start node (so the first link it chooses defines the first task to schedule on the machine); as before it uses a transition ruleto take one step at a time, biased by pheromone levels, and also a heuristic score, each time choosing the next machine to schedule. What heuristic might you use in this case? E Start Why is it sensible to have a Start node for this problem
  • 37. Example table from a research paper comparing ACO with other things on some scheduling problems
  • 38. • http://iridia.ulb.ac.be/dorigo/ACO/ACO.html See here if you’re very interested in ACO: ACO is a thriving and maturing research area – it has its own conferences. It gets very good results on some difficult problems. Following the above link will help you find examples. ACO research and practice tends to concentrate on: • hybridisation with other methods; e.g. it is common to improve an individual ant’s solution by local search, and then lay pheromone. • New and adaptive ways to control the relative influence of heuristics, pheromone strength and pheromone decay.
  • 39. Self-study material: Thinking about Emergence These are to help you think about “emergence” and “emergent properties”. The following slides list the interesting behaviours Franks observed in ants, and tries to characterize the “emergent property” that each relates to.
  • 40. What is the emergent property of the individual actions in each of these cases? • regulation of nest temperature • forming bridges; • raiding specific areas for food; • building and protecting nest; • sorting brood and food items; • cooperating in carrying large items; • emigration of a colony; • finding shortest route from nest to food source; • preferentially exploiting the richest food source available. Solving an online/dynamic control problem
  • 41. What is the emergent property of the individual actions in each of these cases? • regulation of nest temperature • forming bridges; • raiding specific areas for food; • building and protecting nest; • sorting brood and food items; • cooperating in carrying large items; • emigration of a colony; • finding shortest route from nest to food source; • preferentially exploiting the richest food source available. A useful physical structure is built
  • 42. What is the emergent property of the individual actions in each of these cases? • regulation of nest temperature • forming bridges; • raiding specific areas for food; • building and protecting nest; • sorting brood and food items; • cooperating in carrying large items; • emigration of a colony; • finding shortest route from nest to food source; • preferentially exploiting the richest food source available. Exhibiting learning and memory
  • 43. What is the emergent property of the individual actions in each of these cases? • regulation of nest temperature • forming bridges; • raiding specific areas for food; • building and protecting nest; • sorting brood and food items; • cooperating in carrying large items; • emigration of a colony; • finding shortest route from nest to food source; • preferentially exploiting the richest food source available. Useful physical structure, plus online control
  • 44. What is the emergent property of the individual actions in each of these cases? • regulation of nest temperature • forming bridges; • raiding specific areas for food; • building and protecting nest; • sorting brood and food items; • cooperating in carrying large items; • emigration of a colony; • finding shortest route from nest to food source; • preferentially exploiting the richest food source available. Good housekeeping, better sanitation, etc …
  • 45. What is the emergent property of the individual actions in each of these cases? • regulation of nest temperature • forming bridges; • raiding specific areas for food; • building and protecting nest; • sorting brood and food items; • cooperating in carrying large items; • emigration of a colony; • finding shortest route from nest to food source; • preferentially exploiting the richest food source available. `Co-operation’itself is maybe an emergent property. Plus, large items get relocated to a `better’place.
  • 46. What is the emergent property of the individual actions in each of these cases? • regulation of nest temperature • forming bridges; • raiding specific areas for food; • building and protecting nest; • sorting brood and food items; • cooperating in carrying large items; • emigration of a colony; • finding shortest route from nest to food source; • preferentially exploiting the richest food source available. Emigration of colony is possibly emergent property environmental factors plus something like Reynold’s rules …
  • 47. What is the emergent property of the individual actions in each of these cases? • regulation of nest temperature • forming bridges; • raiding specific areas for food; • building and protecting nest; • sorting brood and food items; • cooperating in carrying large items; • emigration of a colony; • finding shortest route from nest to food source; • preferentially exploiting the richest food source available. SOLVING AN OPTIMISATION PROBLEM. How???