## 4 Bee Colony Algorithms
### A Modified Bee Colony Algorithm
Let us shortly discuss the peculiarities of the MBC algorithm used here:  
* This algorithm demonstrates competent division into local areas through the Euclidean distance;
* The shrinkage of the area occurs after \(\tau\) unsuccessful attempts, not after every failure, thus reducing the chance to miss local minima;
* The shrinkage of the area is aggressive in order to achieve faster convergence and higher accuracy (it is adapted for the class of problems considered here);
* When a local extremum is found, it is stored, and the bees from the local area disappear; at the same time, the search in the other local areas continues;
* The stopping criteria is checked for each location individually. Let us now provide some more explanations concerning each item above. The BA family is conceptually developed to search only for the global extremum; therefore, after each iteration, the values of the functional are sorted globally, and the few most perspective points are selected to continue the search. In our modification, the sorting and the selection are done locally for each local active area, thus enabling the local extrema to be found. In the original algorithm, the area is shrunk once no improvement of the results is observed after the current iteration. Instead, in our modification, \(\tau\) iterations are allowed before the area is shrunk. This allows the density of the bees exploring the area to be increased. Such a variant has advantages for functionals like the one considered here. One can start with a small number of bees per local area, and thus, in a cheap way, go down close to the bottom of the valley. Close to the bottom of the valley is relatively flat, so the density of the bees has to be increased. This is done either by repeated search in the same area, or by shrinking. ```
Initialize the scout bees (\(sb\));  Sort them by nectar value;  Via \(\delta\), divide into local areas; forAll regions (\(n+m\))do  Set initial best value for the region;  Set \(\xi\) to zero;  Set local search area;  Initialize local area where extremum is in the center; whileUntil convergedo Iteration counter += 1;  Initialize agent bees ;  Sort them by feed value; ifA better value is found compared to the one in the centerthen  Change the extremum value to new one;  Allocate new search area around the new best value;  Set fail = 0 ; else fail += 1;  end if iffail == \(\tau\)then  Set fail = 0;  Set \(\xi\) += 2 ;  Shrink local search area \(\zeta\) times; if\(\delta\) between the best values from two consecutive iterations \(\leq\varepsilon_{1}\)or local  search area side \(\leq\varepsilon_{2}\)then  Break;  end if  end for forAll regions (\(n+m\))do  Print found extremum coordinates and values  end for
```  
**Algorithm 1**A modified Bee Colony algorithm pseudo-code. Aggressive shrinking of the local area is explored in our case, unlike the most known bee-type algorithms, having in mind the shape of the considered functional. Each dimension of the respective local area is halved during shrinking. This allows for the computational costs to be reduced and the accuracy to be improved. The SBA introduced the concept of the local area abandonment procedure. When a site is abandoned, the bee becomes a scout and the search process begins in a new place. In our modification, there is no concept of local area abandonment, since the local extrema are sought in addition to the global extremum. In our approach, the stopping criteria is checked for each local area and not globally.