# 3D Global Path Planning Optimization for Cellular-Connected UAVs under Link Reliability Constraint
## 3 Methodology
### Optimization Algorithms
#### 3.3.3 Pso-Ga  
Although GA has distinct capabilities, such as the cooperative use of different genetic operators (selection, crossover, and mutation), it still suffers from some inherent shortcomings, such as premature convergence, the poor capability of local search, and slow convergence speed. One of the main reasons for such shortcomings is the lack of information flow and collaboration between individuals. The lack of information flow makes GA an inefficient algorithm for solving many optimization problems.  
Meanwhile, the PSO algorithm was developed based on the collaboration between particles to exploit the swarm intelligence. Therefore, to overcome the aforementioned issues, both GA and PSO algorithms can be combined to complement each other, in which the hybrid algorithm could improve the path planning algorithm performance. In addition, the PSO-GA algorithm would more effectively make a tradeoff between exploration and exploitation rate, and enhance the capacity of local search and global search, which consequently minimizes the probability of trapping in local optima and increases the probability of generating stable solutions. Algorithm 3 presents the pseudo-code of the PSO-GA algorithm, and Table 5 lists the simulation parameters for PSO-GA in different scenarios.  
\begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline
**Parameter** & \(n_{pop}\) & \(n_{ii}\) & \(n_{pso}\) & \(n_{ga}\) \\ \hline
**Value** & 50 & 50 & 2 & 1 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Simulation parameters for the PSO-GA algorithm in different scenarios.  
```
1:Input:\(n_{pop}\): Population size; \(n_{var}\): no. of variables; \(n_{ii}\): maximum no. of iterations;
2:\(n_{ga}\): maximum no. of subiterations for GA; \(n_{pvs}\): maximum no. of subiterations for PSO; \(w\): inertia weight; \(c_{1}\), \(c_{2}\): acceleration coefficients; \(p_{c}\): crossover percentage; \(p_{m}\): mutation percentage; \(\xi\): mutation rate; \(\eta\): selection pressure
3:Output: Best solution
4:for\(i=1\): \(n_{pop}\) do (initialize the parameters)
5: Randomly generate \(n\) initial positions \(P_{i}(i=1,2,\ldots,n)\) of \(n_{pop}\) individuals
6: Set \(n\) initial velocities \(V^{i}(i=1,2,\ldots,n)\) of \(n_{pop}\) individuals to 0
7: Calculate the cost value \(c_{i}\) of each individual
8: Set best position, best cost, and best solution of \(i^{th}\) particle
9: Update global best solution, \(\xi_{best}\)
10:endfor
11: Sort populations based on their cost values
12: Set the worst cost \(c_{max}\)
13: Calculate the number of offsprings, \(n_{c}\), using Equation (24)
14: Calculate the number of mutants, \(n_{m}\), using Equation (25)
15:for\(i=1:n_{ii}\) do
16:for\(k=1:n_{pso}\) do
17: PSO algorithm (lines 10-22 of Algorithm 1)
18:endfor
19:for\(k=1:n_{ga}\) do
20: GA algorithm (lines 14-28 of Algorithm 2)
21:endfor
22: Check the feasibility of the solution by checking Equations (9)-(11) = 0
23: Update the best solution ever found
24:endfor
```  
**Algorithm 3** Hybrid PSO-GA algorithm.