## 5 Case Study and Algorithm Validation
### Effects of Swarm Sizes
It is even larger than that of standard BAS when the swarm size is set as 80 and 90, respectively. That is because the overall global optimum solutions are obtained by sacrificing the turning angles when the path is generated using the proposed BSO method. In some situations, the priority of the effective factors should be higher than the turning angles within the limitations of the UAVs themselves, such as the path risk, path length, and path smoothness. If the turning angles are on an accepted level, it will be alright for the UAVs to follow. Figure 10 shows the effects of different swarm sizes on the path length. It is obvious that the path length of the proposed BSO is the shortest, no matter how many individuals there are in a swarm. Meanwhile, the rate of convergence is the fastest of all, which further proves that the global best solutions could be found within 30 iterations in all kinds of conditions compared with algorithms. As shown in Figure 10, when the swarm size is larger than 20, PSO works better than standard BAS. If there are fewer individuals in a swarm, for example, the swarm size is 10, the path generated by standard BAS is better with a shorter flying distance after the 75 th iteration. GA and FA are worse than the other three. For FA, it will fall into the local optimum quickly when it starts, which leads to the path length staying the same with no changes. It also proves that FA could only provide one flying path when it runs, which may not be the best. Oppositely, for GA, there are a lot of drastic fluctuations in the UAV  
Figure 9: Effects of swarm sizes on turning angles. path length in the optimization process. This is because the GA algorithm is always trying to locate the optimum solutions, but it ultimately fails. The biggest difference in the path length of the five algorithms appears in Figure 9(a). Based on the data provided in Figure 10, we can see that when the swarm size is set as 10, the proposed BSO method is 27.75%, 66.51%, 64.31%, and 23.20% better than PSO, GA, FA, and standard BAS, respectively. The overall cost of a generated UAV path, including the ground risk, turning angles, and path lengths, is shown in Figure 11. From the figures, we can see that the path cost of the proposed BSO method is the lowest under all kinds of swarm size settings. It converges quickly and locates the global optimum solutions within 20 iterations. After that, it becomes the smoothest of the five. Combined with Figure 9, it can be concluded that the proposed BSO algorithm obtains a UAV path with the lowest overall cost by sacrificing the larger turning angles, which is satisfied with the UAV's performance limitations. PSO performs similarly to the proposed BSO method. However, its rate of convergence is much lower, and as a result, more iterations are needed. The path cost of PSO is higher than that of the proposed BSO method under all the conditions of different swarm sizes. The biggest difference is as much as 27.74% when the swarm size is set as 10. From Figure 11, for standard BAS, at the beginning of a few iterations, there are a lot of fluctuations, and it becomes much smoother after 40 iterations, regardless of the swarm sizes. It is because only one beetle in standard BAS could not determine the optimum search directions because of the lack of global information. In this way, more iterations are needed. When the number of individuals in the swarm is 10, the overall path cost of standard BAS is better than that of PSO after 75 iterations, which is improved by 5.92%. It means that PSO is highly affected by the swarm size and can only work well with more  
Figure 10: Effects of swarm sizes on path length. individuals. Based on the given path cost, GA still cannot locate the global best waypoints. It always fluctuates from position to position. GA would have a strong randomness, which makes it hard to plan an optimal flying path for the UAVs. Similarly, FA easily falls into the local optimum at the beginning and until the end.