Particle Swarm and Ant Colony Optimization
A genetic algorithm borrows from evolution: solutions breed, and the good ones have more children. The two methods in this chapter borrow from something faster and stranger — the coordinated behaviour of a swarm, in which individuals of no particular intelligence produce collectively intelligent results by sharing information. In particle swarm optimization, candidate solutions fly through a continuous space, pulled by their own best memory and by their neighbours' best discovery. In ant colony optimization, artificial ants build solutions step by step and leave chemical traces that bias the ants who follow. Both are population methods; neither uses recombination; each dominates a different half of the optimization world.
- What swarm intelligence is, and the two ways a swarm shares information — social learning and stigmergy.
- The PSO velocity and position updates, and the meaning of the inertia, cognitive and social terms.
- Inertia schedules, velocity clamping, the constriction factor, and why swarms stagnate.
- Topologies — how \(gbest\) and \(lbest\) trade convergence speed against diversity.
- The Ant System: the pheromone–visibility transition rule, deposit and evaporation.
- The ACS and MAX–MIN variants, and when to reach for PSO, ACO, or a GA.
Swarm Intelligence
A single ant is nearly mindless. It has poor eyesight, no map, no plan, and no conception of the colony's goal. Yet a colony reliably discovers the shortest route to a food source, and does so without any ant ever comparing two routes. A flock of starlings turns as one without a leader. This is swarm intelligence: complex, apparently purposeful global behaviour emerging from simple local rules, applied by many individuals, with no central control.
For an optimizer the appeal is obvious. If a colony can solve a shortest-path problem it cannot even perceive, using rules simple enough to write in three lines, then those rules are worth stealing. Two mechanisms do the work, and the distinction between them is exactly the distinction between the two algorithms in this chapter.
| Mechanism | How information travels | Biological original | Algorithm |
|---|---|---|---|
| Social learning | Individuals observe each other and are attracted toward what others have found | Birds flocking, fish schooling | Particle swarm optimization |
| Stigmergy | Individuals modify the environment; later individuals read the modification | Ants laying pheromone trails | Ant colony optimization |
Stigmergy — coined by Grassé in 1959 for termite mound-building — deserves the emphasis, because it is the more radical idea. The ants never communicate with one another at all. They communicate with the ground, and the ground remembers. Information persists after its author has gone, accumulates when many agree, and fades when unreinforced. That is a shared memory external to every individual, and it is a genuinely different way to build an algorithm.
Both methods are population-based, so both inherit the strengths Chapter 23 attributed to that class: many regions sampled at once, trivial parallelism, robustness to ruggedness. But note what they do not inherit from Chapter 24. Neither method has crossover; neither kills anyone. A GA's population is a gene pool that turns over every generation. A swarm's population is a fixed cast of individuals that persist for the whole run and merely change what they know.
The Particle Swarm Algorithm
Kennedy and Eberhart introduced PSO in 1995 after trying to simulate a flock of birds and noticing that the simulation, pointed at an objective function, optimised it. A swarm of \(N\) particles flies through \(\mathbb{R}^n\). Particle \(i\) carries three things: where it is, how fast it is going, and the best place it has personally ever been.
| Symbol | Name | Meaning |
|---|---|---|
| \(\mathbf{x}_i^k\) | Position | A candidate solution — the design vector itself |
| \(\mathbf{v}_i^k\) | Velocity | The step to be added this iteration; the particle's momentum and direction |
| \(\mathbf{p}_i\) | Personal best (\(pbest\)) | The best position particle \(i\) has visited so far — its private memory |
| \(\mathbf{g}\) | Global best (\(gbest\)) | The best position any particle has visited — the shared memory |
Each iteration, every particle updates its velocity from three influences and then moves. These two lines are the entire algorithm:
\[ \mathbf{x}_i^{k+1} = \mathbf{x}_i^{k} + \mathbf{v}_i^{k+1} \]
with \(r_1, r_2 \sim U(0,1)\) drawn afresh for every particle, every dimension, every iteration. That per-component randomness is essential — it is the swarm's only source of diversity.
The full procedure is then short enough to state completely:
- Initialise \(N\) particles with random positions across the search domain and small random velocities.
- Evaluate \(f(\mathbf{x}_i)\) for every particle.
- Update \(\mathbf{p}_i\) if the particle's current position beats its own record; update \(\mathbf{g}\) if it beats the swarm's.
- Update every velocity by the equation above, clamping to \(\pm\mathbf{v}_{\max}\) if used.
- Move every particle: \(\mathbf{x}_i \leftarrow \mathbf{x}_i + \mathbf{v}_i\). Repair any particle that has left the feasible box.
- Repeat from step 2 until the evaluation budget is spent or the swarm stops improving. Report \(\mathbf{g}\).
Compare this to a genetic algorithm and the economy is striking. There is no encoding — a particle is the design vector, in the units the engineer already uses. There is no selection, no crossover, no mutation, and nothing dies. The whole method is a difference equation, which is also why PSO has been analysed far more successfully than most metaheuristics: it is a linear dynamical system with stochastic coefficients, and its stability can be studied directly.
Inertia, Cognitive & Social Terms
The velocity update earns its behaviour from the tension between its three terms. Read each as a separate opinion about where the particle should go, with the sum a compromise.
| Term | Says | Contributes | If dominant |
|---|---|---|---|
| Inertia \(w\mathbf{v}_i\) | "Keep going the way you were going" | Momentum — carries the particle across barriers and past the pull of the bests | The swarm flies off and never settles |
| Cognitive \(c_1r_1(\mathbf{p}_i - \mathbf{x}_i)\) | "Return to the best you have found" | Individual memory; nostalgia — a spring anchored at \(\mathbf{p}_i\) | Particles search independently; no cooperation at all |
| Social \(c_2r_2(\mathbf{g} - \mathbf{x}_i)\) | "Go where the swarm's best is" | Cooperation — the channel through which discovery spreads | All particles collapse onto \(\mathbf{g}\); premature convergence |
The cognitive and social terms are literally spring forces: each pulls the particle toward an attractor with a strength proportional to the distance, so a particle far from \(\mathbf{g}\) is yanked hard while one already there feels nothing. Without inertia the particle would be over-damped and simply slide to a point between \(\mathbf{p}_i\) and \(\mathbf{g}\). Inertia makes it overshoot — and overshoot is what lets the swarm explore past its own best guesses instead of collapsing onto them. A particle that always stopped exactly where the springs balanced would learn nothing new.
Parameters, Topology & Stagnation
PSO has few parameters, and each is a direct handle on the exploration–exploitation dial of Section 23-4.
| Parameter | Role | Typical value | Effect of increasing |
|---|---|---|---|
| \(w\) | Inertia weight | \(0.9 \to 0.4\), linearly decreasing | More exploration; above \(\approx 1\) the swarm diverges |
| \(c_1\) | Cognitive coefficient | \(2.0\) (or \(1.49\)) | More independent search; less cooperation |
| \(c_2\) | Social coefficient | \(2.0\) (or \(1.49\)) | Faster convergence; more risk of collapse |
| \(N\) | Swarm size | \(20\)–\(50\) | Better coverage; proportionally more evaluations |
| \(v_{\max}\) | Velocity clamp | \(0.1\)–\(0.2\) of the domain range | Longer jumps allowed; too large and particles fly out of the domain |
The inertia schedule is the workhorse. Shi and Eberhart's linear rule, \(w_k = w_{\max} - (w_{\max}-w_{\min})\,k/K\), starts the swarm loose and wide and finishes it tight and local — the exploration-to-exploitation slide made into arithmetic, exactly as the cooling schedule does for simulated annealing in Chapter 26.
The alternative is Clerc and Kennedy's constriction factor, which arrives at damping by analysis rather than by schedule. Treat the particle as a linear system and ask what keeps it stable; the answer is to multiply the whole velocity by a factor \(\chi\):
The canonical choice \(\varphi = 4.1\) gives \(\chi = 0.7298\), and the method then needs no velocity clamp at all — convergence is guaranteed by the algebra rather than enforced by a cap. It is also, as Example 2 shows, algebraically identical to the inertia form with \(w = 0.7298\) and \(c_1 = c_2 = 1.4962\). The two "competing" formulations are the same equation.
The other design choice is topology: who counts as "the swarm" in the social term. Using the true global best (\(gbest\)) makes every particle a neighbour of every other; using a ring in which each particle sees only two neighbours (\(lbest\)) lets good news travel slowly, so different parts of the swarm can explore different basins for a while.
That framing explains PSO's characteristic failure. Suppose the swarm converges: every particle sits on \(\mathbf{g}\), so \(\mathbf{p}_i = \mathbf{g} = \mathbf{x}_i\) and both spring terms vanish identically. The update degenerates to \(\mathbf{v}_i^{k+1} = w\mathbf{v}_i^{k}\) — a geometric decay to zero for any \(w < 1\). The swarm freezes, permanently, wherever it happens to be, whether or not that place is any good.
Collapse is self-reinforcing and irreversible: with no diversity there is no force, and with no force there is no diversity. This is why an \(lbest\) ring, a larger \(w\), or a re-diversification trigger matters — a converged swarm cannot restart itself.
Stigmergy & the Double Bridge
The experiment that founded ACO is worth describing exactly, because the algorithm is a direct transcription of it. Goss and colleagues connected an Argentine ant nest to a food source by two bridges, one twice as long as the other, and watched. Ants leaving the nest initially chose at random — they cannot see the food and have no way to measure a bridge. Within minutes, almost the entire colony was using the short bridge.
No ant compared the two. The mechanism is entirely mechanical: ants lay pheromone as they walk, and ants prefer paths with more pheromone. An ant taking the short bridge reaches the food and returns sooner, so its trail is laid down twice while a long-bridge ant is still travelling. The short bridge therefore accumulates pheromone faster; the higher concentration attracts more ants; more ants lay more pheromone. It is autocatalysis — a positive feedback loop in which the difference in trip time is amplified into a difference in choice.
The pheromone table is a memory that no individual owns: it survives the ants who wrote it, sums the opinions of many, and forgets what is not reinforced. Positive feedback discovers a good path; evaporation is what stops the first accidental consensus from becoming permanent.
Both halves of that last sentence matter. Feedback without forgetting locks in whatever the first few ants did — and in the real experiment, if the short bridge is added only after the colony has committed to the long one, the ants never switch, because their pheromone does not evaporate fast enough. Artificial ants, unbound by chemistry, are given an evaporation rate we control. Evaporation is not a modelling detail; it is the exploration mechanism, and Example 6 measures exactly how long the colony's memory lasts.
The Ant System
Dorigo's Ant System (1992) turns the bridge into an algorithm. Take the TSP as the standard vehicle. Each edge \((i,j)\) of the city graph carries a pheromone level \(\tau_{ij}\), which the colony writes, and a visibility \(\eta_{ij} = 1/d_{ij}\), which the problem provides and never changes. Each ant builds a complete tour by walking the graph, choosing its next city probabilistically from those it has not yet visited.
Ant \(k\) at city \(i\) moves to \(j\) with this probability, where \(N_i^k\) is its set of unvisited cities. The exponents are the whole design: \(\alpha\) weights learned experience (pheromone), \(\beta\) weights problem knowledge (short edges). The denominator merely normalises over the legal moves.
The two exponents deserve to be read as a dial of their own. Set \(\alpha = 0\) and pheromone is ignored — the ants become a randomised nearest-neighbour heuristic that learns nothing. Set \(\beta = 0\) and distance is ignored — the colony learns from experience alone, converging slowly and often badly. Typical settings \(\alpha = 1\), \(\beta \in [2,5]\) say something quietly important: trust the problem's own structure more than your accumulated opinion, at least at first.
Once every ant has completed a tour, the colony writes to the environment. This happens in two steps, and their order matters: everything evaporates, then the ants deposit in proportion to how good their tours were.
Here \(L_k\) is the length of ant \(k\)'s tour, \(Q\) a constant, and \(\rho \in (0,1]\) the evaporation rate. The deposit \(Q/L_k\) is the mechanism that replaces the real ants' round-trip timing: a shorter tour is a larger deposit, so good solutions shout louder — and an edge on many good tours gets reinforced many times over. Meanwhile \((1-\rho)\) applies to every edge, including those no ant chose, so unused edges fade geometrically toward irrelevance and old mistakes are forgotten.
The full loop is therefore: initialise all \(\tau_{ij}\) to a small constant \(\tau_0\); let \(m\) ants each construct a tour by the transition rule; evaporate; deposit; record the best tour seen; repeat. Note that ACO fills the generic framework of Section 23-7 in an unusual way — its "generate" step constructs solutions from nothing each iteration rather than perturbing existing ones, and its memory lives entirely in \(\boldsymbol{\tau}\).
ACO Variants & Method Comparison
Plain Ant System is rarely competitive today; it is the ancestor everything else refines. Each descendant attacks the same weakness — too little intensification, or too much.
| Variant | Change from Ant System | Purpose |
|---|---|---|
| Elitist AS | The best-so-far tour deposits extra pheromone every iteration | Stronger intensification around the incumbent |
| Rank-based AS | Only the top few ants deposit, weighted by rank | Suppresses the noise of poor tours |
| Ant Colony System (ACS) | Pseudorandom-proportional rule: with probability \(q_0\) take the greedy best edge, else sample; only the best ant updates; a local rule lowers \(\tau\) on edges as they are used | Sharper exploitation, with the local rule pushing later ants onto different edges |
| MAX–MIN AS (MMAS) | Only the best ant deposits; \(\tau\) is clamped to \([\tau_{\min}, \tau_{\max}]\); trails initialised at \(\tau_{\max}\) | The clamp makes it impossible for any edge's probability to reach zero — stagnation is structurally prevented |
MMAS is the most instructive. Its bounds are a direct admission of ACO's characteristic failure mode, the exact mirror of PSO's: runaway positive feedback drives \(\tau\) on one tour's edges so high that every other edge's transition probability rounds to zero, and the colony can never construct anything different again. Clamping \(\tau\) below by \(\tau_{\min}\) guarantees a floor on the probability of every edge forever — exploration by fiat.
With three population methods now on the table, the comparison that matters is which to reach for.
| Genetic algorithm (Ch. 24) | Particle swarm | Ant colony | |
|---|---|---|---|
| Natural domain | Either, via encoding | Continuous \(\mathbb{R}^n\) | Combinatorial / graph problems |
| A solution is | A chromosome (encoded) | A position (the design vector itself) | A path constructed edge by edge |
| Memory lives in | The population's gene pool | Each particle's \(\mathbf{p}_i\), plus \(\mathbf{g}\) | The pheromone matrix \(\boldsymbol{\tau}\) |
| New solutions from | Crossover + mutation | Velocity update (no recombination) | Probabilistic construction from scratch |
| Key parameters | \(N\), \(p_c\), \(p_m\) | \(w\), \(c_1\), \(c_2\) | \(\alpha\), \(\beta\), \(\rho\), \(m\) |
| Fails by | Loss of diversity in the gene pool | Stagnation: velocities decay to zero | Pheromone lock-in on one tour |
| Typical use | Mixed or awkwardly structured spaces | Tuning controllers, weights, geometry | Routing, scheduling, assignment |
Notice how the last two rows rhyme. All three methods die of the same disease — the population agrees with itself and stops generating anything new — and all three treatments (mutation, inertia, evaporation) are devices for manufacturing disagreement. That is the through-line of Part 6: a population method's real parameter is how vigorously it resists its own consensus.
Worked Examples
Problem. Minimise \(f(x,y) = x^2 + y^2\). A particle is at \(\mathbf{x} = (2, 5)\) with velocity \(\mathbf{v} = (1, -1)\), personal best \(\mathbf{p} = (3, 4)\), and the swarm's best is \(\mathbf{g} = (1, 1)\). Take \(w = 0.7\), \(c_1 = c_2 = 1.5\), and suppose the draws are \(r_1 = 0.4\), \(r_2 = 0.3\). Find the new position.
Solution. Build the three terms separately. Inertia: \(0.7(1,-1) = (0.7,\,-0.7)\). Cognitive: \(c_1r_1(\mathbf{p}-\mathbf{x}) = 0.6\,\big((3,4)-(2,5)\big) = 0.6(1,-1) = (0.6,\,-0.6)\). Social: \(c_2r_2(\mathbf{g}-\mathbf{x}) = 0.45\,\big((1,1)-(2,5)\big) = 0.45(-1,-4) = (-0.45,\,-1.8)\). Summing, \(\mathbf{v}^{\text{new}} = (0.7+0.6-0.45,\ -0.7-0.6-1.8) = (0.85,\,-3.1)\), and \(\mathbf{x}^{\text{new}} = (2,5) + (0.85,-3.1) = (2.85,\ 1.9)\). Then \(f\) falls from \(29\) to \(2.85^2 + 1.9^2 = 11.73\), which also beats the personal best \(f(\mathbf{p}) = 25\), so \(\mathbf{p} \leftarrow (2.85, 1.9)\). Observe the \(y\)-component: all three terms pulled downward and agreed, producing a large step, while in \(x\) the social term partly cancelled the other two. The particle is now closer to \(\mathbf{g}\) but has not landed on it — the inertia carried it past where the springs alone would have stopped.
Problem. Compute \(\chi\) for the canonical \(\varphi = 4.1\), and show the constriction form is the inertia form with particular constants.
Solution. \(\varphi^2 - 4\varphi = 16.81 - 16.4 = 0.41\), so \(\sqrt{0.41} = 0.6403\). Then \(2 - \varphi - \sqrt{\varphi^2-4\varphi} = 2 - 4.1 - 0.6403 = -2.7403\), and \(\chi = 2/|-2.7403| = 0.7298\). Now expand the constriction update: \(\mathbf{v} \leftarrow \chi\mathbf{v} + \chi c_1r_1(\mathbf{p}-\mathbf{x}) + \chi c_2r_2(\mathbf{g}-\mathbf{x})\). This is exactly the inertia form with \(w = \chi = 0.7298\) and effective coefficients \(\chi c_1 = 0.7298 \times 2.05 = 1.4962\). So the famous "standard PSO" settings \(w = 0.729\), \(c_1 = c_2 = 1.494\) are not tuned constants at all — they are the constriction analysis, rewritten. Two formulations that appear to compete in the literature are one equation.
Problem. A swarm has fully converged: every \(\mathbf{p}_i = \mathbf{g} = \mathbf{x}_i\). With \(w = 0.7\), what fraction of its velocity remains after 20 iterations? Compare \(w = 0.4\) and \(w = 0.9\).
Solution. Both spring terms are identically zero, so \(\mathbf{v}^{k} = w^{k}\mathbf{v}^{0}\). After 20 iterations: \(0.7^{20} = 7.98\times10^{-4}\) — the swarm is motionless, retaining under a tenth of a percent of its speed. At \(w = 0.4\): \(0.4^{20} = 1.1\times10^{-8}\), frozen almost instantly. At \(w = 0.9\): \(0.9^{20} = 0.122\), still drifting at 12% — which is why a decreasing schedule ends near \(0.4\) only at the end of the run. The lesson is structural: the decay is geometric and the state is absorbing. Once diversity is gone the algorithm has no mechanism to recover it, so the cure must be prevention — a ring topology, or a restart trigger on \(\lVert\mathbf{v}\rVert\).
Problem. An ant sits at city 1 with unvisited cities \(\{2,3,4\}\). Pheromones are \(\tau_{12} = 1.0\), \(\tau_{13} = 2.0\), \(\tau_{14} = 0.5\); distances are \(d_{12} = 10\), \(d_{13} = 20\), \(d_{14} = 5\). Find the transition probabilities for \(\alpha = 1, \beta = 2\), and again for \(\alpha = 1, \beta = 0\).
Solution. Visibilities: \(\eta_{12} = 0.1\), \(\eta_{13} = 0.05\), \(\eta_{14} = 0.2\). With \(\alpha=1,\beta=2\) the numerators \(\tau\eta^2\) are: city 2, \(1.0(0.01) = 0.01\); city 3, \(2.0(0.0025) = 0.005\); city 4, \(0.5(0.04) = 0.02\). Sum \(= 0.035\), so \(p_{12} = 0.286\), \(p_{13} = 0.143\), \(p_{14} = 0.571\). City 4 is the favourite despite having the least pheromone, because it is very close and \(\beta = 2\) squares that advantage. Now set \(\beta = 0\): the numerators are just \(\tau\), giving \(1.0, 2.0, 0.5\) over a sum of \(3.5\) — so \(p_{12} = 0.286\), \(p_{13} = 0.571\), \(p_{14} = 0.143\). The favourite flips to city 3, purely on accumulated opinion. Same state, opposite decision: \(\beta\) sets how much the colony trusts the problem over its own history.
Problem. Three ants complete tours of lengths \(L_1 = 100\), \(L_2 = 80\), \(L_3 = 120\). Ants 1 and 3 used edge \((1,2)\); none used edge \((3,4)\). With \(\tau_{12} = \tau_{34} = 2.0\), \(Q = 100\), \(\rho = 0.5\), update both edges.
Solution. Deposit on \((1,2)\): \(\Delta\tau_{12} = Q/L_1 + Q/L_3 = 100/100 + 100/120 = 1 + 0.833 = 1.833\). Then \(\tau_{12} \leftarrow (1-0.5)(2.0) + 1.833 = 1.0 + 1.833 = 2.833\) — reinforced by 42%. Edge \((3,4)\) receives nothing: \(\tau_{34} \leftarrow 0.5(2.0) = 1.0\), halved. Note what ant 2 did: it had the best tour (\(L_2 = 80\), worth \(1.25\) per edge) but avoided edge \((1,2)\), so its opinion counted against that edge by omission. Note also the asymmetry in the arithmetic — a single iteration widened the ratio \(\tau_{12}/\tau_{34}\) from \(1\) to \(2.83\). That is autocatalysis at work, and it is why \(\rho\) must be chosen with care: this gap compounds every iteration.
Problem. An edge stops being used. Define the pheromone half-life as the number of iterations for \(\tau\) to fall to half its value. Compute it for \(\rho = 0.1\), \(\rho = 0.5\), and \(\rho = 0.02\).
Solution. With no deposit, \(\tau^{k} = (1-\rho)^{k}\tau^{0}\), so the half-life solves \((1-\rho)^{k} = 0.5\), i.e. \(k_{1/2} = \ln(0.5)/\ln(1-\rho)\). For \(\rho = 0.1\): \(k_{1/2} = -0.693/-0.105 = 6.6\) iterations. For \(\rho = 0.5\): \(k_{1/2} = 1\) exactly — the colony forgets almost everything each round, which is nearly random restarting. For \(\rho = 0.02\): \(k_{1/2} = -0.693/-0.0202 = 34.3\) iterations — a long memory, better for a rugged problem where an early consensus is likely to be wrong, at the cost of much slower convergence. So \(\rho\) is not an incidental constant: it is the colony's forgetting rate, and hence its position on the exploration–exploitation dial, precisely as \(w\) is for PSO and \(T\) for annealing.
Chapter Summary
Global competence from simple local rules — via social learning (PSO) or stigmergy, a decaying trace in a shared environment (ACO).
\(\mathbf{v} \leftarrow w\mathbf{v} + c_1r_1(\mathbf{p}_i - \mathbf{x}) + c_2r_2(\mathbf{g} - \mathbf{x})\), then \(\mathbf{x} \leftarrow \mathbf{x} + \mathbf{v}\). No encoding, no crossover, nothing dies.
Inertia explores and overshoots; the cognitive spring pulls to \(\mathbf{p}_i\); the social spring pulls to \(\mathbf{g}\) and spreads discovery.
\(w: 0.9 \to 0.4\), or \(\chi = 0.7298\) at \(\varphi = 4.1\) — the same equation. Once \(\mathbf{p}_i = \mathbf{g} = \mathbf{x}_i\), velocity decays as \(w^k\) and the swarm is dead.
Construct by \(p_{ij} \propto \tau_{ij}^{\alpha}\eta_{ij}^{\beta}\), then evaporate and deposit \(Q/L_k\) — shorter tours shout louder; \(\alpha\) weights memory, \(\beta\) weights distance.
PSO for continuous tuning, ACO for routing and scheduling, GA for awkward encodings. All three die of consensus; \(w\), \(\rho\) and \(p_m\) are the antidotes.
Problems
For the PSO problems, always build the three terms separately before summing. For the ACO problems, compute \(\tau^{\alpha}\eta^{\beta}\) for every candidate before normalising. Difficulty rises down the list.
- Define swarm intelligence, and distinguish social learning from stigmergy with one example of each.
- Write the PSO velocity and position updates, and name the role of each of the three terms in the velocity equation.
- A particle is at \((4, -2)\) with \(\mathbf{v} = (-1, 2)\), \(\mathbf{p} = (3, 0)\), \(\mathbf{g} = (0, 0)\). With \(w = 0.8\), \(c_1 = c_2 = 2\), \(r_1 = 0.5\), \(r_2 = 0.25\), find \(\mathbf{v}^{\text{new}}\) and \(\mathbf{x}^{\text{new}}\), and state whether the particle improved on \(f = x^2 + y^2\).
- Explain why \(r_1\) and \(r_2\) must be redrawn for every particle and every dimension, rather than once per iteration. What would break otherwise?
- Using \(w_k = w_{\max} - (w_{\max}-w_{\min})k/K\) with \(w_{\max} = 0.9\), \(w_{\min} = 0.4\), \(K = 1000\), find \(w\) at \(k = 0, 250, 500, 1000\), and relate the trend to the exploration–exploitation dial.
- Compute the constriction factor \(\chi\) for \(\varphi = 4.05\) and \(\varphi = 4.5\), and comment on what happens as \(\varphi \to 4^{+}\).
- Show that if \(\mathbf{p}_i = \mathbf{g} = \mathbf{x}_i\) for all \(i\), the swarm can never recover, and give two design measures that prevent this.
- Contrast the \(gbest\) and \(lbest\) topologies in terms of convergence speed and diversity. On a highly multimodal problem, which would you choose, and why?
- Describe the double-bridge experiment and explain, without reference to any ant comparing paths, why the short bridge wins.
- An ant at city 1 may go to cities 2, 3 or 4 with \(\tau = (3.0,\ 1.0,\ 2.0)\) and \(d = (4,\ 2,\ 8)\). Compute the transition probabilities for \((\alpha,\beta) = (1,2)\), \((2,2)\), and \((1,5)\), and explain the trend.
- Four ants have tour lengths \(90, 110, 70, 130\). Ants 2, 3 and 4 used edge \((5,6)\), whose pheromone is \(1.5\). With \(Q = 100\) and \(\rho = 0.3\), compute the updated \(\tau_{56}\), and separately the value of an edge used by nobody.
- Derive the pheromone half-life \(k_{1/2} = \ln(0.5)/\ln(1-\rho)\), and find the \(\rho\) that gives a half-life of exactly 10 iterations.
- MAX–MIN AS clamps \(\tau \in [\tau_{\min}, \tau_{\max}]\). Explain precisely which failure mode the lower bound prevents, and identify the corresponding failure mode and remedy in PSO.
- You must (a) tune the six gains of a cascade controller against a SPICE simulation, and (b) route a delivery fleet over 60 stops. Choose a method from Chapters 24–26 for each, and justify your choice by the representation each method assumes.