# Salp Swarm Algorithm Optimized A* Algorithm and Improved B-Spline Interpolation in Path Planning
## 2 Path Planning Algorithm
### Improvement of the A* Algorithm
#### 2.2.2 Optimization Using the SSA  
To determine the weight coefficients \(\omega_{1},\omega_{2},\omega_{3}\), an efficient optimization method is required. The combination of these weight coefficients directly impacts the performance of the heuristic function, and therefore, identifying the optimal solution in a complex parameter space is of critical importance. When selecting an optimization method, we take into account that the optimization problem for the weight coefficients may have multiple local optima. Thus, an algorithm that can effectively prevent being trapped in local optima is required. Moreover, to enhance optimization efficiency, the algorithm should be able to find a near-optimal solution in fewer iterations. Additionally, the algorithm needs to handle nonlinear, multi-modal  
Figure 1: Calculation of obstacle count. optimization problems to accommodate the complexity of the weight coefficients in the heuristic function, and it should be easy to implement and insensitive to initial parameter settings, reducing the complexity of tuning. Based on these requirements, we have chosen the SSA for the optimization of the weight coefficients. The Salp Swarm Algorithm (SSA) [26], proposed by [PERSON] et al. [27] in 2017, is a nature-inspired swarm intelligence algorithm that simulates the foraging behavior of salps (as shown in Figure 2). Salps are marine organisms that search for food through collective cooperation and leader-following behavior. The SSA leverages this behavior to optimize problem solutions. Salps form chain-like swarms in the ocean, and the SSA simulates this behavior by dividing the swarm into leaders and followers. The leader is at the front of the chain and is responsible for guiding the group, while the followers move by following the leader. The SSA simulates the foraging behavior of salp swarms in the ocean, offering strong global search capability and efficiently exploring high-dimensional parameter spaces [28]. Its rapid convergence speed makes it suitable for solving complex optimization problems. Furthermore, the SSA is insensitive to initial parameter settings, simple to implement, and easy to adjust, making it well suited to meet our optimization needs. Next, the SSA is used to determine the weight coefficients \(\omega_{1},\omega_{2},\omega_{3}\). First, we initialize the population using (2) and (3). \[x= \begin{bmatrix}X_{1}^{1}&X_{2}^{1}&\ldots&X_{d}^{1}\\ X_{1}^{2}&X_{2}^{2}&\ldots&X_{d}^{2}\\ \vdots&\vdots&\ddots&\vdots\\ X_{1}^{n}&X_{2}^{n}&\ldots&X_{d}^{n}\end{bmatrix}  \tag{2}\]  
\[X_{j}^{i}=rand*\left(ub_{j}-lb_{j}\right)+lb_{j},i\in\{1,2,\ldots,n\},j\in\{1, 2,\ldots,n\} \tag{3}\]  
\(X\) is an \(n*d\) matrix, with \(n\) representing the population size and \(d\) representing the dimensionality of the problem. The terms \(ub\) and \(lb\) denote the upper and lower bounds of the problem, respectively, while \(rand\) is a randomly generated number between 0 and 1. To enhance the efficiency of the A* algorithm, we define the fitness function as the number of searched nodes, where a lower number of searched nodes indicates a higher fitness score. Each individual's fitness is ranked, with the highest fitness individual designated as the leader and the remaining individuals as followers. Subsequently, both the  
Figure 2: Movement of the salp chain. leader and followers update their positions according to the predefined formulas. The leader's position is updated using (4) and (5). \[X_{j}^{i}= \begin{cases}F_{j}+c_{1}\big{[}(ub_{j}-lb_{j})*c_{2}+lb_{j}\big{]},c_{3} \leq 0.5\\ F_{j}-c_{1}\big{[}(ub_{j}-lb_{j})*c_{2}+lb_{j}\big{]},c_{3}>0.5\end{cases}  \tag{4}\]  
\[c_{1}=2e^{-(\frac{4\pi}{2})^{2}} \tag{5}\]  
The followers update their positions using (6). \[X_{j}^{i}=\frac{1}{2}\Big{(}X_{j}^{i}+X_{j}^{i-1}\Big{)} \tag{6}\]  
After each update, the fitness of each individual is re-evaluated, and the optimization process iterates until a predefined number of iterations is reached or a convergence criterion is met. Finally, the optimal weight parameters are selected.