particle swarm optimization - stanford...

46
Particle Swarm Optimization Ginny Hogan November 6, 2012 1

Upload: nguyenkhanh

Post on 19-Jul-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Particle Swarm Optimization

Ginny HoganNovember 6, 2012

1

Page 2: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Outline

IntroductionAlgorithmBenefitsDownsidesConvergenceVariantsApplications

2

Page 3: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Introduction

3

Page 4: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Background

Kennedy, Eberhart, Shi 1995.

Observations from nature.

Swarm Intelligence

Moves particles in search-space, searching for a"roost".

4

Page 5: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Set-Up

Cost (or fitness) function f : Rn → R.

Goal: minimize (or maximize) f over all possiblepositions in the search space, defined by upper andlower boundaries.

Parameters ω, φp and φg, chosen by practitioner.

Termination criterion.

5

Page 6: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Set-Up

Cost (or fitness) function f : Rn → R.

Goal: minimize (or maximize) f over all possiblepositions in the search space, defined by upper andlower boundaries.

Parameters ω, φp and φg, chosen by practitioner.

Termination criterion.

6

Page 7: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Set-Up

Cost (or fitness) function f : Rn → R.

Goal: minimize (or maximize) f over all possiblepositions in the search space, defined by upper andlower boundaries.

Parameters ω, φp and φg, chosen by practitioner.

Termination criterion.

7

Page 8: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Set-Up

Cost (or fitness) function f : Rn → R.

Goal: minimize (or maximize) f over all possiblepositions in the search space, defined by upper andlower boundaries.

Parameters ω, φp and φg, chosen by practitioner.

Termination criterion.

8

Page 9: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Algorithm, Initialization

For each particle in the swarm:Initialize current position xi with uniform randomvector.

Set best position pi to xi .

If f (xi) < f (g), set g to xi .

Initialize velocity vi with uniform random vector.

9

Page 10: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Algorithm, Initialization

For each particle in the swarm:Initialize current position xi with uniform randomvector.

Set best position pi to xi .

If f (xi) < f (g), set g to xi .

Initialize velocity vi with uniform random vector.

10

Page 11: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Algorithm, Initialization

For each particle in the swarm:Initialize current position xi with uniform randomvector.

Set best position pi to xi .

If f (xi) < f (g), set g to xi .

Initialize velocity vi with uniform random vector.

11

Page 12: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Algorithm, Initialization

For each particle in the swarm:Initialize current position xi with uniform randomvector.

Set best position pi to xi .

If f (xi) < f (g), set g to xi .

Initialize velocity vi with uniform random vector.

12

Page 13: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Algorithm, Iteration

Until termination criterion, for each particle in the swarm,for each dimension, update position and velocity in the

following way:

(Note that I am leaving out indices for dimension, just tomake more readable.)

13

Page 14: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

To update velocity:

Uniformly pick random numbers rp, rg ∈ (0,1).

Update velocity based on parameters and randomlyselected numbers:

vi = ωvi + φprp(pi − xi) + φgrg(g − xi).

14

Page 15: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

To update velocity:

Uniformly pick random numbers rp, rg ∈ (0,1).

Update velocity based on parameters and randomlyselected numbers:

vi = ωvi + φprp(pi − xi) + φgrg(g − xi).

15

Page 16: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

To update velocity:

Uniformly pick random numbers rp, rg ∈ (0,1).

Update velocity based on parameters and randomlyselected numbers:

vi = ωvi + φprp(pi − xi) + φgrg(g − xi).

16

Page 17: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

To update velocity:

Uniformly pick random numbers rp, rg ∈ (0,1).

Update velocity based on parameters and randomlyselected numbers:

vi = ωvi + φprp(pi − xi) + φgrg(g − xi).

17

Page 18: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Update current position:

xi = xi + vi .

Check new f (xi) against particle and swarm, update ifimproved.

Keep going until termination.

18

Page 19: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Update current position:

xi = xi + vi .

Check new f (xi) against particle and swarm, update ifimproved.

Keep going until termination.

19

Page 20: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Update current position:

xi = xi + vi .

Check new f (xi) against particle and swarm, update ifimproved.

Keep going until termination.

20

Page 21: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Update current position:

xi = xi + vi .

Check new f (xi) against particle and swarm, update ifimproved.

Keep going until termination.

21

Page 22: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Acceleration Coefficients

Recall:vi = ωvi + φprp(pi − xi) + φgrg(g − xi).

Cognitive component: models tendency of particles toreturn to previous best positions.

Social component: quantifies performance relative toneighbors.

22

Page 23: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Acceleration Coefficients

Recall:vi = ωvi + φprp(pi − xi) + φgrg(g − xi).

Cognitive component: models tendency of particles toreturn to previous best positions.

Social component: quantifies performance relative toneighbors.

23

Page 24: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Acceleration Coefficients

Recall:vi = ωvi + φprp(pi − xi) + φgrg(g − xi).

Cognitive component: models tendency of particles toreturn to previous best positions.

Social component: quantifies performance relative toneighbors.

24

Page 25: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Inertia Weight ω

CrazinessMemory of the previous direction, prevents drasticchange in directions.Bigger ω means more searching ability for wholeswarm (exploration, don’t get trapped in local minima).Smaller ω means more searching ability for partialswarm (exploitation, gets to know local search areavery well).Experimental results: fastest convergence whenω ∈ (0.8,1.2).

25

Page 26: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Topology

Particles receive information from their neighbors.

Network of neighborhoods forms a graph.

Imitates different societies.

Characterize neighborhoods by connectivity,clustering.

26

Page 27: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Types of Topologies

Fully Connected Topology (gbest)Square Topology (Von Neumann)Ring Topology

27

Page 28: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Benefits

Makes few assumptions about the problem.

Doesn’t require differentiability (doesn’t use gradient).

Large spaces of candidate solutions.

Simple to implement.

28

Page 29: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Downsides

Does not guarantee optimality.

If maximum velocity too small, will only converge tolocal min.

Weak theoretical foundation.

Biased; solution more easily found if it is on axes.

29

Page 30: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Convergence

Based on experimental studies, relative to otherevolutionary algorithms, PSO has fast convergenceability but slow fine-tuning ability.Linearly decreasing inertia weight leads to betterperformance, but lacks global search ability.

30

Page 31: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Multiobjective/Constrained Optimization

Originally, PSO for single objective continuousproblem.Without constraints, sometimes particles want to gooutside search space.Particles initialized with only feasible solutions(speeds up search process).Only select feasible solutions as best values.Initialization takes longer.

31

Page 32: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Pareto Optimality

Search for multiple solutions.

Pick non-dominated solution.

Requires decision-maker at the end.

Aggregation: sum objective functions together usingweighted aggregation.

32

Page 33: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Pareto Optimality

Search for multiple solutions.

Pick non-dominated solution.

Requires decision-maker at the end.

Aggregation: sum objective functions together usingweighted aggregation.

33

Page 34: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Pareto Optimality

Search for multiple solutions.

Pick non-dominated solution.

Requires decision-maker at the end.

Aggregation: sum objective functions together usingweighted aggregation.

34

Page 35: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Pareto Optimality

Search for multiple solutions.

Pick non-dominated solution.

Requires decision-maker at the end.

Aggregation: sum objective functions together usingweighted aggregation.

35

Page 36: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Discrete Domains

Basic idea: map discrete search space to continuousspace, use a PSO, map result back to discrete space.Binary Particle Swarm Optimization – position isdiscrete, velocity is continuous.In velocity vector for agent i , vi , vij is probability thatxij = 1.

36

Page 37: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Applications

Human tremor analysis.

Biomedical Engineering.

Electric power and voltage management.

Machine scheduling.

Point Pattern Matching.

37

Page 38: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Applications

Human tremor analysis.

Biomedical Engineering.

Electric power and voltage management.

Machine scheduling.

Point Pattern Matching.

38

Page 39: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Applications

Human tremor analysis.

Biomedical Engineering.

Electric power and voltage management.

Machine scheduling.

Point Pattern Matching.

39

Page 40: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Applications

Human tremor analysis.

Biomedical Engineering.

Electric power and voltage management.

Machine scheduling.

Point Pattern Matching.

40

Page 41: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Applications

Human tremor analysis.

Biomedical Engineering.

Electric power and voltage management.

Machine scheduling.

Point Pattern Matching.

41

Page 42: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Open Shop Scheduling Problem

n jobs, m machines, each job has to be processed byeach machine at least once (m operations per job).Order irrevelant, processing time can be zero.Multi-objective: want to minimize completion time(makespan), minimize idle machine time.NP-hardTo use PSO, decode particle position into an activeschedule.

42

Page 43: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Permutation-Based PSO for Open Shop Scheduling Problem

Randomly generate group of particles represented bya permutation sequence (ordered list of operations)For n-job, m-machine problem, position of a particle isin m x n matrix.Let oij be operation of job j that must be processed onmachine i (these are the particle positions).Let the objective function be f(i,j), the earliest time atwhich oij can be finished.Minimize f , add the corresponding operations to theschedule.

43

Page 44: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Bibliography

44

Page 45: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Bibliography

Azlina, Nor, Mohamad Alias, Ammar Mohemmed, Kamarulzan Aziz."Particle Swarm Optimization for Constrained and MultiobjectiveProblems: A Brief Review." 2011 Conference on Management andArtificial Intelligence. PDER vol. 6 (2011).

Bai, Qinghai. "Analysis of Particle Swarm Optimization Algorithm."Computer and Information Science. Vol. 3, No. 1, February 2010.

45

Page 46: Particle Swarm Optimization - Stanford Universityweb.stanford.edu/class/cme334/docs/2012-11-14-Hogan_PSO.pdf · Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,

Clerc, Maurice and James Kennedy. "The Particle Swarm - Explosion,Stability, and Convergence in a Multidimensional Complex Space." IEETranscations on Evolutionary Computation, Vol. 6, No 1, February 2002.

McCaffrey, James. "Particle Swarm Optimization." MSDN Magazine.August 2011.

Montes de Oca, Marco. "Particle Swarm Optimization." University ofDelaware, 2011.

P. N. Suganthan. "Particle Swarm Optimiser with NeighbourhoodOperator." Proceedings of the IEEE Congress on EvolutionaryComputation (CEC), pages 1958-1962, 1999.

http://tracer.uc3m.es/tws/pso/neighborhood.html

46