Evolutionary computation is a family of optimization methods inspired by natural selection and collective animal behavior. Instead of following a gradient, they maintain a population of candidate solutions, score each with a fitness function, and use selection plus random variation to produce better candidates over many generations. They are useful when the objective is a black box, noisy, multi-modal, discrete, or simply not differentiable — scheduling, routing, design optimization, hyperparameter search, and neural architecture search.
Chromosome encodings, selection, crossover and mutation operators, elitism, and a from-scratch GA in Python.
Particle Swarm Optimization and Ant Colony Optimization: velocity updates, pheromone trails, and Python examples.
Every method on these pages follows the same skeleton. What differs is how candidates are represented (bit strings, real vectors, trees, permutations), how parents are chosen, and how new candidates are generated. Selection provides exploitation (concentrate on what works); variation provides exploration (try new regions). Balancing the two controls whether the search converges prematurely or wanders.
scipy.optimize.differential_evolution.Use evolutionary methods when gradients are unavailable, the search space is combinatorial or mixed, the landscape has many local optima, or you need a set of trade-off solutions (multi-objective algorithms such as NSGA-II return a Pareto front). Do not use them when a gradient exists and the problem is smooth: gradient descent, L-BFGS, or Bayesian optimization (for expensive evaluations with few parameters) will be far more sample-efficient. Evolutionary search typically needs thousands to millions of fitness evaluations.