According to the previously established model, the reconnaissance task can be assigned to each UAV after obtaining the initial position of each UAV. Due to the large scale of the problem, an improved GA based on the FWA is proposed here to increase the solution speed. That means the MKP problem is solved with an FW–GA hybrid algorithm.
3.2.1. Fundamental Theory of FWA
Inspired by the process of fireworks exploding, Tan and Zhu [
22] proposed a brand-new swarm intelligence algorithm, FWA, in 2010. FWA is a very effective method to solve optimization problems. FWA considers the complex and huge solution space to be like a dark night sky and fireworks to represent a feasible solution. The process of exploding in the dark night sky and generating a large number of sparks is considered to be the process of searching for optimal solutions in the solution space around the feasible solutions. Fireworks in the night sky constantly “explode” in the night sky, searching for the optimal solution in the solution space.
- 2.
Operator analysis of fireworks algorithm
The FWA mainly consists of the explosion operator, Gaussian mutation operator, mapping operator and selection operator. The performance of the operator in the algorithm directly determines the optimization performance of the FWA.
- (1)
Explosion operator
The explosion operator is the core of the FWA and is also the primary way of generating explosive sparks from the initial fireworks as well as searching for optimal solutions in the solution space. The explosion radius and number of exploding sparks for one firework are determined based on the firework’s adaptive degree and the adaptive degree of other fireworks in the fireworks population. It can make a reasonable allocation of resources to balance local search capability with global search capability. If a firework has a high adaptive degree, then the possibility of a global optimal solution in its neighborhood will be much higher. Thus, more resources will be assigned to the firework to generate more sparks to find the global optimal solution in its neighborhood. For fireworks with low adaptive degrees, fewer resources will be assigned for them.
First, the adaptive degree of the firework
i is defined as
. Then, the explosion radius
and the number of exploding sparks
of the firework
i can be calculated as follows:
where
is the maximum adaptive degree,
N is the number of individuals in the fireworks population,
is a small quantity to make sure the value of the denominator is not 0 and
is an adjustment coefficient to adjust the explosion radius.
In Equation (18), is the minimum adaptive degree and is also an adjustment coefficient to adjust the number of exploding sparks. The meanings of the remaining parameters are the same as in Equation (17).
To prevent too few sparks being generated from fireworks with low fitness and too many sparks being generated from fireworks with high fitness, the number of sparks produced is limited in the following fireworks algorithm:
where
a and
b are two constant coefficients and “round” represents the rounding function.
- (2)
Gaussian mutation operator
In order to avoid the local optimum problem in the optimization process and increase the diversity of the spark population, Gaussian mutation is introduced in the process of generating exploding sparks. The specific mathematical expression of Gaussian mutation is as follows:
where
is the
k-dimensional coding value of the firework
i in the fireworks population and
is a one-dimensional Gaussian distribution with a mean of 1 and a variance of 1.
The selection operator here is similar to the selection operator in the GA. We will introduce it in detail in the next section.
- 3.
Algorithm Procedure
3.2.2. Improved GA for Solving Multidimensional 0-1 Knapsack Problem
The GA is a computing model based on computer technology. It was developed based on Darwin’s theory of evolution and Mendel’s genetic law. Its essence is an efficient, parallel global search algorithm to find the optimal solution by simulating the natural selection of genes and the evolution of populations in nature.
The GA has been widely adopted to solve the multidimensional knapsack problem [
31,
33]. However, the standard GA has the shortcomings of high computational complexity, slow convergence speed and ease of falling into local optimal solutions. Those problems are unacceptable in forest fire reconnaissance. The fire reconnaissance task assignment problem requires a faster solving speed to execute fire reconnaissance more quickly and efficiently, thereby reducing economic losses. Therefore, the standard GA is obviously difficult to use to meet the requirements of solving speed and optimization for the fire reconnaissance task assignment problem. Inspired by the fireworks algorithm, an improved GA is proposed based on the FWA to balance its solving speed and optimization for the fire reconnaissance task assignment problem. At the same time, elite opposition-based learning and the greedy selection operator are introduced to further improve the convergence speed and optimization ability of the algorithm.
- 2.
Process of the improved algorithm
Figure 9 is the flow diagram of the FW–GA hybrid algorithm in this paper. Whether in the improved GA or the standard GA, the GA is the process of optimization via computer simulation of the evolutionary process. First, a digital coding scheme is needed to initialize the population. Then, the fitness of each individual is evaluated using the fitness function, and the individual with the highest fitness is selected based on the selection function. At the same time, a mutation operator and a crossover operator are introduced to increase the genetic diversity of the population.
The FW–GA hybrid algorithm is mainly inspired by the spark radius and spark number in FWA, and its mutation and crossover operators are improved. When the individual fitness in the population is high, there is a greater possibility of finding the global optimal solution in its vicinity; thus, more offspring are generated in a smaller solution space nearby. Conversely, if its fitness is low, the probability of finding the global optimal solution nearby is low; thus, fewer offspring are generated in a wider range nearby to explore a larger solution space. The FW–GA hybrid algorithm takes into account both local and global optimization abilities, greatly improves the utilization of computing resources compared to standard GA and improves both its speed of solving and its optimization effectiveness.
The hybrid genetic algorithm adopts the principle of binary encoding, as illustrated in
Figure 10. In this encoding scheme, each chromosome represents a feasible solution, and the number of gene fragments in the chromosome, denoted as “
n”, represents the number of reconnaissance tasks that need to be assigned. Specifically, a binary encoding of 1 indicates that the UAV should execute the corresponding reconnaissance task, whereas a binary encoding of 0 indicates that the UAV should not execute the task. This encoding strategy has been widely used in scientific research and has been proven to be effective.
As the chosen background for fire reconnaissance comprises a total of n fire points, a random binary matrix is generated by a computer, where is the population size. This matrix represents different solutions for a UAV, with each solution consisting of 886 pieces of information, which correspond to 886 tasks that need to be assigned.
Here, a concept of profit density is introduced, and the flight range constraint is taken as an example to explain the concept of profit density:
where
is the profit density,
,
,
,
,
and
are as defined in Equations (1) and (3) and
is the limit value defined in Equation (4). When solutions beyond the feasible space arise, they will be remoted one by one by setting the gene fragment of the corresponding task point to 0 for individuals with lower profits. This process is repeated until all individuals in the population are within the feasible solution space.
To ensure the quality of solutions and guide subsequent mutation, crossover and selection, it is necessary to calculate the fitness of individuals. For the knapsack model introduced in
Section 2, the objective function value is selected as the fitness. By iterating and optimizing the fitness function, high-quality solutions can be obtained.
To improve the convergence rate of the algorithm, an elite opposition-based learning strategy is introduced. In the current study, the iteration direction of the swarm intelligence algorithm is mostly dominated by the elite solution population, and making full use of the elite solution information is the key to increase the iteration speed. The basic idea is shown as follows:
The elite group
is defined as:
where
is the set of all feasible solutions and
represents the elite solution in
.
Here, the individual with fitness greater than 95% of the maximum fitness in the pop set can be considered an elite individual.
In Equation (23),
is the fitness of the elite individual
and
is the maximum fitness in
.
For the multidimensional 0-1 Knapsack problem, the reverse solution of binary encoding can be expressed as:
where
is the coding value of individual
in dimension
and
is the value of the reverse solution of individual
in dimension
.
According to the binary elite opposition-based learning strategy, the dimensions with differences are reversed to obtain a new individual.
At the same time, the step length of the reverse solution
is defined:
where
is the number of reverse solution dimensions,
is a small quantity and
is an integer function. After obtaining the step length
of the reverse solution,
dimensions are randomly selected, and then the reverse solution is obtained. In the elite reverse decoding process shown in
Figure 11, two segments were randomly selected from the non-identical encoding area of the third individual for reverse binary operation, namely
and
with
values of
and
, respectively.
In the standard GA, mutation is achieved by randomly mutating different gene coding positions with equal probability. This approach can increase the genetic diversity of the population to a certain extent. However, it may slow down the iteration and make it difficult to converge to the global optimal solution if the mutation probability remains constant when the fitness of the population is generally high at the end of the iteration. In the standard GA, each parent generally produces a certain number of offspring after mutation. It is well-known that the probability of producing offspring with high fitness is generally higher for a parent with higher fitness and lower for a parent with lower fitness. If each parent produces the same number of offspring, it will waste a lot of computational resources and may affect the final optimization result.
Intelligently regulating the mutation probability and the number of offspring produced by each parent is the key to optimize the GA and to solve the multidimensional 0-1 Knapsack problem faster and better. Inspired by the FWA, the mutation operator in the traditional GA was improved based on the concept of explosion radius and number of explosion sparks proposed by the FWA to solve the multidimensional 0-1 Knapsack problem.
Intelligently regulating mutation probability and the number of offspring produced by each parent is crucial to optimizing the GA and achieving faster and better solutions to the multidimensional 0-1 Knapsack problem. Drawing inspiration from the FWA, the mutation operator in the standard GA was enhanced by incorporating the concepts of explosion radius and number of explosion sparks from the FWA.
A dynamically adjustable mutation probability
can be acquired from Equation (26).
In Equation (26),
is the mutation probability of the parent
,
is the fitness of the parent
,
is the maximum fitness,
is the number of individuals in population,
is a small quantity to make sure the value of denominator is not 0 and
is an adjustment coefficient to adjust mutation probability. After determining the mutation probability of each parent, equiprobable mutations are performed on each gene segment, as shown in
Figure 12, where the first and second gene segments indicate successful gene mutations. Analysis of the previous fireworks algorithm shows that when individual fitness is relatively high, the mutation probability will be reduced to narrow the search range; when it is low, the mutation probability will be increased to expand the search radius and search for the optimal solution in a larger space.
At the same time, to better assign computational resources, the number of offspring produced by the parent
,
, is defined as follows:
In Equation (27), is the number of offspring produced by the parent , is integer function, is the fitness of parent , is the minimum fitness, is a small quantity to make sure the value of denominator is not 0, is the number of individual in the population and is also an adjustment coefficient to adjust the number of offspring. The definition of the lower and upper limits of the number of offspring is the same as the definition of the lower and upper limits of the number of fireworks in the FWA.
From Equation (27), it can be determined that the number of offspring is determined by the fitness of the parent. A parent with higher fitness is likely to be closer to the global optimal solution, and more computational resources will be allocated for it to search for the optimal solution. Conversely, a parent with lower fitness is more likely to be far from the global optimal solution; thus, less computational resources are allocated for it.
In standard GA, the crossover points and the crossover length are random, and the crossover probability is generally determined, which leads to the same dilemma as the mutation operator: the unreasonable allocation of computational resources. A method similar to the method to improve the mutation operator was applied to the improve crossover operator.
First, the crossover length
and crossover probability
are determined for parent
.
In Equation (29), n is the number of gene fragments in the chromosome. The definitions of the variables in Equations (28) and (29) are the same as their counterparts in Equation (26). Similar to the mutation operator, the crossover length and the crossover probability are related to the fitness of the parent. For individuals with high fitness, the distance from the global optimal solution is likely to be shorter; thus, the value of crossover length and crossover probability need not be too high; on the contrary, a higher crossover probability and a longer crossover length will be adopted to search the optimal solution in a wider space.
Second, the numbers of offspring generated by each parent need to be determined, and here, a strategy similar to that in the mutation operator is also adopted:
The definition of each variable in Equation (30) is the same as in Equation (27), and the crossover operation is shown in
Figure 13.
The standard GA adopts a roulette wheel selection method to select offspring for the next generation. To accelerate iteration, a greedy strategy was introduced to improve the selection operator. As it is shown in
Figure 14, the top
ceil(
N/10) (where
ceil() is the integer function) individuals ranked by fitness in each generation are preserved to the next generation without probability-based selection. Meanwhile, the roulette wheel selection method is also adopted to choose N-ceil (0.1 ×
N) individuals from the remaining population, thereby ensuring that the number of offspring selected in every generation is always
N.
There are two termination conditions for the GA–SA algorithm in this paper. The first condition is that if the ratio of the difference between the maximum fitness value of the current generation population and the previous generation population to the maximum fitness value of the current generation is less than eps, then the iteration stops. The second condition is that if the algorithm reaches the preset number of iterations, then the iteration stops.