## 2 Constraint-Handling Technique Based on a Neural Network for the Differential Evolution Algorithm
### Neuronal Constraint-Handling Technique  
The Neuronal Constraint-Handling (NCH) technique is based on a feed-forward artificial neural network [59]. This technique selects the most suitable individual between two existing individuals \(X_{p}^{G}\) and \(U_{p}^{G}\). The best individual for the next population \(X^{G+1}\) is obtained considering the value of the objective functions \(\bar{J}(x)\) and the sum of infeasible constraint distance \(\phi(x)\) given by (6). \[\phi(x)=\sum_{j=1}^{m}max(0,g_{j}(x)) \tag{6}\]  
The best individual between \(X_{p}^{G}\) and \(U_{p}^{G}\) is defined based on the neural network architecture. The operation of the NCH technique with DE/RAND/1/BIN algorithm is presented in the block diagram shown in Figure 1. The NCH technique can be divided in three processes to select solutions. In the first process, the value of the objective function \(\bar{J}\) and the value of the sum of infeasible constraint distance \(\phi\) of two individuals are normalized in the range [0,1], using the maximum objective function value (\(max(\bar{J}(X^{G}))\)) and the maximum sum of infeasible constraint distance (\(max(\phi(X^{G}))\)) found in the population \(X^{G}\). Each normalized value is introduced in the input layer of neurons consisting of four neurons \(a_{1}^{s=1}\), \(a_{2}^{s=1}\), \(a_{3}^{s=1}\), and \(a_{4}^{s=1}\). The input neuron values are defined by (7)-(10). \[a_{1}^{1} =\frac{\bar{J}(X_{p}^{G})}{max(J(\mathbf{X}^{G}))} \tag{7}\] \[a_{2}^{1} =\frac{\phi(X_{p}^{G})}{max(\phi(\mathbf{X}^{G}))}\] (8) \[a_{3}^{1} =\frac{J(U_{p}^{G})}{max(J(\mathbf{U}^{G}))}\] (9) \[a_{4}^{1} =\frac{\phi(U_{p}^{G})}{max(\phi(\mathbf{U}^{G}))} \tag{10}\]  
In the second process, the neuron values of the input layer go to a hidden layer of neurons, where the inputs are analyzed according to a selection rule learned a priori. Hence, the values in the input layer goes to the neurons in the hidden layer \(a_{r}^{s}\)\(\forall\)\(r=\{1,2,\ldots,nf_{s}\}\wedge s=\{2,3,\ldots,c-1\}\), where \(c\) is the number of layers and \(nf_{s}\) is the number of neurons in the \(s\) layer. In this process, the user can select the number of layers and neurons. The third process selects the best individual between \(X_{p}^{G}\) and \(U_{p}^{G}\). One neuron \(a_{1}^{s=c}\) is established in the output layer, and then, with this information, the best individual is given by the selector (11):  
\[X_{p}^{G+1}= \begin{cases}X_{p}^{G}&\text{ if }a_{1}^{c}<0\\ U_{p}^{G}&\text{ if }a_{1}^{c}\geq 0\end{cases}  \tag{11}\]  
As can be seen in Figure 1, the neurons \(a_{r}^{s}\) in the NCH technique receive the values of previous neurons, but these input values do not go directly to the next neuron. These input values are introduced using neuronal weights \(\bar{w}_{t,r}^{s}\in[-100,100]\)\(\forall\)\(t=\{1,2,\ldots,nf_{s-1}\}\), as shown in Figure 2.  
Figure 1: Neuronal constraint-handling technique. Figure 2: Artificial neuron or node in the NCH technique. The output value of the neuron \(a_{r}^{s}\) is obtained using (12), where \(\bar{a}_{r}^{s}\in[-100,100]\) is a bias value, \(nf_{s-1}\) is the number of neurons in the \(s-1\) layer, and \(f(\mu)\in[-1,1]\) is a sigmoid activation function given by (13):  
\[a_{r}^{s}=f\left(\sum_{t=1}^{nf_{s-1}}(\bar{a}_{t,r}^{s}a_{r}^{s-1})+\bar{a}_{ r}^{s}\right) \tag{12}\]  
\[f(\mu)=\frac{1-e^{-\mu}}{1+e^{-\mu}} \tag{13}\]  
Algorithm 1 shows the operation of DE/RAND/1/BIN algorithm with the neuronal constraint-handling technique. The proposal is called R1B-NCH. ```
1: Generate an initial population \(\mathbf{X}^{0}\) with \(NP\) individuals. 2: Evaluate \(\mathbf{X}^{0}\). 3:\(G\gets 0\)
4:while\(G\leq G_{max}\)do
5:for all\(X_{p}^{G}\in\mathbf{X}^{G}\)do
6: Generate a child individual \(U_{p}^{G}\) based on (5)
7: Evaluate the fitness of \(U_{p}^{G}\). 8: Determine for the next generation, the individual \(X_{p}^{G+1}\) according to the proposed NCH technique (11) between \(X_{p}^{G}\) and \(U_{p}^{G}\).