Transcript Swarm algorithms - University of Liverpool
Swarm algorithms
COMP308
Swarming – The Definition
• aggregation of similar animals, generally cruising in the same direction • • • Termites swarm to build colonies Birds swarm to find food Bees swarm to reproduce
Swarming is Powerful
• Swarms can achieve things that an individual cannot
Powerful … but simple
• • • • All evidence suggests: No central control Only simple rules for each individual Emergent phenomena Self-organization
Harness this Power out of Simplicity • • Technical systems are getting larger and more complex – Global control hard to define and program – Larger systems lead to more errors Swarm intelligence systems are: – Robust – Relatively simple (How to program a swarm?)
Swarming – Example
• Bird Flocking • “Boids” model was proposed by Reynolds – Boids = Bird-oids (bird like) • Only three simple rules
Collision Avoidance
• Rule 1: Avoid Collision with neighboring birds
Velocity Matching
• Rule 2: Match the velocity of neighboring birds
Flock Centering
• Rule 3: Stay near neighboring birds
Define the neighborhood
• • • Model the view of a bird Only local knowledge, only local interaction Affects the swarm behavior (fish vs. birds)
Swarming - Characteristics
• Simple rules for each individual • No central control – Decentralized and hence robust • Emergent – Performs complex functions
Ant Colony Optimization - Biological Inspiration • • • • • Inspired by foraging behavior of ants.
Ants find shortest path to food source from nest.
Ants deposit pheromone along traveled path which is used by other ants to follow the trail.
This kind of indirect communication via the local environment is called stigmergy.
Has adaptability, robustness and redundancy.
Foraging behavior of Ants
• 2 ants start with equal probability of going on either path.
Foraging behavior of Ants
• The ant on shorter path has a shorter to-and fro time from it’s nest to the food.
Foraging behavior of Ants
• The density of pheromone on the shorter path is higher because of 2 passes by the ant (as compared to 1 by the other).
Foraging behavior of Ants
• The next ant takes the shorter route.
Foraging behavior of Ants
• Over many iterations, more ants begin using the path with higher pheromone, thereby further reinforcing it.
Foraging behavior of Ants
• After some time, the shorter path is almost exclusively used.
Generic ACO
• • • • Formalized into a metaheuristic.
Artificial ants build solutions to an optimization problem and exchange info on their quality vis-à-vis real ants.
A combinatorial optimization problem reduced to a construction graph.
Ants build partial solutions in each iteration and deposit pheromone on each vertex.
Ant Colony Metaheuristic
• • • ConstructAntSolutions: Partial solution extended by adding an edge based on stochastic and pheromone considerations.
ApplyLocalSearch: problem-specific, used in state-of-art ACO algorithms.
UpdatePheromones: increase pheromone of good solutions, decrease that of bad solutions (pheromone evaporation).
Thinking is Social
• • • • Direct/Indirect communication Social science can be used to perform combinatorial optimization Adaptive Culture Model contains most of ingredients that will be used in the more sophisticated practical swarm algorithms Similarity between pairs of individuals can result in spread of culture.
Culture Model (Axelrod, 1997)
• Model of the spread of culture with social interactions • Individuals represented by symbolic strings (as in GAs), and arranged on a 2-D grid • Probability of agent interaction increases with agents’ similarity • Algorithm – Randomly select an agent – Randomly select a neighbor of the agent – Probability of interaction = (# shared string values)/(string length) – If interact, then copy value on one feature of neighbor’s string to the agent’s string • Behavior – Preservation of different cultures in same world – Increased local harmony over time – Similarity-based interaction creates distinct boundaries
Adaptive Culture Model (Kennedy & Eberhart, 1997) • • • Agents interact with each other based not on similarity, but on performance – Behavior is not only based on fads, but on results – “If neighbor’s sum is larger than my sum, then interact” -> “99999” – “If neighbor’s first 3 numbers are close to last 2 numbers (compared to my numbers), then interact” -> pockets of “17769” and “83193” Can solve the Traveling salesman problem Behavior – Preservation of different cultures in the same world – Increased local harmony over time
A Hard Function
• • • Problem is considered intractable if the amount of time required to solve it increases at a faster-then polynomial rate as the size of the problem increases.
For instance Travelling Salesman Problem (TCP) requires finding the shortest path through a set of nodes without passing through any node twice, and ending at the starting point With each additional city the number of possible solutions grows exponentially: with N nodes there are NN possible combinations of nodes and N! “legal” tours. (NP-complete problem)