## 2 Improved Sparrow Search Algorithm and PSO Optimization Algorithm
### Optimization of the Sparrow Search Algorithm
#### 2.2.2 Improvement of the Sparrow Search Algorithm (ISSA)  
Owing to the idea of following the optimal solution throughout the procedure, all particles may converge to the ideal solution more quickly. This non-two-way feedback information flow leads to a single change in the particle's position, so the PSO algorithm tends to cause early convergence late in the repetition. The updated method of the SSA at different positions diversifies the individual displacement, which has the advantages of a good convergence effect, fast speed, and strong robustness, yet when it approaches the global optimum, it will have the disadvantage of decreasing the population diversity. Therefore, in this paper, we considered the following two aspects for the improvement of the sparrow algorithm, to result in a higher performance global search capability and find more meaningful regions in the solution space.  
Dynamic adaptive weights  
All sparrows in the population rely on detectors with initial fitness values to forage, and the amount of food available at each sparrow's present position determines its fitness value. If the location of the detectors is not updated in a timely manner, it is easy for the entire population to fall into a local optimum.  
In this paper, we introduce a dynamic weight factor in the detector update position so that it can supply a higher weight increase in the convergence speed at the start of the iteration and adaptively lower its value at the conclusion of the iteration to accomplish a better local search.  
The following is the weight calculation formula:  
\[\omega=\frac{e^{2(1-t/iter_{\max})}-e^{-2(1-t/iter_{\max})}}{e^{2(1-t/iter_{ \max})}+e^{-2(1-t/iter_{\max})}} \tag{15}\]  
the sparrows' position update formula is as follows:  
\[X_{i,j}^{t+1}=\left\{\begin{aligned} X_{i,j}^{t}+\omega \Big{(}f_{j,l}^{t}-X_{i,j}^{t}\Big{)}\cdot\text{rand},R_{2}<ST\\ X_{i,j}^{t}+Q\cdot L,R_{2}\geqslant ST\end{aligned}\right. \tag{16}\]  
where \(f_{j,l}^{t}\) is the global optimal solution.  
Reverse learning strategy  
This study utilized the reverse learning approach to improve the sparrow algorithm and achieve the inverse solution using the inverse learning mechanism, which increases the search range of the algorithm and improves the fault, whereby the algorithm falls easily into the local region.  
\[X_{best}^{\prime}(t)=ub+r\oplus(lb-X_{best}(t)) \tag{17}\]  
\[X_{i,j}^{i+1}=X_{best}^{\prime}(t)+b_{1}\oplus\big{(}X_{best}(t)-X_{best}^{ \prime}(t)\big{)} \tag{18}\]  
\[b_{1}=(iter_{\max}-t/iter_{\max})^{t} \tag{19}\]  
where \(b_{1}\) is the control parameter; \(X_{best}^{\prime}\) is the inverse solution of the best solution in the \(t\)-th generation.  
The reverse learning strategy improves the sparrow algorithm's global search capabilities. For insurance purposes, it is necessary to determine whether the new position is superior to the prior one, and a greedy rule is introduced after performing the update to decide whether to update the position by comparing the magnitude of the new fitness value with the old fitness value. The greedy rule is as follows:  
\[X_{best}=\left\{\begin{aligned} X_{i,j}^{t+1},f\Big{(}X_{i,j}^{t+1 }\Big{)}<f(X_{best})\\ X_{best}(t),f\Big{(}X_{i,j}^{t+1}\Big{)}\geq f(X_{best})\end{aligned}\right. \tag{20}\]