liveBook · Manning

Binary particle swarm optimization

As explained in Optimization Algorithms: AI techniques for design, planning, and control problems

Binary particle swarm optimization is a particle swarm variant whose particle positions represent binary decisions rather than continuous parameter values.

Binary particle swarm optimization (BPSO) adapts particle swarm optimization to decisions represented by 0s and 1s. A particle’s position is a bit string rather than a vector of continuous values. This makes BPSO a candidate when each variable is a binary choice, as in feature selection. section 9.3

A BPSO update keeps the swarm’s cooperative search but changes how positions are chosen:

  • Evaluate particle positions and use each particle’s best-known position and the best-known position among its neighbors to guide the search. section 9.3 section 9.8
  • Update velocity as a real-valued quantity, then pass it through a sigmoid function to obtain a value between 0 and 1. section 9.3
  • For each bit, compare that value with a random number between 0 and 1 to choose its next position. A value of 0.3 means a 30% chance that the updated bit is 1—not a 30% chance that its current value flips. section 9.3

Check the representation before choosing a variant

A Python comparison uses PySwarms to train a neural network on penguin measurements with global-best, local-best, and binary PSO. In the reported run, their accuracies are 99.1%, 69.1%, and 43.8%, respectively. Binary PSO is a poor match here because the network parameters are continuous; its availability as an optimizer does not make every search space binary. section 9.7

Choose BPSO for a binary encoding, not merely because a problem is discrete: permutation-based PSO is another variant for discrete search. When experimenting, tune inertia and cognitive and social coefficients to balance exploration and exploitation, and check whether the representation matches the variables being optimized. section 9.3 section 9.8

How Optimization Algorithms: AI techniques for design, planning, and control problems covers it

How deep it goes
Explains bitwise positions, real-valued velocity, sigmoid conversion, and probabilistic updates without presenting a formal proof.
Examples
Uses a probability-of-one example and a PySwarms neural-network comparison that exposes a mismatch with continuous parameters.
What it assumes
Assumes basic particle swarm terminology while defining binary positions and explaining how sigmoid-based updates select bits.
What you can do after
Evaluate/understand it by matching binary PSO to binary variables and recognizing its poor fit for continuous neural-network parameters.
How it connects
Connects particle swarm optimization with feature selection, permutation-based PSO, and exploration–exploitation tuning.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Optimization Algorithms: AI techniques for design, planning, and control problems. The section links point to the parts of the book it draws on.