A Novel Hybrid Fireﬂy Algorithm with Double-Level Learning Strategy

: The ﬁreﬂy algorithm (FA) is a swarm intelligence algorithm capable of solving global optimization problems exactly; it has been used to solve many practical problems. However, traditional ﬁreﬂy algorithms solve complex optimization problems with a simple update method, which leads to premature stagnation due to the limitation of ﬁreﬂy diversity. To overcome these drawbacks, a novel hybrid ﬁreﬂy algorithm (HFA-DLL) with a double-level learning strategy is proposed. In HFA-DLL, a double-level learning strategy is proposed to avoid premature convergence and enhance the algorithm’s global search capability. At the same time, a competitive elimination mechanism is introduced to increase the accuracy of solving complex optimization problems and improve the convergence rate of the algorithm. Moreover, a stochastic disturbance strategy is designed to help the best solution jump out of the local optimum and minimize the time cost in the wrong direction. To understand the advantages and disadvantages of HFA-DLL, experiments were conducted on the CEC 2017 benchmark suite. Experimental results show that HFA-DLL outperforms other state-of-art algorithms in terms of convergence rate and exploration efﬁciency.


Introduction
Global optimization problems play a crucial role in scientific research, engineering, and industrial design. Many problems are eventually transformed into global optimization problems, such as image compression, inventory prediction, genetic identification, mathematical planning, graph theory, and network analysis. As the complexity of optimization problems increases, traditional algorithms have difficulty solving them effectively. As a result, many swarm intelligence algorithms have emerged, including the artificial bee colony algorithm (ABC) [1], locust swarms (LS) [2], cuckoo search (CS) [3], particle swarm optimization (PSO) [4], the harmony search algorithm (HS) [5], the fruit fly optimizer algorithm (FOA) [6], the tree seed algorithm (TSA) [7], biogeography-based optimization (BBO) [8], and the differential evolution algorithm (DE) [9]. These swarm intelligence algorithms iteratively update the population through various strategies to find an approximate solution to the global optimization problems.
The Firefly algorithm (FA) is a heuristic algorithm proposed by Professor Yang of Cambridge University in 2008 [10]. Its inspiration comes from the flickering behavior of fireflies, which attract other fireflies by shining. FA is easy to use and implement, and is widely used to solve complex optimization problems in the real world. An improved firefly algorithm for global continuous optimization problems (AD-IFA) [11] is proposed by Wu for global continuous optimization problems. AD-IFA improves local availability and accelerates convergence speed by adding Lévy adaptive algorithm spirals. A new dynamic FA (NDFA) [12] algorithm is proposed by Hui Wang et al., which is used to estimate water resource demand. NDFA improves the accuracy of water demand prediction through three different estimation models (linear, exponential, and mixed) combining historical water consumption and local economic structure. Due to the ability of FA to effectively and quickly solve constrained optimization problems, a novel particle swarm optimization based on a hybrid-learning model was proposed by Wang et al. [13]. It is used to solve global optimization problems in the continuous domain and has achieved excellent results. A GPU-based implementation of the firefly algorithm was put forward by Lauro et al. [14]. It uses a graphics processor to accelerate variable selection in multivariate calibration problems, finding more suitable choices in multivariate calibration and improving processing efficiency. A hybrid particle swarm optimization firefly algorithm (HPSOFF) [15,16] was proposed by Sivaranjani et al.; it is used to plan the location and shape of modules in the VLSI design cycle and calculate the cost indicators such as optimized layout area and wiring length. A support vector machine-firefly algorithm (SVM-FFA) [17] was proposed by Sudheer et al., which can predict the incidence of malaria to ensure that appropriate actions are taken to control the epidemic.
Complex optimization problems necessitate the rapid identification of global optimal values, which requires firefly algorithms (FAs) to possess both high search accuracy and swift convergence speeds. Consequently, researchers have focused on improving these aspects of FAs. In 2020, Hui Wang et al. [11] proposed an adaptive logarithmic spiral Levy firefly algorithm (AD-IFA) for continuous global optimization problems, which incorporated an adaptive change mechanism and enhanced global search capabilities, effectively addressing single-peak problems. However, for more complex optimization problems, an overly rapid search speed may lead to entrapment in local optima.
AD-IFA may have slow convergence speed and lack of individual diversity in highdimensional and complex problems. This is because, in the search process, the movement rules of fireflies are mainly based on the calculation of light attraction and distance, and the light intensity has a limited guiding effect on the global search, which easily leads to the search process falling into the local optimal solution. At the same time, it will also lead to the lack of global exploration ability and difficulty in maintaining diversity. To alleviate the issues of premature convergence and local optima stagnation in firefly algorithms, we proposed a novel hybrid firefly algorithm with a double-level learning strategy (HFA-DLL). This approach utilizes an elite archive queue (EAQ) and the global best firefly to guide the fireflies' movement, The main framework of HFA-DLL was shown in Figure 1, and the main contributions of this study can be summarized as follows: (1) HFA-DLL uses the EAQ to increase the diversity of the firefly population, and the size of the EAQ is set to 4m. In each generation, m elite fireflies are selected from the firefly population to enqueued at the rear of the EAQ, while m fireflies are dequeued at the front of the EAQ.
(2) The EAQ is capable of self-reproducing by utilizing a double-level (individual and dimensional) learning method for crossover to generate new offspring. It then compares the new offspring with their parents to retain the individuals with superior fitness values. This process can expand the search space of the elite fireflies, enhance population diversity, and effectively prevent premature convergence.
(3) A competitive elimination mechanism is introduced to eradicate the least effective fireflies in each generation by generating new fireflies from the elite individuals in the EAQ. This enhances the accuracy of HFA-DLL in solving complex optimization problems and accelerates convergence velocity. However, it can also lead to entrapment in local optima.
(4) To minimize the time wasted on incorrect search directions in intricate problem landscapes and address the issue of local optima entrapment when using the competitive elimination mechanism, a stochastic disturbance strategy is proposed. This assists elite individuals in escaping local optima.
In conclusion, the HFA-DLL method balances search accuracy and convergence speed; thus, providing an effective solution for complex optimization problems while mitigating the risk of stagnation in local optima.
The structure of this paper is as follows: Firstly, the work of the FA, Lévy-flight FA and AD-IFA is reviewed in the Section 2. Section 3 introduces the framework of HFA-DLL. Section 4 is the experimental part. Conclusions and the outlook of the work are given in Section 5.

Standard Firefly Algorithm
The firefly Algorithm (FA) is a swarm intelligence optimization algorithm that simulates the luminescence characteristics and attraction behavior of fireflies. It is a new meta-heuristic algorithm proposed by Professor Yang after observing firefly behavior [10].
In nature, fireflies use their light as a signal to attract other fireflies. Each firefly has the intensity of light I and attractiveness β, which is determined by the light intensity I. In the global optimization problem, the light intensity of a firefly is usually measured by the fitness value. The movement of each firefly depends on the brightness and attractiveness of its peers in its neighborhood structure. The higher the light intensity of the firefly, the greater its attraction. The brightness of fireflies is inversely proportional to the distance. The farther the distance, the lower the brightness of fireflies. The firefly algorithm searches for the global optimal solution through the movement of each firefly. In the process of finding the global optimal solution, high-brightness individuals continue to attract low-brightness individuals. The FA has the following three basic principles: (1) All fireflies are assumed to be hermaphrodites, so one firefly might be attracted to any other.
(2) The brightness of fireflies determines their attractiveness, and high-brightness fireflies attract low-brightness fireflies. If a firefly is brighter than other fireflies in the population, it will move randomly.
(3) Generally, the objective function value of the feasible solution of the problem to be solved is taken as a single brightness value.
When light is emitted from a source of a given intensity at a given distance r, it obeys the inverse square law. The light intensity I decreases with the increase in distance r, the air act as an obstacle, and the light intensity decreases with the increase in distance. The relative brightness of fireflies at r is calculated as follows: where r represents the distance between the fireflies, γ represents the light intensity attraction coefficient, and I 0 represents the initial fluorescence brightness of the firefly (r = 0). The attraction between fireflies and their relative brightness follows the proportional law, which can be expressed as follows: where β 0 is the attraction at the light source (r = 0), γ is the absorption coefficient of light intensity, represents the air with light absorption capacity, and r ij is the Cartesian distance between firefly i and j. The Cartesian distance between different fireflies can be expressed as follows: where x i,k represents the k-th component of the i-th firefly spatial coordinate, where D is the space dimension. During the iteration process, each firefly will move to the firefly whose brightness is higher than its own. The position update formula is as follows: where x t i and x t j are the spatial position of fireflies i and j, r ij is the distance between the i-th firefly and the j-th firefly, Rnd represents the d-dimensional uniform random vector in [0,1], and α is the step size factor of the disturbance.

Lévy-Flight Firefly Algorithm
The Lévy-flight firefly (LF-FA) [18] algorithm introduces Lévy-flight into the FA to adjust the update step size, which enhances the local space exploitation ability and improves the global exploration ability. Compared with the traditional FA, LF-FA has the better and faster convergence speed and global exploration efficiency. The main idea of LF-FA is to replace the traditional random or uniform distribution with the Lévy random distribution. The position update formula of firefly is as follows: where x t i is the position of i-th firefly at t-th generation, the second term is due to the attraction, α is the coefficient of the random term, the product ⊕ means entry-wise multiplications, sign() is a symbolic function that provides a random direction, and the random step size is extracted from Lévy flights, Rnd ∈ [0, 1]. The random step size is taken from the Lévy distribution based on the Fourier transform as follows [19]: where α is a parameter within [−1,1] interval and is known as the skewness of scale factor. An index of o stability β ∈ (0, 2) is also referred to as the Lévy index. The analytic form of the integral is not known for general β except for a few special cases. For random walk, the step length S can be calculated by Mantegna's algorithm as: where β = 1.5, ν and µ conform to the standard normal distribution, that is: where τ is a standard Gamma function.

The Framework of HFA-DLL
In HFA-DLL, it employs an elite archive queue (EAQ) and the global best firefly to guide the movement of fireflies. In each generation, the EAQ selects m elite fireflies from the population to enqueue on the rear of the EAQ, while there are m fireflies' elements which dequeue on the front of the EAQ. The EAQ uses a double-level (particle-level and dimension-level) learning strategy to update the position of elite fireflies in the EAQ. The EAQ can be used to store the historical optimal solutions from the past search process. These optimal solutions tend to have high fitness values and may be ignored by the current search process. By retaining these historical optimal solutions, they can be prevented from being lost during the search process, while providing valuable references and heuristics to help ordinary individuals better explore the search space. In addition, the solutions stored in the EAQ can be used as a reference or guide to improve the current search strategy. By comparing the fitness value, characteristics, and other information between the current solution and the solution in the EAQ, the search direction is adjusted and the elite individuals of new solutions are generated. In this way, the past experience and success can be used for reference and applied to the current search process, which helps to improve the convergence and search effect of the algorithm. The detail of the double-level learning strategy was shown in Section 3.2. HFA-DLL uses a competitive elimination mechanism to replace the worst fireflies in the population with descendants of the EAQ; thereby, accelerating the convergence speed of HFA-DLL. The detail of the competitive elimination mechanism was introduced in Section 3.3. In order to prevent HFA-DLL from falling into local optima, a stochastic disturbance strategy is introduced to update the position of the global best firefly. The detail of the stochastic disturbance strategy is shown in Section 3.4.
In order to balance the trade-off between exploration and mining, HFA-DLL uses an adaptive switch ratio to choose the appropriate method from the two methods (the exploration method is attracted by the EAQ and the global best firefly, and the exploitation method uses the logarithmic spiral path) of updating the position of the firefly. The formula for updating the position of fireflies in the population is as follows: where u is a uniform random number in [0,1], R t is an adaptive switch ratio at t-th generation with an initial value of 0.5, and its next generation value is calculated by the Equation (11). x t+1 i is the position of i-th firefly at (t + 1)-th generation, gbest is the global best firefly, r g,i is the Euclidean distance between gbest and the firefly i, eaq t k is the k-th elite firefly in the EAQ at t-th generation, k is a random number whose range is [0, n], n is the size of the EAQ, and α is the step size factor in [0,1]. β 0 and β 1 are the initial attraction coefficients, which is usually 1, and γ is the light absorption coefficient, generally set as a constant 1. I is a d-dimensional uniform random vector whose range is [−1, 1] d , b is a constant value with a default value 1 for defining the shape of the logarithmic spiral, ⊗ is the Hadamard product, and the term cos(2π · I) provides a random direction logarithmic spiral path by the coefficients e b·I .
The adaptive switch ratio R t can control the search direction (global search and local search) of HFA-DLL. At different stages of iterative evolution, R t can be adaptively changed based on the fitness value. Followed by the idea of AD-IFA [11], it is calculated as follows: where f * t is the best fitness value at the t-th generation, lg(·) = log 10 (·), · is the floor function, and the adaptive scale parameter threshold θ is as follows:

Double-Level Learning Strategy
The EAQ is a queue that stores multiple generations of elite fireflies. In every generation, m elite fireflies will be selected to insert at the rear of the EAQ, while m elite fireflies at the front of the EAQ will be deleted. The EAQ is represented as follows: where n is the size of the EAQ, it is equal to m, m represents the number of elite fireflies selected per generation with a default value 4, m ∈ [1, NP], and NP is the size of the population.
In order to increase the diversity of the population, we give the elite fireflies of the EAQ maximum movement freedom to simulate their irregular manner in the natural environment. As a general rule, every firefly only jostles each other, so it cannot fully explore the high-dimensional landscape for complex multi-modal problems. Therefore, a double-level learning strategy (particle-level and dimension-level) has been proposed. It not only achieves irregular movement of fireflies at the macro level but also can achieve mutation in a certain dimension within a single firefly at the micro level. In the particle-level learning strategy, the elite firefly moves a random direction based on the Euclidean distance between two fireflies. In the dimension-level learning strategy, every elite firefly has only one dimension to move along a logarithmic spiral path. These two strategies are as follows: where r is a random number between [0, 1], p e ∈ [0, 1] is a control parameter called the rotation probability. ψ(·) is a particle-level learning strategy; it attracts each other through the Euclidean distance between fireflies. φ(·) is a dimension-level learning strategy; it updates a dimension within a single firefly. When r is less than p e , ψ(·)can make the i-th firefly move in random directions by j-th firefly. When r is more than p e , φ(·) can make the d-th dimension of the i-th firefly explore the landscape through a logarithmic spiral path. The particle-level learning strategy is as follows: where θ is used to define the elite firefly spiral shape, and θ is a random number generated within the range [−π, π], D i,j is used to represent the Euclidean distance between an elite firefly x t i and an elite firefly x t j . The dimension-level learning strategy is used to simulate the irregular logarithmic spiral movement behavior of the firefly, with its update strategy is as follows: where k and d is a randomly chosen dimension, H is a random number obeying normal distribution.

Competitive Elimination Mechanism
In order to accelerate the convergence speed of HFA-DLL, a competitive elimination mechanism was proposed. This mechanism can eliminate the worst firefly by the elite firefly of the EAQ in each iteration. The worst firefly is defined as: where wx t is the worst firefly of the population at t-th generation, and NP is the size of the population. nx t is the child firefly of the EAQ at t-th generation, r 1 is a scale factor, and r 1 ∈ [0, 1]. j and k are a random number, j = k ∈ [1, n], and n is the size of the EAQ.
where i is the index of the worst firefly of the population.

Stochastic Disturbance Strategy
In the search process, all fireflies in the population will learn from the global best firefly gbest, so gbest has an important influence on the population. For the complex multi-modal problem, once the gbest falls into a local optimum, the remaining fireflies will easily converge to the sub-optimal region, leading to premature convergence. A stochastic disturbance strategy is designed to prevent HFA-DLL from being in stagnation behavior. If the value of gbest does not change after ten iterations, the stochastic disturbance strategy will be triggered. This strategy is given below: where r 2 ∈ (0, 1) is a random parameter and D g,p is the Cartesian distance between gbest and eaq t p . b is the logarithmic spiral shape constant, and the path coefficient h is a random number in [−1,1].

Complexity Analysis
Similar to other iteration-based meta-heuristics, the computational time is evaluated by the running time of each cycle multiplied by the number of iterations. According to the pseudo-code given in Algorithm 1, the time complexity of HFA-DLL is analyzed as follows. N is the population size, D is the dimension problem dimension, and 4m is used to represent the number of elite fireflies in the EAQ. In the location update stage, the position of the elite fireflies in the EAQ is updated 4m times, and the remaining fireflies are The fitness function f (x), x = (x 1 , x 2 , x 3 , · · · , x d ) T ; 2 Initializes the firefly position x i (i = 1, 2, · · · , NP); 3 Randomly generate 4m elite fireflies to enter the elite archive queue (EAQ); 4 for t = 1, 2, 3, · · · , itermax do 5 for i = 1 : NP all fireflies do 6 for j = i : NP all fireflies (inner loop) do 7 Light intensity l i at x i is determined by f (x i ); 8 if l i < l j then 9 Update the i-th firefly's position by Equation (10) ; 10 Sort fireflies from best to the worst; 11 Enqueue m elite fireflies on the rear of EAQ; 12 Dequeue m elite fireflies on the front of EAQ; 15 Update the position of firefly by Equation (14); 16 else 17 Update the position of firefly by Equation (15); 18 Replace the worst firefly (wx t ) with (nx t ) by Equation (21); Update global best (gbest) by Equation (23); 22 if f nbest t < f gbest t then 23 gbest t = nbest t ; 24 return global best value (gbestval) ; A workstation equipped with Intel Core i7, 8700k 6 cores, and 12 threads CPU running at 4.5 GHz coupled with a 16 GB of DDR4 RAM at 3200 MHz, running Microsoft Windows 10 operating system was used to execute all of the simulations reported here. The algorithms were coded in the MATLAB 2021a platform. From Table 1, the running average time of different algorithms on 30-D functions. Each test is conducted 30 times independently and the computational time (in seconds).

Experimental Studies
In order to test the the performance of HFA-DLL, several experiments were conducted on the CEC 2017 global optimization benchmark function suite. Some state-of-the-art algorithms (PSO [20], FA [10], LF-FA [18], EE-FA [21], AD-IFA [11], and SHADE [22]) are used to compare with HFA-DLL. Further, the comparison of test results of different algorithms, strategy effectiveness, and parameter sensitivity were conducted to test the robustness of HFA-DLL.

Experimental Settings and Benchmark Functions
For all algorithms, the populations size NP = 30, and the maximum number of fitness evaluations MaxFes = 1000 × D, where D is the dimension of the benchmark functions. In the HFA-DLL, the random parameters α = 0.2, the fixed optical absorption coefficient γ = 1, and the coefficient of attraction b 0 = 1. In the PSO, c 1 = 0.2, c 2 = 0.2, the maximum velocity vmax = 0.8. In the SHADE, P min = 2 NP , and H = NP = 30. The parameters for other state-of-the-art algorithms (FA, LF-FA, EE-FA, and AD-IFA) were set to the identical guidelines from their original publications.
Due to the stochastic nature of these algorithms, each algorithm was independently run 30 times for statistical comparisons. The mean value and standard deviation value are calculated to assess the algorithm's performance. For each problem, the best result is bolded. The results of HFA-DLL are compared with those of PSO, FA, LF-FA, EE-FA, SHADE, and AD-IFA, respectively, by Wilcoxon rank sum test at the significance level of 0.05. The marker "−" means it is worse than the HFA-DLL result, "+" is better than the HFA-DLL result, and "≈" is equivalent to the results of HFA-DLL.
The performance of HFA-DLL is evaluated on the CEC 2017 global optimization benchmark function suite; it has 30 benchmark functions. The CEC 2017 can be divided into four categories: unimodal functions (F1-F3), multimodal functions (F4-F10), hybrid functions (F11-F20), and composition functions (F21-F30). The detailed information is shown in Table 2, and also can be seen in [23]. Because our algorithm produces significantly different results each time when it runs on the F2 function, F2 is unstable, so the F2 function was excluded from the comparative experiment. We only use 29 functions of CEC 2017.  Note: x * stands for the global optima, F(·) is the fitness value, F2 has been excluded because it shows unstable behavior.

Comparison with Other
State-of-the-Art Algorithms on CEC2017 for 30D/50D Problems From Figure 2, Tables 3 and 4, HFA-DLL is compared with three firefly algorithm variants and three traditional swarm intelligence algorithms on the CEC 2017 benchmark function suite. Some observations and conclusions are drawn from the analysis of the experimental results.
Firstly, for the unimodal functions (F1-F3), at 30D, HFA-DLL outperforms almost all other algorithms; only slightly worse than SHADE. In the case of 50D, SHADE can find the global optimal solution to F1 and F3, and HFA-DLL is only inferior than SHADE, and better than the other five algorithms on unimodal functions. For unimodal functions, HFA-DLL has a fast convergence ability and can quickly find the optimal solution. This is because the double-level learning strategy can converge quickly on unimodal problems. Through the information exchange of fireflies of different dimensions, the search scope is expanded and the search efficiency is improved.   Secondly, for the multimodal functions (F4-F10), at 30D, the performance of HFA-DLL is second only to SHADE on F7-F9 and better than all other algorithms on F10. Furthermore, HFA-DLL can find the optimal solution on F4 and F6. In the case of 50D, the performance of HFA-DLL is worse than SHADE on multimodal functions F5, F7-F9, and HFA-DLL outperforms all other algorithms on F4, F6, and F10. Because this category benchmark functions have the characteristics of translation, rotation, non-separability, extensibility, and continuous but differentiable only on a set of points. In addition to this, multimodal functions contain many local optima, which become more and more complex and difficult to optimize as the dimension increases. So it makes PSO, FA, and LF-FA more likely to become trapped in local optima and fails to find the global optimal solution. HFA-DLL uses the EAQ to store excellent information on the better position in each generation of the population to help the double-level learning strategy update the position. Each particle inherits through its elite fireflies, to improve the convergence accuracy. It can help the stagnation dimension jump out of the local minimum, and enhance the global search ability of HFA-DLL.
Thirdly, for the hybrid functions (F11-F20), at 30D, HFA-DLL can find the global optimal solution on F11, HFA-DLL is second only to SHADE on F12-F13, F15, F17-F18, and HFA-DLL maintains its advantage on F14, F16 and F19-F20. At 50D, HFA-DLL has worse capability than SHADE on F12, F15, F17 and F19-F20, and is better than all other algorithms on F11, F13-F14, F16 and F18. Since the category of hybrid functions is a composition of functions of several different types. It is a complicated optimization problem and contains a large number of locally optimal solutions. At the same time, the suboptimal local optimal solution is far from the global optimal solution. Within this category, different types of functions often exhibit different features and properties, and it is necessary to consider multiple different types of functions simultaneously. HFA-DLL retains an adaptive switching ratio when faced with a mixture function. It can leverage the fusion of multiple strategies to balance exploration and exploitation, and it can be optimized over a wider search space to improve global and local search capabilities.
Finally, for the composition function (F21-F30), at 30D, HFA-DLL shows significant advantages on F21, F23, F26 and F28-F30, but maintains the same local optimal performance with the SHADE on F27, and HFA-DLL is second only to SHADE and EE-FA on F22 and F25, respectively. In the face of the 50D problem, On F27 and F28, HFA-DLL, AD-IFA, EE-FA and LF-FA have the same performance, HFA-DLL outperforms the other six algorithms on F21, F23, F25-F26 and F29-F30, and is only slightly worse than SHADE on F22, F24 and F28. This is because the composition function is composed of multiple functions and the components often have some local properties. Each function is nonlinear, so its complexity is high, and it takes a long time to deal with such problems. HFA-DLL can not only expands the search range of the double-level learning strategy by learning from the elite fireflies, but also enhances the diversity of the population. Moreover, the competitive elimination mechanism is used to improve the convergence speed and accuracy of the algorithm while ensuring that the optimal value is not lost. In addition, a stochastic disturbance strategy is used to help the elite fireflies jump out of the local optimum, minimizing the time wasted in the wrong direction.
The effectiveness of the proposed HFA-DLL algorithm in terms of convergence accuracy, convergence speed, and algorithm reliability is verified through the CEC 2017 benchmark function suite. Experimental results show that the HFA-DLL algorithm significantly outperforms other classical FA and PSO algorithms and various other materialistic evolutionary algorithms in terms of statistical performance for most functions. Compared with the excellent algorithm SHADE, the ability of HFA-DLL is worse than the excellent algorithm SHADE in dealing with unimodal functions and multimodal functions, but it shows more powerful processing ability than SHADE in dealing with complex optimization problems such as hybrid functions and composition functions.
In the theorem of "no free lunch" theorem of optimization [24], that is "any elevated performance over one class of problems is offset by the performance over another class". Therefore, a general purpose general optimization algorithm is theoretically impossible. The reason why HFA-DLL outperforms other algorithms is that HFA-DLL is able to use a two-level learning strategy to learn and communicate between different elite firefly individuals and different dimensions, which effectively enhances the diversity of the population and improves search efficiency. Competitive elimination is used instead of worst-case fireflies to speed up convergence, which can improve the accuracy of solving complex optimization problems. The stochastic disturbance strategy helps the elite fireflies to jump out of the local optimum, reducing the time wasted in the wrong direction. These strategies can work together to enable HFA-DLL to achieve optimal or suboptimal results on all 30-dimensional problems of the CEC 2017 benchmark suite of functions.
In order to evaluate the performance of all algorithms more effectively, the Friedman test was separately conducted for each algorithm in this study. The mean values of all algorithms on the 29 test functions were used in the Friedman test, where a lower average ranking value indicates better performance. As shown in Table 5, it is clear that the six algorithms in the 30-D scenario can be ranked in the following order: HFA-DLL, SHADE, AD-IFA, PSO, EE-FA, LF-FA, and FA. HFA-DLL achieves the best average ranking, while FA exhibits the weakest performance.

Parameter Sensitivity
The influence of the parameters m and NP on the performance of HFA-DLL are analyzed. Different combinations of m and NP values are compared on the CEC 2017 benchmark function set, and the average value is used to judge the results. The results of the sensitivity analysis for the parameters m and NP are shown in Table 6.
In parameter sensitivity analysis, when one parameter is analyzed, other parameters are set as standard values (i.e., m = 4 or NP = 30). HFA-DLL mainly relies on the (EAQ) to balance exploration and exploitation, to quickly find the global optimal solution. The EAQ can store excellent information from multiple generations of elite fireflies and, at the same time, it can help the double-level learning strategy to find new optimal solutions. The EAQ has a population size of 4m, where m is the size of the elite fireflies selected from the population at each generation. The chosen parameter m determines the size of the EAQ and the ability of the firefly to learn from other good individuals, which is important for the solution. Therefore, different values of m were chosen based on the CEC 2017 benchmark function suite and performed 30 times.
HFA-DLL mainly relies on the elite archive queue (EAQ) to balance exploration and exploitation, and quickly finds the global optimal solution. The EAQ can store excellent information from multiple generations of elite fireflies. At the same time, it can help the double-level learning learning strategy to find a new optimal solution. The population size of the EAQ is 4m, where m is the size of the elite fireflies selected from the population at each generation. The choice of the parameter m is determined The scale of the EAQ and the ability of fireflies to learn from other good individuals, which is very important for the solution. According to the analysis of experimental data, m = 4 is an appropriate parameter setting. This is because, when choosing a smaller m, it means that this firefly has fewer opportunities to learn from other elite fireflies, which leads to a decrease in population diversity, and a larger m will increase the exploration ability of HFA-DLL, but also significantly increase the computational cost. NP parameters influence on the performance of the HFA-DLL, when NP = 20, small population size, leading to poor global search ability, on the multimodal functions and hybrid functions overall performance is poorer, but the larger population size cause to solve the waste of resources. Therefore, when NP = 30 and m = 4, HFA-DLL achieves the best overall performance.     6.41 × 10 +2 ≈ 6.41 × 10 +2 ≈ 6.15 × 10 +2 + 6.14 × 10 +2 + 6.41 × 10 +2 ≈ 6.45 × 10 +2 -6.40 × 10 +2 + 6.41 × 10 +2 ≈ 6.41 × 10 +2 F6 6.01 × 10 +2 -6.00 × 10 +2 ≈ 6.00 × 10 +2 ≈ 6.00 × 10 +2 ≈ 6.13 × 10 +2 -6.11 × 10 +2 -6.00 × 10 +2 ≈ 6.01 × 10 +2 -6.00 × 10 +2

Strategy Effectiveness
HFA-DLL has three strategies: the double-level learning strategy, competitive elimination mechanism, and stochastic disturbance strategy. The details of these three strategies can be seen in Section 3. In order to verify the effectiveness of these three strategies, HFA-DLL(A), HFA-DLL(A + B), HFA-DLL(B + C), HFA-DLL(A + C), and HFA-DLL were compared in the CEC 2017 benchmark function suite. Here, A represents a double-level learning strategy, B represents a competitive elimination mechanism, and C represents a stochastic disturbance strategy. HFA-DLL(A) is HFA-DLL with only a double-level learning strategy, HFA-DLL(A + B) is HFA-DLL with a double-level learning strategy and competitive elimination mechanism, HFA-DLL(B + C) is HFA-DLL with a competitive elimination mechanism and stochastic disturbance strategy, HFA-DLL(A + C) is HFA-DLL with a double-level learning strategy and stochastic disturbance strategy, HFA-DLL is a standard HFA-DLL with these three strategies. The average of the 30 runs is shown in Table 7 and Figure 3. The best results obtained by the five algorithms are shown in bold. The "best" row represents the number of times the corresponding algorithm finds the best solution. From Table 7 and Figure 3, we can see that HFA-DLL(A) is effective for the doublelevel learning strategy for unimodal function F1, multimodal (F4-F9), and hybrid (F11-F14, F16-F20) functions. This is due to the lack of local optima for unimodal functions, and, thus, it becomes simple to obtain ideal solutions as the convergence rate increases. However, it is slightly underrepresented in the composite function and does not show significant performance. The double-level learning strategy can speed up the firefly search, so on the unimodal functions; it can help HFA-DLL(A) to find the global optimal solution quickly. The multimodal function (F4-F9) has multi-local optimal solutions in the solution space. At the same time, as the dimensionality increases, the multimodal function becomes more and more complex. While the extension of the firefly search range can make it easier to search for optimal solutions for unimodal functions, it is not a good thing for multimodal functions. Therefore, it is important to balance the exploration and exploitation capabilities of fireflies. The double-level learning strategy and the adaptive switching mechanism can help fireflies to escape from the local optima. Hybrid and composite functions not only consist of a single function, but also have multiple properties. HFA-DLL uses the EAQ and a double-level learning strategy to increase the search horizon based on excellent solutions, which increases the probability and accuracy of finding the global optimal solution. At the same time, the adaptive switching mechanism can better balance global search and local search. It is not hard to conclude from Table 7 and Figure 3 that the double-level learning strategy is effective under the same number of iterations.   The experimental results show that, after updating the competitive elimination mechanism and stochastic disturbance strategy, the experimental results of the unimodal function, multimodal function, and hybrid function have achieved better results, but the optimal solution can not be localized on the composite function (F25-F29). The competitive elimination mechanism will increase the probability that the worst firefly jumps out of the local optimum and increase the convergence rate of the overall firefly. The competitive elimination mechanism improves the likelihood of jumping out of the local optimum of the solution space by learning from elite fireflies. The development power of the algorithm is enhanced and better solutions can be obtained for most functions on the test set. For complex mixture functions, where multiple local optima are close to each other, competitive elimination mechanisms using elite firefly updates do not support finding the optimal value when the elite firefly is also trapped in the local optimum. Therefore, a stochastic disturbance strategy is used to search for the global optimum, which helps the elite fireflies to jump out of the local optimum and maximizes the time wasted in the wrong direction. The experimental results validate the design expectation that the stochastic disturbance strategy focuses on global exploration while the competitive elimination mechanism focuses on local exploration.

Conclusions and Future Work
In this study, we integrated the three strategies into AD-IFA to obtain the HFA-DLL algorithm. In order to better balance the exploration behavior and exploitation characteristics of firefly algorithm, the adaptive search strategy of the AD-IFA algorithm is retained. At the same time, the double-level learning strategy is designed to effectively enhance the diversity of the population and avoid premature convergence. Then, a competitive elimination mechanism is proposed to improve the accuracy of HFA-DLL in solving complex optimization problems. Finally, a stochastic disturbance strategy is designed to enhance the ability of the algorithm to jump out of the local optimum and reduce the waste of resources in the wrong direction. The CEC2017 test functions were used to test the performance of the algorithm, including unimodal functions, multimodal functions, hybrid functions, and composition functions. Experimental results show that the performance of HFA-DLL algorithm is significantly better than that of the other six algorithms on most test functions. It is worth noting that the performance of the proposed HFA-DLL algorithm is not satisfactory on some unimodal and multimodal functions. The reasons for this phenomenon are complex, and there must be some underlying mechanisms that deserve further in-depth investigation. Combining other excellent learning strategies with the firefly algorithm can solve this problem. Our follow-up research will also include applying the proposed optimization algorithm to other complex practical engineering problems.  Informed Consent Statement: Informed consent was obtained from all subjects involved in the study.

Data Availability Statement:
The data that support the findings of this study are available from the corresponding author upon reasonable request.

Conflicts of Interest:
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.