The first question before choosing any algorithm: what does a solution look like? The way an individual is represented (vector, binary string, permutation, tree) determines the suitable update operators, and most nature-inspired algorithms were originally designed for the continuous domain and then extended with discrete or binary versions.
Continuous optimization
Continuous optimization
The variables are real numbers that take any value within a given range, so the search space is part of Euclidean space. It is the original domain of most swarm and physics algorithms in the encyclopedia, and the simulator's standard test functions are built on it.
\min_{x\in\mathbb{R}^d} f(x),\qquad l_i\le x_i\le u_i
- AI example
- Tuning the learning rate and the regularization coefficient, optimizing the weights of a small network without derivatives, and calibrating the parameters of a physical model.
- How nature-inspired algorithms handle it
- The algorithms work directly on real vectors by adding random steps, differences or jumps, then clipping the values to the bounds.
From the encyclopedia:
PSO
DE
CMA-ES
GWO
WOA
HHO
Algorithms for the "continuous" space (123)
Related task: Hyperparameter Optimization
Try it in the simulator: Sphere
- Storn, R., & Price, K. (1997). Differential evolution – A simple and efficient heuristic for global optimization over continuous spaces. Journal of Global Optimization, 11(4), 341–359. doi:10.1023/A:1008202821328
Discrete and integer optimization
Discrete / integer optimization
The variables take only countable values or integers, such as the number of layers or the batch size from a list. Intermediate values are meaningless, and a small change in one variable may change the whole shape of the solution.
\min_{x\in\mathbb{Z}^d\cap[l,u]} f(x)
- AI example
- Choosing the number of layers, cells and the kernel size in a convolutional network, or the number and depth of trees in a random forest.
- How nature-inspired algorithms handle it
- The common approach is to round the continuous variable to the nearest allowed value at evaluation, or to use native discrete operators as in GA and HS.
From the encyclopedia:
GA
HS
SA
BBO
Algorithms for the "discrete" space (1)
Related task: Neural Architecture Search
Binary optimization
Binary optimization
Each variable is 0 or 1, so the solution becomes a bit string of length d and the size of the space is 2 to the power d. It is the natural representation for selection and exclusion problems.
\min_{x\in\{0,1\}^d} f(x),\qquad |\mathcal{S}|=2^d
- AI example
- Feature selection, where bit 1 means keeping the feature, and pruning connections or channels in neural networks.
- How nature-inspired algorithms handle it
- Continuous algorithms are turned into binary ones with a sigmoid or V-shaped transfer function that turns the velocity or position into a bit-flip probability, as in binary PSO.
From the encyclopedia:
PSO
GA
GWO
WOA
Related task: Feature Selection
- Kennedy, J., & Eberhart, R. C. (1997). A discrete binary version of the particle swarm algorithm. IEEE International Conference on Systems, Man, and Cybernetics, 5, 4104–4108. doi:10.1109/ICSMC.1997.637339
Combinatorial and permutation optimization
Combinatorial / permutation optimization
The solution is an ordering or combination of a finite set of elements, such as a route that visits every city once or a task schedule. The number of solutions grows factorially (n!), and many of these problems are NP-hard.
\min_{\pi\in S_n} \sum_{k=1}^{n} c\big(\pi_k,\pi_{k+1}\big)
- AI example
- Scheduling training jobs on processing units, ordering layers or operations in architecture search, and routing and scheduling problems in general.
- How nature-inspired algorithms handle it
- They need operators that keep the permutation valid (swap, insertion, segment reversal, order crossover). ACO was originally designed for this type because it builds the solution element by element.
From the encyclopedia:
ACO
GA
SA
Algorithms for the "combinatorial" space (1)
Mixed optimization
Mixed-variable (mixed-integer) optimization
It combines continuous, integer and categorical variables in the same solution. This is the usual form of hyperparameter tuning in machine learning.
\begin{gathered}\min_{x=(x_c,\,x_z,\,x_k)} f(x)\\ x_c\in\mathbb{R}^{d_c},\ x_z\in\mathbb{Z}^{d_z},\ x_k\in\mathcal{K}\end{gathered}
- AI example
- Tuning the learning rate (continuous) together with the number of units (integer) and the optimizer type (categorical: Adam or SGD).
- How nature-inspired algorithms handle it
- Each variable is encoded with a suitable representation and decoded at evaluation, with specific operators for each type. GA, SA and HS handle it relatively easily.
From the encyclopedia:
GA
SA
HS
BBO
CA
Algorithms for the "mixed" space (5)
Related task: Hyperparameter Optimization
Structure and program optimization
Structural / program optimization
The solution is a variable-length structure such as an expression tree, a program or a network architecture graph, so the number of variables is not fixed in advance.
\begin{gathered}\min_{T\in\mathcal{T}} f(T)\\ \mathcal{T}=\{\text{trees over } F\cup V\}\end{gathered}
- AI example
- Discovering a mathematical formula from data (Symbolic Regression), and neural architecture search (NAS).
- How nature-inspired algorithms handle it
- Genetic programming (GP) represents the solution as a tree and applies crossover and subtree replacement, while controlling size growth (Bloat).
From the encyclopedia:
GP
GA
Algorithms for the "tree (programs)" space (1)
Related task: Neural Architecture Search