Tech Blog · Algorithms Explained
[Prescription Methods 6] Search that imitates natural selection — Evolutionary algorithms
Optimization problems that cannot be differentiated, have several goals, and have a rugged landscape. Why evolutionary algorithms are still used, how CMA-ES and NSGA-II work, and the limit of needing tens of thousands of evaluations.
Jul 30, 2026 · OPTI-X
Series “Prescription Methods” · Part 6
Evolutionary algorithms imitate biological evolution. They create many candidate solutions at once, keep the good ones, mix them, and alter them slightly, repeating generation after generation. If reinforcement learning in the previous part learns a sequence of decisions, evolutionary algorithms are search methods that directly look for "which combination of setpoints is best."
How it works: many candidates move together
One generation runs through evaluation, selection and variation. Each candidate's objective value is calculated, good candidates are picked as parents, and the parents are mixed or slightly altered to create the next generation. No gradient (derivative) information is used, only the value that comes out when a candidate is put in.
One generation of an evolutionary algorithm
This process is repeated for tens to hundreds of generations
- 1Evaluate the candidate populationCalculate the performance of several candidate solutions (setpoint combinations)Next
- 2SelectionPick the best-performing candidates as parentsNext
- 3Crossover and mutationMix the parents and alter them slightly to create the next generation of candidatesTo the next generation
Hansen (2016) describes this as randomized black-box search. Candidates are sampled from a search distribution and evaluated, and the results are used to revise the distribution before sampling the next candidates. CMA-ES, a representative method, uses only the ranking among candidates, not the objective values themselves. So rescaling the objective or applying any order-preserving transformation leaves the search unchanged.
Where evolutionary algorithms are strong
Hansen notes that such randomized search is robust on rugged landscapes with discontinuities, sharp ridges and local optima. CMA-ES is a good option when classical gradient-based methods such as quasi-Newton methods fail on landscapes like these. Put the other way, for problems with a smooth landscape where gradients can be used, classical methods come first.
The kinds of problems they are used for
Cases where gradient-based methods struggle
With several objectives, the advantage comes from the population. According to Deb et al. (2002), classical methods combine the objectives into one and find one solution at a time, so getting several trade-offs means running them many times. Because evolutionary algorithms maintain a population of candidates, they can find several trade-offs in a single run.
Representative methods: genetic algorithms, CMA-ES, NSGA-II
Genetic algorithms center on crossover, which pairs and mixes candidates, and mutation, which changes them at random. CMA-ES and NSGA-II refine this framework for continuous-variable search and for multi-objective problems, respectively.
Representative evolutionary algorithms
Same framework, different strengths
| Method | How candidates are made | Strength |
|---|---|---|
| Genetic algorithm | Crossover and mutation of parents | Can represent both discrete and continuous variables |
| CMA-ES | Sampling from a multivariate normal distribution | Continuous problems with interacting variables |
| NSGA-II | Genetic algorithm + nondominated sorting | A set of trade-offs across several objectives |
Each generation, CMA-ES samples candidates from a normal distribution and moves the distribution's center to a weighted average of the best ones. At the same time, it revises the covariance (the spread and correlation between variables) to follow the shape in which the good candidates spread out. Hansen explains that this is similar to how a quasi-Newton method learns curvature information.
Hansen and Ostermeier (2001) reported speedups of several orders of magnitude on functions whose variables are badly scaled and interact, and of three to ten times on moderately mis-scaled functions. On perfectly scaled functions there was no difference.
The default population is also small. The tutorial's default is about 4 + 3 ln n (n being the number of variables), so with 10 variables there are about 10 candidates per generation. A small population converges faster; a large one helps avoid local optima. The step size is controlled by the length of the path traveled over recent generations, which keeps the population from collapsing onto one point too early.
Worked example: two objectives in heat treatment
Consider heat-treatment cooling, where cooling rate and holding temperature are adjusted to reduce both the variation in product hardness and energy use. If more uniform hardness takes more energy and less energy means more variation, there is no single right answer. The answer is the set of solutions where improving one objective means giving up the other: the Pareto front.
NSGA-II combines parent and offspring candidates, then sorts them into layers (fronts), starting with candidates that no other candidate beats. The next generation is filled from the front layers onward, and in the last layer to fit, candidates with less crowded surroundings are kept (crowding distance). Because parents are compared too, good solutions once found are not lost; because uncrowded candidates are kept, the front spreads out evenly.
Crowding distance is the sum, over each objective, of the gap between a candidate's two neighbors, and the candidates at both ends of each objective are given infinity so they are always kept. So the ends of the front, for example the condition using the least energy and the condition with the most uniform hardness, do not disappear.
Deb et al. reduced the computation of this sorting from the cube of the population size in the earlier NSGA to the square, and removed the user-set parameter previously used to maintain diversity. On nine test problems, NSGA-II spread solutions more evenly and converged closer to the true front than the two algorithms compared (PAES and SPEA). On one problem, however, PAES came closer to the true front.
Process conditions have lines that must not be crossed. NSGA-II's constraint handling is simple. A candidate that satisfies the constraints beats one that violates them, and if both violate them, the one with the smaller violation wins. Because constraints and objectives are not mixed into one formula, there is no penalty coefficient to set.
The authors reported that this approach also did better than the method compared on a nonlinear problem with five objectives and seven constraints. The plant can then pick the point on the resulting front that fits that day's priorities.
What to check, and the limits
The number of evaluations is the first condition. In Deb et al.'s tests, NSGA-II ran 250 generations, up to 25,000 evaluations, on each two-objective test problem. Compared with Bayesian optimization in Part 4, which stopped after a few dozen evaluations on its test functions, the scale is different. The problems differ, so this is not a direct comparison, but no real equipment can be tried that many times.
Also check variable interactions and noise. Deb et al. found that all three multi-objective algorithms they compared struggled on a problem whose variables were rotated to interact strongly. CMA-ES revises its distribution to fit such interactions, but according to Hansen, its step-size control does not adapt well on very noisy functions, and it does not prevent the search itself from ending up in a local optimum.
Pros and cons of evolutionary algorithms
Flexible, but they need many evaluations
How it relates to other methods
Bayesian optimization picks the next conditions with few trials when each evaluation is expensive. Evolutionary algorithms are strong when evaluations are cheap and plentiful, and when there are several objectives or the landscape is rugged. That is why evolutionary algorithms are mainly used to search on a predictive model or simulator, not on the real process.
The optimum found this way can be trusted only as far as the model is right. An evolutionary algorithm will chase any place where the model's values look good, even in regions with no data. This is the same problem as the out-of-data actions offline reinforcement learning had to be wary of in Part 5.
Evolutionary algorithms find trade-offs across several objectives without gradients, and they are at their best on a model where evaluation is cheap. Then how far can that model be trusted? In the next part, we cover surrogate-based optimization.
References
- IEEE Transactions on Evolutionary Computation (Deb et al.), "A fast and elitist multiobjective genetic algorithm: NSGA-II" (2002-04-01) ↗
- Evolutionary Computation 2001 (Hansen et al.), "Completely Derandomized Self-Adaptation in Evolution Strategies" ↗
- arXiv 2016 (Hansen), "The CMA Evolution Strategy: A Tutorial" (2016-04-04) ↗
Could this work for your process?
Talk to us