Particle swarm optimization
Particle swarm optimization is a population-based optimization method in which candidate solutions adjust their positions using individual and collective search information.
Optimization Algorithms: AI techniques for design, planning, and control problems
Particle swarm optimization is a population-based optimization algorithm in which candidate particles adjust their movement using individual and collective experience.
- How it is used
- Uses cooperative, population-based search to tackle continuous and discrete optimization problems.
- How deep it goes
- Explains particle movement, best-known positions, tuning factors, and an implemented routing example without developing a formal proof.
- Examples
- Works through a Python implementation for a 20-city traveling salesman problem and names function optimization and neural network training as applications.
- What you can do after
- Applies it via PySwarms to evaluate and print a traveling salesman route.
Evolutionary Deep Learning: Genetic algorithms and neural networks
Particle swarm optimization is a population-based optimization algorithm in which candidate solutions move through a search space according to collective-swarm behavior.
- How it is used
- Applies population search to function parameters and automatic hyperparameter optimization.
- How deep it goes
- Works through DEAP particle generation, fitness evaluation, best tracking, velocity updates, and a complete swarm loop.
- Examples
- Uses cannon-shot velocity and angle to hit a target distance, plus loss-driven neural-network hyperparameter search.
- What you can do after
- Apply it via DEAP to optimize function inputs or map particle vectors to model hyperparameters.
Grokking AI Algorithms, Second Edition
Particle swarm optimization is a swarm-intelligence optimization technique in which particles adjust candidate solutions using collective and individual search information.
- How it is used
- Finds good solutions in large or high-dimensional search spaces without testing every possible value.
- How deep it goes
- Walks through initialization, fitness evaluation, repeated particle movement, stopping, and returning the best position; treats movement details as a further step.
- Examples
- Uses a drone’s aluminum–plastic mix and a mountain-peak analogy, then identifies electrode configuration and neural-network weights as applications.
- What you can do after
- Build it from scratch: initialize particles, evaluate fitness, repeat position updates, and return the best solution found.
Read how Grokking AI Algorithms, Second Edition explains particle swarm optimization →
Related concepts
- particleuses · A particle is an individual entity represented or managed as a unit within a physical or computational model.
- inertia componentuses · The inertia component is the particle-swarm velocity term that weights a particle’s previous velocity during movement updates.
- cognitive componentuses · A particle-swarm parameter controlling the influence of a particle’s attraction toward its own best-known position.
- social componentuses · The social component is a particle-swarm parameter that weights attraction toward the best-known position of the swarm or a neighborhood.
- populationuses · A population is a defined group or complete set of people, units, observations, or candidate solutions considered together in a particular context.
- hyperparameter tuninguses · Hyperparameter tuning is the process of selecting or adjusting configurable settings not learned directly from examples and evaluating their effects against a chosen objective.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


