## 2 The Theoretical Basis of the Algorithms Used in This Research
### Genetic Algorithm (Ga)  
GAs are optimization algorithms inspired by the process of natural selection and genetic theory. GAs are efficient, parallel, global, random search algorithms for combinatorial optimization problems [52]. A genetic algorithm deals with a specific problem of exploring and exploiting the search space and manages the issue by processing a set of encoded variable strings. The algorithm starts with the initialization of a population, then fitness evaluation, parent selection, reproduction via genetic operators, offspring fitness evaluation, survivor selection, and termination. These steps are repeated until a satisfactory solution is found. In fact, this algorithm is used to find the best solution among a large set of possible solutions for optimization problems [53]. The general schematic of a Genetic Algorithm is shown in Figure 1.  
In the algorithm used in this research (all risks are not processed at the same time and this algorithm is used for each risk separately and the results are recorded in the archive), the initial population uses a randomly generated initialization strategy that is created by randomly selecting neurons for the neural network, learning rates, activation functions, and regularization techniques. It consists of \(N\) coded individuals:  
\[Population(I)= \begin{bmatrix}I_{1}\\ \vdots\\ I_{N}\end{bmatrix}  \tag{17}\]  
In the optimization of neural networks using GA, the evaluation step consists of evaluating the fitness of each chromosome in the population. This step is very important in order to find the best solutions and guide the search for better solutions. When optimizing neural networks, the evaluation step usually involves training and testing the neural network using the chromosome-specified architecture. In the current case, the fitness of a population in Ga is based on the prediction error. The fitness value of each chromosome (\(f_{j}\)) can be calculated as follows:  
Moreover, the selection operator (\(p_{j}\)) of this individual is:  
\[p_{j}=\frac{f_{j}}{\sum_{j=1}^{m}f_{j}} \tag{18}\]  
where \(f_{j}\) is the fitness value of the \(j\)th chromosome, \(n\) is the number of ANN input data, \(m\) is the GA population size, and \(l\) is the error of the \(i\)th ANN input corresponding to the \(j\)th chromosome [54]. Crossover recombines information from the two best parent solutions into what we hope are even better offspring solutions. The problem is to design a crossover operator that combines the features of both parent individuals. For the real-code GA, the crossover operator includes simple, arithmetic, and heuristic crossovers. In the present study, the arithmetic crossover was used. Therefore, suppose \(\overset{-1}{x}=(x_{1}^{1},\dots,x_{i}^{1},\dots,x_{n}^{1})\) and \(\overset{-2}{x}=(x_{1}^{2},\dots,x_{i}^{2},\dots,x_{n}^{2})\) are two parent chromo  
Figure 1: General flowchart of genetic algorithm. somes selected for the application of the crossover operator and two offspring, namely, \(\overrightarrow{y}^{1}=(y^{1}_{1},\ldots,y^{1}_{i},\ldots,y^{1}_{n})\) and \(\overrightarrow{y}^{2}=(y^{2}_{1},\ldots,y^{2}_{i},\ldots,y^{2}_{n})\); they are built as follows:  
\[ \begin{array}{l}\overrightarrow{y}^{1}_{i}=rx^{1}_{i}+(1-r)x^{2}_{i}\\ \overrightarrow{y}^{2}_{i}=rx^{2}_{i}+(1-r)x^{2}_{i}\end{array}  \tag{19}\]  
Here, \(r\) is a random number from an interval that remains constant for uniform arithmetic crossover or varies based on the number of generations for non-uniform arithmetic crossover. The mutation operation randomly changes the value of each chromosome element according to the mutation probability. For the real-code GA, the mutation operators include uniform, non-uniform, multi-non-uniform, boundary, etc. In the present research, the non-uniform mutation was used. Assume \(\overrightarrow{X}=(x_{1},\ldots,x_{i},\ldots,x_{n})\) as a chromosome and \(x_{i}\in[a_{i},b_{i}]\) as a gene to be mutated. Then, the gene \(\dot{x_{i}}\) is as follows:  
\[\dot{x_{i}}=