## 4 Results and Discussions
### Path Optimization  
To find the minimum traveling path for the aerial data collection on the considered farm, the positions of the deployed sensors were used as the input of the TSP and, in addition, the PSO and EPSO algorithms were utilized to solve the problem. Figure 19a shows the result of the PSO algorithm where a swarm size of 100 was considered during the simulation. As seen from the result, the paths intersect and the algorithm cannot find the global optimum. The weakness of the original PSO algorithm in solving the TSP is that the algorithm soon falls into the trap of local optimum. To further evaluate the performance of the algorithm, several swarm sizes were examined (i.e., 20, 40, 60, 80, and 100), and the maximum number of iterations was set to 1250. Figure 19b shows that even by changing the swarm size, the algorithm cannot converge to the best cost function and even when increasing the swarm size to 100, the cost function increases and becomes worse. The main reason for this behavior is that the initial answers of evolutionary algorithms are reached randomly and, because of the complexity of the TSP, especially when the number of nodes increases, the particles mainly exploit their local optimum neighborhood, instead of exploring the entire search space and finding the global optimum. To solve the challenge, the idea of mutation from the GA was used and applied to the TSP. Therefore, in each iteration, the EPSO algorithm generates some random new solutions for both personal and global cases, resulting in a higher exploration rate. Figure 20a shows the optimal flight path without any intersection, and Figure 20b presents the performance of the ESPO algorithm when the size of the swarm changes. As can be seen from the results, regardless of the swarm size, the algorithm converges to the best minimum cost function. By comparing the results of Figures 19b and 20b, EPSO can reduce the cost function by 35% compared to PSO. In other words, the EPSO algorithm was able to reduce the total length of the route from 79 km to 49 km. Industrial farming drones usually follow a series of predefined routes in their flight mission planner software to sweep the entire farm, e.g., zigzag, square, and circular routing patterns. To justify the need for path planning optimization in large-scale drone-based data collection, the Ardupilot(r) mission planner was used and the flight path was planned in square and circular modes. Figure 21a,b shows circular and square path planning, respectively, and Figure 21c depicts the optimized drone path for the considered farm. Furthermore, to ensure that the drone can reliably collect data from all the ENs, the distance  
Figure 19: (**a**) The optimal flight path calculated by the PSO algorithm and (**b**) the performance of the PSO algorithm under different sizes of the swarm. between adjacent routes was set to 500 m. According to the results, the circular and square paths' total length was about 175 km and 212 km, respectively. Figure 21: (**a**) Circular model path planning, (**b**) square model path planning, and (**c**) optimized path planning. Figure 20: (**a**) The optimal flight path calculated by the enhanced PSO algorithm and (**b**) the performance of the EPSO algorithm under different sizes of the swarm. Table 6 compares the performance of the developed system under different flight mission modes. In the calculation, a maximum flight time of 60 min is assumed, following the specifications of the utilized drone and the small industrial VTOL drones [71]. According to the results, by optimizing the flight path, the same mission can be performed in a much shorter distance (49 km) and a shorter time (40 min), without stopping to replace or charge the battery. This result suggested that EPSO-based flight mission planning will create an optimal path for a VTOL drone operated with LoRaWAN(r) to collect data from a large-scale rural livestock farm. The demand of the modern agricultural and livestock industries for utilizing recent advanced technologies is rapidly growing.