MULTI-UAV Task Allocation Based on Improved Genetic Algorithm

The path length of multiple unmanned aerial vehicle (multi-UAV) has a certain impact on the task allocation of multi-UAV. In order to improve the efficiency of multi-UAV and reduce the loss of multi-UAV during the process of performing tasks, this paper takes the path length as one of the influencing factors of the evaluation function. The UAV path length, UAV performance, and task characteristics are taken as the influencing factors of multi-UAV task allocation evaluation function. In addition, in order to improve the efficiency of genetic algorithm (GA) in solving multi-UAV task allocation problem, this paper proposes a fusion genetic algorithm based on improved simulated annealing (ISAFGA). In order to improve the population diversity of GA, the second selection operation of GA is carried out and the improved simulated annealing algorithm (SA) is used in the second selection operation. The threshold is set to improve the acceptance criteria of new solutions in SA, and then the promotion of secondary selection operation on population diversity is improved. The simulation results showed that the improved algorithm could improve the diversity of the population and improve the global search ability, and verified the effectiveness of the improved algorithm.


I. INTRODUCTION
With the development of science and technology, unmanned aerial vehicle (UAV) has the advantages of convenience, quickness, and small size. Therefore, UAV can be applied in many aspects, such as monitoring, search and rescue, reconnaissance [1], and attack [2]. However, due to the limited ability of UAV itself, it is difficult to complete large-scale combat tasks. Multi-UAV has the overall combat capability [3], which is an important way to solve the problem of large-scale combat tasks.
Multi UAV task allocation belongs to NP-hard combinatorial optimization problem [4]. This problem is mainly considered from the construction of problem model and the solution of model [5]. In order to solve this problem, scholars have proposed mixed integer linear programming (MILP) [6], simulated annealing (SA) [7], particle The associate editor coordinating the review of this manuscript and approving it for publication was Chih-Yu Hsu . swarm optimization (PSO) [8], genetic algorithm (GA) [9], and so on. The traditional deterministic search algorithm can obtain the local optimal solution for the low dimensional problem, but when the complexity of the problem and the amount of calculation increase, the traditional deterministic search algorithm can no longer effectively find the feasible solution of the problem [10]. The feasible solution can be obtained by using random operation and heuristic algorithm. As a heuristic algorithm, GA has been applied to task allocation [11]. Reference [12] shows the path cost and task cost were used as the penalty term to modify the objective function, and the gene coding method of GA was improved according to the physical meaning. Reference [13] shows A * algorithm was used to predict the path between tasks. Reference [14] shows the improved SA algorithm was introduced into discrete PSO, which solved the problem that discrete PSO was easy to fall into local minimum. Reference [15] proposed an improved genetic simulated annealing algorithm. Because the SA has strong local search ability, it can improve VOLUME 9, 2021 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ the search ability of GA by using SA, and then solve the problem that GA is prone to local optimization [15]. In the background of reconnaissance, attack, and evaluation tasks, reference [16] modeled the task allocation problem. When solving the problem, improved GA with multi type gene coding was used to prevent deadlock. According to the task allocation problem in reference [17], the task was divided into three layers. The first layer established the task allocation model, the second layer established the path planning of UAV, and the third layer optimized the path under constraint conditions. Reference [18] shows that a double chromosome multi mutation GA was proposed to solve the problem of large-scale reconnaissance task allocation. Different from the above reference, in order to improve the efficiency of solving the multi-UAV task allocation sequence, this paper proposes an improved simulated annealing fusion genetic algorithm (ISAFGA) for multi-UAV task allocation. In this paper, by improving the acceptance criteria of the new solution in SA, we change the way that the algorithm jumps out of the local optimal solution and set a threshold to accept the new solution to improve the efficiency of the algorithm. At the same time, the sequence of UAV tasks is represented by coding and the selection operation of GA is improved to double selection operation. After the mutation operation, the selection operation is performed again, which combines the improved SA to increase the diversity of individuals and improve the efficiency of the algorithm to get the task allocation order.
The rest of paper is organized as follows. Section II introduces the basic model. In section III, we introduce the construction of fitness function. Section IV explains the algorithm used in this paper. Section V illustrates the performance and advantages of the method through simulation and comparison. Section VI concludes this paper.

II. BASIC MODEL
In the process of task allocation for multi-UAV, in order to make multi-UAV complete reconnaissance and attack tasks reasonably, effectively, and safely, the performance of multi-UAV and the characteristics of tasks are specifically understood. At the same time, different allocation order will have a certain impact on the income [19] and risk [20] of UAV. When UAV carries out tasks, it is necessary to ensure that UAV can perform the tasks safely. At the same time, choosing a shorter flight path is conducive to improving the income of UAV and reducing the loss of fuel.

A. PATH LENGTH
In order to reduce the fuel consumption and increase the income of multi-UAV, the path length of multi-UAV is taken as one of the factors that affect the task allocation. In the whole process of executing the task, in order to reduce the time for the algorithm to get the task allocation order, the off-line mode is used to calculate the multi-UAV path length. The path length is obtained by A * algorithm [21]. As shown in Fig.1, Path planning and task allocation are  divided into two series modules, and the output of path planning is used as the input of task assignment. At the same time, UAV should fly back to the starting point after completing the task of detecting and attacking enemy camp.
In the task allocation of multi-UAV, UAV's performance should be considered, so that UAV can better match the appropriate task to execute. At the same time, we need to consider the characteristics of the task. The length of flight distance affects the gains when UAV perform tasks. When multi-UAV fly for a long distance, they will consume more energy. At the same time, there are many unknown interference problems when UAV perform long-distance tasks. Shortening the path length of UAV will reduce the energy loss and the possibility of encountering unknown risks [22]. In this paper, targets are set in three different directions, as shown in Fig.2. UAV's task is to detect and attack the three targets. Table 1 shows the distance from the UAV to each task and between tasks, and the distance is worked out by A * algorithm. Figure 3 shows the paths of UAV to three tasks obtained by A * algorithm.
The UAV's path is represented by matrix, as in (1).    where i (i = 1, . . . , 5) is the starting point of each path segment during the execution of the task. j (j = 1, . . . , 5) is the end point of each segment path when UAV performs a task. For example, u 1,1 is the flight distance from UAV 1 to task 1, the starting point of this segment is the coordinate of UAV 1, and the end point is the coordinate of task 1. u 3,4 is the distance that the UAV needs to fly from task 1 to task 2. The starting point of this segment is the coordinates of task 1 and the end point is the coordinates of task 2.

B. CHARACTERISTICS OF UAV
Understanding the performance of UAV and task can help UAV to assign tasks better. In this paper, UAV's performance is divided into value, reconnaissance capability, and attack capability. When the UAV performs the task, it will be attacked by the enemy's target. At this time, it is necessary to analyze the performance of each UAV to determine the most suitable UAV to perform the task, so as to reduce the risk of UAV performing the task. The UAV's performance is expressed by matrix, as in (2).

C. TASK CHARACTERISTICS
The characteristic value of task is expressed in the form of matrix, as in (3).
where i (i = 1, 2, 3) represents the model of the task, and j (j = 1, 2) represents the characteristic properties of the task.

III. FITNESS FUNCTION
For the multi-UAV multi-task assignment problem, reasonable use of UAV resources can bring higher benefits. In this paper, the task of UAV is divided into reconnaissance and attack. Reconnaissance and attack are subtasks. In the process of task allocation, the UAV and the task should be reasonably constrained. UAV can complete all sub tasks corresponding to a task. Each subtask can only be performed by one UAV. In order to show that the algorithm is effective to solve the problem of UAV task allocation, fitness function is used to reflect. The fitness function is influenced by UAV path length, UAV performance, and task characteristics [23]- [25].
When the same UAV performs different tasks, if it performs tasks with short path length and less threat to the UAV from enemy's targets, the benefits of UAV will be greater, which is more conducive to the UAV to perform tasks, so the corresponding fitness function value will be larger.
where w is the weight coefficient of path length, l is the path length, p 1 is the weight coefficient of UAV's own value, v is the value of UAV, p 2 is the weight coefficient of UAV's reconnaissance capability, r 1 is the reconnaissance capability of UAV, p 3 is the weight coefficient of UAV's attack capability, a 1 is the attack capability of UAV, k 1 is the weight coefficient of task's anti-reconnaissance capability, r 2 is the task's anti-reconnaissance capability, k 2 is the weight coefficient of the task's anti-attack ability, a 2 is the anti-attack capability of the task. Each weight coefficient meets the (5).
In (6), W k i,j represents a constraint on the number of tasks, i is the number of UAVs, j represents the number of tasks, k is the number of subtasks of the task, W 2 1,3 means that UAV 1 performs the attack task of task 3. k = 2 means that the UAV performs the attack task. k = 1 means that the UAV performs the reconnaissance task. Equation (7) indicates that a subtask can only be performed by one UAV, (8) indicates that a task can be performed by multi-UAV.

IV. ALGORITHMIC SOLUTION
UAV task allocation is a combinatorial optimization problem. The sequence of task allocation is expressed by coding. As shown in Fig.6, genes on chromosome represent different meanings. The first gene represents UAV's reconnaissance task for task 1, and the second gene represents UAV's attack task for task 1. The gene in the third position represents the UAV's reconnaissance task to task 2, the gene in the fourth position represents the UAV's attack task to task 2, the gene in the fifth position represents the UAV's reconnaissance task to task 3, and the gene in the sixth position represents the UAV's attack task to task 3.
In the double chromosome multi-mutation operator GA [18], as shown in Fig.7, the number represented by DNA II is the breakpoint. The gene of DNA I in front of the breakpoint is the task performed by UAV 1, and the gene of DNA I behind the breakpoint is the task performed by UAV 2. The number of genes in DNA II is determined by the number of UAVs, as in (9).
where N DNA II is the number of genes in DNA II, N UAV is the number of UAVs. The maximum range of gene coding values in DNA II is determined by the length of DNA I, which is shown in (10).
where G DNA II is the maximum value of gene coding range in DNA II, L DNA I is the length of DNA I.

A. SELECTION OPERATION
In the selection operation, roulette is used to select the initial population. The selection steps are as follows: 1) The fitness value of initial population is obtained by fitness function; 2) The roulette method is used to select the fitness value corresponding to the initial population; Through the above selection operation, the obtained population is a new population that is composed of individuals randomly selected from the initial population.
where pd p,g (k+1) is the p-th individual of the population in the k +1 generation, p is the p-th individual, g is the g-th gene in the p-th individual. In the selection operation, g represents all the genes on the individual.

B. CROSSOVER AND MUTATION OPERATION
The new population obtained by selection operation needs to be cross operated again. The specific steps are as follows: where P c is the crossover probability, rand is a random number between 0 and 1. By comparing the random number with P c , if P c is larger than the random number, the crossover operation will be carried out, otherwise the crossover operation will not be carried out, as in (13).
where p is the p-th individual, g is the g-th gene in the p-th individual.
2) The crossover operation is to take two individuals from the population as the parents and randomly select one position as the crossover position. When the genes at the crossing point in father II are the same as those in father I except for the position to be crossed, there is a conflict, and the conflict elimination operation should be adopted. Firstly, the gene at the intersection of father I is exchanged with the gene at the conflict position. Then, the original gene at the intersection of father I is compared with the gene at the intersection of father II. If there is a conflict, the gene at the intersection of father II is exchanged with the gene at the conflict position. Finally, the genes that need to be crossed in father I and father II are crossed. By eliminating the conflict operation, the crossover operation is equivalent to introducing the small mutation operation, which increases the diversity of the population after the crossover operation, as shown in Fig.8. When the crossover operation is completed, the mutation operation will be performed. The mutation operation adopts the multi-mutation operator in reference [18].

C. SELECT OPERATION AGAIN
After selection, crossover and mutation, reverse operation is performed on each gene value in the individual, that is, if the code is 1-3-2-4-5-6, then the reverse code is 6-4-5-3-2-1.
In order to increase the diversity of the population and improve the efficiency of the solution, an improved selection operation is performed on the mutated population. Mutation population is a combination of the upper part of coding population and the upper part of anti coding population. In order to make gene communication better, the improved SA algorithm is used to select from the remaining half of the mutation population and the selected half of the anti coding population. SA algorithm can accept the worse solution, which is helpful to make the genetic algorithm jump out of the local optimum, increase the diversity of the population and improve the efficiency of solution.
The traditional SA algorithm is used to solve the multi UAV task allocation problem, which is time-consuming and inefficient. Therefore, the traditional SA algorithm is improved on the acceptance criterion of the new solution, as shown in (14). where now is the fitness function value corresponding to the task assignment order at the current time, before is the fitness function value corresponding to the task assignment order at the previous time, y min is the minimum of the threshold, y max is the maximum of the threshold. The maximum and minimum values of threshold are set according to the difference of fitness function data in the algorithm.

D. PSEUDO CODE E. PROGRAM FLOW CHART V. SIMULATION
In the multi-UAV multi-task assignment problem, the traditional SA algorithm is used to solve the problem. For the initial task allocation order, 0-1 random number is used, 0 means that the task is not selected, 1 means that the task is selected. In the process of solving the algorithm, the tasks are sorted. Table 5 shows the coordinates of UAV and task. Table 6 is the task allocation. The initial task allocation is random allocation. Table 7 is the weight coefficient table.
In Table 6, the two rows and three columns in the upper left corner of the table are 0-1 matrix, the two rows and three columns in the upper right corner are 0 matrix, the two rows and three columns in the lower left corner are 0 matrix, and the two rows and three columns in the lower right corner are 0-1 matrix. VOLUME 9, 2021

A. TRADITIONAL SIMULATED ANNEALING ALGORITHM
When the SA algorithm is used to solve the task allocation problem, the better objective function value is retained. Table 8 shows the task allocation order corresponding to the better objective function value. It can be seen from Table 8 that different task allocation orders correspond to different objective function values. The profit, that UAV 1 first performs the reconnaissance  and attack of task 1, then performs the reconnaissance and attack of task 3, and UAV 2 performs the reconnaissance and attack of task 2, is larger. The corresponding objective function values of the above three allocation results are shown  in Fig.11. The yellow line is the simulation result of traditional SA. And the maximum value is 623.65. The running time of the algorithm is 511.881 seconds.

B. IMPROVED SIMULATED ANNEALING ALGORITHM
Under the same condition of the weight, the task assignment problem is solved by improving the SA algorithm in the environment that the coordinate of UAV and task is unchanged.
It can be concluded from Table 9 that the objective function value obtained by assigning reconnaissance and attack to the same UAV is larger. The corresponding objective function values of the above three allocation results are shown in Fig.11. The blue line is the simulation result of improved SA. And the maximum value is 623.65. The running time of the algorithm is 25.039 seconds.
It can be seen from Table 8 and Table 9 that the allocation order and objective function value of UAV are the same, but the time of solving the problem by the improved SA algorithm is reduced by about 95.11%. The improved SA can get a larger objective function value at the beginning from Fig.11. It shows that the efficiency of the improved SA is relatively high.

C. FUSION SIMULATED ANNEALING DOUBLE COLORING MULTI-MUTATION GENETIC ALGORITHM
The improved double chromosome multi-mutation GA is used to assign tasks to multi-UAV. The initial task allocation order is random sorting of six numbers 1-2-3-4-5-6. The crossover probability is 0.9 and the mutation probability is 0.1. Some fitness function values and task allocation orders are shown in Table 10. Table 10 is the objective function value of double chromosome multi-mutation GA.
The yellow line that is in Fig.12 is the fitness function value of double chromosome multi-mutation GA, and DNA II is the breakpoint of the assignment order. The results show that the DNA II is 3, so the optimal allocation order is 2-1, 3-4-5-6. UAV 1 performs reconnaissance and attack of task 1, UAV 2 performs reconnaissance and attack of task 2, and then performs reconnaissance and attack of task 3. According to Fig.12, the best fitness function value of yellow line is 648.325. The running time of the algorithm that is double chromosome multi-mutation GA is 0.42 seconds.
The six fitness function values that are from objective function value of double chromosome multi-mutation GA are taken as the Table 10's data. The comparison of specific fitness function values is shown in Fig.12.
The six fitness function values that are from objective function value of ISAFGA are taken as the Table 11's data. The blue line that is in Fig.12 is the fitness function value of ISAFGA. And the optimal allocation order is 2-1, 3-4-5-6. UAV 1 performs reconnaissance and attack of task 1, UAV 2 performs reconnaissance and attack of task 2, and then performs reconnaissance and attack of task 3. As shown in Fig.12, the best fitness function is 648.325. The running time of the algorithm is 0.208 seconds.
By comparison, it is found that the optimal allocation order of the two algorithms in Fig.11 and Fig.12 is the same, and the optimal fitness function value is also the same, but the ISAFGA takes a shorter time. At the same time, by comparing the fitness function values in Fig.11 and Fig.12, it can be seen that SA is in the local optimal solution, and the fitness value is not the maximum fitness value, while GA can find a VOLUME 9, 2021   larger fitness value. The ISAFGA can improve the diversity of the population and greatly shorten the solution time of the problem. The final task allocation diagram is shown in Fig.13.
The histogram in Fig.14 shows the comparison of the double chromosome multi-mutation GA and ISAFGA in terms of time and iteration times. Among them, the time of   double chromosome multi-mutation GA is 0.42 seconds and the number of iterations is 21; the time of the ISAFGA is 0.208 seconds and the number of iterations is 9. The ISAFGA can shorten the time in solving the UAV task allocation sequence.

D. COMPARISON OF SIMULATION RESULTS
In order to better verify the effectiveness of the ISAFGA, the starting point coordinates of UAV are changed twice. The task allocation diagram of UAV with two coordinate changes is shown in Fig.15 and Fig.16.  In order to show that the ISAFGA can improve the efficiency of solving problems, the fitness function values of double chromosome multi-mutation GA and ISAFGA are compared, as shown in Fig.17 and Fig.18.
The yellow line is the fitness function value of the ISAFGA, and the blue line is the fitness function value of the double chromosome multi-mutation GA. It can be seen from the Fig.17 and Fig.18 that the fitness function values obtained at the beginning of the algorithm are very different. The fitness function value of double chromosome multi-mutation GA is very large at the beginning, while the fitness function value of the ISAFGA is small at the beginning. However, with the operation of the algorithm, the fitness function value of the ISAFGA reaches a maximum value and converges to the maximum value, while the double chromosome multi-mutation GA finds the maximum value and converges after the ISAFGA converges, which shows that the ISAFGA increases the diversity of the population, improves the convergence speed and efficiency of the algorithm.
It can be seen from Fig.19 and Fig.20 that the ISAFGA takes less time and iterations to solve the problem.
In order to fully reflect the feasibility of the ISAFGA, the number of UAVs and tasks is changed to 5 UAVs and 10 tasks.
It can be seen from Fig.21 that the time and iteration times of the ISAFGA are less than those of the double chromosome   multi-mutation GA. It shows that the ISAFGA can improve the efficiency of the algorithm and increase the diversity of the population.
It can be seen from Fig.22 that the initial values of the ISAFGA and the double chromosome multi-mutation GA are the same. With the increase of the number of iterations, the ISAFGA can find a larger fitness function value in a shorter number of iterations and converge, while the double chromosome multi-mutation GA is trapped in the local   optimal solution and converges after several iterations. It can be concluded that the ISAFGA improves the diversity of the population, makes the algorithm jump out of the local optimal solution, improves the efficiency of the solution, and is conducive to the solution of UAV task allocation. According to the optimal solution, the corresponding UAV task allocation order can be obtained. Table 12 shows the tasks' sequence that each UAV needs to perform. T1 means task 1, R means reconnoitre, A means attack, and U1 means UAV 1. Fig.23 is the flight path's figure that the UAV perform its tasks, and each color represents the each UAV's flight path.

VI. CONCLUSION
A new task allocation algorithm for multi-UAV based on double chromosome multi-mutation GA is proposed in this paper namely ISAFGA. This paper introduces the task allocation model, task allocation based on SA algorithm, and task allocation based on ISAFGA. The main findings are summarized as follows: (1) The new solution acceptance criterion is reconstructed by task assignment, which reduces the time of the algorithm compared with the traditional SA. (2) Through the analysis of double chromosome multimutation GA, double selection operation is used to increase the diversity of population. (3) The improved SA algorithm is introduced into the double selection operation to reduce the solving time and improve the efficiency of the algorithm.
ISAFGA increases the diversity of the population. At the same time, ISAFGA can quickly find a solution with a larger fitness function value, through which the task order of UAV can be determined.