Improved Sparrow Search Algorithm Based on Iterative Local Search

This paper solves the shortcomings of sparrow search algorithm in poor utilization to the current individual and lack of effective search, improves its search performance, achieves good results on 23 basic benchmark functions and CEC 2017, and effectively improves the problem that the algorithm falls into local optimal solution and has low search accuracy. This paper proposes an improved sparrow search algorithm based on iterative local search (ISSA). In the global search phase of the followers, the variable helix factor is introduced, which makes full use of the individual's opposite solution about the origin, reduces the number of individuals beyond the boundary, and ensures the algorithm has a detailed and flexible search ability. In the local search phase of the followers, an improved iterative local search strategy is adopted to increase the search accuracy and prevent the omission of the optimal solution. By adding the dimension by dimension lens learning strategy to scouters, the search range is more flexible and helps jump out of the local optimal solution by changing the focusing ability of the lens and the dynamic boundary of each dimension. Finally, the boundary control is improved to effectively utilize the individuals beyond the boundary while retaining the randomness of the individuals. The ISSA is compared with PSO, SCA, GWO, WOA, MWOA, SSA, BSSA, CSSA, and LSSA on 23 basic functions to verify the optimization performance of the algorithm. In addition, in order to further verify the optimization performance of the algorithm when the optimal solution is not 0, the above algorithms are compared in CEC 2017 test function. The simulation results show that the ISSA has good universality. Finally, this paper applies ISSA to PID parameter tuning and robot path planning, and the results show that the algorithm has good practicability and effect.


Introduction
With the continuous emergence of various optimization problems, various algorithms and improved algorithms are emerging [1][2][3][4]. e emergence of swarm intelligence algorithm provides new ideas for solving various optimization problems. e swarm intelligence optimization algorithm is a meta-heuristic optimization algorithm that imitates the behavior of biological populations or biological behaviors and natural phenomena in the natural world. As the optimization effect of swarm intelligence algorithms is recognized by the public, swarm intelligence algorithms develop continuously, and more and more new swarm intelligence algorithms are proposed, such as firefly algorithm (FA) [5], ant lion optimizer (ALO) [6], whale optimization algorithm (WOA) [7], sine cosine algorithm (SCA) [8], crow search algorithm (CSA) [9], Harris hawks optimization algorithm (HHO) [10], slime mould algorithm (SMA) [11], hunger games search (HGS) [12], Runge-Kutta method (RUN) [13], and colony predation algorithm (CPA) [14].
Sparrow search algorithm (SSA) is a new group intelligence optimization algorithm proposed by Xue and Shen [15] in 2020. Inspired by sparrow foraging behavior, the algorithm has obvious advantages over traditional intelligent optimization algorithms, such as grey wolf Optimizer (GWO) [16], particle swarm optimization (PSO) [17], and genetic algorithm [18], with high stability, good search accuracy, and fast convergence [19]. Despite its fast convergence rate, the algorithm is prone to fall into local optimum and the results of optimization are random. To overcome this shortcoming, many scholars have proposed improved algorithms based on different strategies for the sparrow search algorithm and successfully solved many engineering problems. Based on the principle and model of sparrow search algorithm, Lv et al. proposed a fusion algorithm of bird swarm algorithm and sparrow search algorithm [20] and a chaotic sparrow search algorithm [21]. e former uses the search mechanism of bird swarm algorithm to add to the discoverers and followers of the sparrow search algorithm, which changes the update strategy of "full dimension reduction," effectively breaks through the local restriction of search, and strengthens the global search ability; and the latter uses tent chaotic map to initialize the population, which makes the population more uniform. After one iteration, the second iteration of chaotic disturbance and Gaussian variation is carried out according to individual fitness and average fitness, which prevents local aggregation in the optimization process, enhances its ability to jump out of local optimization, and achieves good results in the application of image segmentation. A chaotic sparrow algorithm based on cubic mapping and elite reverse learning to initialize population is presented by Tang et al. [22]. At the same time, the sinusoidal algorithm is introduced, which balances the development and exploring ability of the algorithm. At the same time, when the algorithm comes to a standstill, the Gauss Walk strategy is used to jump out of the standstill, and its optimization performance is verified in 15 benchmark functions. Finally, the UAV track planning simulation is carried out in the case of threat. Compared with other optimization algorithms, the algorithm obtains the safe and feasible track with the best cost and meets the constraints. Ouyang et al. proposed a learning sparrow algorithm [23] adding lens reverse learning during the discoverer search phase makes the search more flexible and increases the diversity of the population. A spiral guidance mechanism is introduced to make the discoverer search more precise. en, a local search mechanism is added to prevent the omission of high-quality solutions, and compared with other swarm intelligence algorithms in 12 basic test functions and CEC 2017 test sets, this shows good optimization ability. Finally, the improved sparrow search algorithm is validated in the robot path planning, and a stable and safe optimal path is planned. e above algorithms have made some improvements on the basis of sparrow algorithm, but there are still some shortcomings: (1) ere is still some randomness in the improved method of population initialization, which does not guarantee absolute uniformity of the population each time it is initialized. (2) e selected improved search strategy is subject to regional limitations, is easy to exceed the boundaries, and fails to perform effective global search in the whole space, resulting in a large number of individuals exceeding the boundaries and still trapped in local optimum.
(3) By jumping directly to the discoverer, it is easy to miss the optimal solution. e improvement of local search accuracy is not significant, and there can be more improvement in search accuracy. (4) In terms of boundary control, the strategy of updating to boundary is adopted for individuals beyond the boundary, which does not make good use of the individual location and reduces the diversity of the population.
In order to solve the above problems, the sparrow search algorithm based on iterative local search is proposed in this paper. By variable helix factor and improved iterative local search, the effective utilization and search of individuals are improved. By adding a dimension by dimension lens learning strategy and change the focusing ability of the lens, the algorithm converges faster while helping to jump out of the local optimum, and improving the boundary strategy, the population diversity is increased. To verify the optimization performance of the algorithm, ISSA PSO, SCA, GWO [16], WOA, MWOA [24], SSA, BSSA, CSSA, and LSSA are tested and analyzed on 23 basic functions. To further verify the universality of the algorithm, the above algorithms are tested and analyzed in CEC 2017 test function [25,26]. Finally, ISSA is applied to PID parameter tuning [27]. e accuracy and convergence speed of the tuned results are improved compared with the SSA, which shows that the algorithm has good practicability. e main contributions of this paper are as follows: (1) In order to improve the effective use and search of individuals, a variable helix factor strategy is proposed and boundary control is improved (2) An improved iterative local search strategy is presented to improve the problem of low accuracy and missing better solutions in the search process (3) In order to improve the ability of the algorithm to jump out of local optimization, a dimension by dimension lens learning method is proposed to change the lens focusing ability (4) e versatility and flexibility of the algorithm using benchmark functions and CEC 2017 functions are validated (5) ISSA is used to optimize PID parameters to help quickly complete PID parameter tuning (6) ISSA is used to optimize the robot path planning problem and help get fast and stable results e main work arrangement of this paper is as follows: Section 2 introduces the basic sparrow algorithm. Section 3 introduces and analyses the ISSA. Section 4 compares and analyzes the algorithm on the basic test function. Section 5 compares and analyzes the algorithm on CEC 2017. Section 6 applies the algorithm to PID parameter tuning. Section 7 applies the algorithm to robot path planning. Section 8 discusses and provides future research directions.

Sparrow Search Algorithm
In the process of sparrow foraging, there are two behavioral strategies: discoverer and follower. e individuals with better positions in the sparrow population generally take 10%-20% of the total population as discoverers, while the remaining individuals take part in the process. At the same time, 10%-20% of individuals are randomly assigned as scouters.
e discoverer is responsible for leading the population in search direction and finding food, while the follower follows the discoverer to obtain food, and the scouter is alert to environmental threats and warns the sparrow population to move closer to a safe area.
In order to describe the process of sparrow foraging through mathematical models, it is necessary to formulate rules to simplify various behaviors of sparrows. e specific rules are as follows: (1) e individual energy of sparrow population depends on individual fitness evaluation, and the individual energy of discoverer is higher than that of discovers. (2) Once the scouters in the sparrow population find the threat of the external environment, they begin to send out an alarm signal. When the alert value is greater than the security threshold, the discoverers direct the population to the security zone. (3) Sparrows have flexible individual behavior strategies and can switch between discoverers and followers. As long as the individual energy reaches a certain degree, they can become discoverers, but the proportion between discoverers and followers in the population remains unchanged. (4) Sparrows with low energy may fly to other places for feeding in order to obtain higher energy. (5) When there is an external environmental threat, the sparrows at the edge of the population will quickly move to the safe area, and the sparrows in the middle of the population will immediately swim away to get close to other sparrows. e discoverer is responsible for guiding the population to forage or to the location of the safe zone. e location update is described below: Among them, t represents the current number of iterations, and M is the maximum number of iterations. X i,j represents the current position of the i-th sparrow in the j-th dimension. α ∈ [0, 1] and is a random number. R 2 represents an early warning value, ST is the security threshold, and R 2 ∈ [0, 1], ST ∈ [0.5, 1]. Q represents a random number that follows a normal distribution. L represents a 1 × d matrix with all elements 1. When R 2 < ST, this indicates that the population environment is safe at this time, no predators are found around them, and the discoverers can conduct extensive searches to guide the population to higher energy levels. When R 2 ≥ ST, this indicates that an individual within a population has discovered a predator and issued an alert, and that the discoverer quickly adjusts the search strategy to flee the current location, leading the population to a safe location.
In order to obtain high-quality food, followers follow the discoverer or forage alone, so the location of followers is updated as follows: Among them, X p is the best position currently occupied by the discoverer, and X worst represents the worst position currently. A is a 1 × d matrix with only 1 or − 1 elements, where A + � A T (AA T ) − 1 . When i > n/2, this indicates that the less adaptable 1st participant is not getting food, is very hungry, and needs to fly elsewhere to get more energy; when i < n/2, followers monitor the finder and compete for food with the finder with a higher predator, thereby increasing their energy.
When aware of the danger, the sparrow population will make antipredation behavior, and its mathematical expression is as follows where X best represents the current global optimal position. β is the control step parameter and is a normally distributed random number with a mean value of 0 and a variance of 1. K is a random number belonging to [− 1, 1], which controls the direction of the sparrow's movement as well as the step. f i represents the fitness value of the current sparrow individual. f g and f w are the current optimal and worst fitness values, respectively. ε is a very small real number that prevents the denominator from being zero. When f i ≠ f g , this indicates that the current sparrow is at the edge of the population and that an individual is vulnerable to predators, and it is necessary to approach other individuals in the population center to reduce the risk of predation. When f i � f g , this indicates that individuals in the center of the population are aware of the danger and need to flee from their current location in order to avoid it.

Sparrow Search Algorithm Based on Iterative Local Search (ISSA)
3.1. Variable Helix Factor. Followers occupy the majority of individuals in the population. When i < (N/2), they have a unique update mechanism that draw closer to the Computational Intelligence and Neuroscience discoverers quickly; it results in a fast convergence rate. When i > (N/2), they have the ability to search globally. However, the global search ability is not strong, limited by the boundary of the search area, which tends to cause aggregation at the boundary in the early stage, resulting in loss of population diversity, easy to fall into the local extreme phenomenon, and poor ability to jump out of the local optimal. e location update method of follower adopts the random coefficient that obeys the normal distribution. Without considering the boundary, the coefficient has strong global search ability. However, when considering the boundary, this mechanism is detrimental to the individuals who are at or near the boundary. Many absolute coefficients exceed 1. When the boundary is exceeded, it causes the population individuals to aggregate at the boundary, does not make full use of the current location, and results in a significant decrease in population diversity and overall algorithm performance. Based on this, a variable helix factor is proposed to reduce the number of individuals beyond the boundary, control the search step and direction, make full use of the whole population space, the space for early search is large, maintain the diversity of the population, and help jump out of the trap of local optimum. Later local search is more detailed, which greatly improves the search ability of the algorithm, as shown in Figure 1.
e formula for the variable helix factor works as follows: H is a variable helix factor, a is a parameter used to control the helix, with a value of 1 in the earlier period and a decreasing number of iterations in the later period; k is a parameter representing the helix cycle, (M/10) in general; and l is a parameter that decreases linearly from 1 to − 1 in terms of the number of iterations.
In this paper, we select a high-dimensional test function, step function, and a low-dimensional test function, Shekel function, to test the original model and the improved model for individuals beyond the boundary, as shown in Figure 2. Set the population individual as 30 and the number of iterations as 500, run each for 10 times, and take the average value. e test results are shown in Table 1.
According to Table 1, when the followers conduct extensive search, the number beyond the boundary accounts for the vast majority of the total number beyond the boundary of the sparrow population, resulting in the loss of a large number of individuals. erefore, it is necessary to restrict the extensive search scope of the followers; based on the variable helix factor, the number of times the followers exceeding the boundary is greatly reduced to 0, which fully retains the favorable position information of the current individual.
Improvements to the extensive search of the followers make it possible for the followers to make full use of the whole search space, get rid of the attraction of the local optimal solution more easily, strengthen the search for the whole space, maintain the diversity of the population, enhance the ability of algorithm exploration in the early stage, and enhance the ability of algorithm development in the later stage. Based on this, the formula is updated as follows: 3.2. Improved Iterative Local Search. When i < (N/2), the followers have a unique update mechanism that quickly closes to the discoverer's optimal solution, which results in fast convergence of the algorithm. e followers jump directly to the neighborhood of the discoverer's optimal solution. Although they have some development ability near the current optimal solution, they do not make enough use of the current solution and have poor stability. ey cannot guarantee the quality and accuracy of the solution and have poor local development ability. Once trapped and unable to jump out of the local extreme state, the overall performance of the algorithm will be limited. Inspired by [28][29][30], this paper presents an improved iterative local search.
Local search algorithm [31] is a simple greedy search algorithm that is improved from the hill-climbing method. Local search starts from an initial solution, then searches the neighborhood of the solution, and updates the solution if there is a better solution or returns to the current solution. Iterative local search is an exploratory method that adds perturbation to the local optimal solution obtained by local search and then re-searches the local solution.
e improved iterative local search first performs a local search near the initial solution, then disturbs the initial solution by updating the location of the followers closer to the discoverer, and then searches the updated location again. It makes full use of the location information of the current individual and the location information of the current optimal solution to make the search more flexible. e first modification uses the mechanism by which the follower approaches the discoverer to disturb, so that the individual jumps near the current global optimal position to jump out of the local optimal position; the second modification uses the local search to obtain stable optimization results and improve the accuracy of the local search; and the third modification uses the local search result to obtain the optimal local search result to ensure the quality of the solution, as shown in Figure 3.
At the same time, two cases are illustrated in this paper. Figure 3(a) indicates that after individual disturbance, a better solution can be found near the current global optimal solution; and Figure 3(b) indicates that an individual can find a better solution using his own favorable position, both of which help to jump out of the local optimal solution. is paper has not been replaced by the current global optimal solution to maintain population diversity and prevent premature convergence.

e First Modification (SSA Method).
e improved iterative local search strategy is more suitable for this algorithm than the original iterative local search. It works by first disturbing the initial solution to get an intermediate solution (when i < n/2, the followers of the SSA are disturbed    Computational Intelligence and Neuroscience by a unique update mechanism that closes quickly to the finder's optimal solution). e initial and intermediate solutions are then searched again for a better solution. e first modification is used to solve the problem that the SSA is easy to fall into local optimal solution. e algorithm flow is as follows: Step 1.
e initial solution X * is perturbed by the current optimal solution X best to obtain the intermediate solution X * * . e perturbation formula is as follows: e formula for the original followers is as follows: X best is x t+1 P , which is the best position the discoverer currently occupies; X * is x t i,j , which is the current position; X * * is x t+1 i,j , which is the updated location.

e Second Modification (ILS Algorithm).
e second modification solves the problem of unstable and inaccurate optimization results of the SSA. e ILS algorithm here represents the local search stage in the ILS algorithm. It works by searching the initial and intermediate solutions locally to get a better solution and effectively utilizes the current position of the initial solution to prevent the individual from missing the better solution in the process of jumping directly to the current optimal solution. At the same time, local search near the current optimal solution helps to improve the accuracy of the solution and jump out of the local optimum in a small range. e algorithm flow is as follows: Step 2. Initial solution X * starts local search, and the formula is as follows: rand() is a random number between 0 and 1.
Step 3. Intermediate solution X * * starts local search, and the formula is as follows:

e ird Modification.
e third modification is to optimize the local search results to ensure the quality of the solution. e working principle is to use greedy strategy to compare the local search results of the initial and intermediate solutions and select the better value as the final solution X. e algorithm flow is as follows: Step 4. Calculate fitness f(X 1 ) of X 1 .
Step 5. Calculate fitness f(X 2 ) of X 2 Step 6. Compare f(X 1 ) and f(X 2 ) to select the best individuals for location updates; that is, Based on the SSA and the three modifications above, the formula of the follower (i < N/2) in the SSA is updated as follows:   Computational Intelligence and Neuroscience

Dimension by Dimension Lens Imaging Learning.
Swarm intelligence algorithms have the disadvantage of easily falling into local optimum. In this regard, relevant scholars have proposed the method of adding reverse learning to swarm intelligence algorithm [32][33][34]. e solution after reverse learning can be closer to the optimal solution. Generally, reverse learning can only search for the optimal solution in a certain space, but it still has monotonicity and the possibility of falling into local optimum. Lens learning [35,36] has better optimization ability than general direction learning and can continuously converge to the optimal solution in a certain space. However, once there is no optimal solution in the selected space, it will still lead to local optimization in the end. At the same time, scouters have antipredator behavior to help the population to jump out of the local optimum, but their ability to jump out of the local optimum is unstable, resulting in sometimes unable to jump out of the local optimum. In view of this phenomenon, this paper proposes a dimension by dimension lens imaging learning strategy to change the focusing ability of the lens, which is used to strengthen the scouters' ability to jump out of the local optimum, lens learning for each dimension, and reduce the mutual interference between the dimensions. In the early stage, the lens with poor focusing ability is selected for reverse learning. At this time, the imaging is divergent and far away from the lens, which can help jump out of the local optimum, as shown in Figure 4(a); in the later stage, the lens with strong focusing ability is selected for reverse learning. e imaging is concentrated and close to the lens, which can accelerate the convergence, as shown in Figure 4(b). Comparison of three kinds of reverse learning is shown in Table 2. e principle of lens imaging is as follows: As shown in Figure 4, taking one-dimensional space as an example, it is assumed that there is an individual with a height of h at the position. Under the action of the lens, it forms an image with a height of h * at the position x * . a, b is the boundary, and the lens position is the midpoint of [a, b]. According to the principle of lens imaging and triangle similarity principle: By transforming the above formula, we can get k is used to indicate the focusing ability of the lens, that is, the imaging size. When k � 1, it can be simplified as follows: is is the general reverse learning strategy. It can be seen that the general reverse learning strategy is a special case of lens imaging. e general reverse learning strategy k is fixed, and the obtained individuals are also fixed. Lens learning can change the position of individuals by adjusting k, so as to further enhance the diversity of groups. Generally, it takes a constant that is not equal to 1. is paper proposes a strategy of linearly increasing K according to the number of iterations, that is where a is a small constant to prevent the previous iterative imaging from being too large, which is taken as 0.1 in this paper. e early k is small, and the imaging is large; in the later stage, k is near 1, and the imaging is slightly smaller, which can help convergence. At the same time, lens imaging is extended to each dimension, and lens imaging reverse learning is performed for each dimension. e formula is extended as follows: where j is the current dimension, a j is the lower bound of the j-th dimension, and b j is the upper bound of the j-th dimension. At the same time, this paper adopts dynamic boundary: where min(x j ) is the minimum value of the j-th dimension in all individuals, and max(x j ) is the maximum value of the j-th dimension in all individuals. Because a j and b j do not represent the boundary of the whole search space, when the imaging exceeds the boundary [a j , b j ], it may not exceed the boundary of the whole search space. erefore, when k is small in the current period, the imaging will exceed the boundary of the current j-th dimension, which helps to expand the search range, reduces the possibility of premature stagnation in the early stage, and helps to jump out of the local optimum. Finally, the greedy strategy is adopted. If the fitness value of the reverse solution is small and better than the original solution, the solution is updated and applied to the algorithm as follows:

Verify the Ability to Jump Out of Local Optimization.
In this paper, the Shekel function mentioned above is selected as an example to draw the individual distribution diagram between the improved algorithm and the original algorithm to verify the ability of the above strategy to jump out of local optimization. e function image is shown in Figure 2. e selected population is 100, and the maximum number of iterations is 20. e individual distribution of the two algorithms are shown in Figures 5 and 6. As can be seen from Figure 5, most individuals in the original algorithm have local aggregation and fall into local optimization. As can be seen from Figure 6, the improved Computational Intelligence and Neuroscience algorithm has a larger search space, and most individuals converge near the optimal solution, effectively jumping out of the local optimal solution.

Proof of Convergence of Dimension by Dimension Lens Imaging Learning.
e proof of convergence of general refraction reverse learning swarm intelligence algorithm is given in reference [37]. Here, its conclusion is introduced to prove the convergence of the ISSA for dimensional lens back learning. It should be pointed out that the proof of convergence does not necessarily ensure that the algorithm converges to the global optimal solution. Since the SSA is also a swarm intelligence search algorithm, there are the following theorems: Theorem 1. If the SSA algorithm based on general back learning converges, the ISSA algorithm also converges.
Proof. Let x i (t) and x * i (t) be the current solution and reverse solution of generation t, x i,j (t) and x * i,j (t) be the values of x i (t) and x * i (t) in the j-th dimension, respectively, and the global optimal solution is x best . From eorem 1,  According to the dynamic change of iteration times, the first and middle stages are less than 1, and the later stage is more than 1 In the early and middle stages, the image is enlarged at the midpoint of the boundary, and in the later stage, the image is smaller Jump out of the local optimum in the first and middle stage and accelerate the convergence in the later stage   Computational Intelligence and Neuroscience Extended to the j-th dimension: In the t-th generation, the current solution generated by the reverse learning strategy based on the lens imaging principle is When t ⟶ ∞, from the above formula, we get Return to the whole dimension: It can be seen that when x i (t) converges to x best , the inverse solution x * i (t) generated by lens learning also converges to x best . erefore, if the SSA based on general reverse learning converges, the ISSA also converges. □ 3.4. Improved Boundary Control. In the standard SSA, when an individual in the optimization process exceeds the boundary, the boundary control will be carried out for the individual. e principle is as follows: Ub and Lb are the upper and lower bounds of space, respectively. In this method, the strategy of turning the individuals beyond the boundary into the boundary will lead to the aggregation of individuals at the boundary and reduce the diversity of the population. It can be seen from Table 1 that although the improved strategy reduces the number of individuals beyond the boundary, some individuals still exceed the boundary and gather at the boundary. Literature [38] adopts the strategy of the current optimal solution for individuals beyond the boundary, which will be difficult to get rid of the local optimization. erefore, this paper proposes a simple boundary treatment method, namely, In this method, the individuals beyond the boundary are randomly assigned to the search space, which makes more effective use of the population individuals and increases the diversity of the population more than that of the original algorithm.

Improved Sparrow Search Algorithm Flow.
In this paper, an improved sparrow search algorithm based on iterative local search is proposed. Firstly, the variable helix factor is used to improve the extensive search of followers, which reduces the individuals beyond the boundary and speeds up the convergence speed in the later stage. Secondly, the improved iterative local search is used to improve the local search of the followers. e initial solution is subject to local search and iterative local search after disturbance, which makes full use of the current position information to prevent premature convergence and improve the quality and accuracy of understanding. en, the lens with changed focusing ability is used to carry out dimension by dimension lens imaging learning for the scouter, and it increases the search space and helps the population jump out of the local optimum. Finally, the boundary control strategy is improved  Computational Intelligence and Neuroscience to reduce the aggregation of individuals at the boundary and increase the diversity of the population. e introduction of various strategies makes the algorithm more flexible in the optimization ability, makes the population more diverse, strengthens its ability to get rid of local optimization, balances the global search ability and local search ability of the algorithm, and is conducive to finding reliable solutions. e specific algorithm flow is shown in Figure 7. e specific pseudo code is as follows: 3.6. Time Complexity Analysis. Time complexity is an important index to measure the performance of the algorithm, which is used to measure the running time of the algorithm. Assuming that the population size of the algorithm is P, the maximum number of iterations is M and the dimension is D, and the time complexity of the sparrow search algorithm is O (P·M·D). From a macro point of view, the improved sparrow search algorithm does not change the structure and cycle times of the algorithm, so its time complexity is also O (P·M·D), which is consistent with the original algorithm. From the microscopic point of view, the greedy strategy is adopted for iterative local search and dimension by dimension lens learning, which increases the algorithm complexity of some followers and all scouters to a certain extent, but the introduction of the improved strategy does not improve the order of magnitude of the algorithm, so the time complexity is still O (P·M·D).

Benchmark Function Test
In order to better verify the performance of ISSA, this paper selects 23 common basic test functions for verification and tests and compares them with 10 algorithms including PSO, SCA, GWO, WOA, MWOA, SSA, BSSA, CSSA, and LSSA. e specific parameter settings are shown in Table 3, and the test function information is shown in Table 4. F1-F7 is the high-dimensional single-peak benchmark function, F8-F13 is the high-dimensional multipeak benchmark function, and F14-F23 is the low-dimensional multipeak benchmark function. F1-F13 is tested in 100 dimensions to verify the performance of the algorithm in higher dimensions. For the sake of fairness, the population size and maximum number of iterations of each algorithm are 30 and 500, respectively, and each algorithm is run independently for 30 times to calculate its best value (best), worst value (worst), average value (AVE), and standard deviation (STD), and the optimal value of each index is processed in bold. Finally, each algorithm will be ranked according to the average value of the algorithm in the function. When the average values of the two algorithms are equal, the standard deviation will be compared. For performance evaluation, simulations are performed on Windows 10 Matlab 2016a, AMD Ryzen 7 4800U with Radeon Graphics @1.80 GHz with 16 GB RAM.
ISSA ranks first in most functions, and its average ranking is better than that of other algorithms. It can be seen from Tables 5 and 6 that, compared with other algorithms, ISSA has found the theoretical optimal value except F7, F10, F12, F13, and F15 and has found the optimal value in all algorithms in the above five functions. It can be seen that the ISSA has good ability to find the optimal solution. Among them, only the ISSA in F5 finds the theoretical optimal value, and only SSA and ISSA in F6 find the optimal value. e optimization accuracy of ISSA in F12 and F13 is a large number of orders of magnitude higher than that of other algorithms. When the dimension increases to 100, the optimization performance of ISSA is still very stable, while PSO, SCA, WOA, GOA, and SSA have a great impact on the optimization ability. It is worth mentioning that in F6 and F12, ISSA is only better than SSA and SSA improved the algorithm in terms of optimal value, but other indicators are better than other swarm intelligence algorithms. In F1-F13 function, ISSA finds a better solution than or the same Start Update the all individuals location according to formula (28) Initialize the initial position and the number of populations and iterations.
Calculate the cost function of each population to find the best and worst positions Update the position of the discoverers according to formula (1) Update the position of the followers according to formula (5)-(7) and (12) Update the position of the scouters according to formula (3), (16) and (20) Has the maximum number of iterations been reached?
Output the best position and mininmum fitness value solution as SSA, indicating that ISSA does not reduce the optimization ability of the algorithm. In the fixed dimension F14-F23, ISSA algorithm has good stability and the ability to jump out of the local optimum. It can find the solution close to the theoretical optimum almost every time.
In order to better describe the optimization ability, difference, and convergence speed of the algorithm with other algorithms, the Wilcoxon rank sum test results with other algorithms is given in Table 7 according to ISSA, and the convergence diagram of each algorithm is given in Figure 8. At the same time, in order to test the contribution of the four strategies to the algorithm, this paper selects a basic function to test the four components of the improved algorithm, as shown in the first figure in Figure 8. e above is based on the test results of 23 benchmark functions.
In this paper, the four strategies and the original SSA and ISSA are tested in the F1 function of the basic test function, as shown in the first figure in Figure 8. ISSA1, ISSA2, ISSA3, and ISSA4 represent the algorithms improved separately by the four improved strategies proposed before. Among them, ISSA2, ISSA3, and ISSA have found the theoretical optimal value. Compared with the original SSA, ISSA2 has significantly improved the convergence speed, reflecting its excellent search ability; ISSA3 suddenly converges to the theoretical optimal value in the middle of the iteration, indicating its excellent ability to jump out of the local optimal. Compared with the original SSA algorithm, the optimization results and convergence speed of ISSA1 and ISSA4 are improved by dozens of orders of magnitude, which can improve to a certain extent. It can be seen that improved iterative local search and dimension by dimension lens imaging learning play a more critical role in improving the ability of the algorithm. e combination of the above four strategies enables us to obtain an ISSA with faster convergence speed, more accurate results, and more stability.
In the Wilcoxon rank sum test, when the value is less than 0.05, it can be considered that there is a significant difference between the two. In Table 7, NaN indicates that their performance is equivalent and cannot be compared. It can be seen that most values are less than 0.05, indicating that the optimization performance of ISSA is significantly different from other algorithms, among which the difference between ISSA and CSSA is the Input: M: maximum number of iterations PD: proportion of discoverer SD: proportion of scouters R 2 : alert value N: population sparrows Output: Find the position of the best and worst sparrow individuals according to fitness values. (1) For i � 1 : PD Update the location of the discoverers according to formula (1); End for For i � (PD + 1) : N Update the location of the followers according to formulas (5)- (7) and (12); End for For l � 1 : SD Get the individual position of a sparrow that is aware of danger according to formulas (3), (16), and (19); End for Get the location of the new optimal individual; Update the all individuals' location according to formula (27); t � t + 1 End while Return: X best , f g ALGORITHM 1: e framework of the ISSA.        Computational Intelligence and Neuroscience 13      Computational Intelligence and Neuroscience     Computational Intelligence and Neuroscience            smallest, followed by LSSA, BSSA, and SSA. As shown in Figure 8, the ISSA shows excellent optimization speed and convergence accuracy, and the convergence speed is fastest in most functions. e ISSA converges faster in the single-peak benchmark function and has better ability to resist the attraction local optimum in the multipeak benchmark function.

CEC 2017 Function Test
In order to better illustrate the generality and effectiveness of the algorithm and avoid that the ISSA is only applicable to the case where the optimal value is 0, the algorithm is tested on the CEC 2017 test function. e evaluation times are 10000 * dim, the number of population individuals is 30, the dimension is 30, SD is set to 0.6, and other parameters remain unchanged. In this paper, the above algorithms are run independently for 30 times, and five indexes of each algorithm are calculated according to the results, namely, the best value (Best), the worst value (Worst), the median (Med), the average value (Ave), and the standard deviation (Std). Finally, each algorithm will be ranked according to the average value of the algorithm in the function. e optimal value of each index is treated in bold. Due to the defects of F2 function, it will not be tested in this paper. e specific test results are shown in Table 8. At the same time, six functions F4, F7, F14, F17, F24, and F27 are selected to draw the box diagram of the results, as shown in Figure 9.
It can be seen from the data in Table 8 that, in the 29 functions, ISSA ranks first in most functions and its average ranking is better than other algorithms. ISSA has good optimization effect and can be close to the theoretical optimal value of each function. In F1, F3, F6, F7, F8, F13,F14, F18, and F29, each index of ISSA is the best in the algorithm. Among the 20 functions, ISSA finds the optimal value of all algorithms, which shows that ISSA has strong optimization ability. When the optimal solution is not 0, ISSA shows better optimization performance than SSA, and PSO and CSSA also show good performance.
As can be seen from the box diagram in Figure 9, the ISSA has strong search ability and is closest to the theoretical optimal value among all algorithms. And ISSA's box graph has shorter length and stronger stability than other algorithms. Among them, the realization of SSA is poor because the individual in the SSA is directly jumping when approaching the current optimal solution, rather than moving to the current optimal solution like PSO.
is problem leads to the rapid convergence of SSA, but it is easy to miss the high-quality solution and fall into local optimization.
e ISSA uses the improved strategy to make up for this disadvantage, makes full use of the current solution, ensures the convergence speed, and increases its ability to jump out of the local optimum. But overall, the ISSA has better optimization performance than other algorithms, has good universality and effectiveness, and can adapt to some complex optimization problems.

PID Parameter Tuning
A PID controller is the most widely used controller in the industry (accounting for about 90% of the controller). e PID controller is composed of three basic gain parameters to control the controlled object. It is mainly applicable to the system whose basic linear and dynamic characteristics do not change with time. Its structure is shown in Figure 10. When the proportional parameter K p increases, the rise time and steady-state error decrease. When the integral parameter K i increases, the rise time is smaller, but the stability time and overshoot increase. e negative effect of the K i increase can be overcome by adjusting the differential parameter K d . e relationship between output and input of the PID controller is as follows: Manual PID parameter tuning is a time-consuming process. Generally, it is tried through the experience and skills of engineers and the intelligent algorithm can complete the parameter tuning in a short time. In order to verify the practicability of ISSA, this paper uses ISSA to optimize PID parameters, simulates under unit step response and sinusoidal input response respectively, and tests with SSA to prove its optimization performance.
In this paper, the objective function [39] is set as follows: e(t) is the error between the input value and the output value. Considering the dynamic characteristics of the iterative process, the integral of its absolute value is adopted; u(t) is the control value, which is added to avoid excessive control range; w 1 and w 2 are weights, and the value range is [0, 1]. In addition, measures shall be taken to prevent overshoot, that is, when overshoot occurs, an additional overshoot item shall be introduced into the objective function. At this time, the settings are as follows: where w 3 is the weight and w 3 ≫ w 1 . Generally, w 1 � 0.999, w 2 � 0.001, w 3 � 100. erefore, the goal of ISSA is to find a set of PID parameters to minimize the error of objective function. In this paper, the number of individuals and the number of iterations of the population are set to be 30 and 50, respectively. Other parameters are consistent with those of Table 2. e test is carried out under the condition of unit leap forward and sinusoidal input respectively and run independently for 10 times.
e test results are shown in Figure 11, and the optimization results are shown in Table 9.
Since the results of 10 independent runs are consistent, only one is shown here. It can be seen from Figure 11 and Table 9 that in the unit step response, ISSA can complete the parameter setting in a very short time, and the convergence Computational Intelligence and Neuroscience  Computational Intelligence and Neuroscience Computational Intelligence and Neuroscience 23  Computational Intelligence and Neuroscience 25  26 Computational Intelligence and Neuroscience speed and accuracy are better than SSA. In the sinusoidal input response, ISSA can almost coincide with rin, and the tracking effect is significant. e tracking effect of SSA is slightly inferior. At the same time, the convergence speed and accuracy of ISSA are slightly better than SSA. e above results verify that ISSA has good algorithm performance, can quickly and accurately complete the PID parameter tuning, and help the system have shorter response time, higher system control accuracy, and better robustness. So far, the practicability has been proved.

Robot Path Planning
In PID parameter tuning, the dimension of the practical application is low. erefore, this paper selects the discrete problem of more complex path planning to further verify the practicability of ISSA and makes a comparative experiment with SSA. In path planning, each sparrow is a feasible path. e environment modeling adopts the grid method, and the obstacles at the equivalent position are calculated according to the grid value. Grid number 0 is defined as feasible area and 1 as obstacle area.

28
Computational Intelligence and Neuroscience In equation (31), j is the j-th dimension of a sparrow. Set each algorithm at 15 × 15, and the best path is shown in Figure 12. In order to eliminate the contingency, each algorithm is tested for 10 times, the optimal value, worst value, average value, and standard deviation of the fitness value of each algorithm are calculated, and these four indexes are used to measure the stability and feasibility of each algorithm. e optimization statistics of each algorithm are shown in Table 10.
It can be seen from the Table 10 and Figure 12, the minimum cost of ISSA planning is 19.7990, while the minimum cost of SSA is 22.6274. It can be seen that ISSA has  Computational Intelligence and Neuroscience 29 strong path planning ability. According to other indicators, it can be seen that the path planned by ISSA has good stability. erefore, ISSA has a good effect in more complex robot path planning and can plan a more stable and safer path.

Conclusions
is paper proposes an improved sparrow search algorithm based on iterative local search strategy, which introduces four strategies: variable helix factor, improved iterative local search, the lens imaging with changing focusing ability, and improved boundary control. ISSA overcomes the shortcomings of poor utilization of current individuals and lack of effective search and effectively improves the problems of falling into local optimal solution and low optimization accuracy. e test function results show that ISSA has good optimization performance and universality. e results of PID parameter tuning and robot path planning show that ISSA algorithm has good practicability. e improved ISSA has good optimization performance, but it also has some shortcomings. For example, it can only find the optimal value in some functions, and other performance indicators are poor and unstable; a certain amount of work is added, resulting in a longer consumption time of the algorithm; and it did not improve the search scope of discoverers. In view of the shortcomings, we still need to do some work in the future: first, how to improve the stability of the algorithm; second, how to improve the search ability of followers; third, how to balance the time and optimization ability of the algorithm; and fourth, how to improve the search ability of discoverers on the basis of discoverers.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.