4.1.3. Solving Drone Flight Routes
Initially, all drones are mounted on the vehicle, with identical positions and remaining endurance, forming a symmetric state. In this case, the drone flight routes can be determined first, and then these routes can be assigned to individual drones for execution. For the task nodes covered by each parking node, multiple drone flight routes need to be determined. These routes must cover all task nodes, and the drones will visit the task nodes according to these routes. In this study, we use the AMP algorithm to solve the drone flight routes at each parking node. The core idea of the AMP algorithm is that a good solution can often be constructed by combining components of other good solutions. In this context, a solution for the drone flight routes at a parking node is a set of multiple drone flight routes. By selecting and combining the best components from multiple solutions, a superior solution can be obtained. Iterating this process will eventually lead to an optimal solution.
Figure 3 shows the flowchart of solving the drone flight routes at a parking node based on the AMP algorithm. The following sections will provide a detailed explanation of each part of the process for solving drone flight routes using the AMP algorithm.
(1) Memory Initialization: The algorithm begins with the initialization of the memory pool, which is designated to store the flight paths of drones. The initialization process employs a combination of random and greedy algorithms to construct multiple drone flight paths. Specifically, for a parking node
, a task node is randomly selected from the set of task nodes
assigned to
, to serve as the initial task node in the drone flight path. Subsequently, the nearest task node to the current task node is chosen as the next node. This procedure is repeated until the length of the constructed drone flight path exceeds the drone’s maximum flight distance. The completed drone flight path is then added to the memory pool, and the task nodes contained within this flight path are removed from
. This process is repeated until all task nodes in
have been allocated to drone flight paths. Once
is exhausted, it is reinitialized, and the construction continues until the memory pool reaches its maximum capacity
. The pseudocode for the memory pool initialization is presented in Algorithm 3.
Algorithm 3 solving the drones route |
- Input:
parking node, assigned task nodes set at ; - Output:
memory pool M;
- 1:
Initialize M and ; - 2:
whiledo - 3:
; - 4:
while do - 5:
, ; - 6:
choose a random task node in ; - 7:
, update , ; - 8:
while and do - 9:
get the task node that is closest to ; - 10:
, update ; - 11:
if then - 12:
; - 13:
end if - 14:
end while - 15:
; - 16:
end while - 17:
end while - 18:
return M;
|
(2) Solution Construction: After the initialization of the memory pool, it is necessary to construct the solution for the drone flight routes at the current parking node. First, evaluate the drone flight routes in the memory pool
M. Each drone flight route in memory
M is evaluated using the average access distance, which is defined by Equation (
17):
Here, represents the length of a drone flight route in the memory pool M, and denotes the number of task nodes in that route.
The route with the shortest average access distance is selected to construct the solution. Subsequently, the remaining drone flight routes in the memory pool
M are updated. If any of these remaining routes contain task nodes already included in the selected route, those task nodes are removed, and the average access distance for the remaining routes is recalculated. This process continues until the selected routes cover all task nodes in the region. The pseudocode for this procedure is provided in Algorithm 4.
Algorithm 4 construction of drone flight routes solution |
- Input:
memory pool M, parking node , assigned task nodes set at ; - Output:
drone flight routes solution at ;
- 1:
whiledo - 2:
sort the drone flight paths in M according to ; - 3:
get the drone flight path r with the smallest from the memory M; - 4:
; - 5:
; - 6:
for do - 7:
; - 8:
for do - 9:
if then - 10:
; - 11:
end if - 12:
end for - 13:
end for - 14:
end while - 15:
return;
|
(3) Solution Optimization: After constructing the drone flight route solutions, it is necessary to optimize these routes. This paper employs a local search strategy to enhance the efficiency of the drone flight paths. Specifically, two drone flight routes, and , are randomly selected from the solution set. The closest task nodes within these routes, and , are identified. The following two operations are performed on these task nodes:
Task Node Swap: Exchange the positions of and in and , resulting in the new routes and .
Task Node Move: There are four move strategies for task node migration: ①Move from to immediately after in , resulting in new routes and . ②Move from to immediately before in , resulting in new routes and . ③Move from to immediately after in , resulting in new routes and .④Move from to immediately before in , resulting in new routes and .
Figure 4 illustrates these two operations. The pseudocode for the detailed optimization process of the drone flight route solutions is provided in Algorithm 5:
Algorithm 5 optimization of drone flight routes solution |
- Input:
, ; - Output:
;
- 1:
fordo - 2:
randomly take out two drone flight paths and from ; - 3:
find the two closest task nodes and in and ; - 4:
; - 5:
, ; - 6:
; - 7:
; - 8:
for do - 9:
if or then - 10:
; - 11:
end if - 12:
end for - 13:
; - 14:
get the route group with the shortest sum of route lengths in ; - 15:
if then - 16:
replace and in with and ; - 17:
end if - 18:
end for - 19:
return;
|
(4) Memory Update: Following the optimization of the drone flight route solutions, a more efficient solution is obtained. The next step involves storing these optimized routes in the memory pool, enabling the construction of superior solutions in subsequent iterations. During the memory update process, if the number of drone flight routes in the memory pool reaches its maximum capacity , the algorithm removes the less optimal routes, specifically those with larger values. It is crucial to ensure that the remaining routes still cover all task nodes at the current parking node before deleting the less optimal routes. If the remaining routes fail to cover all task nodes, the algorithm will select and delete other less optimal routes instead.