0% found this document useful (0 votes)
10 views11 pages

Particle Swarm Optimization (PSO) - An Overview - GeeksforGeeks

Particle Swarm Optimization (PSO) is a metaheuristic optimization algorithm inspired by the social behavior of birds and fish, designed to find optimal solutions in complex problems. The algorithm involves a swarm of particles that adjust their positions based on their own experience and that of their neighbors, aiming to minimize a fitness function. While PSO is efficient and easy to implement, it has limitations such as slow convergence during the refined search stage.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views11 pages

Particle Swarm Optimization (PSO) - An Overview - GeeksforGeeks

Particle Swarm Optimization (PSO) is a metaheuristic optimization algorithm inspired by the social behavior of birds and fish, designed to find optimal solutions in complex problems. The algorithm involves a swarm of particles that adjust their positions based on their own experience and that of their neighbors, aiming to minimize a fitness function. While PSO is efficient and easy to implement, it has limitations such as slow convergence during the refined search stage.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Particle Swarm Optimization (PSO) –

An Overview
Last Updated : 25 May, 2023

The process of finding optimal values for the specific parameters of a given
system to fulfill all design requirements while considering the lowest
possible cost is referred to as an optimization. Optimization problems can
be found in all fields of science.

Conventional optimization algorithms (Deterministic algorithms) have some


limitations such as:

single-based solutions
converging to local optima
unknown search space issues

To overcome these limitations, many scholars and researchers have


developed several metaheuristics to address complex/unsolved optimization
problems. Example: Particle Swarm Optimization, Grey wolf optimization,
Ant colony Optimization, Genetic Algorithms, Cuckoo search algorithm, etc.

The Introduction to Particle Swarm Optimization (PSO) article explained the


basics of stochastic optimization algorithms and explained the intuition
behind particle swarm optimization (PSO). This article aims to deep dive
into particle swarm optimization (PSO).

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

Build a
meaningful
career in tech

Mathematical model

Each particle in particle swarm optimization has an associated position,


velocity, fitness value.
Each particle keeps track of the particle_bestFitness_value
particle_bestFitness_position.
A record of global_bestFitness_position and global_bestFitness_value is
maintained.
:
Fig 1: Data structure to store Swarm population

Fig 2: Data structure to store ith particle of Swarm

Algorithm

Parameters of problem:

Number of dimensions (d)


Lower bound (minx)
Upper bound (maxx)
:
Hyperparameters of the algorithm:

Number of particles (N)


Maximum number of iterations (max_iter)
Inertia (w)
Cognition of particle (C1)
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 of PSO:

1. Insensitive to scaling of design variables.


2. Derivative free.
3. Very few algorithm parameters.
4. Very efficient global search algorithm.
5. Easily parallelized for concurrent processing.

Disadvantages of PSO:

1. Slow convergence in the refined search stage (Weak local search


ability).

Are you passionate about data and looking to make one giant leap into your
career? Our Data Science Course will help you change your game and,
most importantly, allow students, professionals, and working adults to tide
over into the data science immersion. Master state-of-the-art methodologies,
powerful tools, and industry best practices, hands-on projects, and real-
world applications. Become the executive head of industries related to Data
AI ML DS Machine
Analysis, Data Science Data Analysis
Learning, and DataData Visualization with
Visualization Machine
theseLearning
growing Deep Learning
skills. Ready to Transform Your Future? Enroll Now to Be a Data Science
:
Expert!

S shaa… Follow 12

Next Article
Fuzzy Optimization Techniques: An
Overview

Similar Reads ▲

Implementation of Particle Swarm Optimization


Previous article Particle Swarm Optimization - An Overview talked
about inspiration of particle swarm optimization (PSO) , it’s…
mathematical
7 min read
modelling and algorithm. In this article we will implement
particle swarm optimization (PSO) for two fitness functions 1)
Rastrigin function 2) Sphere function. The algorithm will run for a
predefined number o
Cat Swarm Optimization
Nature is replete with social compartments to carry out various jobs.
Even if the final goal of all persons and collective conduct is survival…
5 min read
:
5 min read

How To Make Counts Appear In Swarm Plot For Seaborn?


Swarm plots, a type of dot plot, effectively visualize data distribution
within categories. Unlike standard dot plots, swarm plots avoid…
overlapping points, making it easier to see individual values. However,
3 min read
including the count of data points in each category can further
enhance the plot's clarity. This article will guide you through the
process o
Bee Swarm with SHAP Values for Random Forest in R
SHAP values offer a potent technique for the interpretability of
predictions and shed light on where each feature is guiding the…
outcome. One can better understand the importance and interactions
5 min read
of features by visualizing these SHAP values using bee swarm plots.
The following article is a step-by-step guide on how to use SHAP
values in the interpr
Overlaying Box Plot on Swarm Plot in Seaborn
Seaborn is a powerful Python library built on top of Matplotlib,
designed for creating attractive and informative statistical graphics. I…
provides a high-level interface for drawing attractive and informative
4 min read
statistical graphics, making it easier to create complex visualizations
with less code. One of the key features of Seaborn is its ability to

Customizing the Position of a Single Swarm Group


When visualizing data with Seaborn, the swarmplot function is an
effective tool to display individual data points within a category.…
However, there might be scenarios where you want to customize the
3 min read
position of a single swarm group, for example, to make your
visualization clearer or to emphasize a particular data group. This
article will guide you
How to Create a Swarm Plot with Matplotlib
Swarm plots, also known as beeswarm plots, are a type of categorical
scatter plot used to visualize the distribution of data points in a…
dataset. Unlike traditional scatter plots, swarm plots arrange data
5 min read
points so that they do not overlap, providing a clear view of the
distribution and density of data points across different categories. This
makes
Plotting a column-wise bee-swarm plot in Python
Bee-swarm plots are a great way to visualize distributions, especially
when you're dealing with multiple categories or columnar data. They…
allow you to see the distribution of points in a dataset while avoiding
5 min read
:
Uni-variate Optimization vs Multivariate Optimization
Wikipedia defines optimization as a problem where you maximize or
minimize a real function by systematically choosing input values fro…
an 4allowed
min read
set and computing the value of the function. That means
when we talk about optimization we are always interested in finding
the best solution. So, let say that one has some functional form(e.g in
the for
Hyperparameter Optimization Based on Bayesian…
Optimization
In this article we explore what is hyperparameter optimization and how
can we use Bayesian Optimization to tune hyperparameters in vario…
machine learning models to obtain better prediction accuracy. Before
7 min read
we dive into the how's of implementing Bayesian Optimization, let us
learn what is meant by hyperparameters and hyperparameter
optimization. H
Article Tags : AI-ML-DS Machine Learning

Practice Tags : Machine Learning

Corporate & Communications Address:-


A-143, 9th Floor, Sovereign Corporate
Tower, Sector- 136, Noida, Uttar Pradesh
(201305) | Registered Address:- K 061,
Tower K, Gulshan Vivante Apartment,
Sector 137, Noida, Gautam Buddh Nagar,
Uttar Pradesh, 201305

Company
About Us
Legal
In Media
Contact Us
:
Advertise with us
GFG Corporate Solution
Placement Training Program
GeeksforGeeks Community

Languages
Python
Java
C++
PHP
GoLang
SQL
R Language
Android Tutorial
Tutorials Archive

DSA
Data Structures
Algorithms
DSA for Beginners
Basic DSA Problems
DSA Roadmap
Top 100 DSA Interview Problems
DSA Roadmap by Sandeep Jain
All Cheat Sheets

Data Science & ML


Data Science With Python
Data Science For Beginner
Machine Learning
ML Maths
Data Visualisation
Pandas
NumPy
NLP
Deep Learning

Web Technologies
HTML
CSS
JavaScript
TypeScript
ReactJS
NextJS
:
NextJS
Bootstrap
Web Design

Python Tutorial
Python Programming Examples
Python Projects
Python Tkinter
Web Scraping
OpenCV Tutorial
Python Interview Question
Django

Computer Science
Operating Systems
Computer Network
Database Management System
Software Engineering
Digital Logic Design
Engineering Maths
Software Development
Software Testing

DevOps
Git
Linux
AWS
Docker
Kubernetes
Azure
GCP
DevOps Roadmap

System Design
High Level Design
Low Level Design
UML Diagrams
Interview Guide
Design Patterns
OOAD
System Design Bootcamp
Interview Questions

Inteview Preparation
Competitive Programming
:
Competitive Programming
Top DS or Algo for CP
Company-Wise Recruitment Process
Company-Wise Preparation
Aptitude Preparation
Puzzles

School Subjects
Mathematics
Physics
Chemistry
Biology
Social Science
English Grammar
Commerce
World GK

GeeksforGeeks Videos
DSA
Python
Java
C++
Web Development
Data Science
CS Subjects

@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved


:

You might also like