Abstract
Whale Optimization Algorithm (WOA) is a relatively novel algorithm in the field of meta-heuristic algorithms. WOA can reveal an efficient performance compared with other well-established optimization algorithms, but there is still a problem of premature convergence and easy to fall into local optimal in complex multimodal functions, so this paper presents an improved WOA, and proposes the random hopping update strategy and random control parameter strategy to improve the exploration and exploitation ability of WOA. In this paper, 24 well-known benchmark functions are used to test the algorithm, including 10 unimodal functions and 14 multimodal functions. The experimental results show that the convergence accuracy of the proposed algorithm is better than that of the original algorithm on 21 functions, and better than that of the other 5 algorithms on 23 functions.
Keywords
Introduction
In scientific research and industrial applications, many computational problems can be summarized as complex optimization problems, which are often characterized by nonlinearity, non-differentiability, and multimodal. In these complex optimization problems, it is necessary to find the optimal solution of a given problem under highly complex constraints in a reasonable time. In order to solve these problems, various optimization algorithms have been proposed.
These optimization algorithms include traditional optimization algorithms and meta-heuristic algorithms. The traditional optimization algorithms are based on the gradient algorithm, and they have high computational efficiency and strong reliability. They are important and widely used optimization algorithms. However, traditional optimization algorithms search the optimal from a single point and require a lot of time to reach the global optimum. Due to their limited pertinence and complexity of constraints, these algorithms are not very effective for solving complex optimization problems. These shortcomings have led to significant limitations of traditional optimization algorithms in solving a variety of practical problems.
Meta-heuristic algorithm takes inspiration from random phenomena in nature, combines random algorithm with local algorithm, and has a certain probability of jumping out of local optimum to obtain global optimum. These methods are used to solve real-world engineering problems and obtain potential optimal solutions in a given time [1–4].
Meta-heuristic algorithms mainly have four categories, namely evolutionary algorithm, swarm intelligence algorithm, physics-based algorithm and hybrid algorithm. Evolutionary algorithm is inspired by the evolution of organisms in nature, It generally includes basic operations such as gene coding, population initialization, crossover and mutation operators, operation and reservation mechanism, etc. At present, the famous evolutionary algorithms are Genetic Algorithm (GA) [5], Biogeography-Based Optimization (BBO) [6] and Differential Evolution (DE) Algorithm [7], among which GA is the most popular. It simulates Darwin’s concept of evolution. Each new population is generated by the combination and mutation of the previous generation of individuals. The ergodicity of evolution operators enables GA to search globally in probabilistic sense very effectively. GA provides great flexibility to deal with various special problems, which ensures the effectiveness of the algorithm.
Swarm intelligence algorithms mostly imitate the social behavior of biocenosis in nature. At present, the famous swarm intelligence algorithms are Particle Swarm Optimization (PSO) [8], Artificial Bee Colony (ABC) Algorithm [9], Firefly Algorithm (FA) [10], Grey Wolf Optimizer (GWO) [11], Ant Lion Optimization (ALO) Algorithm [12], Salp Swarm Algorithm (SSA) [13], Butterfly Optimization Algorithm (BOA) [14], Moth-flame Optimization (MFO) Algorithm [15] and Whale Optimization Algorithm (WOA) [16]. The most popular swarm intelligence algorithm is PSO, which introduces the social behavior of bird swarm for the first time, and uses multiple particles to track the location of the best particle and the best position obtained so far. Because of its simple operation and fast convergence, PSO has been widely used in many fields, such as function optimization, image processing, geodesy and so on.
Physics-based algorithms usually imitate physical rules. Some of the most popular algorithms are Sine Cosine Algorithm (SCA) [17], Gravitational Aearch Algorithm (GSA) [18], Atom Search Optimization (ASO) [19], etc. GSA performs the search by using a proxy set with a quality proportional to the fitness function value. In the iterative process, the masses are attracted to each other by the gravity between them. The heavier the mass, the greater the attraction. GSA is simple in principle, simple in operation and high in efficiency in solving various nonlinear functions, which makes GSA applied in many fields.
Hybrid algorithm is usually a new algorithm that combines the advantages of two different optimization algorithms. At present, the common hybrid algorithms are PSO-GA [20], GSA-GA [21], GA-GSA [22], PSO/GSA [23] and so on. GA-GSA combines the characteristics of genetic algorithm and gravity search algorithm, and proposes a hybrid genetic algorithm. By embedding genetic operators in gravity search algorithm, the exploration and exploitation ability of gravity search algorithm are improved.
Whale Optimization Algorithm (WOA) searches for global optimal solutions by surrounding prey, hunting prey and attacking prey. WOA has outstanding properties, such as a small number of parameters controlled, including only two main internal parameters to adjust, easy to implement and high flexibility. WOA smoothly transit between exploration and exploitation depending on only one parameter. Due to the simplicity of WOA in implementation and the low dependence on parameters, the algorithm has been successfully applied in many fields such as image processing [24], prediction of thermal consumption rate of generator sets [25], characteristic selection [26], neural network [27], wind speed prediction [28], fault diagnosis [29] and so on.
At present, the research of WOA can be divided into two categories: (1) Improving the performance of WOA: Kaur and Arora [30] proposed chaotic WOA (CWOA), using chaos theory to adjust the main parameters of WOA to improve its convergence speed; Ling et al. [31] proposed Lévy flight trajectory-based WOA (LWOA). The LWOA employed Lévy flight trajectory to increase the diversity of population; Sun et al. [32] proposed an improved WOA (MWOA) to solve large-scale global optimization problems. MWOA uses Levy flight strategy to improve WOA’s exploration ability, secondary interpolation to improve WOA’s exploitation ability, uses nonlinear control strategy to control the entire search process, and balances WOA’s exploration and exploitation capabilities; Abdel-Basset et al. [33] used Lévy flight and logical chaos mapping to replace and determine the coefficient C in WOA and to switch probability p, improving the exploitation ability of the WOA; Ismai et al. [34] introduced chaos search into the iterative search of WOA, proposed a CWOA that significantly improved WOA’s performance.
(2) Applying WOA to solve some optimization problems: Zhao et al. [35] established the WOA-LSSVM model to predict CO2 emissions by searching for the optimal value of the two parameters of LSSVM; Reddy et al. [36] used WOA to optimize the allocation of renewable resources to reduce waste in distribution systems; Azizd et al. [24] used WOA to determine the optimal threshold problem of image segmentation and solved the time-consuming problem of determining the best threshold at multiple level threshold.
In the present study, an improved WOA is proposed to solve the problem that WOA is not good at exploring space and easily falls into local optimal. On the one hand, the new strategy of random hopping update is introduced to adjust the position update of whales, which makes the algorithm maintain a faster convergence speed in the convergence process and improves the exploitation ability of WOA. On the other hand, by analyzing the influence of control parameter a on the exploration and exploitation ability of WOA, random control parameter is introduced to make WOA jump out of local optimal better, balance the exploration and exploitation ability of WOA and avoid falling into local optimal prematurely. The performance of the improved WOA was tested by 24 typical benchmark function tests and compared with other algorithms, the results show the effectiveness of the proposed algorithm.
Whale optimization algorithm
Whale Optimization Algorithm (WOA) is a new meta-heuristic algorithm proposed by Mirjalili in 2016. The algorithm is a simulation of the humpback whale predation behavior. This special hunting mechanism is called bubble net foraging. When humpback whales surround prey, this foraging is done by creating unique bubbles along a circular or “9-shaped” path. The humpback whale can dive underwater for 10-15 meters and then start making spiral bubbles around the prey and then swim to the surface. Its hunting behavior is shown in Fig. 1.

Bubble-net feeding behavior of humpback whale.[16].
The mathematical model of WOA for surrounding the prey, spiral bubble net foraging action and searching for prey are described as follows:
Humpback whales are able to identify the position of the prey and surround them. Since the position of the optimal solution in the search space is not a priori, the WOA assumes that the current best candidate solution is the target prey or near optimal solution. After the best search agents are defined, other search agents will therefore attempt to update their location to the best search agent. This behavior can be represented by Eq. (1) and Eq. (2):
The bubble whale foraging of the humpback whale is characterized by moving along the spiral path toward the prey in the constricted encirclement. Therefore, the WOA designs the contraction enveloping mechanism and the spiral update position to simulate the unique bubble net predation behavior of the humpback whales.
a) Shrinking encircling mechanism: This behavior is achieved by decreasing the value of a from 2 to 0 in Eq. (3). According to Eq. (3), the value of A decreases as the a decreases, and when a decreases linearly from 2 to 0, A is a random value in the interval [-a, a]; Therefore, when setting random values for A in [-1,1], the new position of a search agent can be defined anywhere between the original position of the agent and the position of the current best agent.
b) Spiral updating position: This approach first calculates the distance between the whale located at (X, Y) and prey located at (X*,Y*). Then create a spiral equation between the position of the whale and the prey to simulate the spiral movement of the humpback whale as Eq. (5):
As humpback whales swim around their prey in a shrinking circle, they swim along a spiral path. To model this simultaneous behavior, it is assumed that there is a probability of 50% that a choice can be made between a reduced enclosure mechanism and a spiral model to update the position of during optimization. The mathematical model is as Eq. (6):
In fact, humpback whales search randomly according to the position of each other. Therefore, we use
The WOA starts with a set of random solutions, search agents update their positions through randomly chosen search agent or current optimal solution during the iteration, the different values of parameter a control the exploration and exploitation of the WOA, and parameter p affects the selective jump execution of the exploration or exploitation. By exploring the process and the parallel iteration of the exploitation of the search agents, the optimal solution of the problem is finally determined.
WOA is briefly introduced in the above section. In spite of having good performance, WOA still cannot perform that better in finding the global optima, which affect the convergence rate of the algorithm. So, to reduce this affect and to improve its efficiency, this paper proposes PAWOA. In order to improve the exploration ability of WOA, in this study random hopping update strategy is integrated into WOA. For better exploration and exploitation balancing, the random control parameter is introduced. The improvement strategies are presented in the next sections.
Random hopping update strategy (PWOA)
The excellence of the swarm in the iterations of the WOA is dependent on the search agents, which are randomly selected from the previous generation of swarm. From the Eq. (7) and Eq. (8), we can obtain that WOA updates the position of the search agent in the exploration based on a randomly selected search agent, rather than the best search agent so far. In the iterations of the WOA, it is inevitably be relatively small fitness of individuals, if these individuals are selected by randomly selecting mechanisms, the new swarm will certainly affect the convergence speed and accuracy of WOA.
In view of this situation, this paper proposes a random hopping update strategy. It can select search agents more efficiently. For the iterations, the improved strategy is shown in Eq. (9):
From Eq. (9), we can conclude that the search agent selected in the iteration process has a better fitness, so the exploration ability of WOA will be improved. Because the coefficient of the equation is a random number, there will be some mutations in the iteration process. Consequently, these mutations can reduce the possibility of the population falling into local optimum and enhance optimization ability. The mutations are generated by random parameters in this paper, the random parameter makes the position of individuals randomly generated from the vicinity of the current optimal agent. This ensures that the individuals within the population will not be infinitely close during the entire process of algorithm iteration. A random distance is kept between the individuals in the population, which ensures that the algorithm will not fall into the local optimal prematurely, thus improving the exploitation ability of the algorithm.
In order to obtain better optimization results, the WOA needs to balance exploration and exploitation in the optimization process. when
In Eq. (3), is decreased from 2 to 0 over the course of iterations. Because of, the position update formula is converted between Eq. (6) and Eq. (8) to making the WOA have better global search capability. However, the global search ability of WOA will decrease rapidly with the increase of iterations, which is making WOA easily to fall into local optimum. Therefore, this paper proposes an improvement method as shown in Eq. (10):
In summary, this paper proposed an improved WOA (PAWOA) based on a random hopping update strategy and random control parameter strategy. The flowchart is shown in Fig. 2.

Flowchart of the PAWOA.
The improved algorithm (PAWOA) optimizes whale predation behavior from two aspects. On the one hand, the position update strategy for whale individuals is changed through random hopping update strategy, so that new individuals are randomly generated near the optimal individuals, and the exploration ability of the algorithm is improved; On the other hand, by introducing random control parameters, the convergence factor a can nonlinearly adjust the ability of global search and local search during the entire iteration of the algorithm, thus ensuring that the algorithm is not easy to fall into local optimal solution.
The performance of the improved algorithm is better than hybrid Particle Swarm Optimization and Gravity Search Algorithm (PSO/GSA), Ant Lion Optimization (ALO) Algorithm, Butterfly Optimization algorithm (BOA), Moth Flame Optimization (MFO) Algorithm and Biogeography-Based Optimization (BBO) on the whole. For comparison of the algorithms, see chapter 4.
To validate the performance of the proposed algorithm, this paper uses 24 well-known benchmark functions for the experiment. These functions are divided into two categories: unimodal functions (ten functions) and multimodal functions (fourteen functions). The experiment consists of two parts: (1) the convergence accuracy test of PWOA, AWOA, PAWOA and WOA with the fixed iterations. (2) the Wilcoxon signed ranks test of PWOA, AWOA, PAWOA and WOA. (3) the comparison experiment of the PAWOA and other five optimization algorithms.
Benchmark function and parameter settings
In the 24 benchmark functions, f1-f10 are unimodal functions, which have only a global optimum. Thus, they are suitable for evaluating the ability of algorithms in terms of local search and convergence speed. f11-f24 are multimodal functions, which have a massive number of local optima and are suitable to evaluate local optima avoidance and exploration ability of an algorithm. An algorithm should avoid all the local optima to approach and determine the global optimum. Detailed descriptions of these functions are given in Table 1.
Test functions
Test functions
In order to ensure the fairness and rationality of the experiment and avoid the influence of the randomness of the algorithm on the experiment, the population size and maximum iterations of all algorithms are set to 30 and 500. All results are recorded and compared based on 30 independent runs. The experimentation and algorithms are implemented in MATLAB R2014a and simulations are tested on Core i5 processor with 2.4 GHz and 8 GB main memory.
This paper compares the performance of PWOA, AWOA, PAWOA and WOA. To statistically asses the proposed algorithm, this paper evaluates the performance of the algorithm by four evaluation criteria: average (mean), standard deviation (std), worst values (worst) between and best values (best). “best” and “worst” respectively denote the maximum and minimum fitness values of the optimal solution obtained by the algorithm, “mean” denotes the average of the result fitness values, and “std” denotes standard deviation. “std” indicates the stability of the algorithm, the smaller the standard deviation,the greater the stability of the algorithm. The results of the experiment are shown in the Table 2.
Experimental results of fixed number of iterations
Experimental results of fixed number of iterations
Table 2 shows that PAWOA is very competitive as compared with other competitors. The PAWOA can obtain the best results on f1, f3, f6, f16, f17, and PAWOA are the best algorithm in terms of standard deviation. For f7, f8, f12, f13, f18, f22,f24, although PAWOA do not reach the minimum accuracy, but also significantly better than PWOA, AWOA and WOA. For f9, f10, f11, f12, f21 there is no significant difference between these algorithms. For f2, f10, f14, PWOA is the best algorithms in terms of average and standard deviation, and PAWOA is the second. For most of the cases, PAWOA gives good results for the standard deviation. This means that the proposed algorithm has higher stability for finding the optimum values. Based on overall performance, we can sort these algorithms as follows: PAWOA>PWOA>AWOA>WOA.
In order to visually observe the performance difference between the improved algorithm and the original algorithm, the convergence curves of 24 benchmark functions are given in this paper, as shown in Fig. 3. The red curve in the figure represents the convergence curve of WOA, and the pink curve, the blue curve and the green curve represent the convergence curve of PWOA, AWOA and PAWOA respectively.

Convergence curves of the test functions.
It can be clearly seen that in most functions, the convergence speed and accuracy of the curve of PWOA have been significantly improved compared with that of WOA, indicating that random hopping has a strong effectiveness in improving the performance of the algorithm. For most of the convergence curves, such as f3 f4 f12 f18, PWOA is easy to fall into the local optimal, but when AWOA is added to the global search equation, the algorithm converges quickly.
From the figures we observed that for most of the cases both the convergence speeds and the final results of our approach PAWOA are better than PWOA, AWOA and WOA. These convergence curves show that the convergence of PAWOA is more rapid and more accurate, and the convergences of PWOA and AWOA are better than WOA, but for but for the functions f8, f14, f15, f19, f23, AWOA is easy to fall into the local optimal.
In order to test the statistical significance, this paper uses Wilcoxon signed rank sum test to analyze the performance of the algorithm and sets the significance level to 0.05. The Wilcoxon signed rank test results of the optimal values of 24 test functions optimized by the algorithm after 30 independent runs are given in Table 3. p-value is the significance probability of whether the population of the two comparative samples is the same, h returns the result of the hypothesis test. If p-value is less than the set significance level, the overall difference between the two comparison samples is significant, and the value of h is 1; If p-value is exceeds the set significance level, the overall difference between the two comparison samples is not significant, and the value of h is 0; If the result of p-value is NaN, there is no difference between the two samples. Wilcoxon rank sum test further shows that the improved algorithm has significant advantages over the WOA.
Experimental results of fixed number of iterations
Experimental results of fixed number of iterations
In this experiment, to evaluate the performance of the proposed algorithm, five well-known metaheuristics are chosen for comparison. These algorithms are hybrid particle swarm and gravity search algorithm (PSO/GSA), ant lion optimization algorithm (ALO), butterfly optimization algorithm (BOA), moth flame optimization algorithm (MFO) and biogeography-based optimization (BBO). These algorithms are evaluated on the conventional benchmark functions, and the parameter values of these algorithms are set as they are recommended in their original papers. The experimental results of the compared algorithms for the functions are shown in Table 4, in which the bold values show the best solutions.
Experimental results of algorithm comparison
Experimental results of algorithm comparison
In this paper, functions f1, f3, f16, f17 are selected with representative and optimal values of 0, and the convergence curve of the six algorithms is given, as shown in Fig.4. From the convergence curve, we can see that PAWOA has the characteristics of fast convergence speed and high convergence precision, strong robustness, and the overall performance is obviously better than the other five algorithms.

Convergence curve of algorithm comparison.
It can be seen from Table 4 that PAWOA has obvious advantages in convergence speed and accuracy. In comparison with five algorithms, PAWOA has significantly better performance than PSO/GSA on 20 problems, better than ALO, BOA and MFO on 21 problems, better than BBO on 23 problems. For f11 and f21, there is no significant difference among these algorithms. Therefore, it can be concluded that the results of PAWOA are significantly effective than competitive approaches. Overall, the results reveal that PAWOA outperforms other algorithms.
This paper improved on the basis of the WOA. In order to improve the exploitation ability of the algorithm, a random hopping strategy is proposed. In order to improve the exploration ability of the algorithm, a random parameter strategy is proposed. PAWOA combines the two strategies to better balance the exploration and exploitation ability of the algorithm. According to comparative studies, it can be found that the improved WOA algorithm has a higher success rate in finding global optimal for different benchmark functions. In the future, with the deepening of research, many potential directions can be explored, which are mainly divided into two categories: the mechanism of swarm intelligence and specific practical applications.
Footnotes
Acknowledgments
This work is supported by National Nature Science Foundation of China [61401307]; Tianjin Research Program of Science and Technology Commissioner of China [18JCTPJC57500]; Hebei Province Research Project of Higher Education Science and Technology of China [ZD2018045].
