Evolutionary Algorithms#
Evolutionary algorithms are a class of population based optimization algorithms inspired by biological evolution. For a more detailed explanation of evolutionary algorithms, see the Evolution – optimizing with evolutionary algorithms page.
Supported Algorithms#
The supported algorithms are summarized below
Name |
Identifier |
Objectives |
Reference |
|---|---|---|---|
Genetic Algorithm (GA) |
|
Single-objective |
|
Differential Evolution (DE) |
|
Single-objective |
|
Particle Swarm Optimization (PSO) |
|
Single-objective |
|
Covariance Matrix Adaptation Evolution Strategy (CMA-ES) |
|
Single-objective |
|
Non-dominated Sorting Genetic Algorithm (NSGA-II) |
|
Multi-objective |
|
S-Metric Selection EMOA (SMS-EMOA) |
|
Multi-objective |
A single-objective algorithm needs a metric with one objective; selecting one for a metric
with several raises ValueError when Evolution is created. A multi-objective algorithm
also accepts a single objective. "pso" and "cmaes" need size of at least 2.
The parameters of each algorithm are set through the algorithm_kwargs argument of
Evolution.run, keyed by the names in the tables below, for example
algorithm_kwargs={"CR": 0.7}.
Genetic Algorithm (GA)#
GA is a single-objective evolutionary algorithm that mimics the process of natural selection. It uses techniques such as selection, crossover, and mutation to evolve a population of candidate solutions towards an optimal solution. Some of the key default parameters used in pymoo are:
Parameter Description |
Default value |
|---|---|
crossover type |
SBX (simulated binary crossover) |
crossover probability - float, [0,1] |
0.5 |
distribution index for sbx crossover - float, [0,100] |
15 |
mutation type |
PM (polynomial mutation) |
mutation probability - float, [0,1] |
0.9 |
distribution index for polynomial mutation - float, [0,100] |
20 |
Differential Evolution (DE)#
Differential Evolution (DE) is a population-based algorithm for continuous optimization. It generates new candidates by adding scaled differences between population members to a base vector, allowing the search direction and step size to depend on the current population. Each resulting vector is combined with the candidate being updated through crossover, and the new candidate replaces the original only if its objective value is no worse.
The variant string "DE/<selection>/<n_diffs>/<crossover>"
specifies the base vector (rand or best),
the number of difference vectors (1 or 2), and the crossover method (bin or exp).
Key |
Description |
Default value |
|---|---|---|
|
Base vector, number of difference vectors and crossover |
|
|
Crossover rate - float, [0,1] |
0.2 |
|
Scale factor of the difference vectors - float, > 0 |
0.5 |
|
Whether to add a small random variation to |
|
|
Probability of an additional polynomial mutation - float, [0,1] |
0.1 |
A sampling array for DE needs at least size rows.
Particle Swarm Optimization (PSO)#
Particle Swarm Optimization (PSO) is a population-based algorithm that moves a swarm of particles through the parameter space. Each particle has a position and velocity, which is updated based on its previous velocity, the best position it has personally found, and the best position found by the entire swarm. The particles retain these best positions as they explore new regions.
The main parameters and their pymoo defaults are:
Key |
Description |
Default value |
|---|---|---|
|
Inertia weight - float |
0.9 |
|
Cognitive coefficient, pull towards the particle’s own best - float |
2.0 |
|
Social coefficient, pull towards the swarm’s best - float |
2.0 |
|
Whether |
|
|
|
|
|
Maximum velocity, as a fraction of the bounds’ width - float |
0.2 |
|
Whether the best particle moves, in each generation, to a mutation of its best position instead |
|
A sampling array sets the swarm size to its number of rows for the whole run; size is
then ignored.
Covariance Matrix Adaptation Evolution Strategy (CMA-ES)#
Covariance Matrix Adaptation Evolution Strategy (CMA-ES) generates each population by sampling from a multivariate normal distribution. It adapts the distribution’s mean, step size, and covariance matrix based on the best-performing candidates, allowing the search to move towards promising regions and adjust to correlations between optimization variables.
The first generation differs from the others. Without x0, it consists of 20 Latin hypercube
points, and the best of them becomes the starting point; with x0, it is that single point.
Every later generation holds size candidates. CMA-ES does not take sampling; the start
is set with x0, which must lie within the bounds. The main parameters and their pymoo
defaults are:
Key |
Description |
Default value |
|---|---|---|
|
Starting point - numpy.ndarray of shape (number of variables,) |
|
|
Initial step size; with |
0.1 |
|
Whether the search runs in coordinates scaled to the bounds |
|
|
Number of restarts after the search converges - int |
0 |
|
Stop once the objective changes by less than this - float |
1e-11 |
|
Stop once the changes in the parameters fall below this - float |
1e-11 |
Non-dominated Sorting Genetic Algorithm (NSGA-II)#
NSGA-II is a popular multi-objective evolutionary algorithm that uses non-dominated sorting and crowding distance to maintain diversity in the population. Its core ideas are similar to GA, but it is designed to handle multiple objectives simultaneously. Some of the key default parameters used in pymoo are:
Parameter Description |
Default value |
|---|---|
crossover type |
SBX (simulated binary crossover) |
crossover probability - float, [0,1] |
0.9 |
distribution index for sbx crossover - float, [0,100] |
15 |
mutation type |
PM (polynomial mutation) |
mutation probability - float, [0,1] |
0.9 |
distribution index for polynomial mutation - float, [0,100] |
20 |
S-Metric Selection EMOA (SMS-EMOA)#
SMS-EMOA is a multi-objective evolutionary algorithm similar to NSGA-II, but uses hypervolume contribution instead of crowding distance for survivor selection. This favors candidates that contribute most to the region of objective space dominated by the population. The main parameters and their pymoo defaults are:
Key |
Description |
Default value |
|---|---|---|
|
Crossover operator |
SBX, probability 0.9, distribution index 15 |
|
Mutation operator |
PM, probability 0.9, distribution index 20 |
|
Parent selection operator |
Binary tournament on constraint violation and domination |
|
Number of candidates per generation after the first - int |
|
|
Whether duplicate candidates are removed before evaluation |
|
|
Whether the objectives are normalized before the hypervolume contributions are computed |
|