3.2. Improved Harris Hawk Algorithm
At present, some researchers are attempting to improve the accuracy and convergence of the algorithm results by increasing the time complexity of the operation, but sacrificing time complexity will bring great challenges to computational resources and solving time. The improved operations in this paper are derived without changing the time complexity of the original heuristic algorithm. The Harris Hawk algorithm (HHO) is a new type of swarm intelligence algorithm proposed in 2019 [
39]. It mainly searches for the optimal solution by simulating the predatory behavior of the Harris Hawk. HHO is an excellent heuristic algorithm. It does not have many parameters to adjust and has good performance. Compared with other heuristic algorithms, HHO has good search performance and the ability to jump out of local optima. HHO mainly includes the following three key steps: global search, conversion stage, and local search. The global search involves dividing two searches’ formulas into equal probabilities using a random number as follows:
In Formula (1),
represents the current position,
represents a random position,
and
represent the prey’s position and average position, respectively,
r represents a random number,
q represents the strategy selection probability, and
N represents the population number. The transformation stage is represented by a simple linear formula, i.e., Formula (7), which includes four strategies of a Harris Hawk in the local search, as shown in the
Table 2:
Detailed explanations of Formulas (1)–(5) in the above table can be found in the literature [
39]. In the above equation,
r represents a random number,
E represents the energy formula,
represents the position difference in the Harris Hawk,
J represents ta random number between 0 and 2,
Z simulates the glide process, and
Y simulates the movement process of the approach. Aiming at the characteristics of HHO such as low population richness, easily falling into local optimization, and slow convergence speed, this study made improvements to several parts of the Harris Hawk algorithm. The improvement methods are all carried out without changing the time complexity of the algorithm itself, including improvements to initialization and search strategies.
Many meta-heuristic algorithms use a random strategy when initializing populations, significantly reducing the richness of simulated biological populations. Many studies use chaotic mapping to map variables into the value range of the chaotic variable space and linearly transform the problem’s solution into the optimal variable space to solve this problem, such as [
40]. In this study, chaotic mapping is introduced into the initial population stage of the Harris Hawk algorithm, and a circle map is used to initialize the population. The improved initial position distribution of the population is more uniform compared with the random initialization. This part of the disturbance to population chaos reflects the idea of symmetry. This method not only broadens the search space of the Harris Hawk and increases the diversity of group location but also avoids the local optimization of the algorithm to a certain extent and improves the algorithm’s efficiency. The circle mapping formula, i.e., Formula (6), is as follows:
where
in Formula (6) represents an individual position and
mod represents modular operation.
The convergence speed of the Harris Hawk algorithm is largely influenced by the energy conversion formula. In the original text of the Harris Hawk algorithm, the author adopted a linear formula to simulate the process of decreasing prey energy with an increase in iteration times. However, the dynamic process of prey energy changes is not reflected by using the linear formula in the original text. That is, in the early stages of encirclement, the prey’s energy is high and vigorous; during the process of encirclement, the prey constantly moves to avoid the Harris Eagle, and energy is rapidly consumed; and at the end of the iteration, the prey is already exhausted, and its energy will remain at a low level and continue to decline. To optimize this process, this study uses a nonlinear dynamic formula instead of the original formula:
In Formulas (7) and (8),
t represents the current number of iterations,
T represents the maximum number of iterations,
represents the amplitude coefficient, and
is an exponential parameter. The improved energy formula can be more appropriate to the energy process of the prey, as shown in
Figure 4, and the energy remains at a high level at the beginning of the iteration.
Figure 5 above shows that the exponential parameters are taken as 3, 5, and 10, respectively. In the middle of the iteration, the prey’s energy will rapidly decline; at the end of the iteration, the prey’s energy remains at a low level and continues to decline. The algorithm can dynamically search at different search stages through this improved energy formula. The energy formula is an important factor connecting different search strategies in the design of the algorithm, and this nonlinear dynamic search can improve the efficiency of the algorithm.
The Harris Hawk algorithm has the disadvantage of easily falling into local optimization during the iterative process. Many scholars have conducted many studies to solve the above problems, such as [
41]. The linear motion and spiral motion in the black widow algorithm adopt the guidance mechanism of the optimal individual, which is a key step in the black widow algorithm to reduce the population falling into a local optimal. The original author continued the idea of the black widow algorithm and proposed a jumping spider algorithm in the design of subsequent algorithms. The missing spiral search strategy makes it perform mediocrely in the global search process, although it performs outstandingly in continuous unimodal functions. This study introduced the spiral motion behavior of spiders in the black widow algorithm [
42] into the global search to strengthen the ability of the Harris Eagle algorithm to jump out of local optima, and the improvement also be used to characterize the circling behavior of Harris Hawks during the global search.
The improved Harris Eagle global search process is:
In Formula (9) above, m is a random number in [0.4, 0.9], is a random number in [−1, 1], and indicates the optimal location for the black widow spider. in (10) represents the random position of the Harris Eagle, represents the prey’s position, and represents the average position. lb, ub, and r represent the lower limit positions, upper limit positions, and random numbers, respectively. q is used to represent the transition of the Harris Hawk search strategy with equal probability.
Many studies have optimized the local search stage of the Harris Hawk to accelerate the convergence speed of the Harris Hawk algorithm. Zhang et al. [
43] introduced the sine and cosine algorithm into the Harris Hawk algorithm, using the oscillating optimization process of the sine and cosine to accelerate the convergence speed of the Harris Hawk. This paper adds a nonlinear inertia weight factor to the local search process of the Harris Hawk algorithm, which originates from the acceleration of the particle swarm algorithm by the inertia weight factor in the inertia weight particle swarm algorithm. The nonlinear inertia weight factor can make the convergence speed of the algorithm change with the number of iterations. At the beginning of the iteration, the inertia factor is small, and as the number of iterations increases, the value of the nonlinear inertia factor gradually increases first and then decreases. The nonlinear inertia factor formula is as follows:
In Equation (11),
and
represent the initial inertia weight and the end inertia weight, respectively. The value changes with the number of iterations, as shown in
Figure 6.
The nonlinear inertia weighting factor can be combined with the improvement in the Harris Hawk algorithm using the nonlinear dynamic energy formula mentioned above. When the prey’s energy decreases rapidly in the middle of the iteration, the inertia weight factor also remains at a high level, which can accelerate the conversion of the algorithm from a global search to a local search and enable the Harris Hawk algorithm to conduct a local search at a faster speed.
The Levy flight strategy is often used in swarm intelligence algorithms based on birds or swimming fungi [
44,
45] to simulate the gliding behavior of organisms. Levy flight has the characteristics of alternating long and short lengths, strong randomness, and the ability to jump out of local optima, which is relatively consistent with heuristic algorithms. In the Harris Hawk algorithm, the author also uses Levy flight to simulate the gliding process of a Harris Hawk during predation. However, the Levy flight formula in the original text has certain defects. The Levy formula in the original text is as follows:
Formula (12) above conforms to the Markov construction process. In the formula,
is a characteristic coefficient, and it takes a value of 0.01 in the original text. The value range of parameter
is generally between 0 and 2, and in the original text, it takes a value of 1.5. In the original algorithm,
u and
υ are represented by random numbers between [0,1]. This paper uses the positive distribution in the Mantegna method to process
u and
υ in Formula (12) to correct this. The pseudocode of the improved Harris Eagle algorithm is as follows in Algorithm 1:
Algorithm 1. Improved Harris Hawk algorithm |
Require: Initialize related parameters Ensure: Initialize population using circle chaotic map 6 Ensure: Optimize prey energy E through Formula (8) |
1: while do |
2: if abs(E) ≥ 1 then |
3: Perform global search according to Formula (10) 4: else abs(E) < 1 then 5: if r ≥ 0.5 and abs(E) > 0.5 then |
6: Use Formula (9) to improve soft surrounding |
7: end if |
8: if r ≥ 0.5 and abs(E) < 0.5 then 9: Use Formula (9) to improve hard surrounding |
10: end if |
11: if r < 0.5 and abs(E) > 0.5 then |
12: Fast gliding soft surrounding for Levy correction (12) and nonlinear inertia weight optimization |
13: end if |
14: if r < 0.5 and abs(E) < 0.5 then |
15: Fast gliding hard surround for Levy correction (12) and nonlinear inertia weight optimization |
16: end if |
17: end if |
18: end while |
The computational complexity of the IHHO mainly depends on the following three processes: initialization of added disturbances, fitness evaluation, and population position update. Assuming the population size is N, the computational complexity of the initialization part is O (D × N). The computational complexity of evaluating the optimal location and updating the population position vector is O (N × T + N × T × D). In summary, the computational complexity of the IHHO is O (N × (T + D + T × D)).