## 3 Constraint-Handling Techniques in Metaheuristic Algorithms
### Metaheuristic Algorithms  
#### 3.1.1 Differential Evolution Algorithm  
The DE algorithm was proposed by [PERSON] and [PERSON] [45], and it is a direct and stochastic search method. DE was inspired by the theory of natural selection and is shown in the Algorithm 1.  
```
1: Generate an initial population \(X_{0}\) with \(NP\) individuals.
2: Evaluate \(X_{0}\).
3: Initialize the best individual \(x_{best}\).
4:\(G\gets 0\)
5:while\(G\leq G_{max}\)do
6:for all\(x_{i}\in X_{G}\)do
7: Generate a child individual \(u_{i}\) based on (5)-(12).
8: Evaluate \(u_{i}\) and \(U_{G}\gets u_{i}\).
9:endfor
10: Select the new population \(X_{G+1}\) between \(X_{G}\) and \(U_{G}\) according to CHT. \([X_{G+1},x_{best}^{best}]\gets fncCHT(X_{G},U_{G},x_{best})\) (This function is associated to the CHT.)
11:\(G\gets G+1\)
12:endwhile
```  
**Algorithm 1** Differential evolution pseudocode.  
DE starts with a population of individuals called parents \(X_{0}=\{x_{1},x_{2},...,x_{NP}\}\), where \(NP\) is the number of individuals in the population. At each generation \(G\), the individuals in the population \(X_{G}\) perform a crossover and mutation process to generate a population of child individuals \(U_{G}\). The crossover and mutation process depend on the used DE variant. In this case, eight DE variants are chosen, and these are: DE/rand/1/bin (DER1B), DE/rand/1/exp (DER1E), DE/best/1/bin (DEBIB), DE/best/1/exp (DEBIE), DE/current to rand (DECR), DE/current to best (DECB), DE/current to rand/1/bin (DECR1B), and DE/current to rand/1/exp (DECR1E).  
The crossover and mutation process for each variant is defined by Equations (5)-(12), where \(CR\) is the crossover factor, \(F\) and \(K\) are scale factors, \(r_{1}\), \(r_{2}\), and \(r_{3}\) are three random individuals from the current population, \(D\) is the number of design variables and \(j_{rand}\in\{1,2,\ldots,D\}\) is a random value that represents the crossover point.  
Binomial recombination:  
\[\begin{array}{rcl}\text{Rand}/1/\text{Bin}:\\ u_{i}^{j}&=&\left\{\begin{array}{cc}x_{r_{3}}^{j}+F(x_{r_{1}}^{j}-x_{r_{2}}^ {j}),&\text{if}\ rand_{j}(0,1)<CR\text{ or }j=j_{rand}\\ x_{i}^{j},&\text{Otherwise}\end{array}\right.\end{array} \tag{5}\]  
Best/1/Bin:  
Current-to-Rand\(/1\):  
\[\ddot{u}_{i} = \ddot{x}_{i}+K(\ddot{x}_{r_{3}}-\ddot{x}_{i})+F(\ddot{x}_{r_{1}}- \ddot{x}_{r_{2}})\] (9) Current-to-Best\(/1\):  
\[\ddot{u}_{i} = \ddot{x}_{i}+K(\ddot{x}_{best}-\ddot{x}_{i})+F(\ddot{x}_{r_{1}}- \ddot{x}_{r_{2}})\] (10) Arithmetic-binomial recombination: Current-to-Rand\(/1\)/Bin:  
\[u_{i}^{j} = \left\{\begin{array}{ll}x_{i}^{j}+K(x_{r_{3}}^{j}-x_{i}^{j})+F(x _{r_{1}}^{j}-x_{r_{2}}^{j})&\text{if $rand_{j}(0,1)<CR$ or $j=j_{rand}$}\\ x_{i}^{j}&\text{Otherwise}\end{array}\right.\] (11) Current-to-Rand\(/1\)/Exp:  
\[u_{i}^{j} = \left\{\begin{array}{ll}x_{i}^{j}+K(x_{r_{3}}^{j}-x_{i}^{j})+F( x_{r_{1}}^{j}-x_{r_{2}}^{j})&\text{if $rand_{j}(0,1)<CR$ or $j=j_{rand}$}\\ x_{i}^{j}&\text{Otherwise}\end{array}\right. \tag{12}\]  
The population of parents \(X_{G}\) and children \(U_{G}\) compete at each generation to remain to a new population of individuals \(X_{G+1}\) for the next generation. The selection process between the parents and children is based on the CHT, as defined in Section 3.2. Then, the best individual in the population \(X_{G_{max}}\) is considered the best solution for the optimization problem.