Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm...

39
Particle Swarm Optimization

Transcript of Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm...

Page 1: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Particle Swarm Optimization

Page 2: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Brief introduction to PSOParticle Swarm Optimization (PSO):

◦ Swarm Intelligence: a population of agents that interact with the environment and each other following simple rules with no centralized control

How it works:◦ Particles evaluated as they move according to

fitness criterion Best Solution (fitness) achieved so far by particle, called

pbest Best value obtained by any particle in population, called

gbest Second best value around neighbors is local best

(reduces chance of local minima

Page 3: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Brief introduction to PSO

Films that use PSO: http://www.youtube.com/watch?v=TWqx57CR69c

Robot simulation of PSO: http://www.youtube.com/watch?v=RLIA1EKfSys

Page 4: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Particle swarm optimizationSwarming behavior in animals have

been shown to be beneficial in:(1) Reproduction(2) Food gathering(3) Avoiding predator attacks: the

“needle in a haystack” problem.The search efficiency provided by

swarming is what underlies particle swarm optimization (PSO) algorithms.

Page 5: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Brief introduction to PSOhttp://www.youtube.com/watch?v=SkvpEfAPXn4&lis

t=PLB24251D851383A7A

Based on swarming behavior The Boids model: (that inspired the development of

PSO)The movement of artificial bird-like objects (boids)

is determined by three steers: cohesion, alignment and separation.

Page 6: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Brief introduction to PSOVideohttp://cmol.nbi.dk/models/boids/boids.html

SeparationSteer to avoid crowding with local flock mates.

AlignmentSteer toward the average heading of local flock

mates.

CohesionSteer to move toward the average position of

local flock mates.

Page 7: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Brief introduction to PSOPSO is based on swarm principles: A

population of particles move in the n-dimensional search space.

The velocities of the particles in the swarm are updated according to

where xij^pb is the best position (best value of the objective function) obtained by particle i and xi^sb is the best position obtained by any particle in the swarm

Page 8: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Applications of stochastic opt.

Various problems concerning autonomous robots, e.g. behavior selection and decision-making.

Page 9: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A model of swarming: BOIDSCraig Reynolds: A numerical

model introduced for simulation of the swarming of bird-like objects (BOIDS)

BOIDS = Bird-like objects No leader, only local interactions occur. Only a few simple, local rules for the interactions

Results in a coherent swarm!

Page 10: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A model of swarming: BOIDSConsider a swarm of N BOIDS:

where pi is the i:th boid.Visual range defined for each boid:

“visibility sphere”r = global constant

Page 11: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A model of swarming: BOIDSPositions and velocities update

rule:

Page 12: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A model of swarming: BOIDSThe movements of each BOID is

influenced by three steers:(1) Cohesion: Stay near the

center of the swarm.(2) Alignment: Align velocity with

the velocities of nearby swarm mates.

(3) Separation: Avoid collisions with nearby boids.

Page 13: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A model of swarming: BOIDSSteering vectors.

Page 14: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A model of swarming: BOIDSCohesion: Center of density of the boids

within the visibility sphere of boid i:

ki = number of boids in Vi

The steering vector representing cohesion:

T = time constant

If no boids are within Vi (=>ki=0) then set Ci=0.

Page 15: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A model of swarming: BOIDSAlignment:

◦Steering vector:

◦If no boids are within Vi (=>ki=0) then set li=0.

Page 16: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A model of swarming: BOIDSSeparation:

◦Steering vector:

◦If no boids are within Vi (=>ki=0) then set si=0.

Page 17: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A model of swarming: BOIDSThe acceleration of boid i is

obtained by combining the three steering vectors:

Cc, Cl, and Cs are constants, in the range [0,1], defining the relative impact of ci, li, and si.

Page 18: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A model of swarming: BOIDSInitialization:If the initial speed of the boids is too

large, the swarm will break apart almost immediately!

(1) Initial speed vi should be set ~0, for all i.(2) limit speed to vmax(3) limit acceleration to amax(4) Each boid should be placed within the visibility sphere of at least one other boid.

Page 19: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A model of swarming: BOIDSThe BOIDS model leads to very

realistic swarm behavior.Have been used (with small

modifications) in movies (e.g. in Jurassic Park, to simulate herding dinosaurs).

Go to:(1) http://www.youtube.com/watch?v=

rN8DzlgMt3M(2) http://www.cs.ioc.ee/~ando/boids.php

Page 20: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

PSO algorithmsBased on the properties of

swarms. => search efficiency.Particle = Candidate solution.

◦Associated with a position and a velocity in the search space.

◦A change in velocity depends on the performance of the particle itself and that of other particles.

Page 21: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A basic PSO algorithm – Step 1(1) Initialization of the position xi and the

velocity vi of each particle pi, i=1,...,N.N is in [20, 40], commonly.xi and vi are initialized randomly:

r = random number in [0,1] with uniform distribution

N = size of the swarmn = number of variables of the problem.

Page 22: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A basic PSO algorithm – Step 1

r = random number in [0,1] (uniform distribution)

α = constant in [0,1]Δt = timestep (=1, normally)xmin = -xmax is a common special

case.

Page 23: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A basic PSO algorithm – Steps 2-3 (2) Evaluate performance of each particle:=> compute objective function f(xi), i = 1, ..., N (3) Update the best position of each particle, and the

global best position (minimization).

xi_pb = best position so far of particle i. xi_sb = best position so far of any particle in the

swarm.

Page 24: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A basic PSO algorithm – Step 4(4) Update particle velocities and positions. (4.1) Velocities:

q and r are random numbers in [0,1] (uniform).c1 and c2 are weights for the social and

cognitive parts, respectively (= 2, normally).

Page 25: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A basic PSO algorithm – Step 4Note:(a) The contribution of the cognitive

component determines to what extent the particle uses its own (previous) performance as guide towards better results.

(b) The contribution of the social component determines to what extent the particle uses (previous) performance of the other swarm members as guide towards better results.

Page 26: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

A basic PSO algorithm – Steps 4-5(4.2) In order to maintain coherence, restrict

the velocities:

(4.3) Update position of particle pi:

One iteration is now completed.(5) Return to (2) unless the termination

criterion has been reached.

Page 27: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

PSO Summary

Page 28: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Discrete versions of PSOGenerally, it is assumed that the variables xj

take real values.With small modifications PSO can be used

with integer programming problems (i.e. where the variables take integer values only).

Variable truncation PSO is very straightforward:◦ The internal workings of the PSO algorithm are

identical to the standard (continuous) PSO, but each component of the position vector is truncated to the nearest integer value.

◦ Truncation occurs both at initialization, as well as when updating the new positions.

Page 29: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Discrete versions of PSOBinary PSOUsed when binary representation is needed or

yes/no decision making.Same as standard PSO, but:(a) Particle position is restricted to the set {0,

1}.(b) The velocity vij is interpreted as a

probability for setting the particle position to either 0 or 1, by means of an activation function:

Page 30: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Applications of PSOPSO algorithms avoid the problems

normally associated with GAs in connection with ANNs:

(1) Using GA, crossover operator is not very likely to produce useful results from two different networks => avoid the destructive effects of crossover.

(2) In PSO there are no completely random mutations (velocity vector can be interpreted as “almost a gradient”).

PSOs have shown good performance in recent studies.

Page 31: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Supplemental SlidesIf you’re interested in more detail

on PSO, the following slides may be reviewed on your own time.

Page 32: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Discrete versions of PSOBinary PSOσ(vij) is interpreted as the probability of setting

xij equal to 1.Thus, xij is set to 0 with probability 1-σ(vij) .

Specifically

r = random number in [0,1].Truncation of velocities is needed in order to

avoid too high probability of always setting xij to 1:

Page 33: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Properties of PSONote that there exists many

variants on the theme of PSO, just as in the case of EAs and ACOs.

Best-in-current-swarm versus best-ever.◦xsb,e = “best-ever”◦xsb,c = “best-current”

Neighborhood topologies◦Consider the best particle in the

neighborhood of particle pi: xisb,n

Page 34: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Properties of PSO

Other connectivity can be considered as well.

Fully connected. Restricted connectivity.

Page 35: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Properties of PSONeighborhood topologies.Note:

◦The topologies are constructed in another, abstract space than the visibility spheres.

◦Neighborhood structures remain constant throughout the optimization, whereas the position xi in search space do not!

The concept of neighborhoods were introduced for the purpose of prevention of premature convergence – but it may slow down the speed of convergence!

Page 36: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Properties of PSOMaintaining coherence.After removing the stochastic components q

and r, the particle trajectories will remain bounded only if c1+c2<4

Under the influence of q and r, the particle trajectories will diverge eventually, even if c1+c2<4!

Page 37: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Properties of PSOMaintaining coherence.Thus, in order to “control” particle trajectories

we introduce a limit on particle velocities. Restrict velocity of particle pi as:

Page 38: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Properties of PSOMaintaining coherence.Alternatively, use constriction

coefficients:

Then, trajectories do not diverge if:

Page 39: Particle Swarm Optimization. Brief introduction to PSO Particle Swarm Optimization (PSO): ◦ Swarm Intelligence: a population of agents that interact with.

Properties of PSOInertia weight. Determines the relative influence

of previous velocities on the current velocity:

w = inertia weight.If w > 1 particle favors exploration.If w < 1 particle favors exploitation.Exploration is more important in the early stages.Start with w=1.4, reduce in each iteration until

~0.3