In the beginning, this section introduces the basic HHO. Then, it points out the noticed deficiencies of original HHO implementation and, finally, the modifications that target the observed flaws of the basic HHO are proposed at the end of this section.
3.1. Original HHO
The HHO algorithm, as its name states, is inspired by different Harris Hawks’ strategies during their attacks on prey in nature. These attacking phases consist of three steps: exploration, the transition from exploration to exploitation, and, finally, the exploitation phase. The algorithm was initially proposed by Heidari et al. in 2019 [
6].
In the exploration phase, the HHO algorithm strives to find the closest solution to the global optimum. During this phase, an algorithm is randomly initialized on multiple locations and, step-by-step, moves closer to its prey, mimicking how hawks attack in their natural surroundings. To achieve this efficiently, the HHO utilizes two strategies with equal probabilities, determined with parameter
q as follows [
6]:
where
q, together with
,
,
and
, represent random numbers from the range
, which are updated in each iteration,
is the solutions’ position vector for next iteration, while
,
and
denote the best, current and average solutions’ positions in the ongoing iteration
t. Finally,
and
are lower and upper bounds of variables that define the scope of solutions in the search space. Furthermore, to obtain an average position of the solutions
, the simplest averaging approach is employed:
where
N presents the total number of solutions and
is location (position) of individual
X at iteration
t.
During the exploration phase, the HHO can change from exploitation to exploration for different amounts of time, depending on the strength of the solution (prey energy). The strength of solution updates in each iteration is as follows:
where
T expresses the maximal number of rounds (iterations) in a run and
initial strength of pray energy, which changes randomly inside the
interval.
During the exploitation phase, the hawk attacks its prey. However, the prey tries to escape, so the hawk needs to change between different strategies in order to exhaust and consequently catch the prey. In a real situation, hawks will try to come closer and closer to the prey, to make it easier for them to catch it. To incorporate this into the optimization algorithm, they change their attacking pattern from softer to harder. When , a soft besiege is applied, while when , hard besiege occurs.
When
and
, the prey still has energy, so hawks will encircle softly to make the prey more exhausted. This behavior is modeled with the following expressions [
6]:
where
is a vector difference between the best solution (prey) and solution position in iteration
t. Attribute
J is randomly changed in each round and simulates the target escaping strategy:
where
is randomly generated number in interval
. In a case when
and
, prey is exhausted and hawks can perform a hard attack. In this case, the current positions are updated as:
Furthermore, in the situation when the prey still has some energy available, a soft push is performed before the hawks’ attack can occur. This form of attack utilizes zig-zag movements known as leapfrog movements, which are common in nature. To perform this, the hawk can evaluate the following rule:
and then dive in a leapfrog pattern as follows:
where
D is the dimension of a problem and
S represents a random vector of
size, while
is levy flight function, calculated as:
Hence, the strategy for updating individuals’ positions is calculated as follows:
where
Y and
Z are calculated by utilizing Equations (
12) and (
13).
Finally, in the
and
case (hard besiege with progressive rapid dives), the prey does not have energy, and a hard attack is utilized before hawks hunt down the prey. Therefore, hawks decrease their average distance from the pray using the following strategy:
where, contrary to Equation (
15),
Y and
Z are obtained using the following rules:
In the modern literature from the domain of swarm intelligence, the two most commonly used methods for calculating algorithms’ complexity are established: the first one only accounts for the number of fitness function evaluations (FFEs) because this operation is the most expensive in terms of computational resources [
54] and the second one, besides FFEs, also includes the cost of updating solutions’ positions [
6,
17,
55]. The cost of generating the initial population is excluded because it is relatively inexpensive compared to the cost of the solutions’ update process. Both methods calculate complexity in terms of
T; however, if the total number of FFEs is taken as the termination condition when comparing the performance of different algorithms, a comparison in terms of complexity is not needed.
Following the second method, as was suggested in [
6], the complexity of the original HHO is described as follows:
Number of FFEs in the initialization phase-
Number of FFEs in the solutions’ updating phase-
Cost of solutions’ updating phase-
Taking all the above into account, the computational complexity of the HHO is derived as follows:
More details about HHO can be captured from [
6].
3.2. Motivation for Improvements and Proposed Enhanced HHO Method
Notwithstanding the outstanding performance of basic HHO [
6], by conducting simulations with standard CEC bound-constrained benchmarks, it was noted that the original version can be further improved by addressing both processes—exploitation and exploration.
For some testing instances, especially with a higher number of dimensions, it happens that, in early iterations, the algorithm gets stuck in sub-optimal domains of the search space. After analyzing the diversity of convergence and solutions in such scenarios, it was concluded that if the “early” best solutions miss the right part of the search space, then most of the solutions also converge there and it is hard for the HHO to “escape” from this region. In other words, solution diversity for some problems is not satisfying in early execution cycles, and that is extremely dangerous if most of the solutions are generated far from the optimum domain. However, after some iterations, by performing HHO exploration, promising domains are discovered. However, this usually happens in the final stages of execution, when it is late for the search process to perform fine-tuning in this region, and consequently, less good solutions are generated at the end of a run.
The above-mentioned limitation of the basic HHO can also be viewed from the perspective of exploration–exploitation balance. Namely, in early iterations, this trade-off is biased towards exploitation, while in later iterations, when it should move towards exploitation, the intensification–diversification trade-off is in an equilibrium.
To address the above-mentioned issues in the original HHO, this study proposes three modifications.
The first modification is chaos-based population initialization. The idea of embedding chaotic maps in metaheuristics algorithms was first introduced by Caponetto et al. in [
56]. The stochastic nature of most metaheuristics approaches is based on random number generators; however, many recent studies have shown that the search process can be more efficient if it is based on chaotic sequences [
57,
58].
Chaos is defined as non-linear movements of the dynamic systems that exhibit ergodicity and stochasticity, and are susceptible to initial conditions. Generation of the population by chaotic sequences has previously been used in multiple metaheuristics approaches in various domains. Some examples include chaotic multi-swarm whale optimizer for boosting the support vector machine (SVM) that assists doctors in medical diagnostics [
57], chaos-enhanced firefly metaheuristics, applied to the mechanical design optimization problem [
59], K-means clustering algorithm enhanced with chaotic ABC [
60], and many others [
58,
61,
62].
Many chaotic maps are available, such as the circle map, Chebyshev map, intermittency map, iterative map, logistic map, sine map, sinusoidal map, tent map, and singer map. After performing experiments with all the above-mentioned chaotic maps, the best results were achieved with a logistic map, and this was chosen for implementation in HHO.
The chaotic search is implemented in the proposed HHO by generating the chaotic sequence in accordance with the constraints of the observed problem, and then the generated sequence is used by individuals for exploration of the search space. The proposed method utilizes the chaotic sequence
, that starts from the initial random number
, generated by the logistic mapping, according to the Equation (
20):
where
and
N are the chaotic control parameter and size of population, respectively. The
usually has the value 4 [
62], as was also set in this study, to ensure chaotic movements of individuals, while
and
.
The process of mapping solutions to generated chaotic sequences is accomplished with the following expression for each parameter
j of individual
i:
where
is new position of individual
i after chaotic perturbations.
Taking all these into account, the details of chaotic-based population initialization are provided in Algorithm 1.
Algorithm 1 Pseudo-code for chaotic-based population initialization |
Step 1: Generate standard random population P of N solutions with expression: , where is pseudo-random number drawn from the interval . Step 2: Generate chaotic population of N individuals by mapping solutions from P to chaotic sequences using expressions ( 20) and ( 21). Step 3: Calculate fitness of all solutions from P and . Step 4: Sort all solutions from according to fitness. Step 5: Select N best individuals from sorted set as initial population.
|
In this way, the quality of solutions is improved at the beginning of a run and the search agents may utilize more iterations for exploitation. However, despite the efficient chaotic-based initialization, when tackling challenges with many local optima, metaheuristics may still suffer from premature convergence. As noted above, the exploration of basic HHO, which is crucial for avoiding premature convergence, should be improved, which motivated the introduction of the second modification.
One of the most efficient available strategies for improving both intensification and exploration, as well as its balance, is the quasi-reflection-based learning (QRL) procedure [
63]. By using the QRL, quasi-reflexive-opposite solutions are generated and if, for example, the original individual’s position is far away from the optimum, there is a good chance that its opposite solution may be in the domain in which an optimum resides.
By applying the QRL procedure, the quasi-reflexive-opposite individual
of the solution
X is generated in the following way:
where
generates random number from uniform distribution in range
. This procedure is executed for each parameter of solution
X in
D dimensions.
The proposed improved HHO adopts a simple replacement strategy of the worst and best individuals from the population based on the QRL. Applying the QRL mechanism yields the best performance in early iterations by significantly improving exploration if the current worst solution () is replaced with the quasi-reflexive-opposite best individual (). However, based on empirical research, in later iterations, when exploitation should be intensified, it is better if the is replaced with its quasi-reflexive-opposite. In both cases, a greedy selection is applied and a solution with a higher fitness value is kept in the population for the next iteration.
Finally, the third modification that was incorporated into the basic HHO is chaotic search (CS) strategy [
64] around the
solution. During practical experiments, it was noted that, for very challenging benchmarks, e.g., multi-modal shifted and rotated functions [
65], in late iterations, the
may become “trapped” in one of the local optima and, in such scenarios, the QRL mechanism is not able to generate
with better fitness than the original
. The consequence of such scenarios is a quality of worse solutions at the end of a run and, consequently, worse mean values.
The abovementioned case is mitigated by employing the CS strategy in the following way: in later iterations, if the
cannot be improved in best threshold (
) fitness function evaluations (FFEs), instead of generating
, the CS is performed around the
. The CS strategy for generating the chaotic current best (
) is described with the following equations:
where
is a new chaotic sequence for the
determined by Equation (
20) and
is dynamic shrinkage parameter that depends on the current FFEs and the maximum number of fitness function evaluations (
) in the run:
Dynamic enables a better exploitation–exploration trade-off by establishing wider and narrower search radius around the in lower and higher iterations, respectively. The FFEs and can be replaced with t and T when the total number of iterations in a run is considered the termination condition.
Finally, to control which of the proposed two QRL or the CS strategies will be triggered, another control parameter, adaptive behavior, denoted as
, is introduced. This procedure is mathematically described with the following three expressions:
where
k is incremented every time
cannot be improved by QRL and
stands for the predefined
improvement threshold. The FFEs simply represents the current number of fitness function evaluations and can be replaced with
t if the number of iterations is taken as the termination condition. The above expression will execute if, and only if, the newly generated solution is better than the current solution, according to the greedy selection mechanism.
Since metaheuristics are stochastic methods in which randomness plays an important part, empirical simulations are the most reliable way of determining how the control parameters’ values affect the search process. Additionally, in the case of the proposed enhanced HHO, as shown in
Section 4, the values of control parameters
and
, that, on average, obtain the best performance for a wider set of benchmarks, are empirically determined.
Notwithstanding that the enhanced HHO metaheuristics adopts chaotic population initialization, QRL replacement, and CS strategies, for the sake of simple naming conventions, the proposed method is titled enhanced HHO (eHHO) and its working details, in a form of pseudo-code, are provided in Algorithm 2.
Algorithm 2 Proposed eHHO pseudo-code |
Inputs: The population size N and maximum FFEs number () Initialize population , () according to Algorithm 1 Initialize whiledo Calculate the fitness values of all individuals Set as the location of current best solution for each solution do Update the initial energy and jump strength J Update E if then Exploration phase Update the location vector end if if then Exploitation phase if and then Soft besiege Update the location vector by soft besiege else if and then Hard besiege Update the location vector by using hard besiege else if and then Soft besiege with progressive rapid dives Update the location vector by using soft besiege with rapid dives else if and then Hard besiege with progressive rapid dives Update the location vector using hard besiege with progressive rapid dives end if end if end for if then Generate Perform greedy selection between and else if and then Generate Perform greedy selection between and else Generate Perform greedy selection between and end if end while Return Post-process results and visualization
|
As shown in
Section 4 and
Section 5, the proposed eHHO managed to achieve a better performance than the basic HHO. However, according to the NFL theorem, there is always a trade-off. The proposed eHHO employs additional control parameters
and
and performs
N more, and one more FFEs, during initialization and throughout its iterations, respectively. Moreover, the eHHO updates one more solution in each iteration.
Following the same approach as that used to calculate computational complexity, as well as the costs (Equation (
19)), in terms of
T, the eHHO complexity can be expressed as: