26
1 Thomas Stidsen DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the zoo Thomas Stidsen [email protected] DTU-Management Technical University of Denmark

Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

  • Upload
    dolien

  • View
    213

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

1Thomas Stidsen

DTU-Management / Operations Research

Ant Colony Optimization and ParticleSwarm Optimization– welcome to the zoo

Thomas Stidsen

[email protected]

DTU-Management

Technical University of Denmark

Page 2: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

2Thomas Stidsen

DTU-Management / Operations Research

OutlineAnt Colony Optimization (ACO)

Particle Swarm Optimization (PSO)

Page 3: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

3Thomas Stidsen

DTU-Management / Operations Research

The power of many ...One ant is stupid

But, many ants are smart collectively.

Page 4: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

4Thomas Stidsen

DTU-Management / Operations Research

What is Ant Optimization?“Swarm intelligence is a property of systems ofnon-intelligent robots exhibiting collectivelyintelligent behaviour”.

Characteristics:distributed, no central control or data source.ability to change environment.perception of environment, i.e. sensing.

Page 5: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

5Thomas Stidsen

DTU-Management / Operations Research

Pheromone Trails

Page 6: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

6Thomas Stidsen

DTU-Management / Operations Research

Pheromone Trails Continued

Page 7: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

7Thomas Stidsen

DTU-Management / Operations Research

Pheromone Trails Continued Again

Page 8: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

8Thomas Stidsen

DTU-Management / Operations Research

The Travelling SalesantWe have given a graph G = (N,A). dij is thedistance between i and j.

Before we start we have k ants in each city.

Page 9: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

9Thomas Stidsen

DTU-Management / Operations Research

The actions of an antChoose the next city to go to. The choise is afunction of the distance to the city and theamount of pheromone.

Cities already chosen can not be visited.

When finished: Put out a trail of pheromone onthe TSP-tour.

Page 10: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

10Thomas Stidsen

DTU-Management / Operations Research

The pheromone decisionWhen the salesant has to decide which next city tovisit:

0.15

....

0.05

0.01

.....

Page 11: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

11Thomas Stidsen

DTU-Management / Operations Research

Choose the next cityThe simple one:pij(t) =

τij(t)∑k∈jτij(t)

Generally the simple method has convergenceproblems as we do not consider the distance dij.

Define the visibility nij : nij = 1dij

.

Now define pij(t) as:

pij(t) =[τij(t)]

α[nij ]β

∑k∈j[τij(t)]α[nij ]β

if transition is allowed, 0

else.

Page 12: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

12Thomas Stidsen

DTU-Management / Operations Research

Be aware ofα and β controls the relative importance of trail andvisibility. Note that if α = 0 one would have a randomgreedy algorithm with multiple starting points.

High values of and will lead to stagnation, thatis, early convergence.

Low values of and might lead to weakconvergence.

In papers and values from 0:5 to 5 are often used.Experiments are needed to set them appropriately.

Page 13: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

13Thomas Stidsen

DTU-Management / Operations Research

Update of pheromoneBasicly we update the pheromone trail after eachTSP iteration:τij(t + 1) = γτij(t) + ∆τij(t)The factor 0 < γ < 1 is the “evaporation” factor. Thisensures a certain “dynamism” is the system.

Page 14: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

14Thomas Stidsen

DTU-Management / Operations Research

Update of pheromon continuedHow should we set ∆τij(t) ?

Arcs not used by the ant does not get anypheromone.

∆τij(t) =∑

k ∆τ kij(t)

Page 15: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

15Thomas Stidsen

DTU-Management / Operations Research

Update of pheromone continued again∆τ k

ij(t) = c where c is a constant.

Use the arc length dij of the ant k:∆τ kij(t) = Q

dij

where Q is a constant.

Use the tour length Tk of the ant k: ∆τ kij(t) = Q

Tk

where Q is a constant.

In an elitist strategy we put more emphasis onthe pheromone from the “good” ants.

Good values for γ generally tends to be from 0.5 to0.9.

Page 16: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

16Thomas Stidsen

DTU-Management / Operations Research

Stopping criterionRun a fixed number of iterations, or better: Fora fixed amount of time !

Run until stagnation occurs (all ants travel thesame tour).

Run until convergence has occurred (a softversion of stagnation).

Page 17: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

17Thomas Stidsen

DTU-Management / Operations Research

ACO - Biological SimilaritiesColony of cooperating individuals.

An (artificial) pheromone track.

A sequence of local moves.

A stochastic decision policy using local

information and no lookahead.

Page 18: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

18Thomas Stidsen

DTU-Management / Operations Research

The ACO algorithmInitialise pheromone valuesrepeat

Fora ant k ∈ {1, ...,m}construct k’th ant solution

EndforFor all pheromone values

decrease pheromone (evaporation)EndforFor all good solutions

increase pheromone (intensification)Endfor

until time

Page 19: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

19Thomas Stidsen

DTU-Management / Operations Research

ACO - Biological DifferencesTheir moves consists of transitions from state tostate.

Artificial ants has an internal state (= memory).

Artificial ants deposit an amount of pheromonethat is a function of the quality of the solutionfound.

Artificial ants’ timing inpheromone laying isproblem dependent and often does not reflectreal ants’ behaviour.

Extra capabilities are often added to enhancealgorithm performance.

Page 20: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

20Thomas Stidsen

DTU-Management / Operations Research

Different NamesAnt Colonies.

Ant Optimization.

Ant Systems.

Collective Intelligence.

Page 21: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

21Thomas Stidsen

DTU-Management / Operations Research

Particle Swarm OptimizationMimic a swarm of particles, insects ...

Gradually the swarm zooms in on the optimalsolution

Page 22: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

22Thomas Stidsen

DTU-Management / Operations Research

The PSO algorithm

Initialise location and velocity of each particlerepeat

For each particleevaluate objective function for each particle

For each particleupdate best solution

update best global solutionFor each particle

update the velocitycompute the new locations of the articles

until finished()

Page 23: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

23Thomas Stidsen

DTU-Management / Operations Research

The parameters are thenxid: The “new” positions ...

vid: The “velocity” of the particle (the newposition of the particle ...)

pid: The “individual” bests of the particles

pgd: The “global” best of all particles

Page 24: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

24Thomas Stidsen

DTU-Management / Operations Research

The Updatesvid = w · vid + c1 · r1 · (pid −xid)+ c2 · r2 · (pgd −xid)

xid = xid + vid

The effect is that the good solutions (particle posi-

tions) “attracts” the particles ...

Page 25: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

25Thomas Stidsen

DTU-Management / Operations Research

Solved ProblemsPSO is mostly used for continuous optimization(it seems)

There is an example in the book that

To my big surprise, there are actually articles whichdescribe PSO for different combinatorialoptimization problems ...

Page 26: Ant Colony Optimization and Particle Swarm · PDF fileThomas Stidsen 1 DTU-Management / Operations Research Ant Colony Optimization and Particle Swarm Optimization – welcome to the

26Thomas Stidsen

DTU-Management / Operations Research

CommentsFor continuous problems, it is very hard tocompare with gradient methods. PSO could beused if the functions are not differentiable ...

I doubt that it is reasonable for integer problems...

There are a number of suggestions forimprovements in the book.