← ACI Book Explained

BOOK NOTES · ENGELBRECHT CI 2ND ED. · CHAPTER 6

CI Chapter 6 — Particle Swarm Optimization.

aci engelbrecht chapter-6 AIMLCZG557

// the one-minute version

Particle Swarm Optimization, introduced by Kennedy and Eberhart in 1995, is swarm intelligence inspired by bird flocking and fish schooling. Instead of evolving a population through crossover and mutation, PSO moves a cloud of candidate solutions through the search space. Each particle remembers its own best position, listens to the best position found by its neighborhood or the whole swarm, and updates its velocity using inertia, personal experience, and social information. The result is a simple but surprisingly strong optimiser for continuous spaces, feature selection, neural network training, and many engineering problems.

Chapter 6 is the point where the ACI story shifts from Darwin-style evolution to collective motion. Chapter 5 gave us evolutionary computation: populations, selection pressure, recombination, mutation, and survival of fitter individuals. Chapter 7 will give us ants, pheromone, and constructive graph search. Particle Swarm Optimization sits beautifully between them. It is population-based like evolutionary algorithms, but the population does not reproduce. It is swarm-based like ACO, but it does not leave pheromone trails. Its memory lives inside particles and inside the communication topology of the swarm.

01 Why PSO belongs after evolutionary computation

PSO is easiest to understand if you first notice what it is not. It is not a genetic algorithm with a bird costume. There is no crossover operator taking two parent strings and splicing them into children. There is no mutation operator flipping bits or perturbing genes just to maintain diversity. There is usually no explicit survival contest where weak individuals are removed and strong individuals reproduce. A PSO particle stays itself. It moves.

That tiny change of verb matters. In a GA, the central question is: how do we create better offspring from existing solutions? In PSO, the central question is: how should each existing solution move next, given what it has personally learned and what the group has learned? So the algorithm feels less like breeding and more like coordinated navigation.

Kennedy and Eberhart originally developed PSO while thinking about social behaviour, especially the way flocks and schools appear to move with coordinated intelligence even though no single bird or fish is solving an optimisation equation. Individuals respond to their own state and to information from nearby individuals. The group pattern emerges from simple rules. That is the swarm-intelligence idea in one sentence.

key ideaPSO is a population-based optimiser where candidate solutions cooperate by sharing good discoveries. The search improves by movement through the space, not by reproduction.

02 The bird flocking metaphor, without over-romanticising it

The biological image is useful: imagine birds scattered over a landscape looking for food. Each bird can sense how good its current location is. Each bird remembers the best place it personally visited. It can also observe some successful neighbour or the best bird in the flock. A sensible bird will not teleport directly to the best known point, because the landscape might contain better food nearby and because sudden movement can overshoot. Instead, it drifts with momentum, bends toward its own memory, and bends toward social information.

That is already PSO. The landscape is the objective function. A bird is a particle. Food quality is fitness. A good remembered location is a best-so-far solution. Velocity is the current direction and speed of search. Randomness makes the pull imperfect, preventing the swarm from becoming a perfectly rigid machine.

The metaphor has limits. Real birds care about collision avoidance, aerodynamics, predators, and three-dimensional movement. PSO abstracts almost all of that away. What survives is the computationally useful part: multiple agents, simple local memory, social sharing, and adaptive movement. Engelbrecht's treatment emphasizes this distinction. We borrow inspiration from natural swarms, but the algorithm is a mathematical search process.

think of it likeImagine several students searching a huge library for the best explanation of a topic. Each remembers the best page they personally found. They also occasionally shout, “This shelf looks promising!” The group does not merge into one student; everyone keeps searching, but their movement is biased by shared clues.

03 Swarm intelligence versus evolutionary computation

Swarm intelligence and evolutionary computation both use populations, randomness, and iterative improvement, so students often lump them together. The clean distinction is the mechanism of adaptation. Evolutionary computation adapts through selection and variation. Better individuals tend to influence the next generation more strongly, and variation operators create new individuals. Swarm intelligence adapts through interaction among agents and the environment. Agents usually persist, communicate directly or indirectly, and adjust behaviour based on collective information.

In PSO, every particle is a candidate solution. The particle does not die when it performs badly. It is simply pulled by memory and by social experience. This makes PSO psychologically easier to follow than many EAs. You can track one particle across time and see exactly why it moved.

QuestionEvolutionary computationParticle Swarm Optimization
Main metaphorNatural evolutionFlocking / schooling / social learning
Population memberIndividual chromosomeParticle with position and velocity
Primary adaptationSelection, crossover, mutationMovement guided by pbest and gbest/lbest
MemoryMostly implicit in population compositionExplicit personal and social bests
Natural fitDiscrete, combinatorial, mixed encodingsContinuous numerical optimisation
the catchPSO is population-based, but that does not automatically make it evolutionary. No crossover plus no mutation plus persistent moving particles means the search logic is fundamentally different.

04 Anatomy of a particle

A particle is a tiny record containing enough state to fly through the search space. For particle number 1, 2, ..., or generally particle i, we usually track at least four things.

  • Position \(x_i(t)\): the current candidate solution at iteration \(t\). If the problem has \(d\) variables, then \(x_i\) is a vector in \(d\)-dimensional space.
  • Velocity \(v_i(t)\): the particle's current movement vector. It says how much the position will change and in what direction.
  • Personal best \(p_i\): also called pbest. This is the best position particle \(i\) has personally visited so far.
  • Social best \(g\): often called gbest when it is the best position found by the whole swarm. In local-topology PSO it may instead be the best position found in particle \(i\)'s neighborhood.

So a particle is not just a point. It is a point with memory and momentum. That is why PSO can be more efficient than naive random search. A purely random point forgets everything after evaluation. A PSO particle carries its own search history and can be influenced by the discoveries of others.

If the objective is minimisation, “best” means lowest function value. If the objective is maximisation, “best” means highest. In most textbook examples, including the clean numerical examples below, we minimise a function such as \(f(x)=x^2\).

05 The full PSO update equation

The standard PSO update has two lines. First update velocity:

\[ v_i(t+1)=w\,v_i(t)+c_1 r_1 (p_i - x_i(t)) + c_2 r_2 (g - x_i(t)) \]

Then update position:

\[ x_i(t+1)=x_i(t)+v_i(t+1) \]

Every symbol in that first line deserves a plain-English translation.

  • \(x_i(t)\) is particle \(i\)'s current position at time \(t\).
  • \(v_i(t)\) is particle \(i\)'s current velocity before the update.
  • \(v_i(t+1)\) is the new velocity that will be applied to the position.
  • \(p_i\) is the particle's personal-best position, the best place it personally found.
  • \(g\) is the social-best position available to the particle, usually the global best in the whole swarm.
  • \(w\) is the inertia weight. It controls how much old velocity carries forward.
  • \(c_1\) is the cognitive acceleration coefficient. It controls how strongly the particle trusts its own memory.
  • \(c_2\) is the social acceleration coefficient. It controls how strongly the particle trusts the swarm.
  • \(r_1\) and \(r_2\) are random numbers sampled from \([0,1]\), often independently for each dimension and each particle.

The equation is usually vector-valued. In two dimensions, for example, \(x_i=(x_{i1},x_{i2})\) and the same update is applied component by component. The random terms may differ per component, so the particle is not pulled in a perfectly straight deterministic line.

watch outDo not read \(p_i-x_i(t)\) and \(g-x_i(t)\) as abstract decoration. They are direction vectors. They point from the current position toward remembered good locations.

06 The three forces: inertia, cognitive pull, social pull

The velocity equation is much less scary when split into three forces. The first term, \(w\,v_i(t)\), is momentum. It says, “keep going somewhat in the direction you were already going.” A large inertia weight encourages wide exploration because particles keep flying across the search space. A small inertia weight damps movement, helping particles settle down.

The second term, \(c_1 r_1 (p_i-x_i(t))\), is the cognitive component. It says, “return toward the best place I personally discovered.” This protects individual experience. Even if the swarm is excited about some global location, a particle can still remember that it found something useful elsewhere.

The third term, \(c_2 r_2 (g-x_i(t))\), is the social component. It says, “move toward the best place the group knows about.” This is cooperation. Without it, each particle would be a private local searcher. With it, good discoveries spread through the swarm.

current \(x_i\) personal best \(p_i\) swarm best \(g\) inertia cognitive social one particle feels three pulls before its next step

Fig 1 — the PSO velocity update as three vector pulls: inertia from old motion, cognitive pull toward pbest, and social pull toward gbest or lbest.

The random numbers \(r_1\) and \(r_2\) are not noise for the sake of noise. They randomise how strongly each pull acts at each update. Sometimes a particle follows its own memory more. Sometimes it follows the swarm more. This variation keeps paths from being too synchronized.

07 Global-best and local-best topologies

The symbol \(g\) hides an important design choice. In the simplest version, \(g\) is the best position found by the entire swarm. This is called the global-best model, or gbest PSO. Its communication topology is a star: every particle can be influenced by the same best-known solution.

gbest tends to converge quickly because good information spreads instantly. If any particle finds a strong region, the whole swarm feels the pull. The downside is premature convergence. If the early best point is only locally good, the entire swarm may collapse around it before exploring enough alternatives.

Local-best PSO, or lbest PSO, restricts social information to a neighborhood. A particle may communicate only with two neighbours in a ring, or with four neighbours in a von Neumann grid. In that case \(g\) should be read as “best in my neighborhood,” not necessarily best in the whole swarm.

gbest starlbest ring g fast information, fast lock-in slower spread, more diversity

Fig 2 — gbest connects everyone to the same best particle; ring lbest spreads information gradually through neighbourhoods.

The exploration-exploitation tradeoff is the whole story. gbest is exploitative. It uses the best known information aggressively. lbest is more exploratory. Several parts of the swarm can investigate different basins before the whole group agrees. For rugged multimodal functions, lbest topologies often avoid early collapse better than pure gbest.

08 Inertia weight, constriction, and velocity clamping

The original PSO formulation did not always use the same inertia-weight notation that later became standard, but modern teaching often presents \(w\) as the main speed-control knob. If \(w\) is high, old velocity survives strongly, so particles roam. If \(w\) is low, motion is damped, so particles settle.

A popular strategy is a linearly decreasing inertia weight. Start with something like \(w=0.9\) to encourage exploration, then reduce toward \(w=0.4\) to encourage exploitation near the end. The schedule can be written as:

\[ w(t)=w_{max}-\frac{t}{T}\times(w_{max}-w_{min}) \]

Here \(T\) is the maximum number of iterations. This formula includes the exact idea: early motion is energetic, late motion is cautious.

Clerc and Kennedy's constriction-factor analysis gives another way to control swarm stability. Instead of only relying on inertia, we multiply the whole velocity update by a constriction factor \(\chi\):

\[ v_i(t+1)=\chi\left[v_i(t)+c_1r_1(p_i-x_i(t))+c_2r_2(g-x_i(t))\right] \] \[ \chi=\frac{2}{\left|2-\phi-\sqrt{\phi^2-4\phi}\right|}, \qquad \phi=c_1+c_2, \quad \phi>4 \]

A famous setting is \(c_1=c_2\approx2.05\), giving \(\phi\approx4.10\) and \(\chi\approx0.729\). This combination became popular because it gives a useful balance between convergence pressure and controlled movement.

Velocity clamping is a simpler safety device. It imposes a maximum allowed speed \(V_{max}\). Component-wise, after computing velocity, we clip it:

\[ v_{ij}\leftarrow \begin{cases} V_{max}, & \text{if } v_{ij}>V_{max} \\ -V_{max}, & \text{if } v_{ij}<-V_{max} \\ v_{ij}, & \text{otherwise} \end{cases} \]
watch outIf velocities are not controlled, particles can overshoot good regions again and again. If velocities are clamped too tightly, the swarm crawls and may not explore enough.

09 Parameter tuning guidance that actually helps

PSO has fewer knobs than many evolutionary algorithms, but the knobs interact. A common beginner setting is \(c_1=c_2=2\) with an inertia weight around 0.7. A common constriction-style setting is \(c_1=c_2\approx2.05\) with \(\chi\approx0.729\). A common inertia schedule is \(w\) decreasing from 0.9 to 0.4. These are not laws. They are sensible starting points.

The meaning of the parameters is more important than memorising numbers. Increasing \(c_1\) makes particles more individualistic. They orbit back toward their own discoveries and may preserve diversity longer. Increasing \(c_2\) makes particles more social. They rush toward the best shared discovery and may converge faster. Increasing \(w\) makes movement more ballistic. Decreasing \(w\) makes movement more careful.

High \(w\)

More momentum, wider exploration, higher chance of overshooting.

High \(c_1\)

More self-trust. Particles revisit personal discoveries and maintain variety.

High \(c_2\)

More social pressure. Faster convergence, more premature-collapse risk.

Small swarm

Cheap iterations, but limited coverage of the search space.

For simple smooth functions, gbest with moderate social pressure can work beautifully. For rugged functions with many local optima, use more particles, consider lbest topology, keep inertia higher for longer, or restart stagnant particles. The tuning question is always the same: are we exploring enough before we exploit?

10 A fully worked one-dimensional numerical iteration

Let us minimise \(f(x)=x^2\). The optimum is obviously \(x=0\), but that is exactly why it is a good teaching example: we can focus on the PSO bookkeeping rather than on a mysterious objective.

Use three particles at iteration \(t=0\):

ParticlePosition \(x_i(0)\)Velocity \(v_i(0)\)Fitness \(f(x)\)Initial pbest \(p_i\)
14.0-0.516.04.0
2-2.00.34.0-2.0
31.5-0.22.251.5

Because we are minimising, particle 3 has the best initial fitness, so the global best is \(g=1.5\). Choose \(w=0.7\), \(c_1=1.5\), and \(c_2=1.5\). Now update particle 1 using random values \(r_1=0.4\) and \(r_2=0.8\).

For particle 1, the personal-best term is zero because \(p_1=x_1(0)=4.0\). The social vector is \(g-x_1(0)=1.5-4.0=-2.5\). Therefore:

\[ \begin{aligned} v_1(1) &= 0.7(-0.5)+1.5(0.4)(4.0-4.0)+1.5(0.8)(1.5-4.0) \\ &= -0.35+0+1.2(-2.5) \\ &= -0.35-3.00 \\ &= -3.35 \end{aligned} \]

The new position is:

\[ x_1(1)=x_1(0)+v_1(1)=4.0+(-3.35)=0.65 \]

Now evaluate the new position: \(f(0.65)=0.4225\). That is better than particle 1's old personal best \(f(4)=16\), so update \(p_1=0.65\). It is also better than the previous global best \(f(1.5)=2.25\), so update \(g=0.65\).

key ideaOne particle's improvement immediately changes the social information available to the swarm. That is the cooperative learning mechanism in numbers.

11 A two-dimensional mini-step for vector intuition

In real optimisation, positions are often vectors. Suppose a particle is at \(x_i(t)=(3,4)\) with velocity \(v_i(t)=(-1,0.5)\). Its personal best is \(p_i=(2,1)\), and the swarm best is \(g=(0,0)\). Use \(w=0.5\), \(c_1=2\), \(c_2=2\), \(r_1=0.25\), and \(r_2=0.75\). For simplicity, use the same random values in both dimensions.

The terms are:

  • Inertia: \(0.5(-1,0.5)=(-0.5,0.25)\)
  • Cognitive: \(2(0.25)((2,1)-(3,4))=0.5(-1,-3)=(-0.5,-1.5)\)
  • Social: \(2(0.75)((0,0)-(3,4))=1.5(-3,-4)=(-4.5,-6)\)

Add them:

\[ v_i(t+1)=(-0.5,0.25)+(-0.5,-1.5)+(-4.5,-6)=(-5.5,-7.25) \]

So the next position is:

\[ x_i(t+1)=(3,4)+(-5.5,-7.25)=(-2.5,-3.25) \]

This example shows why velocity control matters. The particle was pulled strongly toward the origin and overshot it. That might be useful exploration, or it might be unstable behaviour if it repeats endlessly. In a real run, \(V_{max}\), constriction, or a smaller social coefficient would moderate the jump.

12 The algorithm in exam-friendly pseudocode

The complete PSO loop is short enough to memorise, but do not memorise it as a magic incantation. Read it as a repeated cycle of evaluation, memory update, social update, and movement.

  1. Initialise a swarm of particles with random positions and velocities.
  2. Evaluate each particle using the objective function.
  3. Set each particle's pbest to its initial position.
  4. Find the best pbest in the relevant topology and call it gbest or lbest.
  5. For each iteration, update velocities using inertia, cognitive, and social terms.
  6. Move particles by adding velocity to position.
  7. Apply bounds or repair if a particle leaves the legal search region.
  8. Evaluate new positions and update pbest values.
  9. Update neighborhood/global best values.
  10. Stop after a maximum iteration count, a target fitness, or a long period with no improvement.

If written compactly, the state update is almost a two-line engine wrapped in bookkeeping. That is one reason PSO became popular: it is simple to implement, easy to parallelise, and surprisingly competitive for many continuous problems.

the catchThe short pseudocode hides practical choices: boundary handling, topology, random sampling per dimension, velocity limits, stopping criteria, and scaling of variables can all change performance dramatically.

13 Boundary handling and scaling

Most real problems have bounds. A neural-network weight may be allowed between two values, a design variable may have a physical range, or a feature-selection vector may need binary decisions. If a particle flies outside the valid space, the implementation must decide what to do.

Common strategies include clamping position to the nearest boundary, reflecting velocity like a ball bouncing from a wall, resampling invalid coordinates, or penalising invalid solutions through the fitness function. None is universally best. Clamping is simple, but it can cause particles to pile up on boundaries. Reflection preserves motion but can create oscillation. Resampling restores legality but may inject too much randomness.

Scaling also matters. If one variable ranges from 0 to 1 and another ranges from 0 to 1,000, the same velocity settings do not mean the same thing in both dimensions. Good implementations normalise variables or choose velocity limits per dimension. In notation, you might transform a raw variable \(x\) to a scaled variable \(\tilde{x}\) before optimisation, then map it back for evaluation.

watch outBad scaling can make PSO look broken even when the algorithm is fine. If one dimension dominates movement numerically, the swarm may search a distorted version of the problem.

14 PSO versus GA versus ACO

Because this chapter sits between EC and ACO, the comparison is worth making explicit. All three are population-based CI methods, but they store and use information differently.

FeaturePSOGAACO
Main inspirationFlocks and schoolsBiological evolutionAnt foraging and pheromone
Candidate solutionParticle positionChromosome / individualConstructed path or solution
Search motionVelocity update in continuous spaceGenerate offspring by operatorsProbabilistic construction step by step
Information sharingpbest plus gbest/lbestSelection pressure through reproductionPheromone matrix \(\tau\) and heuristic visibility
Typical strengthsContinuous numerical optimisation, tuning, model parametersFlexible encodings, combinatorial and mixed problemsGraph, route, scheduling, TSP-style construction
Common riskPremature convergence / swarm stagnationLoss of diversity or disruptive crossoverPheromone stagnation and greedy lock-in
Mathematical flavourDifference vectors, velocities, sometimes \(\nabla f\)-free searchSelection and stochastic variationTransition probabilities with \(\alpha\), \(\beta\), and evaporation \(\rho\)

The phrase \(\nabla f\)-free matters. PSO does not need gradients. It only needs objective-function evaluations. That makes it useful when the function is noisy, discontinuous, non-differentiable, or too awkward for gradient methods. But if smooth gradients are cheap and reliable, gradient-based optimisation may be faster.

15 Variants: binary PSO, MOPSO, adaptive PSO, and hybrids

The original PSO is naturally continuous: positions and velocities are real-valued vectors. But many problems are discrete. Binary PSO adapts the idea by interpreting velocity as a probability-like tendency for a bit to be 1. A common mapping uses a sigmoid function:

\[ S(v)=\frac{1}{1+e^{-v}} \]

Then a bit may be set according to whether a random number is less than \(S(v)\). The position no longer changes by simple addition in the same physical sense, but the velocity still stores a tendency shaped by personal and social experience. Binary PSO is especially common in feature selection, where each bit says whether a feature is included.

Multi-objective PSO, usually called MOPSO, handles problems with more than one objective. Instead of one best solution, the algorithm tries to approximate a Pareto front: a set of tradeoff solutions where improving one objective would worsen another. MOPSO often keeps an external archive of non-dominated solutions and chooses social leaders from that archive to maintain diversity along the front.

Adaptive PSO changes parameters during the run. For example, it may adjust \(w\), \(c_1\), or \(c_2\) according to swarm diversity. Hybrid PSO combines PSO with local search, differential evolution, simulated annealing, or gradient fine-tuning. A common practical pattern is: let PSO find a promising region globally, then let a local optimiser polish the final answer.

16 Applications: where PSO shows up in practice

PSO became popular partly because it is easy to code and partly because the metaphor maps neatly onto parameter search. If you can represent a solution as a vector and compute a score, PSO is a candidate.

In neural-network training, a particle can represent all weights and biases. For a small network, a position vector \(\theta\) may contain every parameter. The objective is loss on training data, perhaps \(L(\theta)\). PSO then searches for a low-loss parameter vector without backpropagation. For large modern networks, pure PSO is usually too expensive compared with gradient methods, but for small networks, neuroevolution, controller tuning, or non-differentiable components, it can be useful.

In feature selection, a binary PSO particle represents selected and unselected features. The objective may combine validation accuracy with a penalty for using too many features. In engineering design, a particle may represent dimensions of an antenna, controller gains, structural parameters, or process settings. In clustering, particles may encode centroids. In hyperparameter tuning, each particle is one possible configuration.

think of it likePSO is a team of scouts walking over a foggy landscape where height equals solution quality. Each scout remembers its best camp and listens to the best camp reported by friends. Over time the scout paths concentrate around good valleys or peaks.

17 Convergence, premature convergence, and stagnation

PSO often converges in the practical sense that particles cluster and improvement slows. But practical convergence is not the same as proof of global optimality. Like GA and ACO, PSO is a stochastic metaheuristic. It trades guarantees for flexibility and speed on difficult landscapes.

Premature convergence happens when particles become too similar too early. In gbest PSO, this usually means the social best grabbed everyone before the swarm sampled enough of the search space. Velocity may shrink, pbest values may become nearly identical, and the swarm may hover around a local optimum. Stagnation is the annoying state where the algorithm keeps running but no meaningful improvement occurs.

Common cures include using lbest topology, increasing swarm size, restarting some particles, adding turbulence or mutation-like perturbations, adjusting inertia, reducing social pressure, or hybridising with local search. Another useful diagnostic is swarm diversity: if the average distance between particles collapses while fitness is still poor, the swarm is probably stuck.

common catches & gotchas

  • Confusing pbest and gbest — pbest belongs to one particle; gbest belongs to the whole swarm or neighborhood.
  • Forgetting velocity — position alone is not the particle state. Velocity is the movement memory.
  • Using huge velocity limits — particles may fly across good regions without exploiting them.
  • Using tiny velocity limits — the swarm may crawl and fail to escape local basins.
  • Assuming gbest is always better than lbest — gbest is faster, but lbest can preserve exploration.
  • Not normalising variables — dimensions with large numerical ranges can dominate motion.
  • Stopping only by iteration count — also watch improvement plateau and diversity collapse.

18 How to read Engelbrecht's PSO chapter for exams

For AIMLCZG557, do not treat PSO as a bag of formulas. The likely exam understanding is conceptual plus numerical. You should be able to define the particle state, write the velocity and position update equations, explain the roles of \(w\), \(c_1\), \(c_2\), \(r_1\), and \(r_2\), distinguish gbest from lbest, and compute at least one update step by hand.

When a numerical question appears, make a small table. Put columns for current position, current velocity, pbest, gbest or lbest, random values, new velocity, new position, new fitness, and whether pbest changes. Most mistakes disappear when the bookkeeping is visible.

Also remember the story arc. Chapter 5 says population search can improve through variation and selection. Chapter 6 says population search can improve through social learning and motion. Chapter 7 says population search can improve through stigmergic memory in the environment. These are three different answers to the same CI question: how can simple agents collectively search a huge space?

19 Stability intuition without drowning in theory

PSO has a rich stability literature because the velocity update can behave like a stochastic dynamical system. You do not need to derive the full theory for a first course, but the intuition is valuable. If inertia and acceleration are too strong, particles can oscillate or diverge. If damping is too strong, they can freeze before reaching useful areas. Stable PSO is about controlled oscillation that gradually concentrates around promising positions.

The constriction factor was introduced exactly because researchers wanted movement that did not explode. The inequality \(\phi>4\), where \(\phi=c_1+c_2\), and the formula for \(\chi\) are part of that story. The popular \(\chi\approx0.729\), \(c_1=c_2\approx2.05\) setting is not random folklore; it comes from analysing how particles move under attraction to best points.

Still, real landscapes are messy. Noise, constraints, boundary repairs, and high dimensionality can dominate elegant theory. So use stability theory as a guide, then validate empirically. Run multiple seeds. Compare against baselines. Plot convergence curves. Inspect whether different runs find similar solutions or wildly different ones.

key ideaA good PSO run usually starts spread out, discovers promising regions, narrows movement, and keeps just enough randomness to avoid worshipping the first decent point forever.

20 Why PSO feels intelligent

PSO feels intelligent because the swarm turns local experiences into coordinated search. No particle knows the whole objective landscape. No central planner computes a complete map. Yet the group becomes better over time because useful information is preserved and shared.

There is also a nice humility in PSO. A particle trusts itself, but not completely. It trusts the swarm, but not completely. It keeps momentum, but not completely. The algorithm works because these partial influences compete. Too much self-trust and particles ignore useful discoveries. Too much social trust and everyone crowds into one basin. Too much momentum and the swarm flies past answers. Too little momentum and it stops learning.

That balance is the core lesson. Computational intelligence rarely comes from one perfect rule. It comes from interacting pressures: exploration and exploitation, memory and randomness, independence and cooperation. PSO is one of the cleanest algorithms for seeing that balance directly in equations.

Who introduced PSO?

Particle Swarm Optimization was introduced by James Kennedy and Russell Eberhart in 1995, inspired by social behaviour such as bird flocking and fish schooling.

What is the difference between pbest and gbest?

pbest is the best position personally visited by one particle. gbest is the best position found by the whole swarm. In local-best PSO, the social best is the best found within a neighborhood instead of the whole swarm.

Does PSO use crossover or mutation?

Standard PSO does not use crossover or mutation. Particles persist and move according to velocity updates shaped by inertia, personal memory, and social memory.

Why do we need random numbers \(r_1\) and \(r_2\)?

They randomise the strength of the cognitive and social pulls. This prevents particles from moving in perfectly deterministic synchrony and helps preserve exploration.

Is PSO only for continuous optimisation?

The original form is most natural for continuous vectors, but variants such as binary PSO and MOPSO adapt the idea to discrete and multi-objective problems.

  • PSO is swarm intelligence inspired by flocking and schooling, introduced by Kennedy and Eberhart in 1995.
  • A particle stores position \(x_i\), velocity \(v_i\), personal best \(p_i\), and social best information.
  • The velocity update combines inertia, cognitive pull, and social pull.
  • gbest topologies converge quickly; lbest topologies preserve diversity longer.
  • Inertia schedules, constriction factors, and velocity clamping are stability tools.
  • PSO is strong for continuous optimisation, feature selection variants, neural-network tuning, and engineering design.
// chapter cheatsheetconcept quick-ref

core formulas

velocity\(v_i(t+1)=w v_i(t)+c_1r_1(p_i-x_i(t))+c_2r_2(g-x_i(t))\)
position\(x_i(t+1)=x_i(t)+v_i(t+1)\)
inertia schedule\(w(t)=w_{max}-\frac{t}{T}\times(w_{max}-w_{min})\)
constrictionUse \(\chi\approx0.729\) with \(c_1=c_2\approx2.05\) as a common stable starting point.

symbol guide

\(x_i\)Current position, meaning the candidate solution.
\(v_i\)Velocity, meaning direction and step size of movement.
\(p_i\)Personal best position found by particle \(i\).
\(g\)Global best or neighborhood best, depending on topology.
\(w,c_1,c_2\)Inertia, cognitive acceleration, and social acceleration.

practical memory hooks

gbestFast information spread, fast convergence, higher premature-convergence risk.
lbestSlower information spread, better diversity, useful on multimodal landscapes.
binary PSOUses velocity to shape bit-selection probabilities, common in feature selection.
main dangerStagnation: particles cluster too early around a local optimum.
← CI Chapter 5CI Chapter 7 →
© cvam — written in plaintext, served warm