Skip to main content

Physics & Swarm Algorithms: SA & PSO

Topic - When optimizing high-dimensional, non-differentiable engineering systems, physics-based and swarm-based algorithms provide powerful alternatives to evolutionary methods. Simulated Annealing (SA) exploits thermodynamic annealing principles to escape local minima via probabilistic uphill transitions, while Particle Swarm Optimization (PSO) coordinates decentralized swarm intelligence through inertia, personal memory, and social collaboration.


1. Algorithmic Comparison: SA vs. PSO​

DimensionSimulated Annealing (SA)Particle Swarm Optimization (PSO)
Foundational MetaphorStatistical thermodynamics and crystal annealingCollective flocking behavior of birds and fish
Search ParadigmSingle-point trajectory (state-to-state walk)Population-based (swarm of flying particles)
Governing EquationMetropolis probability: P=exp⁡(−ΔE/T)P = \exp(-\Delta E / T)Velocity vector update: Vit+1=wVit+c1r1Δpbest+c2r2Δgbest\mathbf{V}_i^{t+1} = w\mathbf{V}_i^t + c_1 r_1 \Delta \mathbf{pbest} + c_2 r_2 \Delta \mathbf{gbest}
Memory TrackingCurrent best state (xbest\mathbf{x}_{\text{best}})Dual memory: individual (pbesti\mathbf{pbest}_i) and swarm (gbest\mathbf{gbest})
Exploration ControlSystem temperature (TT), cooled via schedule T←αTT \leftarrow \alpha TInertia weight (ww), dynamically decayed over time
Primary DomainCombinatorial and discrete scheduling problemsContinuous multi-dimensional parameter spaces

2. Simulated Annealing (SA)​

Physical Metallurgy Analogy​

Simulated Annealing simulates the thermodynamic process of heating a metal alloy above its melting point and cooling it gradually:

  1. Heating Stage: High thermal energy enhances particle mobility, freeing atoms from existing crystalline dislocations.
  2. Isothermal Phase: Particles collide and exchange thermal energy at constant temperature within an equilibrium boundary.
  3. Cooling Stage: Gradual thermal decay reduces atomic kinetic motion, freezing molecules into the lowest possible energy crystal lattice.

The Metropolis Acceptance Criterion​

In a cost minimization problem, let ΔE=f(xnew)−f(xcurrent)\Delta E = f(\mathbf{x}_{\text{new}}) - f(\mathbf{x}_{\text{current}}).

  • If ΔE≤0\Delta E \le 0 (downhill move toward lower cost): Always Accept (xcurrent←xnew\mathbf{x}_{\text{current}} \leftarrow \mathbf{x}_{\text{new}}).
  • If ΔE>0\Delta E \gt 0 (uphill move toward higher cost): Accept with Metropolis Probability (PP):
P=exp⁡(−ΔET)\boxed{P = \exp\left(-\frac{\Delta E}{T}\right)}

A uniform random number r∼U(0,1)r \sim \mathcal{U}(0, 1) is drawn. If r<Pr \lt P, the inferior solution is accepted.


Temperature Trajectory & Cooling Schedules​

  • High Temperature (T→∞T \to \infty): P≈1P \approx 1. The algorithm accepts virtually every uphill move, exploring the entire landscape and jumping freely out of deep local valleys.
  • Low Temperature (T→0T \to 0): P→0P \to 0. Uphill moves are rejected; the algorithm behaves as a greedy local gradient descent, refining the solution.
  • Geometric Cooling Schedule: Tk+1=αTk(0.80≤α≤0.99)T_{k+1} = \alpha T_k \quad (0.80 \le \alpha \le 0.99)

3. Particle Swarm Optimization (PSO)​

Biological Metaphor & Swarm Mechanics​

Introduced by James Kennedy and Russell Eberhart (1995), PSO simulates the collective foraging intelligence of bird flocks. A swarm of MM particles navigates a continuous DD-dimensional search space without centralized coordination.

Each particle ii tracks three coordinates:

  1. Current Position (Xit\mathbf{X}_i^t): Coordinates in the problem domain.
  2. Personal Best (pbesti\mathbf{pbest}_i): The highest-fitness position achieved by particle ii across all iterations.
  3. Global Best (gbest\mathbf{gbest}): The highest-fitness coordinate discovered across the entire swarm.

The Governing Velocity and Position Equations​

Every particle updates its velocity vector and shifts position at time step t+1t+1 according to:

Vit+1=wVit⏟Inertia Component+c1r1(pbesti−Xit)⏟Cognitive (Personal) Component+c2r2(gbest−Xit)⏟Social (Swarm) Component\mathbf{V}_i^{t+1} = \underbrace{w \mathbf{V}_i^t}_{\text{Inertia Component}} + \underbrace{c_1 r_1 (\mathbf{pbest}_i - \mathbf{X}_i^t)}_{\text{Cognitive (Personal) Component}} + \underbrace{c_2 r_2 (\mathbf{gbest} - \mathbf{X}_i^t)}_{\text{Social (Swarm) Component}} Xit+1=Xit+Vit+1\mathbf{X}_i^{t+1} = \mathbf{X}_i^t + \mathbf{V}_i^{t+1}

  • Mathematical Role: wVitw \mathbf{V}_i^t preserves current flight momentum.
  • Search Function: High inertia (w≈0.9w \approx 0.9) drives broad exploration of unknown space. Low inertia (w≈0.4w \approx 0.4) focuses on localized exploitation.
  • Standard Practice: Linearly decrease ww over iterations from 0.90.9 to 0.40.4.

4. Exam Traps & Operational Nuances​


  • The Trap: Reducing temperature too rapidly (e.g., α=0.5\alpha = 0.5).
  • The Consequence: Known in metallurgy as quenching. Thermal motion vanishes before molecules escape crystalline dislocations, causing the algorithm to freeze permanently in a local minimum.
  • The Correction: Maintain gradual cooling (0.85≤α≤0.980.85 \le \alpha \le 0.98).

5. Summary & Cheatsheet​

Simulated Annealing

  • Metropolis: P=exp⁡(−ΔE/T)P = \exp(-\Delta E / T).
  • Cooling: T←αTT \leftarrow \alpha T (0.8≤α≤0.990.8 \le \alpha \le 0.99).
  • Property: High TT explores; low TT exploits.

Particle Swarm Optimization

  • Velocity: Vt+1=wVt+c1r1Δpbest+c2r2Δgbest\mathbf{V}^{t+1} = w\mathbf{V}^t + c_1 r_1 \Delta \mathbf{pbest} + c_2 r_2 \Delta \mathbf{gbest}.
  • Position: Xt+1=Xt+Vt+1\mathbf{X}^{t+1} = \mathbf{X}^t + \mathbf{V}^{t+1}.
  • Balance: Inertia ww decays from 0.90.9 to 0.40.4.

info

Key Takeaways

  • Asymptotic Optimality: Simulated Annealing guarantees asymptotic convergence to the global optimum provided the temperature decreases logarithmically or sufficiently slowly.
  • Swarm Consensus: Particle Swarm Optimization excels in continuous multi-dimensional search spaces by balancing individual memory (pbest\mathbf{pbest}) against swarm consensus (gbest\mathbf{gbest}).
  • Hyperparameter Discipline: Algorithm performance depends strictly on cooling parameters in SA and velocity clamping/inertia tuning in PSO.

Next Section: Review the Module 4 Exam Prep Checklist and Solved Practice Problems for examination review and practice exercises.