## 2 Optimization Problem and the Method of Finding the Optimal Solution
### Wolf Search Algorithm  
One of the new heuristic algorithms is Wolf Search Algorithm described for the first time in [28]. In the algorithm, the behavior of wolves during the search for food and avoid other predators is modeled. The model assumes that the wolf can only see in a certain area around himself and he can only move in it. This area is understood as a circle, where the center is the point (wolf) with \(r\) radius. The wolf's position is assessed in terms of its adaptability to the function \(f(\cdot)\) which values are interpreted as a number of food locations in the circle. There is a situation that the wolf quickly escapes outside this area when another predator is in the vicinity or the amount of food in the area is quite low.  
Such a behavior of the wolf while searching for food is modeled for optimization purposes. Let \(\overline{x}\) be a particular wolf among the whole population. The actual position of \(\overline{x}\) will be designated as \(\overline{x}_{actual}\)-Wolf moves according to  
\[\overline{x}_{new}=\overline{x}_{actual}+\beta_{0}\exp\left(-r^{2}\right) \left(\overline{x}_{neighbor}-\overline{x}_{actual}\right)+\gamma, \tag{21}\]  
where \(\beta_{0}\) is the ultimate incentive, \(\overline{x}_{neighbor}\) is the closest neighbor with higher value of fitness function, \(\gamma\) is random number in \(\langle 0,1\rangle\) and \(r\) means the distance between two wolves \(\overline{x}_{actual}\) and \(\overline{x}_{neighbor}\)calculated as the Euclidean metric already described in Equation (14). Wolf moves by Equation (21), when he spotted a better feeding. Otherwise, the wolf tries to hunt. Hunting of wolves lies in a process of stalking that can be represented into three steps  
* wolf moves in the area of his vision and looks for food. This behavior is modeled by changing the position of the wolf in the following way \[\overline{x}_{new}=\overline{x}_{actual}+\alpha v\gamma,\] (22) where \(v\) is the velocity of a wolf.
* wolf waits for the opportunity to attack on a given position and tries to attack by Equation (21).
* in case of lack of food or the appearance of another predator, the wolf escapes by \[\overline{x}_{new}=\overline{x}_{actual}+\alpha k\gamma,\] (23) where \(k\) is the step size.  
It is simply model showing the behavior of wolves. In each iteration, wolves search for better food source and in the end, the wolves that is identified with best food source is the result. The full algorithm is presented in Algorithm 6.  
```
Start,  Define basic parameters of the algorithm - the number of iterations \(T\), the number of wolves \(n\), radius of view \(r\), step size \(k\), velocity coefficient \(\alpha\) and rate of appearance of the enemy \(p_{\alpha}\),  Generate a population of wolves at random, \(t:=0\), while\(t<T\)do for each wolf \(\overline{x}_{actual}\) in population do  Check the viewing area by Equation (22),  Calculate the new position \(\overline{x}_{new}\) using Equation (21), if\(d(\overline{x}_{actual},\overline{x}_{new})<r\wedge f(\overline{x}_{new})<f( \overline{x}_{actual})\)then  Move the wolf from \(\overline{x}_{actual}\) to \(\overline{x}_{new}\), endif  Select the value of the parameter \(\beta\in\langle 0,1\rangle\) at random, if\(\beta>p_{\alpha}\)then  The wolf performs escape by Equation (23), endif endfor \(t++\), endwhile  Return the fittest wolf \(\overline{x}_{global}\) in the population, Stop.
```  
**Algorithm 6**Wolf Search Algorithm