The UAV Path Coverage Algorithm Based on the Greedy Strategy and Ant Colony Optimization

: Today, the development of unmanned aerial vehicles (UAVs) has attracted signiﬁcant attention in both civil and military ﬁelds due to their ﬂight ﬂexibility in complex and dangerous environments. However, due to energy constraints, UAVs can only ﬁnish a few tasks in a limited time. The problem of ﬁnding the best ﬂight path while balancing the task completion time and the coverage rate needs to be resolved urgently. Therefore, this paper proposes a UAV path coverage algorithm base on the greedy strategy and ant colony optimization. Firstly, this paper introduces a secondary advantage judgment and optimizes it using an ant colony optimization algorithm to reach the goal of minimum time and maximum coverage. Simulations are performed for different numbers of mission points and UAVs, respectively. The results illustrate that the proposed algorithm achieves a 2.8% reduction in task completion time while achieving a 4.4% improvement in coverage rate compared to several previous works.


Introduction
Nowadays, Unmanned Aerial Vehicle (UAV) technologies are rapidly developing and gaining attention from countries worldwide due to their faster moving speed and wider deployment range, mainly due to freedom to move. With these advantages, UAVs have a wide range of applications in military and civilian use, such as reconnaissance [1], surveillance [2], cargo delivery [3], natural disaster prevention or rescue [4,5], etc. Unlike crewed vehicles, UAVs can take humans out of dull, dirty, dangerous missions. The UAV usually works unsupervised, which requires them to choose the best collision-free coverage path from the start to the destination.
For example, suppose a UAV needs to patrol and monitor a complex area. In that case, the UAV will fly from the base to the location of a possible disaster to collect in-formation and eventually return to the base and generate an early warning situational map of the area. Although UAVs can effectively reduce costs and increase flexibility in large-area surveillance work, it also leads to serious path planning and mission assign-ment problems. In some cases, the flight time is irrelevant to the importance of the mis-sion point. UAVs sometimes have to fly very long times to important mission points. Failure to balance these two aspects will seriously undermine the effectiveness of the work in the mission area [6]. Meanwhile, the inefficient use or waste of energy can also seriously affect the efficiency of UAVs.
Therefore, it is challenging to design path planning algorithms in energy constraints conditions. This challenge also requires flight time and important mission point coordination. In this paper, the problem is considered the minimum time and maximum cov-erage (MTMC) problem, where a group of UAVs is dispatched to effectively patrol tar-gets in a large-scale surveillance area to achieve the maximum coverage in the minimum mission time [7]. The importance of the mission points is quantified as the weight values. The MTMC problem is NP-hard because it is an extension of the well-known Traveling Salesman Problem. No efficient algorithm has been found for this problem, and only its practical approximate optimum can be obtained.
The details of the contribution of this paper can be summarized as follows.
(1) Optimize the greedy algorithm using secondary advantage mechanism to balance the flight time and the importance of mission points. (2) Optimize the flight path using the ant colony algorithm to reduce the UAV flight time.
The rest of this paper is organized as follows. The related work of the paper is shown in Section 2. The system model and the details of the path planning algorithm are pre-sented in Section 3. The simulation results of the algorithm in this paper are given in Section 4. The conclusion and the prospect of future work are presented in Section 5.

Related Work
The path planning is essential to improving the efficiency of UAVs in performing reconnaissance, surveillance, search, and other tasks while moving through the mission area [8]. Meanwhile, the path planning techniques are classified into two categories, global path planning and local path planning, based on the available workspace information.
Recently, more researchers have optimized the global path planning algorithms. In [17], Chenguang Liu et al. study a path planning problem using an improved A* algorithm. The objective is to improve the economy of the planned paths while maximizing mobility constraints. It should be noted that A* may find invalid paths due to the grid [18]. In [19], Sheng Gao et al. introduce a negative feedback mechanism into the ant colony optimization algorithm. In [20], Chen et al. use an adaptive parameter S to modify the probability of crossover and variation during the genetic operation. The methods in [18,19] both make the algorithm converge faster to a certain extent. Since biological heuristics occupy a large amount of calculative space, such as the GA, the algorithm's convergence speed is influenced by the initial path. A bad initial path will cost a longer computation time. In [21], Pehlivanoglu et al. optimize the initial population in the genetic algorithm by the ant colony optimization algorithm to accelerate the convergence of the whole algorithm. In [22], Chengzhi Qu et al. optimize the grey wolf algorithm using a symbiotic biological search algorithm. To deal with the bat algorithm shortcoming that tends to fall into local optima, Xianjin Zhou et al. [23] optimize the bat algorithm using an artificial bee colony algorithm to improve the local search ability of the bat algorithm in a 3D environment.
Secondly, the local path planning or the online planning are referred to the research models in which the environmental information is completely unknown or partially known. The local planning algorithms usually include Artificial Potential Field (APF) method [24] and Dynamic Window Approach (DWA) [25], etc.
Recently, the local path planning has been continuously optimized by researchers [26]. Among them, the artificial potential field (APF) method has been widely used in UAV local path planning for its simplicity, efficiency, and path smoothing advantages. In [27], Song Jia et al. used the method of potential field prediction to solve the drawback that APFs easily fall into the local optima problem. With learning-based methods are widely used [28]. In [29][30][31], methods such as YOLOv4-CSP, Q-learning and Deep Reinforcement Learning are used to improve the speed and accuracy of the algorithms. However, the algorithm cannot resolve whether the flight path follows the original global path planning method or performs local path planning first and then replans.
Perferct global path planning is particularly important for long-range navigation in large-scale mission areas due to the battery life limitation. In the application scenario of this paper, the task completion time and coverage rate are the key performance indicators [7,32].
In [33], Cho et al. propose a grid-based area decomposition method that uses UAVs to quickly search for survivors during maritime search and rescue operations. This method is good at reducing the task completion time. In [34], Somaye Ahmadi proposes a genetic path planning algorithm with adaptive operator selection considering time constraints and path feasibility. The method achieves a maximum coverage of the specified area considering the limited duration. In [35], Rik Bähnemann et al. consider the generalized traveler problem for low-altitude terrain coverage in a known environment and propose an exact metacell decomposition method that shortens the travel time. In [36], Cabreira et al. propose an energy-aware grid-based CPP algorithm for planning coverage paths for irregularly shaped target regions. In [37], Iago Z. Biundini et al. propose a metaheuristic algorithm based on point cloud data for inspecting and generating structures of slopes and dams using UAVs, which can better generate the corresponding 3D stereo maps. All of the works are scanning coverage of the whole target area.
However, the above works are point-by-point scanning type coveraging of the whole target area. The research problem in this paper is focused on a large area of dispersed distribution targets, not on the whole region Therefore, the above studies are algorithms that are not directly applicable to the scenarios in this paper.
To solve the above problem, Xiaofeng Gao et al. use Kruskal [38] algorithm and Christofides [39] algorithm to generate Eulerian cycles and uses a greedy strategy to obtain the whole path [40]. However, when the number of mission points exceeds a certain level, the memory usage and time consumption of the algorithm increase significantly. Jing Li et al. propose the Weighted Targets Sweep Coverage algorithm (WTSC) [7] to balance the priority problems of task time and task weight and finally achieve coverage. In situations where real-time data feedback is required, Chuang Liu et al. plan in a decreasing order of time to ensure the validity of the information [41]. However, the task completion time and coverage of the above algorithm need to be improved. Therefore, we propose the PCBGA algorithm to achieve the goals of reducing task completion time and improving task coverage at the same time.
The relative comparison of the existing algorithms of UAVs' path planning is shown in Table 1. Table 1. Relative comparison of the existing path planning algorithms.

Reference
Global Path Planning Local Path Planning 1 2 3 Paden et al.

Environmental Model
In Figure 1, there are N mission points randomly distributed in a 50 km × 50 km working area [7]. Each point is assigned a weight value based on its importance. Suppose M UAVs are deployed, and they will fly according to a planned path, collecting information such as pictures and videos taken at the mission point during the flight. Eventually, the UAVs returned to the starting point, and the data collection mission finished. During a mission: Each mission point is captured at most once during a mission. The time for mission completion is as follows: the timing starts from the first UAV taking off and ends when the last UAV returns. The main parameters in this paper are listed in Table 2.  Table 2. Main parameters of this paper.

Definition Symbol
The distance between mission points i and j. d ij UAV turning angle at mission point j.
θ ijP The linear speed of UAV.
V The angular velocity of the UAV. ω The flying time between mission points i and j T ij The endurance time of UAV.
T max The time consumed to return to base from point j.
T back Determining whether a UAV has exceeded its service life.
T judge The flying time of the k-th UAV.
T k Task completion time.
T done The cost between mission points i and j COST ij The weight of mission point.
W Weight of task coverage.
W t Weight of the total area. W total Coverage rate.
µ The probability of an ant choosing a path. P g ij The pheromone concentration between mission points i and j. τ ij The reciprocal of the distance between mission points i and j.
η ij The secondary advantage point in the COST set.
In practical scenarios, the consumption time of turning the UAV also can not be ignored. As shown in Figure 2, when the UAV moves from mission point j to the next P, the flight direction changes from → ij to → jP after turning by a certain angle. Therefore, the turning angle of the UAV θ ijP is defined as the angle between two vectors.
It should be pointed out that the turning angle θ ijP ranges from 0 to π. When the mission points i, j and P are in the same line, and the flight direction of the UAV has not changed, the turning angle θ ijP is 0. On the contrary, the turning angle θ ijP is π.
Definition 3 (Flight time, T ij ). Flight time refers to the time it costs for the UAV to take flight between two mission points. Assume that the UAV departs from mission point i and that the velocity is a deterministic constant. As shown in Figure 2, the flight time T ij for the UAV to travel from the current point j to the point P can be obtained by: where V and ω represent the straight-line speed and turning speed of the UAV. It is worth noting that each time a new mission point P is selected, it is necessary to predict whether there will be enough time to spend on returning to the base after reaching mission point P. Because only carrying enough energy can ensure the safety of the UAV's flight. Therefore, it is required to calculate the estimated flight time T back from mission point P back to the base.
where P 0 represents the base. It should be noted that the value T back is only to assist the algorithm in determining whether the remaining energy of the UAV is sufficient to support its return to the base.
Definition 4 (Cost function [7], COST). When the UAV selects a new mission point, it needs to calculate the energy cost function to reach this mission point.
where W j is the weight of mission point j. ε is a constant in the range (0, 1), and it is used to balance the degree of influence of the weight and the flight time on the algorithm Definition 5 (Total flight time, T k ). When the path of the k-th UAV is known, the total flight time T k of the k-th UAV can be calculated by where P k jP indicates whether there is a path from mission point j to mission point P in the path of the k-th UAV, and if the path exists, Q k jP = 1, otherwise Q k jP = 0.
Definition 6 (Path weight, W k ). The importance of different mission points corresponds to different weights. Path weight refers to the sum of the weights of the mission points covered by the k-th UAV. The path weights W k can be obtained by calculating where W i represents the weight of the mission point i. X k i represents whether mission point i is covered by the k-th UAV. If the point is covered, X k i = 1, otherwise X k i = 0.
Definition 7 (Task completion time, T done ). In UAV path planning missions, task completion time and coverage rate are important metrics. The task completion time is the duration when the last UAV returns to the base. That is, the maximum value of the flight time is T done .
Definition 8 (Task weight, W t ). When the paths of these k drones are known, the covered mission points can be counted. Therefore, the mission coverage weights W t can be obtained by calculating the sum of the weights of these mission points.
Definition 9 (Path weight, µ). The coverage rate µ is obtained by calculating the ratio of W total to the task coverage weights W t .
where W total is the sum of the weights of all mission points in the mission area.
Definition 10 (Ant Colony Optimization [43] ACO). Ants secrete pheromones on their way to a mission point to obtain food, and the concentration of this pheromone can be sensed by the ants to each other. Therefore, the pheromone concentration can indicate the path distance, and the higher the density, the shorter the path length. In each iteration, the algorithm will retain the path with the highest concentration parameter. The algorithm selects the shortest path through iteration by combining group perception and a positive feedback mechanism.
where P g ij represents the probability that the g-th ant selects to travel from mission point i to mission point j; τ ij (t) represents the pheromone concentration between mission points i and j at the t-th iteration; η ij (t) is the heuristic function whose value is the reciprocal of the distance between mission points i and j; α and β represent the pheromone concentration and the heuristic function factor, respectively; allow k represents the set of mission points which have not been visited yet. In particular, each iteration updates the pheromone concentration on the path with the following: where ∆τ g ij represents the pheromone concentration secreted by the g-th ant between the mission points i and j; ∆τ ij represents the sum of the pheromone concentrations secreted by the total g ants between the mission points i and j. It should be pointed out that ρ is the volatilization factor and takes a range from 0 to 1. The reason is that the pheromone secreted by the ants is continuously volatilized into the air with iterations.

PCBGA Algorithm
In previous studies [7,40,41], they were calculated to get the new path point through which the UAV passed. However, when the remaining energy of the UAV does not support it to return to the base after reaching the next optimal point, the previous algorithm will decide that the UAV returns to the base directly from the current point. The above methods will lead to the energy of the UAV cannot being fully utilized.
Therefore, this paper introduces the secondary advantage point, which will be activated when the UAV encounters the content described in the previous paragraph. Then, the method will calculate the energy consumed to reach the secondary advantage point and re-evaluate whether the remaining energy is enough to support the UAV back to the base.
Definition 11 (secondary advantage point, sa). When the mechanism of calculating secondary advantage points is activated, the energy already consumed by the UAV when it reaches the sa can be calculated by where ∑ N j=0 T j denotes the time already consumed by the UAV to reach mission point j. T jsa calculates the flight time from the current mission point j to sa, where sa refers to the second mission point in the COST set. It is important to point out that when T sa +T back ≤ T max , the UAV will move to sa. On the contrary, the algorithm will continue to evaluate the third smallest mission point in the COST set and so on. The UAV will return to the base if all the mission points in the COST set fail to satisfy the condition.

Algorithm Description
The details of the PCBGA algorithm are shown in Algorithm 1. First, a set of mission points P and a set of UAVs U are randomly deployed on an area, and the weight set W represent the importance mission point according to the map, as in Figure 1. Set all the UAVs to take off at the initial location of the base P 0 and start flying to each mission point. In Step 1, the parameters are initialized. In Step 2, the Euclidean distance between each mission point in the task area is calculated. From step 3 to step 21, the mission points are added to the path of each UAV. In steps 6 to 7, the algorithm calculates the COST set and selects the smallest value. When the flight duration exceeds the UAV endurance time, the algorithm executes the judgment mechanism of the secondary advantage in steps 9 to 12. The set of mission points P = P 1 , P 2 , · · · , P j , · · · , P N is the points that need to be collected for information. In steps 13 to 15, if the mission time of point j is less than the UAV endurance time (T judge ≤ T max ), point j is added to the UAV path L k . Meanwhile, point j will be removed from the mission points set P, P = {P 1 , P 2 , · · · , P N }. This method avoids the same point being selected repeatedly. In steps 17 to 20, the algorithm optimizes the path of the UAV using the ACO algorithm. If the new total flight time T ACO is shorter than before, the optimization of the ant colony optimization algorithm is proved successful. The path of the k-th UAV will be updated; otherwise, the original path will not be changed. After the above steps are executed, the algorithm is rerun, and the remaining mission points are assigned to the next UAV until all UAVs return to the base. Therefore, the algorithm first uses the greedy strategy to plan the initial flight path of the UAV. When the greedy strategy determine whether the UAV needs to return to the base because of lack of energy, the suboptimal mechanism will be activated. After conducting path planning, the ant colony optimization algorithm is then used to find the optimal visiting order of the mission points that have been selected. Ultimately, the algorithm plans an efficient flight path for each UAV. In Step 1, the parameters are initialized. In Step 2, the Euclidean distance between each mission point in the task area is calculated. From step 3 to step 21, the mission points are added to the path of each UAV. In steps 6 to 7, the algorithm calculates the COST set and selects the smallest value. When the flight duration exceeds the UAV endurance time, the algorithm executes the judgment mechanism of the secondary advantage in steps 9 to 12. The set of mission points P = {P 1 ,P 2 ,⋯,P j ,⋯,P N } is the points that need to be collected for information. In steps 13 to 15, if the mission time of point j is less than the UAV endurance time (T judge ≤ T max ), point j is added to the UAV path L k . Meanwhile, point j will be removed from the mission points set P, P = {P 1 ,P 2 ,⋯,P N }. This method avoids the same point being selected repeatedly. In steps 17 to 20, the algorithm optimizes the path of the UAV using the ACO algorithm. If the new total flight time T ACO is shorter than before, the optimization of the ant colony optimization algorithm is proved successful. The path of the k-th UAV will be updated; otherwise, the original path will not be changed. After the above steps are executed, the algorithm is rerun, and the remaining mission points are assigned to the next UAV until all UAVs return to the base. Therefore, the algorithm first uses the greedy strategy to plan the initial flight path of the UAV. When the greedy strategy determine whether the UAV needs to return to the base because of lack of energy, the suboptimal mechanism will be activated. After conducting path planning, the ant colony optimization algorithm is then used to find the optimal visiting order of the mission points that have been selected. Ultimately, the algorithm plans an efficient flight path for each UAV.

Simulation
The coverage performance of this algorithm is evaluated through simulation experiments. Specifically, it is evaluated by two aspects: task completion time and coverage rate. To demonstrate the superiority of the algorithm, we also use the WTSC algorithm [7] and the G-MSCR algorithm [41] as the contrast. It is important to note that the UAV collects data when it passes the mission point and does hover above it. All simulations in this chapter are performed in MATLAB, and the simulation experiments and detailed results are shown below.

Simulation Model
The main parameters [7] in the simulation experiment are shown in Table 3. The number of mission points is between 50 and 400. It should be pointed out that the mission points are obtained from locations in the monitored area where the heat value is higher than 0, as shown in Figure 3a. The heat value of an area indicates the probability of a disaster occurring in that area and expresses the heat value as the weight of the mission point in that area. The camera carried by the UAV has a coverage range of 1.5 km 2 at an altitude of 1 km.

PCBGA Algorithm for Path Planning on Heat Map
The experiment verifies the planning capability of the PCBGA algorithm on the heat map of the mission area. Refer to Table 2 for the environment and simulation data settings. It should be pointed out that the number M of UAVs is fixed at 5, and the number of mission points N is fixed at 100. The experimental result is shown in Figure 3b.
In Figure 3b, the black square indicates the base, the white circles indicate the mission points, and the white straight lines are the flight paths of the UAVs. The PCBGA algorithm works out the flight paths of the UAVs. The mission points in critical areas are largely covered, while less important points are not. The coverage rate is 92.13%, and the mission completion time is 87.98 min.   In Figure 4, the x-axis represents the number of mission points, and the y-axis represents the task completion time. It is clear from the figure that when the number of the mission points is 50, the task completion times of the PCBGA algorithm, the WTSC algorithm, and the G-MSCR algorithm are 85.77, 88.31, and 88.17 min, respectively. PCBGA algorithm takes the shortest time. The analysis shows that with the increase in the number of mission points, the task completion time of the three algorithms keeps increasing slowly. However, the task completion time of the PCBGA algorithm is always the fastest. Its task completion time is about 2.8% shorter than the other two algorithms. That is, the PCBGA algorithm performs better in the task completion time.

Performance Comparison of the Three Algorithms
In Figure 5, the x-axis represents the number of mission points, and the y-axis represents the coverage rate. When the number of mission points N is 50, the task coverage rate of the PCBGA algorithm and WTSC algorithm is 99.5%, and the algorithm coverage rate of G-MSCR is 98.4%. With the increase of mission points, the task coverage of the three algorithms decreases to a certain extent. The reason is that the endurance time of a single UAV is limited. When the number of mission points exceeds a certain value, the flight time of the UAV reaches the upper limit. As the number of mission points continues to increase, more mission point coverage will not be completed. Nevertheless, regardless of the change in the number of mission points, the task coverage of the PCBGA algorithm is still the largest. It is worth noting that compared with the WTSC algorithm and the G-MSCR algorithm, our algorithm achieves a maximum improvement of 4.4% and 57.3% in task coverage, respectively.

Comparison with Different Number of UAVs
In this case, the number of mission points N is fixed at 200, and the number of UAVs M is increased from 3 to 10. The simulation results are shown in Figures 6 and 7.  In Figure 6, the results show that when the number of mission points is 200, and the number of UAVs is 3, the task completion times for the WTSC algorithm and the G-MSCR algorithm are 89 min and 89.2 min, respectively. However, the task completion time by the PCBGA algorithm is 88 min, which is the shortest one. With the number of UAVs changing, all three algorithms remain stable regarding task completion time. This phenomenon occurs because the task completion time is defined by when the last UAV returns to the base. Meanwhile, the algorithm proposed in this paper plans the UAVs flight paths according to the takeoff sequence. In this case, the change in task completion time will remain stable when the number of UAVs increases. Nevertheless, the PCBGA algorithm is still the fastest among the three algorithms.
In Figure 7, when the number of mission points is fixed at 200 and the number of UAVs is 3, the coverage rates of PCBGA, WTSC, and G-MSCR algorithms are 0.3, 0.4, and 0.43, respectively. As the number of UAVs changes, the coverage rate of the three algorithms keeps increasing. The reason for this phenomenon is that more UAVs are involved during the work. When the number of UAVs is 10, the coverage rate of the PCBGA and WTSC algorithms is 100%. It should be pointed out that the PCBGA algorithm always maintains the highest task coverage. Therefore, it can be seen that the PCBGA algorithm is superior to the other two algorithms. The above conclusions express that the PCBGA can effectively design the path of the UAV, improving the mission coverage while shortening the mission time.

Conclusions
In order to achieve efficient UAV flights planning and ensure surveillance operations in hazardous areas. The problem of concern in this paper is the inability of UAVs to balance mission completion time and coverage in large areas due to energy limitations. The proposed algorithm will seek solutions to obtain maximum coverage benefits with minimum time costs. First, the algorithm introduces a second advantage mechanism to optimize the greedy goal assignment strategy to coordinate the flight time between task points and the importance of task points to obtain the initial path. Secondly, the above initial path is continuously iterated using the positive feedback mechanism of ant colony optimization, this method optimizes the order in which these points are accessed. Finally, the proposed algorithm is compared with the WTSC and G-MSCR algorithms. The results of the experiments show that the proposed algorithm has better stability, and the objective of a higher coverage rate in a shorter time is achieved.
The real shape of the obstacles can affect the flight of the UAV to some degree. Path planning technology for UAVs needs to have online planning capability, shorter computation time, and better robustness. In the future, the authors intend to use a combination of deep learning methods and ant colony optimization to further improve the algorithm in this paper.

Conflicts of Interest:
The authors declare no conflict of interest.