0% found this document useful (0 votes)
8 views

Particle Swarm Optimization paper

Particle Swarm Optimization

Uploaded by

Murilo De Jesus
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Particle Swarm Optimization paper

Particle Swarm Optimization

Uploaded by

Murilo De Jesus
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Particle Swarm

Optimization

Aman Gupta
2K21/SE/21
Pattern Recognition
In PSO, the focus in on a group of birds. This group of birds is
referred to as a ‘swarm‘. Let’s try to understand the Particle
Swarm Optimization from the following scenario.

Example: Suppose there is a swarm (a group of birds). Now, all the birds are hungry and are
searching for food. These hungry birds can be correlated with the tasks in a computation system
which are hungry for resources. Now, in the locality of these birds, there is only one food
particle. This food particle can be correlated with a resource. As we know, tasks are many,
resources are limited. So this has become a similar condition as in a certain computation
environment. Now, the birds don’t know where the food particle is hidden or located. In such a
scenario, how the algorithm to find the food particle should be designed. If every bird will try to
find the food on its own, it may cause havoc and may consume a large amount of time. Thus on
careful observation of this swarm, it was realized that though the birds don’t know where the
food particle is located, they do know their distance from it. Thus the best approach to finding
that food particle is to follow the birds which are nearest to the food particle. This behavior of
birds is simulated in the computation environment and the algorithm so designed is termed as
Particle Swarm Optimization Algorithm.
Inspiration of the algorithm

Particle Swarm Optimization (PSO) is a powerful meta-heuristic optimization algorithm and


inspired by swarm behavior observed in nature such as fish and bird schooling. PSO is a
Simulation of a simplified social system. The original intent of PSO algorithm was to graphically
simulate the graceful but unpredictable choreography of a bird flock.

In nature, any of the bird’s observable vicinity is limited to some range. However, having more
than one birds allows all the birds in a swarm to be aware of the larger surface of a fitness
function.

Let’s mathematically model, the above-mentioned principles to make the swarm find the global
minima of a fitness function
Mathematical model

1. Each particle in particle swarm optimization has an associated position,


velocity, fitness value.
2. Each particle keeps track of the particle_bestFitness_value
particle_bestFitness_position.
3. A record of global_bestFitness_position and global_bestFitness_value is
maintained.
Parameters and Hyperparameters of the
algorithm:

Parameters of problem: Hyperparameters of the algorithm:

1. Number of dimensions (d) 1. Number of particles (N)


2. Lower bound (minx) 2. Maximum number of iterations
3. Upper bound (maxx) (max_iter)
3. Inertia (w)
4. Cognition of particle (C1)
5. Social influence of swarm (C2)
Algorithm
Step1: Randomly initialize Swarm population of N particles Xi ( i=1, 2, …, n)
Step2: Select hyperparameter values
w, c1 and c2
Step 3:
For Iter in range(max_iter): # loop max_iter times
For i in range(N): # for each particle:
a. Compute new velocity of ith particle
swarm[i].velocity = w*swarm[i].velocity + r1*c1*(swarm[i].bestPos - swarm[i].position)
+ r2*c2*( best_pos_swarm - swarm[i].position)
b. Compute new position of ith particle using its new velocity
swarm[i].position += swarm[i].velocity
c. If position is not in range [minx, maxx] then clip it
if swarm[i].position < minx:
swarm[i].position = minx
elif swarm[i].position > maxx:
swarm[i].position = maxx
d. Update new best of this particle and new best of Swarm
if swaInsensitive to scaling of design variables.rm[i].fitness < swarm[i].bestFitness:
swarm[i].bestFitness = swarm[i].fitness
swarm[i].bestPos = swarm[i].position
if swarm[i].fitness < best_fitness_swarm
best_fitness_swarm = swarm[i].fitness
best_pos_swarm = swarm[i].position
End-for
End -for
Step 4: Return best particle of Swarm
Advantages and Disadvantages Of PSO

Advantages of PSO: Disadvantages of PSO:

1. Insensitive to scaling of design 1. Slow convergence in the refined


variables. search stage (Weak local search
2. Derivative free. ability).
3. Very few algorithm parameters.
4. Very efficient global search algorithm.
5. Easily parallelized for concurrent
processing.
Animation to understand better

You might also like