Metaheuristic Optimization Notes: Principles, Formulas and Pseudocode for PSO, Genetic Algorithms, Simulated Annealing and Ant Colony Optimization
A review note in the same style as the site's Deep Reinforcement Learning Core Algorithms note, but for metaheuristics: black-box optimization methods that do not rely on gradients and instead search through randomness and selection pressure. It first lays out the problem framework shared by the four algorithms (black-box objectives, evaluation budget, exploration versus exploitation, and the no-free-lunch theorem), then expands Particle Swarm Optimization (PSO), Genetic Algorithms (GA), Simulated Annealing (SA) and Ant Colony Optimization (ACO) one by one under the same skeleton: why it is needed, principles and formulas, collapsible derivations, complete pseudocode, section-by-section walkthrough, a per-step read/write and state-maintenance checklist, a pitfall checklist, and scope of application. The note contains 14 collapsible derivations, covering the origin of the PSO velocity update and its stable parameter region, the GA schema theorem and building-block hypothesis, detailed balance and cooling convergence in SA, and the ACO transition probability together with pheromone upper and lower bounds. The final chapter puts the four algorithms back into one coordinate system with a single master table, six key divergences, one algorithm-selection decision chain, and a concept-mapping table against reinforcement learning.