Imagine birds flying over mountains trying to find the highest peak. Each bird remembers its own best spot and knows the group's best spot. They adjust their flight speed to move toward these best spots. That's PSO!
GA = population of chromosomes evolving via crossover & mutation
PSO = swarm of particles (birds) flying via velocity updates β much simpler, just 2 formulas!
Starting inertia (bird flies fast initially to explore)
0.9
ΞΈ_min
ΞΈmin
Final inertia (bird slows down to settle at optimum)
0.4
Convergence
β
When all birds reach the same position, answer is found
All x β 1.0
f(x)
f(x)
Objective function β the "height" at position x. Birds want max.
βxΒ²+2x+11
How cβ and cβ Work
Bird's current position (x)
β
βββββββββββββββββββββββββββββββββββ
βββ cβΒ·rβ pulls toward P_best (own memory)
βββββββββ cβΒ·rβ pulls toward G_best (group best)
If cβ > cβ β bird trusts itself more
If cβ > cβ β bird follows the group more
Usually cβ = cβ = 2 (book example uses 1)
GA vs PSO Comparison
GA
PSO
Representation
Binary strings (chromosomes)
Real numbers (positions)
Evolution
Crossover + mutation
Velocity update
Memory
No memory of past
Each particle remembers its best
Operators
Selection, crossover, mutation
Just velocity + position update
Simplicity
More complex
Much simpler (just 2 formulas)
Why Inertia ΞΈ Decreases?
Early iterations (ΞΈ = 0.9): Birds fly fast β explore large area β don't miss the peak
Late iterations (ΞΈ = 0.4): Birds slow down β fine-tune β settle exactly on the peak
Think of it like: first search the whole city for the restaurant, then slowly narrow down to the exact address.
Book Example 13.4 in Plain Words
Find maximum of f(x) = βxΒ² + 2x + 11 (answer: x=1, f=12)
4 birds start at: β1.5, 0.0, 0.5, 1.25
Bird 4 at x=1.25 has highest f = 11.9375, so G_best = 1.25
All birds get pulled toward 1.25. After iteration 1, they're at: 1.12, 1.19, 1.22, 1.25 (all near x=1!)
They keep adjusting until all converge to x β 1.0
PSO Dashboard
Ready
Best Solution Found
Run the optimization to see results.
Convergence Log
Iter
G_best Value
G_best x
Max |Ξx|
All Iteration Details (Step-by-Step)
Run the optimization to see detailed iteration computations for every particle.