Niching Grey Wolf Optimizer for Multimodal Optimization Problems

Metaheuristic algorithms are widely used for optimization in both research and the industrial community for simplicity, flexibility, and robustness. However, multi-modal optimization is a difficult task, even for metaheuristic algorithms. Two important issues that need to be handled for solving multi-modal problems are (a) to categorize multiple local/global optima and (b) to uphold these optima till the ending. Besides, a robust local search ability is also a prerequisite to reach the exact global optima. Grey Wolf Optimizer (GWO) is a recently developed nature-inspired metaheuristic algorithm that requires less parameter tuning. However, the GWO suffers from premature convergence and fails to maintain the balance between exploration and exploitation for solving multi-modal problems. This study proposes a niching GWO (NGWO) that incorporates personal best features of PSO and a local search technique to address these issues. The proposed algorithm has been tested for 23 benchmark functions and three engineering cases. The NGWO outperformed all other considered algorithms in most of the test functions compared to state-of-the-art metaheuristics such as PSO, GSA, GWO, Jaya and two improved variants of GWO, and niching CSA. Statistical analysis and Friedman tests have been conducted to compare the performance of these algorithms thoroughly.


Introduction
The area of nature-inspired metaheuristic algorithms is continuously evolving with newly developed algorithms. These algorithms are well known for their widespread local and global search ability, local optima avoidance, and quick convergence ability. In addition, these algorithms do not need any knowledge of a function's gradient or differentiability [1,2]. Since the metaheuristic algorithms have these superior properties with easy applicability and fewer parameter requirements, significant variants of these algorithms are developed [3]. The most widely used algorithms are Simulated Annealing (SA) [4], Genetic Algorithm (GA) [5], Particle Swarm Optimization (PSO) [6], Differential Evolution (DE) [7], and Ant Colony Optimization (ACO) [8]. A few recent metaheuristics that seek the attention of researchers is Bee Collecting Pollen Algorithm (BCPA) [9], Black Hole (BH) [10] Algorithm, Artificial Bee Colony Algorithm (ABC) [11], Central Force Optimization (CFO) [10], Electro-search Algorithm (ESA) [12], Gravitational Search Algorithm its variants for solving complex multi-modal optimization problems [42,43]. To overcome these limitations, we make a decent attempt to improve the GWO algorithm by adapting the niching technique. Niching techniques are well known to trace multiple optimal solutions together. These techniques increase population diversity and reduce the likelihood of being trapped in local solutions. In one iteration, they are also able to trace numerous local/global optima. A few standard niching techniques developed in recent years are clustering [44], fitness sharing [44], crowding [45], and clearing [46]. Nevertheless, niching methods need more function evaluations to reach the global optima. It has been seen from literature that various niching methods are applied to different types of metaheuristic algorithms such as GA [44][45][46], PSO [2,[47][48][49], CSA [50], and niching technique has significantly improved the performance of these optimization algorithms. Inspired by these results, we incorporate a fitness Euclidean distance ratio (FER) based niching technique with modified velocity update and local search into the GWO algorithm, which has shown to significantly improve the basic GWO algorithm's accuracy. Our proposed method also does not need any tuning parameters, which is a significant advantage. The research's key contribution is to (a) integrate FER niching technique into the GWO algorithm, (b) modify the velocity update equation, and (c) apply a local search technique at the end of the search process. To the best of our knowledge, this study first incorporates the niching technique to the GWO algorithm. Since the multi-modal function optimization also needs to allocate the desired global optima more precisely, we further incorporated the personal best feature of PSO to hold the good solutions. The remaining part of the article is organized as follows: Section 2 describes the NGWO algorithm. Section 3 illustrates the results and engineering applications of NGWO. Finally, Section 4 presents the conclusion.

Grey Wolf Optimizer
Mirjalili et al. [18] suggested GWO, a novel population-based algorithm, which falls under the swarm intelligence category. The key feature of GWO that makes it less prone to local solutions and better than other algorithms is that it searches for the best solutions by following three leader wolves: alpha, beta, and delta, while most other algorithms only follow one best solution. The common wolves are called omega, and they always follow the three leaders. The major steps of GWO are:
The encircling mechanism can be mathematically represented as: → a is a constant vector that declines linearly from 2 to 0. All the wolves update their positions by following these equations.
At each iteration, the wolves will update their positions according to Equations (1)- (5). The parameter → a controls the movement of the wolves during the first half of the iteration period where → a > 1, and it will intensify the exploration ability of the algorithm. In the last half of the iteration period where → a < 1, it will increase the wolves' exploitation ability.

Niching Technique
Niching techniques have the superiority of containing multiple solutions, which help them to handle the multi-modal functions and effectively reach the global optimal basin. In the proposed technique, the fitness Euclidean-distance ratio GWO (FER-GWO) is employed to locate the best closest solutions, and the FER-GWO is developed following the concept of FDR-PSO [51]. To calculate the FER value between two wolves i and j, the following equation has been utilized.
Here, p i and p j are the positions of the corresponding i and j wolves, and F(p i ) and F(p j ) represent their cost function values.
The scaling factor (α) = In the above equation F(p w ) and F(p b ) are the cost function values of the worst and best wolves among the current population, and the search space size is calculated based on decision variables bounds, and numerically represented as: Since, multi-modal optimization needs extensive exploration, niching is an efficient technique that could meet the requirement. Therefore, in the proposed GWO algorithm, we incorporated the personal best features to keep track of the best solutions discovered so far during the search process. The wolves will be guided towards more fittest neighborhood points at each iteration that can be obtained by calculating the FER values. The FER value has superiority in that it does not need parameters specification. Moreover, bigger population size is recommended for niching to locate all the local and global optima.

Modified Velocity Update Equation
During the iteration period, we determine the nbest i of each wolf based on the FER value from Equation (6). The nbest i value is further used to modify the velocity update Equation of beta and delta wolves, which is formulated as: We set a niching constant (NC) as 0.5 and generate a random number (r i ) during each iteration, if ri > NC, then the beta and delta wolves will be guided by nbest i using Equations (9) and (10). Otherwise, the original Equations (3) and (4) will be used to guide the beta and delta wolves. Please note that the alpha wolf is always guided by the original position update equation (Equation (2)).

Local Search
It is challenging for the niching techniques to hit the global optima accurately in complex multi-modal problems reliably. We incorporated a local search technique into our NGWO to generate offspring close to the personal best (Pbest). It also improves the algorithm's fine search capability, which increases the likelihood of obtaining optimal results. The definition of Qu et al. [2] is used to establish the local search technique, and the pseudo-code is provided below in Algorithm 1. During each iteration of the NGWO, the niching technique is applied by using Equations (6)- (8). The wolves update their positions based on Equations (2)-(5) and (9)-(10). Finally, local search is applied to the wolves' personal best (Pbest). Figure 1 shows a detailed flow map of the proposed algorithm.

Experimental Setup
We evaluated the proposed algorithm's performance comprehensively for 23 test functions as a minimization problem [13,18]. These functions are very common for testing any algorithm's effectiveness, consisting of 7 unimodal, 6 multi-modal, and 10 fixed dimensional multi-modal functions. The population and iteration number are set as 50 and 1000 for the proposed method, respectively. We keep these two features similar to the other compared studies to make the comparison fair and non-biased. The compared PSO, GSA, GWO, and SOGWO values are taken from [42], and niching CSA values are inserted from [50]. The Matlab code of Jaya algorithm and IGWO algorithms are collected from the authors website for comparison. The test functions are numerically presented here, and their detailed properties are described in Table 1.

Exploitation Analysis
The unimodal functions (F 1 -F 7 ) are well recognized for evaluating algorithm exploitation ability. The performance indexes of unimodal functions are reported in Table 3. The proposed NGWO shows the superior result for the considered unimodal functions and outperforms all other algorithms for five unimodal functions (F 1 , F 2 , F 4 , F 5 , F 7 ). Nonetheless, the NCSA algorithm performs better for one unimodal function (F 3 ), and GSA achieved the best indexes for one unimodal function (F 6 ).

Exploration Analysis and Local Optima Avoidance
The multi-modal functions are renowned for having multiple local optima, where the number of local optima increases exponentially with dimensions. Therefore, the multi-modal functions (F 8 -F 23 ) are suitable for testing the exploration and local optima avoidance ability of an algorithm. The NGWO algorithm shows very promising results for the multi-modal functions. As seen from Table 4, the NGWO algorithm outperforms all other algorithms and accomplished all the best indexes for nine functions (F 8 , F 9 , F 11 , F 16 -F 20 , F 23 ). Moreover, the NGWO algorithm found the global optima of ten multi-modal functions with pinpoint precision (F 9 , F 11 , F 16 -F 23 ). The NGWO algorithm achieved the best SD indexes for a total of 14 functions, indicating the algorithm's high local optima avoidance ability. The lowest SD values, therefore, mean that there is less variation in the algorithm's optimum values, implying that the algorithm is stable.

Convergence Analysis
This paragraph illustrates the convergence ability of the NGWO and other compared algorithms. Figure 2 shows the convergence characteristics of the unimodal benchmarks, while Figure 3 depicts the convergence behavior of the six multi-modal benchmarks. In Figures 2 and 3, the horizontal axis signifies the iteration number, and vertical axis shows the median function values from 30 runs. In all Figures, the NGWO maintains a consistent downward slope through the iteration periods, which indicates that the wolves are sharing information to improve the cost function values (fitness) through the iteration period. For most of the convergence curves of Figures 2 and 3, the NGWO shows superior convergence ability that also indicates a proper balance between exploitation and exploration. Furthermore, the NGWO algorithm only took 100 iterations to achieve the exact global optima zero for multi-modal functions F 9 and F 11 , demonstrating NGWO's rapid convergence speed.   F 7 ). Here, (a) represents benchmark function F 1 , (b) represents benchmark function F 2 , (c) represents benchmark function F 3 , (d) represents benchmark function F 4 , (e) represents benchmark function F 5 , (f) represents benchmark function F 6 , (g) represents benchmark function F 7 . The parameter space, quest history, trajectory of the first wolf, convergence curves, and wolves average fitness are plotted in Figures 4 and 5 to illustrate the convergence behavior in detail. This section has considered the number of wolves and iteration as 50 and 100, respectively. It has been known from the literature [52] that abrupt position changes during the initial iteration steps are more preferable for improving the exploration ability of an algorithm. These changes need to be decreased to strengthen the exploitation ability in the later part of the iteration. The trajectory and search history of the 1st wolf are demonstrated in Figures 4 and 5. It is explicit from the first wolf's search history (second column of Figures 4 and 5) that the wolves extensively searched through the search space and exploited the best area. The trajectory of 1st wolf (3rd column in Figures 4 and 5) also indicates the same phenomenon, where it emphasized more on exploration in the initial steps, and it decreased through the iteration period. By contrast, the exploitation ability is strengthened during the last periods of iteration. All of these indicate that the NGWO has good convergence ability, and it achieves a proper balance between local exploitation and global exploration.   (F 1 -F 7 ). Here, (a) represents benchmark function F 1 , (b) represents benchmark function F 2 , (c) represents benchmark function F 3 , (d) represents benchmark function F 4 , (e) represents benchmark function F 5 , (f) represents benchmark function F 6 , (g) represents benchmark function F 7 .  . Here, (a) represents benchmark function F 8 , (b) represents benchmark function F 9 , (c) represents benchmark function F 10 , (d) represents benchmark function F 11 , (e) represents benchmark function F 12 , (f) represents benchmark function F 13 . Figures 6 and 7 show the box plots for each algorithm for multi-modal functions. The first six multi-modal functions are 30-dimensional problems (F 7 -F 13 ), while the next ten are fixed dimensional multi-modal problems, and the dimension numbers are reported in Table 1. In MATLAB, we run each algorithm 30 times for each test function, saving the best values from each run and plotting them as box plots. These box plots illustrate the distribution of benchmark function results in a better way and indicates the dispersion and symmetry of data sets. The box plots represent the first, second (median), third and lower quartiles, upper bounds and outliers, respectively. The bigger size of the rectangular box indicates that the data sets are scattered more, and the results obtained by the algorithm are not stable. It also indicates the comparatively worst performance. The red crossbar indicates the median of data sets, and the plus sign (+) in red indicates outliers. Among the plots of Figure 6, the box plot location of the NGWO is lower than the other seven algorithms for four functions (F 8 -F 11 , Figure 6a-d), and the box size is also lowest for these functions. In Figure 6b,d the NGWO algorithm reached the exact zero for all data sets, that is why there is no box for NGWO in these two figures. In the case of Figure 7a-j, the NGWO shows the minimum distribution of the data sets and its box plots lies below that of other algorithms. These things indicate the superiority of the proposed NGWO algorithm and less variation in results, and stability of the algorithm.

Ranking of the Algorithms
To analyze the NGWO algorithm's performance more thoroughly, we conducted nonparametric Friedman tests to rank each algorithm. This multiple comparison test works based on the recurrent measurement of the Anova, and it can determine the differences among the compared algorithms. The best values of each algorithm for 30 runs were stored in a matrix, and the Friedman test was applied to this matrix to obtain the mean ranks of each algorithm for 30 runs. The Friedman test also provides the corresponding p-values for each test function. It is explicit from the Friedman test results in Table 5 that the proposed NGWO attained the best rank for 16 functions among a total of 23 benchmark functions. Additionally, the JAYA, GSA, and PSO obtained the best ranking for 3, 2, and 1 functions, respectively.Very low p-Values indicate that the Friedman test results are statistically significant.

Engineering Application of NGWO
The proposed algorithm has been tested for three real-life engineering case studies and collected from the literature [18,43]. All three problems have inequality constraints, and we use the hard penalty approach to handle the constraints. We have considered 100 wolves over 100 iterations to solve these three problems.

Tension-Compression Coil Spring Design
The weight of the tension-compression coil is reduced in this case study. It consists of three decision variables ((number of coils (n), wire diameter (d), mean coil diameter (D)), and 4 inequality constraints. The following is a numerical representation of the problem: Minimize f(y) = y 3 + 2 y 1 y 2 2 The inequality constraints are: Here, 0.25 ≤ y 1 ≤ 1.30; 0.05 ≤ y 2 ≤ 2; 2 ≤ y 3 ≤ 15 ;

Three Bars Truss Design
Ray and Saini [53] first proposed this case study to minimize the bar's weight. It has 2 variables and 3 constraints, and it can be mathematically presented as: 1 The variables ranges are: 0 ≤ y 1 ≤ 1 ; 0 ≤ y 2 ≤ 1 and l = 100 cm, P = 2 KN/cm 2 , and σ = 2 KN/cm 2

Optimization Result of Welded Beam Design
It is explicit from the reported results shown in Table 6 that the NGWO outperforms all the previous algorithms for this case study. The proposed algorithm achieved optimal values for four indexes among the five compared indexes (best, mean, worst, standard deviation, and NFEs). In contrast, the HEAA algorithm achieved the best result for the standard deviation index.

Result of Tension-Compression Coil Spring Design
For tension-compression coil spring design, we compared our findings with 10 other previous studies from the literature in Table 7. The NGWO algorithm achieved the optimal values for four indexes, while the FSA algorithm attained the optimal value for SD index.  Table 8 summarizes the results of three bars truss design problem. The WCA and DEDS algorithms achieved three and two best indexes, respectively. The NGWO algorithm's results are very similar to the previous best results obtained by various optimization algorithms.

Conclusions
The GWO algorithm was influenced by the leadership structure and group hunting system of wolves. The GWO algorithm undergoes the lack of population diversity and is vulnerable to premature convergence in multi-modal problems. Hence, a new variant of GWO called niching GWO (NGWO) with a modified position update equation is proposed in this research to improve the performance of the GWO algorithm for solving multi-modal problems. The niching techniques are well known for handling multiple optimal solutions in the case of multi-modal optimization problems. A fitness Euclidean distance ratio-based niching GWO called FER-GWO is used to strengthen the searchability of the algorithm. By using the FER technique, the wolves are guided towards the nearby wolves' best position, having better cost function values.
The proposed NGWO algorithm has been thoroughly tested on 23 traditional benchmark functions and three real-world engineering cases. It achieves very promising results and outperforms most other compared algorithms for the considered benchmarks and engineering case studies. This superiority is accomplished by incorporating the niching technique to the basic GWO algorithm and modifying the position update equation, whereas the local search increases the fine searchability. The reported results indicate that the algorithm achieved well-balanced global exploration and local exploitation, which further increases the algorithm's accuracy. This research focuses on single-objective optimization problems only; however, future work will extend the NGWO algorithm to multi-objective optimization problems.

Conflicts of Interest:
The authors declare no conflict of interest.