# Research and Application of an Improved Sparrow Search Algorithm
## 3 Methods
### Adaptive Weibull Distributed Sparrow Search Algorithm  
#### 3.2.1 Adaptive Weibull Distribution Strategy  
The original SSA utilizes normal distribution to update the population position, but this does not take into consideration that the sparrow population's individuals in various iteration stages of the algorithm need to leap out of the present location of the varied requirements. In order to further enhance the optimization abilities of the sparrow search algorithm, this study brings forth a form of adaptive Weibull distribution [31] variation to increase the chance of the program leaping out of the local optimum. The Weibull distribution probability density function is as follows:  
\[f(x;\lambda,k)=\begin{cases}\frac{k}{\lambda}\left(\frac{x}{\lambda}\right)^{k -1}e^{-\left(x/\lambda\right)k}&x\geq 0\\ 0&x<0\end{cases} \tag{4}\]  
where \(x\) is the value of the random variable, \(\lambda\) is the scale parameter, and \(k\) is the shape parameter. Figure 1 illustrates the probability density function picture of the Weibull distribution, from which it can be observed that the distribution is exponential when \(k\) is equal to 1, and the distribution is right-skewed when \(k\) is more than 1.  
Sparrow populations exhibit different behavioral traits during different predation processes, so this study aims to make the sparrow search algorithm a better balance between exploration and exploitation. Specifically, we anticipate that the algorithm favors a vast search space in the early iterations, which has greater potential to leap out of the local optimum solution and enhance the likelihood of discovering a superior solution. In the latter rounds, it tends to be more towards a steady development state in order to converge to the ideal solution quicker. Based on this goal, in this research, we leveraged the Weibull distribution feature, as given in Equation (5), to develop a new shape parameter called a mutation factor, with the number of iterations \(t\) as the independent variable and \(k\) as the dependent variable. In the early stages of the method, the value of \(k\) is small, and the random variable value \(x\) produced by Weibull has a wider range interval. And when the iteration goes to a later stage, the value of \(k\) steadily grows, the peak of the Weibull distribution gets steeper, and the variability subsequently reduces, meaning that the values of the random variable will be more centrally distributed around \(\lambda\). Therefore, the variability factor we construct allows the algorithm to have a greater chance to enter the exploration state in the early iterations, and as the iteration proceeds to the later stages, the variability factor allows the sparrow individuals to develop near the optimal solution, thus accelerating the algorithm's convergence.  
\[k=1+\frac{5\cdot t}{\text{iter}_{\text{max}}} \tag{5}\]  
The formula for updating the strategy by applying the adaptive Weibull distribution strategy is shown in Equations (9)-(11), where \(W\) is the random Weibull number, the value generated by the distribution, and \(\sigma\) is a random value of \(-1\) or \(1\), used to change the search direction.