Computational Intelligence Methods Ant Colony Optimization, Partical Swarm Optimization Pavel Kordík, Martin Šlapák Katedra teoretické informatiky FIT České vysoké učení technické v Praze MI-MVI, ZS 2011/12, Lect. 6 https://edux.fit.cvut.cz/courses/mi-mvi/ Evropský sociální fond Praha & EU: Investujeme do vaší budoucnosti Pavel Kordík, Martin Šlapák (FIT ČVUT) Computational Intelligence Methods MI-MVI, ZS 2011/12, Lect. 6 1 / 13
Swarm intelligence Motivation Lao Tzu: An ant on the move does more than a dozing ox. Richard Whately: Men are like sheep, of which a flock is more easily driven than a single one. (a) Live ant colony (b) Artifical fish flock Figure: Swarm inteligence examples (a) in the nature and (b) in some virtual enviroment. Pavel Kordík, Martin Šlapák (FIT ČVUT) Computational Intelligence Methods MI-MVI, ZS 2011/12, Lect. 6 2 / 13
Swarm intelligence Introduction Swarm intelligence (SI) is the collective behaviour of decentralized, self-organized systems, natural or artificial. The expression was introduced by Gerardo Beni and Jing Wang in 1989 [1]. SI systems are typically made up of a population of simple agents or boids interacting locally with one another and with their environment. The agents follow very simple rules. There is no centralized control. Natural examples of SI include ant colonies, bird flocking, animal herding, bacterial growth, and fish schooling. Pavel Kordík, Martin Šlapák (FIT ČVUT) Computational Intelligence Methods MI-MVI, ZS 2011/12, Lect. 6 3 / 13
Swarm intelligence Lots of algorithms inspired by nature Particle swarm optimization (PSO) Ant colony optimization (ACO) Intelligent Water Drops Stochastic diffusion search River formation dynamics Some real ppplications: Crowd simulation (used in film industry - eg. Lord of the Rings) Ant-based routing (network packets,...) Pavel Kordík, Martin Šlapák (FIT ČVUT) Computational Intelligence Methods MI-MVI, ZS 2011/12, Lect. 6 4 / 13
Particle swarm optimization PSO Introduced by Eberhart and Kennedy in a 1995 [2] Population (swarm) of candidate solution. Each particle is moved by simple rule(s) in the search-space. There is no guarantee, that a satisfactory solution will eventually be discovered. Pavel Kordík, Martin Šlapák (FIT ČVUT) Computational Intelligence Methods MI-MVI, ZS 2011/12, Lect. 6 5 / 13
Particle swarm optimization PSO details x i R n is position of particle i v i R n is velocity of particle i p i is best known position of i g is best known position of particle in whole swarm For earch iteration and particle i in swarm: Pick random coeficients α i, β i (0, 1) Update the particle s velocity: v i+1 = ωv i + ϕ p α(p i x i ) + ϕ g β(g x i ) Update the particle s position: x i+1 = x i + v i Actualize p i and g if better fitness was found. The parameters ω, ϕ p, and ϕ g are selected by the practitioner and control the behaviour and efficiancy of the PSO method. Pavel Kordík, Martin Šlapák (FIT ČVUT) Computational Intelligence Methods MI-MVI, ZS 2011/12, Lect. 6 6 / 13
Particle swarm optimization PSO Parameter selection Has big impact on PSO algorithm performance. It s playfield for another layer optimalization algorithm meta-optimalization concept. In simple tasks are parameters choosen and modified by guesswork... ;-) Pavel Kordík, Martin Šlapák (FIT ČVUT) Computational Intelligence Methods MI-MVI, ZS 2011/12, Lect. 6 7 / 13
Ant colony optimization Ant colony optimization The original idea comes from observing the exploitation of food resources among ants. Individual ant has limited cognitive abilities. Collective memory is done by pheromone. Ants create pheromone trail after itself if then found some food. Ants follows pheromone trail. Pheromone loose power by time (evaporate). Figure: Ants sensing the pheromone 1 1 http://4.bp.blogspot.com/.../army+ant+army+ants+on+the+march+7.jpg Pavel Kordík, Martin Šlapák (FIT ČVUT) Computational Intelligence Methods MI-MVI, ZS 2011/12, Lect. 6 8 / 13
Ant colony optimization ACO 1 The first ant finds the food source (F), via any way (a), then returns to the nest (N), leaving behind a trail pheromone (b) 2 Ants indiscriminately follow four possible ways, but the strengthening of the runway makes it more attractive as the shortest route. 3 Ants take the shortest route, long portions of other ways lose their trail pheromones. Figure: Basic principle Pavel Kordík, Martin Šlapák (FIT ČVUT) Computational Intelligence Methods MI-MVI, ZS 2011/12, Lect. 6 9 / 13
Ant colony optimization ACO by pseudocode while(not_termination) generatesolutions(); //eg. connect two cities in TSP //move each ant from state A to B moveants(); //create a new (particular) solution pheromoneupdate(); end while The probability of moving ant k, from state A to B is: p k AB = τ α AB η β AB (τ α AB η β AB ) τ AB is the amount of pheromone deposited for transition from state A to B. η AB is the desirability of state transition AB (a priori knowledge, typically 1 / d xy, where d is the distance). 0 α is a parameter to control the influence of τ AB (pheromone evaporating) β 1 is a parameter to control the influence η AB Pavel Kordík, Martin Šlapák (FIT ČVUT) Computational Intelligence Methods MI-MVI, ZS 2011/12, Lect. 6 10 / 13
Ant colony optimization ACO extensions Elitist ant system The global best solution deposits pheromone on every iteration along with all the other ants Rank-based ant system All solutions are ranked according to their fitness. The amount of pheromone deposited is then weighted for each solution, such that the solutions with better fitness deposit more pheromone than the solutions with worse fitness. Max-Min ant system Added Maximum and Minimum pheromone amounts t max, t min. Only global best or iteration best tour deposited pheromone. All edges are initialized to t max and reinitialized to t max when nearing stagnation. Pavel Kordík, Martin Šlapák (FIT ČVUT) Computational Intelligence Methods MI-MVI, ZS 2011/12, Lect. 6 11 / 13
Ant colony optimization ACO simulation Figure: Simulation example 2 http://www.forgefx.com/casestudies/prenticehall/ph/ ants/ants.htm 2 http://www.forgefx.com/casestudies/prenticehall/ph/ants/ ant-pheromone-simulation-03.jpg Pavel Kordík, Martin Šlapák (FIT ČVUT) Computational Intelligence Methods MI-MVI, ZS 2011/12, Lect. 6 12 / 13
Ant colony optimization References Beni, G., Wang, J. Swarm Intelligence in Cellular Robotic Systems, Proceed. NATO Advanced Workshop on Robots and Biological Systems, Tuscany, Italy, June 26 30 (1989) R. Eberhart and J. Kennedy. A new optimizer using particle swarm theory. Micro Machine and Human Science, 1995. MHS 95., Proceedings of the Sixth International Symposium on, pages 39-43, Oct 1995 Craig W. Reynolds, Steering Behaviors For Autonomous Characters [online], [cited on 2011-05-02] available at http://www.red3d.com/cwr/steer/gdc99/ Pavel Kordík, Martin Šlapák (FIT ČVUT) Computational Intelligence Methods MI-MVI, ZS 2011/12, Lect. 6 13 / 13