## 2 Optimization Problem and the Method of Finding the Optimal Solution
### Genetic Algorithm  
Genetic Algorithms are examples of optimization algorithms inspired by natural selection [22]. It is a model of activities and operations on chromosomes. Algorithm assumes the creation of the beginning set of chromosomes, very often called the population. Each chromosome is presented by a binary code or a real number (more common is the second case, so we assume that). All individuals are created in a random way. Having the population, some operation are made. The first of them is the reproduction which is a process to transfer some individuals to the next operation. The most common way of reproduction is based on the probability of belonging to a particular group. In optimization problem, \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Function Name** & **Function \(f\)** & **Range** & \(f_{min}\) & **Solution \(\overline{x}\)** \\ \hline Dixon-Price & \(f_{1}(\overline{x})=(x_{1}-1)^{2}+\sum\limits_{i=1}^{n}i\left(2x_{i}^{2}-x_{i -1}\right)^{2}\) & \((-10,10)\) & \(0\) & \(\left(2^{-\frac{1-2}{2^{2}}},\ldots,2^{-\frac{n^{2}-2}{2^{2}}}\right)\) \\ [PERSON] & \(f_{2}(\overline{x})=\sum\limits_{i=1}^{n}4\dfrac{x_{i}^{2}}{4000}-\sum\limits _{i=1}^{n}\Gamma\cos\left(\dfrac{x_{i}}{\sqrt{(i)}}\right)+1\) & \((-10,10)\) & \(0\) & \((0,\ldots,0)\) \\ Rotated Hyper-Ellipsoid & \(f_{3}(\overline{x})=\sum\limits_{i=1}^{n}\sum\limits_{i=1}^{n}x_{i}^{2}\) & \(\langle-100,100\rangle\) & \(0\) & \((0,\ldots,0)\) \\ Schwefel & \(f_{4}(\overline{x})=418.9829n-\sum\limits_{i=1}^{n}x_{i}\sin\left(\sqrt{|x_{i }|}\right)\) & \((-500,500)\) & \(0\) & \((420.97,\ldots,420.97)\) \\ Shubert & \(f_{5}(\overline{x})=\prod\limits_{i=1}^{n}\left(\sum\limits_{i=1}^{n}i\cos((i+ 1)x_{i})\right)\) & \((-10,10)\) & \(-186.7\) & \((0,\ldots,0)\) \\ Sphere & \(f_{6}(\overline{x})=\sum\limits_{i=1}^{n}x_{i}^{2}\) & \((-10,10)\) & \(0\) & \((0,\ldots,0)\) \\ Sum squares & \(f_{7}(\overline{x})=\sum\limits_{i=1}^{n}ix_{i}^{2}\) & \((-10,10)\) & \(0\) & \((0,\ldots,0)\) \\ Styblinski-Tang & \(f_{8}(\overline{x})=\dfrac{1}{2}\sum\limits_{i=1}^{n}\left(x_{i}^{2}-16x_{i}^{ 2}+5x_{i}\right)\) & \((-10,10)\) & \(-39.2n\) & \((-2.9,\ldots,-2.9)\) \\ [PERSON] & \(f_{9}(\overline{x})=100+\sum\limits_{i=1}^{n}\left[x_{i}^{2}-10\cos\left(2\pi x _{i}\right)\right]\) & \((-10,10)\) & \(0\) & \((0,\ldots,0)\) \\ [PERSON] & \(f_{10}(\overline{x})=\sum\limits_{i=1}^{n}x_{i}^{2}+(0.5 ix_{i})^{2}+\left(\sum \limits_{i=1}^{n}0.5 ix_{i}\right)^{4}\) & \((-10,10)\) & \(0\) & \((0,\ldots,0)\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Test functions used in a minimization problem. the group will be created by the best adapted individuals according to fitness function. The probability \(p_{r}\) can be described by the following equation  
\[p_{r}\left(\overline{x_{i}^{t}}\right)=\frac{f\left(\overline{x_{i}^{t}}\right)} {\overline{x_{i}^{t}}}, \tag{2}\]  
where \(\overline{x_{i}^{t}}\) is the \(i\)-th individual in \(t\)-th iteration. For more randomness, the individual is chosen to reproduction process if it meets the following assumptions  
\[P_{r}\left(\overline{x_{i-1}^{t}}\right)<\alpha\leq P_{r}\left(\overline{x_{ i}^{t}}\right), \tag{3}\]  
where \(\alpha\in\left\langle 0,1\right\rangle\) is the random value and \(P_{r}(\cdot)\) is the value calculated as  
\[P_{r}\left(\overline{x_{i}^{t}}\right)=\sum_{j=1}^{i}p_{r}\left(\overline{x_{ j}^{t}}\right). \tag{4}\]  
So in this way, the best individuals are selected to be reproduced and it is made by two classic operators known as mutation and crossover. The first of them is understood as the modification of the chromosome by adding random value \(\tau\in\left\langle 0,1\right\rangle\) as  
\[\overline{x_{i}^{t+1}}=\overline{x_{i}^{t}}+\tau. \tag{5}\]  
Of course, not every of them will be mutated - only these that will meet the inequality given as  
\[\lambda_{i}<p_{m}, \tag{6}\]  
where \(p_{m}\) is mutation probability and \(\lambda\in\left\langle 0,1\right\rangle\).