## 3 Methods  
### Hoa  
Figure 1 presents the high-level view of the original version of the HOA [24], describing the main steps, configuration parameters, and instruction flow. Some of the configurable parameters of the HOA are common to other bio-inspired algorithms, such as: the number of iterations (\(I\)), the number of dimensions of the search space (\(D\)), the size of the population (\(N\)), and the reorganization frequency (\(M\)). On the other hand, some of the configurable parameters are specific to the HOA, such as: the dominant stallions percent (\(DSP\)), the horse distribution rate (\(HDR\)), the horse memory pool (\(HMP\)), and the single stallions percent (\(SSP\)). The main steps of the HOA are described in more detail next:  
**Step 1. **\(N\) horses \(\{h_{1},\ldots,h_{N}\}\) are initialized randomly in the \(D\)-dimensional search space. **Step 2. ** The algorithm computes the fitness value of each horse using the objective function and updates the value of the best horse \(h_{gbest}\). **Step 3. ** The value of _iteration_ is initialized to 0. If _iteration_ is less than \(I\), then there are two cases: if _iteration_ modulo \(M\) equals 0, then the algorithm continues with **Step 4**, otherwise the algorithm continues with **Step 8**. If _iteration_ is greater than or equal to \(I\), then the algorithm continues with **Step 18**. **Step 4. ** The best \(N\times DSP\) horses according to the fitness value are the leaders of the herds from the set \(T\) of newly initialized herds such that \(|T|=|N\times DSP|\). **Step 5. ** The next best \(N\times SSP\) horses according to the fitness value are single stallions and form the set \(S\). **Step 6. ** The remaining horses are assigned randomly to herds from \(T\). Figure 1: HOA high-level view. **Step 7. ** The worst \(N\times HDR\) horses in terms of fitness value are distributed randomly in the \(D\)-dimensional search space, their fitness values are recomputed, and the value of \(h_{gbest}\) is updated accordingly. **Step 8. ** For each herd \(\{h_{1},\ldots,h_{K}\}\) of size \(K\) from \(T\), the ranks are from \(\left\{\frac{1}{K},\frac{2}{K},\ldots,1\right\}\) such that the highest rank values are assigned to the horses with the best fitness values, which are the minimum values in case of minimization problems or the maximum values in case of maximization problems. If two horses with indices \(i\), \(j\) from \(\{1,\ldots,K\}\) have the same fitness value, such that \(i<j\), then the horse with the index \(j\) has a higher rank than the horse with the index \(i\). The center of the herd is computed as the weighted arithmetic mean of the positions of the horses such that the weights are the ranks. The instructions from **Step 9** to **Step 14** are performed for each horse. **Step 9. ** The gait is updated to a random value from \([1,\ 2]\). If the horse is single then its velocity is updated in **Step 10**, otherwise its velocity is updated in **Step 11**. **Step 10. ** The formula for updating the position for a single stallion is:  
\[v^{iteration+1}=v^{iteration}+r\times h_{gait}\times\left(hherd_{center}-x^{ iteration}\right), \tag{1}\]  
such that \(v^{iteration+1}\), \(v^{iteration}\) are the values of the velocity in \(iteration+1\) and \(iteration\), \(r\) is a random value from \([0,\ 1]\), \(h_{gait}\) is the gait of the horse \(h\), \(hherd_{center}\) is the center of the nearest herd, namely, the one for which the Euclidean distance between the position of the stallion and the center of the herd is minimum, and \(x^{iteration}\) is the position of the stallion in the current \(iteration\). **Step 11. ** If the horse belongs to a herd, then its velocity is updated using the formula:  
\[v^{iteration+1}=v^{iteration}+h_{rank}\times h_{gait}\times\left(herd_{center} -x^{iteration}\right), \tag{2}\]  
such that \(h_{rank}\) and \(herd_{center}\) are the rank of \(h\) and the center of the herd, respectively. **Step 12.