Hybrid Whale Optimization Algorithm Based on Three Spiral Searching Strategies and Sine Cosine Operator with Convergence Factor


 Whale Optimization Algorithm (WOA) is a swarm intelligence algorithm inspired by whale hunting behavior. Aiming at the defect that the spiral update mechanism in WOA may exceed the search range, three different spiral searching strategies are first proposed. The agents search with a more reasonable and broader route distribution so as to improve population diversity and traversal. Secondly, an improved sine cosine operator based on the convergence factor was proposed to improve the search efficiency of WOA, where sine search is used for global exploration and cosine search is used for local exploitation. The proposed convergence factor enables search agents to adaptively balance the exploration and exploitation phases with iterations. In the simulation experiment, the effectiveness of three spiral search strategies and sine cosine operator is verified. Then, the whale optimization algorithm (WOA), salp swarm algorithm (SSA), firefly algorithm (FA), moth-flame optimization (MFO) algorithm, fireworks algorithm (FWA), sine cosine algorithm (SCA) and improved WOA are selected for comparison experiments. Finally, the improved WOA is applied to two engineering problems (three-bar truss design problem and the welded beam optimization problem). The experimental results show that compared with other optimization algorithms, the improved WOA has the advantages of high search accuracy, fast convergence speed, and avoiding falling into local optimal values.


Introduction
Exact approaches and meta-heuristics are two types of algorithms for solving optimization problems. Exact approaches are traditional algorithms in the field of operations research. They create mathematical models based on optimization problems. When the scale of the optimization problem is small, the exact approaches can find the optimal solution in an acceptable time. However, exact approaches have a complex structure and fall into the local optimum when solving large-scale optimization problems. Meta-heuristic algorithms are inspired by simple principles and have no derivation mechanism. At the same time, meta-heuristic algorithms treat the optimization problem as a black box, which can solve optimization problems in different fields, which has attracted the attention of researchers. Meta-heuristic algorithms simulate biological or natural worlds to build mathematical models. With the deepening of research, meta-heuristic algorithms have developed the main branches: algorithms based on evolution, swarm intelligence based algorithms and physical phenomena based algorithms. Evolution-based algorithms are inspired by Darwin's theory of evolution. In order to realize the process of survival of the fittest, the algorithm retains eligible individuals through selection, crossover, and mutation, and eliminates other individuals.
The whale optimization algorithm (WOA) was proposed by Seyedali Mirjalili in 2016 [37]. Similar to other swarm intelligence-based algorithms, WOA simulates the predatory behavior of whale populations to establish the mathematical model. Due to simplicity and flexibility, it has attracted the attention of researchers. Researchers have proposed many improvements and applications of WOA. Mafarja M. et al. proposed two binary variants of WOA to solve the classification of the best feature subsets [38]. The first method uses tournament and roulette selection mechanisms to eliminate the accidental effects of WOA random operators. The second method uses crossover and mutation operations to enhance WOA. The results show that the proposed method can improve the classification accuracy. Kaveh A et al. proposed an enhanced whale optimization algorithm (EWOA) for truss optimization [39].
Experimental results prove that EWOA is more effective than WOA. Ling Y et al. used the Levy flight trajectory to update the position of population, and proposed WOA based on the Levy flight trajectory [40]. The statistical results show that the performance of LWOA is excellent, which can solve the identification problem of infinite impulse response model. With a large number of application backgrounds, the flow shop scheduling problem is one of the most important scheduling problems. Abdel-Basset M. et al. introduced a local search strategy into WOA and proposed the hybrid whale algorithm (HWA) [41], which can improve the optimization results of flow shop scheduling problems. Prakash DB et al. applied WOA to find the optimal capacitor size and location for a typical radial power distribution system [42]. The results show WOA can reduce operating costs and power consumption.
The algorithm is more efficient in maintaining the voltage distribution. Parameter extraction of solar photovoltaic (PV) models is a nonlinear multivariate optimization problem. Xiong G. et al. proposed an improved whale optimization algorithm (IWOA) [43]. The comparison results fully prove that IWOA can accurately extract the parameters of different PV models. The above literature shows that WOA can effectively solve different optimization problems. However, WOA still has the defects of low optimization accuracy, slow convergence speed, and easy to fall into local optimal values. The improvement method of WOA needs further research. In addition, according to no free lunch theorem NFL [44], an algorithm can only solve specific optimization problems. In other words, improved algorithms may outperform other algorithms. Therefore, the motivation and necessity of this paper are supported. This paper proposes an improved WOA based on three spiral searching strategies and sine cosine operator with convergence factor. Firstly, three spiral search strategies were used to improve the search efficiency of the spiral update mechanism and population diversity in WOA. Secondly, this paper introduces an improved sine and cosine operator, which can adaptively balance the exploitation and exploration capabilities of the algorithm. The section of this paper are arranged as follows. Section 2 introduces the whale optimization algorithm. Section 3 introduces the improved WOA. Section 4 first selects the salp swarm algorithm (SSA) [44], firefly algorithm (FA), moth-flame optimization (MFO) algorithm [45], fireworks algorithm (FWA), sine cosine algorithm (SCA) and the improved WOA for comparison experiments. Then, the effectiveness of the improved strategies were verified.
Finally, the improved WOA is applied to high-dimensional optimization and engineering optimization problems. Section 5 is the conclusion of this paper.

Mathematical Model of Whale Optimization Algorithm
WOA regards the optimal solution of the optimization problem as a prey. Similar to whale recognition and surrounding prey, searching agents move towards the optimal solution through the location update mechanism [47].
The two-dimensional mathematical model of WOA is shown in Fig. 1

Shrink Enclosing Mechanism
The shrink enclosing mechanism is one of the position update mechanisms of WOA in order to implement the process of whale predation, which can be described as: where, X  indicates the position of the search agent, t is the current number of iterations, indicates the indentation distance, which is used to calculate the distance between the search agent and the optimal solution. A  and C  are used to control the indentation distance, which can be calculated by: where, r  is a random number in [0,1]. In order to realize the process of whale surrounding the prey, a  decreases from 2 to 0 with the iteration, which drives the search agent closer to the target value.
In addition, the whales will search for prey randomly. In order to achieve this process, the algorithm randomly selects a search agent to search the area outside the target value, that is to say: where, indicates a search agent that is randomly selected.
The shrink enclosing mechanism can realize the search method of enclosing prey and random hunting. The choice of the two search methods is determined by the coefficient vector A  . The model of the shrink enclosing mechanism is shown in Fig. 2 , the search agent randomly searches for areas other than the target value. The random search method can reduce the probability of the algorithm falling into a local optimum, which reflects the global exploration capability. Two search methods of the shrink enclosing mechanism can find a balance between exploitation and exploration through the parameter A  .

Spiral Update Mechanism
Another position update mechanism of WOA is the spiral update mechanism. This method first calculates the distance between the search agent and the target value. Then, a logarithmic spiral is generated between the search agent and the target value. Search agents can implement location updates along a spiral route. The spiral update mechanism is described as follows: where, D  indicates the distance between the search agent and the target value, b is a constant to control the shape of the spiral, l is a random number in [-1, 1] to control the location update effect of the search agent.
The spiral update mechanism model is shown in Fig. 3, which shows not only the search method of the spiral route, but also the influence of the parameter l on the search position. When the parameter l is in [0.

Pseudo Code of WOA
The pseudo code of WOA is described as follows and the flowchart of WOA is shown in Fig. 4 .
Initialize the whales population  As a swarm intelligence optimization algorithm, the structure of WOA has simplicity. At the same time, the mathematical model (shrink enclosing mechanism and the spiral update mechanism) of WOA designed parameters for balanced exploitation and exploration. In addition, the initialized random solutions are continuously improved through the location update mechanism to avoid falling into a local optimum. Finally, WOA has an information exchange mechanism. Search agents can update locations based on target values, increasing the interactivity of the population. However, the shortcomings of WOA also deserve attention. First, the parameters of balanced exploitation and exploration are randomly generated, and whether it brings contingency to the algorithm. Second, how to further improve the performance of WOA is an important research direction. Finally, whether the design of the shrink enclosing mechanism and the spiral update mechanism are flawed.

Spiral Search Strategy
The moth-flame optimization (MFO) algorithm [46] firstly proposed a search strategy of logarithmic spiral routes, which is inspired by the laterally positioned moth trajectory. The logarithmic spiral path can make the moth effectively fly to the light source at a fixed angle. In the WOA, the spiral update mechanism creates a logarithmic spiral route between the search agent and the target value. The search agent can move towards the target value along the logarithmic spiral. The logarithmic spiral is also called equiangular spiral, which refers to a spiral whose distance increases in geometric progression. The two-dimensional image of a logarithmic spiral is shown in Fig. 5.
The logarithmic spiral is still a logarithmic spiral after various suitable transformations, which can be described as: x a n l e y a n l e

Fig. 5 2D image of logarithmic spiral
As the distance of the spirals increases in geometric progression, the logarithmic spiral path generated between the search agent and the target value may exceed the searching space. Spiral routes beyond the search space are invalid, and search agents will also fail along invalid routes. The failed search agent reduces the diversity of the population. In addition, due to the large distance of the spirals, the distribution position of the logarithmic spiral in space is sparse, which reduces the population diversity of the search agent. Aiming at the shortcomings of the logarithmic spiral, this paper proposes three different spiral search strategies, namely Archimedes spiral search, Rose spiral search and Hypotrochoid spiral search.

1) Archimedes spiral searching strategy
Archimedes spiral was named after the Greek mathematician Archimedes in the third century BC. The Archimedes spiral is a trajectory generated when a point leaves a fixed point at a uniform speed while rotating around the fixed point at a fixed angular velocity. When the peripheral speed and the linear speed double at the same time, the shape of the Archimedes spiral will not change. Therefore, the Archimedes spiral belongs to the constant velocity ratio spiral. At the same time, the Archimedes spiral is also called an equidistant spiral because it expands equidistantly in each rotation cycle. Two-dimensional image of the Archimedes spiral is shown in Fig. 6.
The parametric equation of the Archimedes spiral is described as follows:

2) Rose spiral searching strategy
Rose spiral is a periodic arc spiral. The parameters controls the shape of the rose spiral. Among them, parameter a determines the length of the petals, and parameter n determines the number, size, and length period of the petals. Different parameters can generate rose spirals with different structures. Two-dimensional image of a rose petal with four petals is shown in Fig. 7. The parametric equation of the rose spiral is described as follows.
        cos sin sin cos x a n l l y a n l l

3) Hypotrochoid spiral searching strategy
Hypotrochoid spiral is a trace obtained by tracking a point attached to a circle with radius a that rolls around the inside of a fixed circle with radius b . The distance from this point to the center of the inner scrolling circle is c . Two-dimensional image of the Hypotrochoid spiral is shown in Fig. 8. The parametric equation of the Hypotrochoid spiral is described as follows.

Sine Cosine Algorithm
Sine Cosine Algorithm (SCA) is a mathematical rule-based algorithm inspired by sine and cosine functions in mathematics. Its advantage is that it can well balance the global exploration and local exploitation capabilities. The sine function is similar to the cosine function. The sine function and the cosine function are converted to each other through the induced formula or a half-angle formula. That is to say the sine function and cosine function are converted to each other by translation. Exploration and exploitation are two indispensable capabilities for optimization algorithms. In order to balance the two phases and show their combined ability as much as possible, SCA uses sine search for global exploration and cosine search for local exploitation. These two search methods can be defined as: where,

Convergence Factor
Logarithmic spiral routes may exceed the searching space. At the same time, the distribution of logarithmic spirals in space will reduce the population diversity of search agents. Aiming at the shortcomings of the spiral update mechanism, this paper proposes three different spiral search strategies, namely Archimedes spiral search, Rose spiral search and Hypotrochoid spiral search. The Archimedes spiral is an equidistant spiral, so it does not exceed the search space. In addition, the Archimedes spiral route can search more locations, which can effectively improve the population diversity of search agents. After introducing the Archimedes spiral searching strategy, Eq.
(6) can be updated as follows: The rose spiral is a periodic arc spiral. From the two-dimensional image, it can be seen that the route of the rose spiral is wider than that of the logarithmic spiral, which increases the location diversity of the search agent.
After introducing the rose spiral search, Eq. (6) can be defined as: Hypotrochoid spiral is internal trajectories generated along a circle, so it does not exceed the searching space.
In addition, compared with the logarithmic spiral, the two-dimensional image shows that the route distribution of the Hypotrochoid spiral can search most areas in the space. After introducing the Hypotrochoid spiral searching strategy, Eq. (6) can be updated as: The mathematical model of WOA (shrink enclosing mechanism and spiral update mechanism) uses parameter r1 to control the transition between exploitation and exploration. However, the generation of parameter r1 is random, which brings randomness to the algorithm. In order to further improve the optimization ability of the WOA, this paper proposes an improved sine cosine operator. Firstly, the improved sine cosine operator improves parameter r1 of the sine cosine algorithm, which improves the convergence effect of the search agent. Secondly, this paper proposes the merit based strategy to eliminate the shortcomings of the SCA in determining the search methods by probability. It can be seen from Eq. (11) that the purpose of designing parameter r1 of SCA is to make the searching agent converge from the exploration stage to the exploitation stage. However, the convergence effect of the parameter r1 needs to be verified. This paper proposes a convergence factor c1 to replace parameter r1 , that is to say: where, t indicates the current number of iterations and T indicates the maximum number of iterations.
In order to verify the convergence effect of the convergence factor, c1 and r1 with different parameters are selected for comparison. The comparison results in Fig. 11 show that the convergence effect of c1 is better than r1 . Convergence factor c1 can guide search agents to quickly transition from the exploration to the exploitation phase.

Fig. 11 Comparison of convergence effects
The sine and cosine searching methods are updated to the following equation after introducing the convergence factor c1 : where, parameters r2 and r3 have the same meaning as Eq. (11). Fig. 12 shows that the convergence factor c1 can make the sine and cosine functions gradually decrease with iteration, which ensures that the search agent develops towards the area of the target value.  The flowchart of the improved WOA is shown in Fig. 15 and its pseudo code is described as follows.
Initialize the whales population Perform improved sine and cosine operator by the Eq.(18) and Eq. (19) Perform the merit based strategy by the Fig.13 t=t+1 End While Return X p

Time Complexity Analysis
Time complexity is used to describe the running time of the algorithm, which is expressed by a big O symbol.
To calculate the time complexity, the number of operating units of an algorithm is usually estimated. Therefore, the time complexity of the optimization algorithm is related to the operating unit and algorithm structure. For WOA, the time complexity mainly depends on the number of search agents, the number of iterations, and the location update mechanism. The improved WOA introduces improved strategies based on WOA. The impact of the improved strategy on the time cost of the algorithm is unknown and needs to be analyzed.
The time complexity of each operation unit in WOA is described as follows.
1) The N search agents are distributed in the D -dimensional search space, which needs to run D N  times.
2) Calculate the fitness of search agent and select the optimal agent as the target value, which needs to run 3) Parameters a , A , C , l and p are updated, which needs to run 5 times.
4) The position update operation of N search agents in the D -dimensional space, which needs to run D N  times. 5) Output the optimal value needs to run 1 times.
Operation units has undergone T iterations. Therefore, the total time complexity of WOA is The time complexity of each operation unit of the improved WOA algorithm is described as follows. 2) Calculate the fitness of search agent and select the optimal agent as the target value, which needs to run 3) Parameters a , A , C , l and p are updated respectively, which needs to run 5 times. 7) Output the optimal value needs to run 1 times.
The total time complexity of the improved WOA is   . From the time complexity analysis, it can be seen that the improvement strategy is simple and does not increase the calculation cost.

Benchmark Functions
The benchmark functions are used to verify the performance of the algorithms. The test function creates the searching space based on the number of variables, constraints, and dimensions. In general, the test functions have a global optimal solution, so it belongs to the single objective optimization problem. 22 test functions were used to evaluate the performance of the improved WOA. The test functions and their specific information are shown in Table 1. Functions    1 500

Comparison of Three Spiral searching Strategies
In order to improve the searching efficiency and the diversity of the population, this paper proposes three different spiral searching strategies. They are Archimedes spiral search (AR), rose spiral search (Rose) and Hypotrochoid spiral search (Hy). The logarithmic spiral (Log) of the original WOA and three spiral searching strategies are selected for comparison on some functions. The convergence curves in Fig. 16 shows that the Archimedes spiral search has the best convergence speed and optimization accuracy. For each function, the algorithm runs independently 10 times. The statistical results in Table 2 show the average accuracy and robustness of different spiral searching strategies. It can be seen from Table 2

Effectiveness Analysis of Improved Sine Cosine Operator
In order to further improve the exploration and exploitation capabilities of WOA, this paper proposes an show that the convergence factor can drive the searching agent to switch from exploration to exploitation, which    Table 4 shows the detailed parameter settings of the algorithms. The convergence curves under different algorithm are shown in Fig. 18. The convergence curves can intuitively show the convergence speed and optimization accuracy of the algorithms, but it can not statistics the average accuracy and robustness of the algorithms. For each function, the algorithm runs independently 10 times. Table 5 shows the mean and variance, which can show the average accuracy and robustness of the algorithms.  The convergence curves show that ARSC-WOA has obvious advantages in most functions.  Table 5. The statistical results in Table 5 can test the optimal accuracy, average accuracy, and robustness. In terms of optimal accuracy, ARSC-WOA found a theoretical optimal value on 50% functions. WOA found a theoretical optimal value on 18% of the functions. The ratio of SSA, FA and FWA to find the theoretical optimal value is 9%. The ratio of MFO and SCA to find the theoretical optimal value is 4%. In terms of average accuracy and robustness, ARSC-WOA is superior to other algorithms on 64% of functions. The statistical results show that the improved WOA has the best optimization accuracy in this experiment. The strong robustness makes the algorithm less susceptible to randomness.

Comparison of Improved WOA with Other Algorithms
In order to show the advantages of the improved WOA more intuitively, this paper uses Wilcoxon rank sum test [48] to further analyze the statistical results. Wilcoxon rank sum test is also called order sum test, and it is a non-parametric test. Wilcoxon rank sum test does not depend on the specific form of the overall distribution, it does not consider the distribution of the research object and whether the distribution is known, so it is more practical.
Wilcoxon rank sum test assesses whether the difference between the two samples is significant and is recorded as the p-value. If the p-value is less than 0.05 and is close to 0, it can be considered that there is a significant difference between two samples. If the p-value is greater than 0.05, it is considered that there is no significant difference between two samples. If the p-value is NaN, there is no difference between two samples. Table 6 summarizes the p-value results of ARSC-WOA compared with other algorithms. The statistical results show that the improved WOA has obvious advantages, which further validates the performance of the algorithm.
In summary, ARSC-WOA showed the best performance in this experiment. It is not only better than WOA, but also better than SCA, which shows that the improved strategies proposed in this paper are effective. First, the Archimedes spiral searching strategy improves the population diversity of search agents. Secondly, the introduction of improved sine cosine operator enables the search agent to adaptively switch search methods, and the exploration and exploitation capabilities are further improved.

Effectiveness Analysis of Improved Strategies
The   19 shows the convergence curves of these algorithms. The statistical results are listed in Table 7. It can be seen from the convergence curves that ARSC-WOA has the best convergence speed and optimization accuracy for both unimodal and multimodal functions. Statistical results show that ARSC-WOA finds the theoretical optimal value on 50% of the functions. AR-WOA found the theoretical optimal value of the 23% functions. SC-WOA found the theoretical optimal value on 36% of the functions. ARSC-WOA also excels in average accuracy and robustness. In summary, the experimental results show that AR-WOA and SC-WOA are superior to WOA in most functions, which proves that two improved strategies proposed in this paper are reasonable. In addition, the experimental results show that ARSC-WOA is superior to AR-WOA and SC-WOA in most functions, indicating

High-dimensional Function Optimization
High dimensionality and non-linearity are common in combinatorial optimization problems. For example, traditional methods such as back propagation and gradient descent can simply and effectively optimize neural networks. However, the quality of the global optimal solution depends on the initial solution, which is easy to fall into the local optimal. Meta-heuristics as a trainer for neural networks can avoid local optimization. At the same time, due to the differences in neural network structure and optimization parameters, the dimensions that the meta-heuristic algorithm needs to optimize may be more than 50 dimensions [49][50], which tests the performance of the algorithm. In this paper, the dimensions of functions F1-F13 are increased to verify the possibility of improved WOA to solve high-dimensional optimization problems. The search range of the unimodal functions F1-F7 will increase as the dimensions increase. In this case, the global convergence of the search agent is reduced.
The multimodal functions F8-F13 have a large number of local optimal values. The increase of the dimensions causes the local optimal values to increase sharply, which interferes with the tendency of the search agent to develop towards the global optimal value. If the algorithm does not have a strong global exploration capability, it will fall into the local optimal value stagnation.
For each dimension of the function, the algorithm runs independently 10 times. For different dimensions, the test results listed in Table 9 show that ARSC-WOA found the theoretical optimal value in 54% of the functions. It should be noted that the optimal value of the function F8 is 9829 . 418 min , and the global optimal value will shift with the dimensions. For different dimensions, ARSC-WOA can find the theoretical optimal value of F8. It shows that the improvement of the dimension will not have a negative impact on the performance of ARSC-WOA.
The introduction of improved strategies enables searching agents to avoid local optimization. Table 10 shows the p-value results of the Wilcoxon rank sum test. Statistical results show that the performance of ARSC-WOA when dealing with high-dimensional optimization problems is not much different from low-dimensional optimization.
The improved WOA did not fall into the dimensional disaster, which lays a theoretical foundation for ARSC-WOA to deal with complex optimization problems of high dimensions.

Fig. 20 Three-bar truss design problem
In order to more objectively show the performance of ARSC-WOA, the optimization costs of different algorithms are selected for comparison. The optimization results in Table 11 show that ARSC-WOA has the best optimization cost. The comparison of the statistical results in Table 12 shows that ARSC-WOA is superior to SSA, GOA and WOA in mean and variance. ARSC-WOA is not only better than other algorithms, but also better than WOA. The improved WOA can effectively solve the three-bar truss design problem.  In addition, this paper also applies the improved WOA to solve the welded beam design problem. The purpose of this engineering problem is to minimize welding costs. The structure and parameters of the welded beam design problem are shown in Fig. 21. The four constraints are shear stress  , bending stress in the beam  , buckling load

Fig. 21 Welded beam optimization problem
In order to more objectively show the performance of ARSC-WOA, the optimization costs of different algorithms are selected for comparison. In addition, mathematical methods [61] such as random method, simplex method, and successive linear approximation are selected in this paper. The optimization results in Table 13 show that ARSC-WOA has the best optimization cost. The comparison of the statistical results in Table 14 shows that ARSC-WOA is superior to GSA, PSO and WOA in mean and variance. Experimental results verify that ARSC-WOA is not only better than other algorithms, but also better than WOA. This shows that the optimization performance of the improved WOA is strong and can effectively solve the welded beam design problem.

Conclusions
As a swarm intelligence based algorithm, WOA relies less on parameters and operators. Aiming at the shortcomings of the spiral update mechanism in WOA, this paper proposes three kinds of spiral search strategies, namely Archimedes spiral search, Rose spiral search and Hypotrochoid spiral search. The experimental results show that the optimization effect of Archimedes spiral search is the best, and it can avoid exceeding the search range. At the same time, Archimedes spiral search can effectively improve the population diversity of search agents.
In addition, the introduction of improved sine cosine operator enables the algorithm to use sine search for global exploration and cosine search for local exploitation. The convergence factor enables the search agent to smoothly transition between exploration and exploitation with iterative adaptation. The algorithm retains the optimal search method through the merit based strategy. The sine search and cosine search can also search different regions based on the returned value, and the optimization performance has been further improved. In the experimental simulation part, the improved WOA based on the Archimedes spiral search strategy and the sine cosine operator (ARSC-WOA) has shown strong competitiveness compared with other algorithms. The introduction of improved strategies enables the algorithm to effectively solve high-dimensional optimization and engineering optimization problems. The future research direction is to apply the improved WOA to more combinatorial optimization problems, such as muti-objective optimization problems, binary optimization problems, and regression prediction models.   The model combining sine and cosine search Comparison of convergence effects Figure 12 The model of sine and cosine function by reducing ranges Figure 13 Flow chart of merit based strategy  Simulation results

Figure 17
Simulation results  Welded beam optimization problem