A multi-truck and multi-UAV task allocation method based on improved variable neighborhood descent
By improving the variable neighborhood descent method and clustering algorithm, combined with the domain search strategy, the problem of local optimal solution and long solution time in multi-truck collaborative multi-UAV task allocation is solved, and an effective package collection and delivery strategy is achieved. Meet the constraints of drones and trucks.
Patent Information
- Application Number
- CN202410808657.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-06-21
AI Technical Summary
Existing multi-truck collaborative multi-UAV task allocation algorithms usually use heuristic algorithms, which are prone to falling into local optimal solutions, and randomized searches lead to long solution times, making it difficult to effectively solve the problem of multi-truck collaborative multi-UAV package collection and delivery. question.
Using the improved variable neighborhood descent method, by constructing the initial solution and using the Prim clustering algorithm, the minimum marginal cost algorithm and the mileage saving algorithm, combined with the domain search strategy and the inferior solution acceptance criterion, the truck and drone paths are regenerated to avoid local minima. Optimize solutions and shorten solution time.
Effectively solves the problem of multi-truck coordinated multi-drone package collection and delivery, determines the customer point set, flight path and truck driving path served by each drone, satisfies the drone load capacity and flight distance constraints, and achieves the minimum ize the total truck and drone travel distance.
Smart Images

Figure CN118378981B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of unmanned aerial vehicle task allocation, and in particular relates to a multi-truck multi-unmanned aerial vehicle task allocation method based on improved variable neighborhood descent. Background Art
[0002] The truck-drone collaborative delivery model has become a highly-watched research direction: both trucks and drones have great practical value, while each has some shortcomings and advantages. Drones have short battery life and poor load capacity, but are not restricted by terrain and have good maneuverability. Trucks are greatly affected by terrain and have poor maneuverability, but have excellent battery life and load capacity. Therefore, trucks and unmanned vehicles are very complementary.
[0003] In the prior art, task allocation methods are generally divided into exact algorithms and heuristic algorithms. Since the multi-truck cooperative multi-UAV task allocation problem is an NP-hard problem, most of the existing algorithms are heuristic algorithms, and most of them use neighborhood search algorithms or local search strategies. In the existing field search algorithms, most of them will use the neighborhood structure to perform randomized search on the nodes, resulting in a time-consuming problem in solving the problem. Different from the existing neighborhood search algorithms, the multi-truck multi-UAV task allocation method based on improved variable neighborhood descent proposed in the present invention uses the inferior solution acceptance criterion to avoid falling into the local optimal solution: accepting a worse solution with a certain probability, and in order to avoid randomized search, a neighborhood structure that can be used for local optimization is designed to shorten the solution time. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides a multi-truck and multi-UAV task allocation method based on improved variable neighborhood descent, which solves the problem of multi-truck coordinated multi-UAV package collection and delivery.
[0005] In order to achieve the above objectives, the technical solution adopted by the present invention is: a multi-truck multi-UAV task allocation method based on improved variable neighborhood descent, comprising the following steps:
[0006] S1. Construct an initial solution to the problem of multi-truck and multi-drone collaborative package collection and delivery;
[0007] S2, initializing the current optimal solution and the current solution, and initializing the current annealing temperature, wherein the current solution is the initial solution constructed in S1;
[0008] S3, determine whether the current annealing temperature is greater than or equal to the termination temperature, if so, proceed to S4, otherwise, proceed to S7;
[0009] S4. Based on the current solution, a new solution is obtained using a domain search strategy to regenerate the truck path and the drone path;
[0010] S5. When the new solution is accepted, update the current optimal solution;
[0011] S6, when all neighborhood structures have been applied to the current solution, cooling is performed and the process proceeds to S7;
[0012] S7. Output the multi-truck and multi-UAV task allocation strategy to complete the multi-truck and multi-UAV task allocation based on improved variable neighborhood descent.
[0013] Furthermore, the S1 comprises the following steps:
[0014] S101, using Prim clustering algorithm to obtain clustering results according to the given n customer points C to be served and the truck stop location set W;
[0015] S102. Based on the clustering results, the path of each truck is calculated using the minimum marginal cost algorithm. , generate a set of truck routes;
[0016] S103. Based on the clustering results, a mileage saving algorithm is used to generate a drone path set DR, thereby completing the construction of an initial solution to the multi-truck and multi-drone collaborative package collection and delivery problem.
[0017] Furthermore, the S101 includes the following steps:
[0018] A1. Based on the given n customer points C to be served and the truck stop location set W, obtain the cost matrix D containing the Euclidean distances between each customer point and each truck stop point;
[0019] A2. According to the cost matrix D, use the Prim clustering algorithm to find a truck stop for each customer point that meets the maximum flight distance constraint of the drone, where the customer point To the top The expression for the shortest distance is as follows:
[0020]
[0021] in, Indicates customer point To the top The shortest distance, Represents a set of customer points Find a customer point in Indicates customer point Corresponding to the clustered truck stops, Represents the set of customer points that have not been clustered. Represents a set of customer points A customer point in Represents a set of vertices There is a vertex in indicates a truck stop, represents a set of vertices, represents the set of truck stop locations, Indicates the maximum flight distance of each drone;
[0022] A3. Based on the solution of A2, determine whether a feasible customer point has been found If yes, then go to A4, otherwise, based on the truck stop set If no solution is found that satisfies the maximum flight distance constraint of the UAV, the process ends;
[0023] A4. Collect from customer point Remove the customer point Add to Vertex Collection and update the truck stop collection And update customer points The corresponding stops are clustered ;
[0024] A5. Determine the customer point set Is it empty? If so, get the clustering result and go to S102; otherwise, return to A2.
[0025] Furthermore, the S102 includes the following steps:
[0026] B1. According to the clustering results, from the customer point set Pick a customer point , and determine the customer point Is it a second-class customer? If so, go to B3; otherwise, go to B2. In the customer point set Belongs to the first type of customers, customer point set Belongs to the second type of customers, customer point set Belong to the third category of customers, , , , , and All represent customer points;
[0027] B2. Use the following formula to get the truck stop point Corresponding customer points ,truck and trucks Insertion position on the path , and update the customer point set and the state matrix , enter B5:
[0028]
[0029] in, It means truck, Indicates customer point The truck stops that were clustered, Indicates location, Indicates that the truck will stop at Insert into truck Path locations, when the truck stops Already exists in the truck path When the marginal cost of returning is 0, there is no need to stop the truck at Repeated insertion, Represents the truck based on the distance matrix D path The distance Represents the customer point, represents the set of customer points, represents a collection of trucks;
[0030] The updated customer point set and the state matrix The expression is as follows:
[0031]
[0032] in, Represents the customer point, Represents the index of the customer point, i.e. Customer points.
[0033] B3. Use the following formula to get the truck stop point Corresponding customer points ,truck and trucks Insertion position on the path , enter B4:
[0034]
[0035] in, Indicates visiting the first type of customers The index of the truck where the drone is located, Indicates visiting the second type of customers Clustered truck stops Can be inserted into truck routes The starting position in Truck The path, Represents a truck route In the Insert truck stops at The distance after Represents a truck route Total distance;
[0036] B4, get the insertion position according to B3 Then, use the following formula to convert customer points Corresponding truck stops Insert into Truck Route Location At the same time, update the customer point set and the state matrix , and enter B5:
[0037]
[0038] The updated customer point set and the state matrix The expression is as follows:
[0039]
[0040]
[0041] in, represents the index of the first type of customer point and , Indicates the number of first-class customer points;
[0042] B5. Determine the customer point set Is it empty? If so, get the path of each truck. , output the truck route set, otherwise, return to B1.
[0043] Furthermore, the S103 includes the following steps:
[0044] C1. According to the clustering results, use the following formula to calculate the savings matrix S of each customer point, and arrange the savings matrix S in descending order according to the savings value:
[0045]
[0046]
[0047] Among them, S represents the saving matrix, represents the total number of rows of the saving matrix S, and All represent customer points. Indicates cost savings, Represents a truck stop To customer point The Euclidean distance of Represents a truck stop To customer point The Euclidean distance of Indicates customer point To customer point The Euclidean distance of
[0048] C2, build the initial drone path set;
[0049] C3, determine whether the current saving matrix S is empty, if so, enter C10, otherwise, enter C4;
[0050] C4. Remove the first row of data from the saving matrix S , and find customer points from the initial set of drone paths And customer points One-to-one correspondence between drone paths and :
[0051] C5. Determine the drone path and drone paths Is it possible to merge? If yes, go to C6, otherwise, return to C3;
[0052] C6. Change the drone path and drone paths Fusion forms the drone path R:
[0053]
[0054] in, Represents the drone path An ordered set of vertices in , Represents the drone path An ordered set of vertices in ;
[0055] C7, check whether the fused drone path R satisfies both the drone maximum flight distance constraint and the load constraint. If so, go to C8, otherwise, return to C3;
[0056] C8. According to the inspection results, determine whether the drone path R satisfies the truck-drone collaboration constraint. If so, proceed to C9. Otherwise, return to C3. The truck-drone collaboration constraint includes the truck path constraint, the drone quantity constraint, and the customer demand constraint.
[0057] C9. Based on the judgment result of C8, the drone path set DR is updated and output, completing the construction of the initial solution to the multi-truck and multi-drone collaborative package collection and delivery problem.
[0058] Furthermore, the simultaneous conditions for fusion in C5 are:
[0059] Customer Point And customer points The visit must be made by a drone in the same truck;
[0060] Customer Point In the drone path The position in is the first customer point;
[0061] Customer Point In the drone path The position in is the last customer point;
[0062] Customer Point In the drone path The position in is the first customer point;
[0063] Customer Point In the drone path The location in is the last customer point.
[0064] Furthermore, the inspection of whether the fused drone path R meets the drone maximum flight distance constraint and load constraint is as follows:
[0065] Targeting drone paths Each vertex , judge whether it satisfies the , if the last vertex in the drone path R satisfies , then the drone path Satisfy the maximum flight distance constraint, otherwise, do not satisfy the maximum flight distance constraint of the drone, where d represents the current cumulative flight distance of the drone, and the initial , Indicates the maximum flight distance of each drone;
[0066] Targeting drone paths Each vertex in , calculate the one-dimensional array Y in the forward and backward order, and judge whether each value in the one-dimensional array Y ensures that the following formula is established. If so, the load constraint of the drone is satisfied. Otherwise, the load constraint of the drone is not satisfied. When traversing to the first value in the drone path R, Customer point, Add the number of packages that need to be delivered to the customer point, and calculate the number of packages that the drone needs to deliver when it leaves the drone path. Middle The number of packages carried by each customer, after calculating the drone path When the last customer is found, the values in the one-dimensional array Y are judged to ensure that the following formula holds:
[0067]
[0068] in, Indicates that the drone has left the drone path No. The number of packages carried when the vertex is Indicates the maximum package weight that can be carried. Represents the drone path The index of the vertex to access.
[0069] If the fused UAV path R does not satisfy the UAV's maximum flight distance constraint and flower-carrying constraint at the same time, return to C3; otherwise, enter C8.
[0070] Furthermore, the new solution is obtained by using a domain search strategy based on the current solution, which is specifically:
[0071] According to the current solution, a new solution is obtained by using the 2-Exchange strategy, deletion-insertion strategy, take-off point or landing point modification strategy and iterative optimization strategy to regenerate the truck path and drone path.
[0072] Furthermore, according to the current solution, a new solution is obtained by using the 2-Exchange strategy to regenerate the truck path and the drone path, which is specifically:
[0073] When two points selected from the truck path are both truck stops, the two points are swapped and the Prim clustering algorithm is used to select a truck stop for each customer point in the truck stop set, and the truck path and drone path are regenerated;
[0074] When both points selected from the drone path are customer points, determine whether the position exchange of the two points does not meet the maximum flight path constraint of the drone. If so, reselect the customer point. Otherwise, use the following formula to exchange the truck stops where the two customer points are clustered, and regenerate the truck path and drone path:
[0075]
[0076] in, and All represent customer points. Indicates customer point The truck stops are clustered. Represents clustering into truck stops The customer point set, Represents clustering into truck stops The customer point collection.
[0077] According to the current solution, a new solution is obtained using the deletion-insertion strategy to regenerate the truck path and the drone path, which are as follows:
[0078] When the point selected from the current solution is a truck stop in the current truck route, a truck route is randomly selected, the truck stop is randomly inserted into the truck route, and the points are clustered into truck stops using the following formula: The truck numbers corresponding to all customer points in are modified to the new truck numbers, and the drone paths that meet the constraints are regenerated based on the truck paths:
[0079]
[0080] in, Indicates customer point By truck Visited by drone, It means truck, Represents the customer point, Indicates that it is clustered into truck stops The customer point set;
[0081] When the point selected from the current solution is a customer point, from the customer point set Randomly select a customer point , use the following formula to reselect a truck stop for the customer within the maximum flight path of the drone, and update the truck stop corresponding to the customer point , and regenerate the truck path and drone path based on the clustering results;
[0082]
[0083] According to the current solution, the take-off point or landing point modification strategy is used to obtain a new solution, and the truck path and the drone path are regenerated, which are as follows:
[0084] Randomly select a drone path , use the following formula to convert the drone path The first customer point Cluster into truck stops, modify the truck stops, and regenerate truck routes and drone routes based on the clustering results:
[0085]
[0086] Randomly select a drone path , use the following formula to convert the drone path The corresponding last customer point is clustered into a truck stop, the truck stop is modified, and the truck path and drone path are regenerated based on the clustering results:
[0087]
[0088] According to the current solution, an iterative optimization strategy is used to obtain a new solution and regenerate the truck path and drone path, which are as follows:
[0089] Remove the truck stop with the highest profit from the current truck route and add the removed truck stop to the set of truck stops with positive removal cost. Use Prim's clustering algorithm to reshape the set. The customer point in reselects a feasible truck stop in the truck stop set, and regenerates the drone path and truck path based on the clustering results, where Indicates that it is clustered into truck stops The customer point collection.
[0090] Furthermore, the S5 comprises the following steps:
[0091] S501, using the inferior solution acceptance criteria, determine whether the new solution is accepted, if so, update the variable and current solution , and proceed to S503, otherwise, proceed to S502, where the expression of the inferior solution acceptance criterion is as follows:
[0092]
[0093] in, represents the probability of accepting a new solution, Indicates a new solution, represents the current solution, represents the objective function value of the current solution, represents the objective function value of the newly generated solution, Indicates the current annealing temperature;
[0094] S502, make variables The value of is increased by one, and the process goes to S503;
[0095] S503, using the following formula, update the current optimal solution and enter S6:
[0096]
[0097] in, represents the current optimal solution, Indicates the current optimal solution Total travel distance.
[0098] The beneficial effects of the present invention are:
[0099] (1) The present invention will consider using multiple trucks to coordinate multiple drones to collect and deliver packages to multiple dispersed customers: packages are collected at some customer points, these packages need to be delivered to another part of customer points, and some packages are delivered directly from the warehouse point to the customer point. The objective function is to minimize the total travel distance of trucks and drones after serving all customers. The present invention solves the following problems at the same time: (1) Determine the set of customer points that each drone needs to serve; (2) Determine the flight path of each drone; (3) Determine at which truck stops each truck should release / recover the drone and the order of visiting the above truck stops (i.e., the driving path of each truck), so that while satisfying the drone payload and flight distance constraints, the total travel distance of all trucks and drones is minimized to serve all customers.
[0100] (2) Different from the existing neighborhood search algorithms, in order to avoid falling into the local optimal solution, the present invention uses the Metropolis acceptance criterion: accepting worse solutions with a certain probability, and in order to avoid randomized search, a neighborhood structure that can be used for local optimization is designed. BRIEF DESCRIPTION OF THE DRAWINGS
[0101] Figure 1 The figure is a flow chart of the method of the present invention.
[0102] Figure 2 This is the truck stop point matrix to which each customer point is clustered based on recording in this embodiment. Constructing the initial drone path set Schematic diagram of .
[0103] Figure 3 This is the drone path in this embodiment. and drone paths When the fusion conditions are met, the customer clicks And customer points In the drone path and drone paths Schematic diagram of the location distribution in.
[0104] Figure 4 Schematic diagram of the truck-drone collaborative constraint in this embodiment.
[0105] Figure 5 Schematic diagram of customer demand constraints in this embodiment.
[0106] Figure 6This is a schematic diagram of the 2-Exchange strategy in this embodiment.
[0107] Figure 7 Schematic diagram of the deletion-insertion strategy in this embodiment.
[0108] Figure 8 This is a schematic diagram of the take-off point or landing point modification strategy in this embodiment. DETAILED DESCRIPTION
[0109] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0110] Example
[0111] First, given Customer points to be served , where the customer point set Belong to the first category of customers, Belongs to the second type of customers, customer point set Belong to the third type of customers, at the customer point Packages collected at the customer's point Delivery, , i.e. the first type of customers With the second type of customers There is an association relationship between them. At the same time, given the truck set is , the number of drones carried on each truck is , the maximum flight distance of each drone is The maximum package weight that can be carried is Finally, given Truck Stops Locations where truck stops is the initial position of each truck and the drone it carries, i.e., the warehouse point.
[0112] like Figure 1 As shown, the present invention provides a multi-truck multi-UAV task allocation method based on improved variable neighborhood descent, and its implementation method is as follows:
[0113] S1. Construct an initial solution to the problem of multi-truck and multi-drone collaborative package collection and delivery. The implementation method is as follows:
[0114] S101. Based on the given n customer points C to be served and the truck stop location set W, Prim clustering algorithm is used to obtain clustering results. The implementation method is as follows:
[0115] A1. Based on the given n customer points C to be served and the truck stop location set W, obtain the cost matrix D containing the Euclidean distances between each customer point and each truck stop point;
[0116] A2. According to the cost matrix D, use the Prim clustering algorithm to find a truck stop for each customer point that meets the maximum flight distance constraint of the drone, where the customer point To the top The expression for the shortest distance is as follows:
[0117]
[0118] in, Indicates customer point To the top The shortest distance, Represents a set of customer points Find a customer point in Indicates customer point Corresponding to the clustered truck stops, Represents the set of customer points that have not been clustered. Represents a set of customer points A customer point in Represents a set of vertices There is a vertex in indicates a truck stop, represents a set of vertices, represents the set of truck stop locations, Indicates the maximum flight distance of each drone;
[0119] A3. Based on the solution of A2, determine whether a feasible customer point has been found If yes, then go to A4, otherwise, based on the truck stop set If no solution is found that satisfies the maximum flight distance constraint of the UAV, the process ends;
[0120] A4. Collect from customer point Remove the customer point Add to Vertex Collection and update the truck stop collection And update customer points The corresponding stops are clustered ;
[0121] A5. Determine the customer point set Is it empty? If so, get the clustering result and go to S102; otherwise, return to A2;
[0122] S102. Based on the clustering results, the path of each truck is calculated using the minimum marginal cost algorithm. , generating a set of truck routes, which is implemented as follows:
[0123] B1. According to the clustering results, from the customer point set Pick a customer point , and determine the customer point Is it a second-class customer? If so, go to B3; otherwise, go to B2. In the customer point set Belongs to the first type of customers, customer point set Belongs to the second type of customers, customer point set Belong to the third category of customers, , , , , and All represent customer points;
[0124] B2. Use the following formula to get the truck stop point Corresponding customer points ,truck and trucks Insertion position on the path , and update the customer point set and the state matrix , enter B5:
[0125]
[0126] in, It means truck, Indicates customer point The truck stops that were clustered, Indicates location, Indicates that the truck will stop at Insert into truck Path locations, when the truck stops Already exists in the truck path When the marginal cost of returning is 0, there is no need to stop the truck at Repeated insertion, Represents the truck based on the distance matrix D path The distance Represents the customer point, represents the set of customer points, represents a collection of trucks;
[0127] The updated customer point set and the state matrix The expression is as follows:
[0128]
[0129] in, Represents the customer point, Represents the index of the customer point, i.e. Customer points.
[0130] B3. Use the following formula to get the truck stop point Corresponding customer points ,truck and trucks Insertion position on the path , enter B4:
[0131]
[0132] in, Indicates visiting the first type of customers The index of the truck where the drone is located, Indicates visiting the second type of customers Clustered truck stops Can be inserted into truck routes The starting position in Truck The path, Represents a truck route In the Insert truck stops at The distance after Represents a truck route Total distance;
[0133] B4, get the insertion position according to B3 Then, use the following formula to convert customer points Corresponding truck stops Insert into Truck Route Location At the same time, update the customer point set and the state matrix , and enter B5:
[0134]
[0135] The updated customer point set and the state matrix The expression is as follows:
[0136]
[0137]
[0138] in, represents the index of the first type of customer point and , Indicates the number of first-class customer points;
[0139] B5. Determine the customer point set Is it empty? If so, get the path of each truck. , output the truck path set, otherwise, return to B1;
[0140] S103. Based on the clustering results, a mileage saving algorithm is used to generate a drone path set DR, and the initial solution to the multi-truck and multi-drone collaborative package collection and delivery problem is constructed. The implementation method is as follows:
[0141] C1. According to the clustering results, use the following formula to calculate the savings matrix S of each customer point, and arrange the savings matrix S in descending order according to the savings value:
[0142]
[0143]
[0144] Among them, S represents the saving matrix, represents the total number of rows of the saving matrix S, and All represent customer points. Indicates cost savings, Represents a truck stop To customer point The Euclidean distance of Represents a truck stop To customer point The Euclidean distance of Indicates customer point To customer point The Euclidean distance of
[0145] C2, build the initial drone path set;
[0146] C3, determine whether the current saving matrix S is empty, if so, enter C10, otherwise, enter C4;
[0147] C4. Remove the first row of data from the saving matrix S , and find customer points from the initial set of drone paths And customer points One-to-one correspondence between drone paths and :
[0148] C5. Determine the drone path and drone paths Is it possible to merge? If yes, go to C6, otherwise, return to C3. The simultaneous conditions for fusion are:
[0149] Customer Point And customer points The visit must be made by a drone in the same truck;
[0150] Customer Point In the drone path The position in is the first customer point;
[0151] Customer Point In the drone path The position in is the last customer point;
[0152] Customer Point In the drone path The position in is the first customer point;
[0153] Customer Point In the drone path The position in is the last customer point;
[0154] C6. Change the drone path and drone paths Fusion forms the drone path R:
[0155]
[0156] in, Represents the drone path An ordered set of vertices in , Represents the drone path An ordered set of vertices in ;
[0157] C7, check whether the fused drone path R satisfies both the drone maximum flight distance constraint and the load constraint. If so, go to C8, otherwise, return to C3;
[0158] Targeting drone paths Each vertex , judge whether it satisfies the , if the last vertex in the drone path R satisfies , then the drone path Satisfy the maximum flight distance constraint, otherwise, do not satisfy the maximum flight distance constraint of the drone, where d represents the current cumulative flight distance of the drone, and the initial , Indicates the maximum flight distance of each drone;
[0159] Targeting drone paths Each vertex in , calculate the one-dimensional array Y in the forward and backward order, and judge whether each value in the one-dimensional array Y ensures that the following formula is established. If so, the load constraint of the drone is satisfied. Otherwise, the load constraint of the drone is not satisfied. When traversing to the first value in the drone path R, Customer point, Add the number of packages that need to be delivered to the customer point, and calculate the number of packages that the drone needs to deliver when it leaves the drone path. Middle The number of packages carried by each customer, after calculating the drone path When the last customer is found, the values in the one-dimensional array Y are judged to ensure that the following formula holds:
[0160]
[0161] in, Indicates that the drone has left the drone path No. The number of packages carried when the vertex is Indicates the maximum package weight that can be carried. Represents the drone path The index of the vertex to access.
[0162] If the fused drone path R does not satisfy the maximum flight distance constraint and the flower-carrying constraint of the drone at the same time, return to C3, otherwise, enter C8;
[0163] C8. According to the inspection results, determine whether the drone path R satisfies the truck-drone collaboration constraint. If so, proceed to C9. Otherwise, return to C3. The truck-drone collaboration constraint includes the truck path constraint, the drone quantity constraint, and the customer demand constraint.
[0164] C9, based on the judgment result of C8, updates the drone path set DR, and outputs the drone path set DR, completing the construction of the initial solution to the multi-truck and multi-drone collaborative package collection and delivery problem;
[0165] S2, initializing the current optimal solution and the current solution, and initializing the current annealing temperature, wherein the current solution is the initial solution constructed in S1;
[0166] S3, determine whether the current annealing temperature is greater than or equal to the termination temperature, if so, proceed to S4, otherwise, proceed to S7;
[0167] S4. Based on the current solution, a new solution is obtained using the domain search strategy to regenerate the truck path and the drone path, which is specifically:
[0168] According to the current solution, a new solution is obtained by using the 2-Exchange strategy, the deletion-insertion strategy, the take-off point or landing point modification strategy, and the iterative optimization strategy to regenerate the truck path and the drone path.
[0169] According to the current solution, a new solution is obtained by using the 2-Exchange strategy to regenerate the truck path and the drone path, which is specifically:
[0170] When two points selected from the truck path are both truck stops, the two points are swapped and the Prim clustering algorithm is used to select a truck stop for each customer point in the truck stop set, and the truck path and drone path are regenerated;
[0171] When both points selected from the drone path are customer points, determine whether the position exchange of the two points does not meet the maximum flight path constraint of the drone. If so, reselect the customer point. Otherwise, use the following formula to exchange the truck stops where the two customer points are clustered, and regenerate the truck path and drone path:
[0172]
[0173] in, and All represent customer points. Indicates customer point The truck stops are clustered. Represents clustering into truck stops The customer point set, Represents clustering into truck stops The customer point collection.
[0174] According to the current solution, a new solution is obtained using the deletion-insertion strategy to regenerate the truck path and the drone path, which are as follows:
[0175] When the point selected from the current solution is a truck stop in the current truck route, a truck route is randomly selected, the truck stop is randomly inserted into the truck route, and the points are clustered into truck stops using the following formula: The truck numbers corresponding to all customer points in are modified to the new truck numbers, and the drone paths that meet the constraints are regenerated based on the truck paths:
[0176]
[0177] in, Indicates customer point By truck Visited by drone, It means truck, Represents the customer point, Indicates that it is clustered into truck stops The customer point set;
[0178] When the point selected from the current solution is a customer point, from the customer point set Randomly select a customer point , use the following formula to reselect a truck stop for the customer within the maximum flight path of the drone, and update the truck stop corresponding to the customer point , and regenerate the truck path and drone path based on the clustering results;
[0179]
[0180] According to the current solution, the take-off point or landing point modification strategy is used to obtain a new solution, and the truck path and the drone path are regenerated, which are as follows:
[0181] Randomly select a drone path , use the following formula to convert the drone path The first customer point Cluster into truck stops, modify the truck stops, and regenerate truck routes and drone routes based on the clustering results:
[0182]
[0183] Randomly select a drone path , use the following formula to convert the drone path The corresponding last customer point is clustered into a truck stop, the truck stop is modified, and the truck path and drone path are regenerated based on the clustering results:
[0184]
[0185] According to the current solution, an iterative optimization strategy is used to obtain a new solution and regenerate the truck path and drone path, which are as follows:
[0186] Remove the truck stop with the highest profit from the current truck route and add the removed truck stop to the set of truck stops with positive removal cost. Use Prim's clustering algorithm to reshape the set. The customer point in reselects a feasible truck stop in the truck stop set, and regenerates the drone path and truck path based on the clustering results, where Indicates that it is clustered into truck stops The customer point set;
[0187] S5. When the new solution is accepted, the current optimal solution is updated. The implementation method is as follows:
[0188] S501, using the inferior solution acceptance criteria, determine whether the new solution is accepted, if so, update the variable and current solution , and proceed to S503, otherwise, proceed to S502, where the expression of the inferior solution acceptance criterion is as follows:
[0189]
[0190] in, represents the probability of accepting a new solution, Indicates a new solution, represents the current solution, represents the objective function value of the current solution, represents the objective function value of the newly generated solution, Indicates the current annealing temperature;
[0191] S502, make variables The value of is increased by one, and the process goes to S503;
[0192] S503, using the following formula, update the current optimal solution and enter S6:
[0193]
[0194] in, represents the current optimal solution, Indicates the current optimal solution Total travel distance;
[0195] S6, when all neighborhood structures have been applied to the current solution, cooling is performed and the process proceeds to S7;
[0196] S7. Output the multi-truck and multi-UAV task allocation strategy to complete the multi-truck and multi-UAV task allocation based on improved variable neighborhood descent.
[0197] In this embodiment, the present invention provides a multi-truck multi-UAV task allocation method based on improved variable neighborhood descent:
[0198] Step 1: Construct an initial solution : The initial solution is constructed by integrating Prim clustering algorithm, mileage saving algorithm and minimum marginal cost algorithm;
[0199] Step 2: Initialize the current optimal solution 、Current solution And the current annealing temperature t:
[0200] (1)
[0201] in, The input parameter for the Prim clustering algorithm represents the initial annealing temperature;
[0202] Step 3: Determine whether the current annealing temperature t is greater than or equal to the termination temperature :like , then jump to step 11 and directly return to the current optimal solution ;like , then continue to execute downward;
[0203] Step 4: Current solution Application A new solution to the neighborhood search strategy ,in, is initialized to 1;
[0204] Step 5: Determine the new solution Is it acceptable? (1) If the new solution The objective function value is better than the current solution If the objective function value is small, it can be accepted; (2) New solution The acceptance criterion of the inferior solution is used to determine whether it is accepted. The inferior solution acceptance criterion will accept a worse solution with a certain probability, which is expressed as follows:
[0205] (2)
[0206] in, Indicates the current annealing temperature, and its starting temperature is , is the objective function value of the newly generated solution, is the objective function value of the current solution;
[0207] Step 6: If the new solution If accepted, update the variable and current solution :
[0208] (3)
[0209] Step 7: If the new solution is not accepted, then let the variable The value of is increased by one;
[0210] Step 8: Update the current optimal solution:
[0211] (4)
[0212] Step 9: Determine whether the current solution has been After applying all neighborhood structures, the judgment variable Is it greater than , Represents the number of neighborhood structure types. In the present invention, ;
[0213] Step 10: If the variable Greater than , then cool down:
[0214] (5)
[0215] in, Indicates the cooling rate;
[0216] Step 11: Output the current optimal solution .
[0217] In this embodiment, the present invention generates an initial solution to the problem of multi-truck and multi-drone collaborative package collection and delivery by integrating the Prim clustering algorithm, the mileage saving algorithm and the minimum marginal cost algorithm.
[0218] In this embodiment, the Prim clustering algorithm is as follows:
[0219] Step D1: Based on the given n customer points C to be served and the truck stop point location set W, obtain the cost matrix D containing the Euclidean distances between each customer point and each truck stop point, where: Represents a vertex and The Euclidean distance between Initially, , Represents the initial set of truck stops.
[0220] Step D2: Use the Prim clustering algorithm to find a truck stop or warehouse point for each customer point that meets the maximum flight distance constraint of the drone. The drone will take off from the truck stop or warehouse point to serve the customer point. Assume Contains the points that have been clustered into truck stops Customer point collection and truck stop points , It represents the set of truck stops needed to serve all customer points and the warehouse points where all trucks are initially located. Represents the set of customer points that have not been clustered. Initially, , , , Indicates Truck stops, meet at customer point Find a customer point and the truck stops to which they are clustered : Compared with other stops, the vertex set There is a vertex in , so that customers point To the top The distance is the shortest, as shown below:
[0221] (6)
[0222] Step D3: Determine whether a feasible customer point can be found :If the customer point cannot be found , then the current stage of the algorithm ends, indicating that based on the truck stop point set If no solution is found that satisfies the maximum flight distance constraint of the drone, it will return directly that there is no solution. If the customer point can be found , then continue to execute downward;
[0223] Step D4: Click the customer Collect from customer point Remove it from the vertex set and add it to the vertex set and update the truck stop collection In order to record the truck stops that each customer point is clustered into, a set . At the same time, the customer points need to be updated The corresponding stops are clustered , respectively expressed as:
[0224] (7)
[0225] Step D5: Determine the customer point set Is it empty: If the customer point set If it is not empty, jump to step D2; if the customer point set If it is empty, the Prim clustering algorithm is executed and the clustering result is output: vertex set , Truck Stop Collection , ,in, , Indicates customer point The truck stops that were clustered;
[0226] In this embodiment, the truck path is generated as follows:
[0227] Based on the results of the Prim clustering algorithm, the minimum marginal cost algorithm is used to solve the problem of each truck Path , m represents the number of trucks, initially, , Truck The initial warehouse point, that is, the path of each truck starts from the corresponding warehouse point. Since some customer points are associated, it is necessary to calculate the truck path from the perspective of the customer point. The main idea is to first collect the customer points The corresponding truck stop set is inserted first, and then the customer point set The corresponding truck stop point set. Let the customer point set corresponding to the current set of truck stops be FC. Initially, , where each customer point The corresponding truck stop is At the same time, in order to record the insertion position of the truck stop corresponding to the first type of customer point, a size of The matrix , represents the number of customers of the first category, where the first row of data records the truck number, and the second row of data records the location of the truck stop corresponding to the customer point inserted into the truck path. Based on different customer points, different strategies need to be used to insert truck stops. The detailed steps for calculating the path of each truck are as follows:
[0228] Step E1: Gather from customer points Take out a customer point , determine whether it is a second-type customer.
[0229] Step E2: If the selected customer point If the customer is not a second-class customer, the following strategy is used to identify the corresponding truck stop point. Choose the right customer point ,truck and trucks Insertion position on the path :
[0230] (8)
[0231] in, It means truck, Indicates customer point The truck stops that were clustered, Indicates location, Indicates that the truck will stop at Insert into truck Path locations, when the truck stops Already exists in the truck path When the marginal cost of returning is 0, there is no need to stop the truck at Repeated insertion, Represents the truck based on the distance matrix D path The distance Represents the customer point, represents the set of customer points, represents a collection of trucks;
[0232] Step E3: Update and the state matrix , which is expressed as follows:
[0233] (9)
[0234] Among them, the customer points Add to collection Truck stops are also recorded Insertion location: the truck number and the location on the truck's route;
[0235] Step E4: If the selected customer point If the customer is the second type, the following strategy is used to assign the corresponding truck stop to the customer: Choose the right customer point ,truck and trucks Insertion position on the path :
[0236] (10)
[0237] in, Indicates visiting the first type of customers The index of the truck where the drone is located, Indicates visiting the second type of customers Clustered truck stops Can be inserted into truck routes The starting position in Truck The path, Represents a truck route In the Insert truck stops at The distance after Represents a truck route The total distance of the truck stop is limited to Can only be inserted into the truck On the path, ensure customer service points and The drones are carried by the same truck. It also limits the truck’s stopping points. Can only be inserted into the truck path Location later;
[0238] Step E5: Update the truck route set , Customer Point Collection , in order to record the visit customer point The truck number corresponding to the drone is declared as a variable , indicating the customer point By truck Find the customer point ,truck and trucks Insertion position on the path After that, the customer clicks Corresponding truck stops Insert into truck route on Position:
[0239] (11)
[0240] Update the customer point set at the same time , and the state matrix :
[0241] (12)
[0242] (13)
[0243] Conditions in formula (13): and must be true at the same time for the matrix To update, you need to update the truck Position on the path The location of the stop in the route is inserted later;
[0244] Step E6: Determine the customer point set Is it empty: If the customer point set is not empty, jump to step E1; if the customer point set If it is empty, it means that the truck route calculation is completed and the truck route set is output.
[0245] In this embodiment, the generation of the drone path is as follows: The present invention is based on the result of Prim clustering: the set of customer points clustered to each stop , the collection of truck stops needed to serve all customers , the truck stop corresponding to each customer point ,in, , the drone path is generated by the mileage saving algorithm. The detailed steps are as follows:
[0246] Step F1: Calculate the savings matrix S of each pair of customer points, and sort the savings matrix S in descending order according to the savings value. First, calculate the distance cost savings brought by the formation of a flight path between each pair of customer points. Suppose the customer points currently calculated are and , then the customer points and Cost savings from continuous access The calculation is as follows:
[0247] (13)
[0248] In the formula, Represents a truck stop To customer point The Euclidean distance of . If , then the customer points , and Recorded in the saving matrix S, , expressed as:
[0249] (14)
[0250] in, Represents the total number of rows of the saving matrix S. Initially, After calculating the savings values between all customer points, the savings matrix is sorted in descending order according to the savings values to re-form the savings matrix S;
[0251] Step F2: Construct the initial UAV path set. Suppose the initial UAV path set is , Indicates the access point to the customer The initial UAV path is , i.e. service customer point The take-off and landing points are , represents the number of the customer point, n represents the total number of customer points, and i represents the customer point index. The schematic diagram is as follows Figure 2 As shown, Figure 2 Squares represent truck stops, circles represent customer points, and arrows represent drone paths. All represent customer points. All indicate truck stops;
[0252] Step F3: Determine the current saving matrix Is it empty? If it saves the matrix If it is empty, jump to step F10;
[0253] Step F4: If the conservation matrix , assuming the conservation matrix The first row of data is , then from the saving matrix Remove the first row of data from the drone path collection Find customer points And customer points One-to-one correspondence between drone paths and ;
[0254] Step F5: Determine the drone path and drone paths Can it be integrated? Drone path and drone paths Three conditions must be met for integration: (1) Customer point And customer points must be accessed by a drone on the same truck, i.e. , Indicates customer point By truck (2) Customer Points In the drone path The position in is the first customer point or the last customer point; (3) Customer point In the drone path The location in is the first customer point or the last customer point. and drone paths If fusion is not possible, jump to step F3; if the drone path and drone paths If they can be integrated, the execution will proceed;
[0255] Step F6: Set the drone path and drone paths The fusion forms the drone path R. The specific fusion process is based on the customer point And customer points In the drone path and drone paths The position in the will be different, which can be divided into the following four cases:
[0256] 1) Customer Point The drone path The last customer point served in The drone path The first customer point served in ;
[0257] 2) Customer Point The drone path The last customer point served in The drone path The last customer point served in ;
[0258] 3) Customer Point The drone path The first customer point to be served in The drone path The first customer point served in ;
[0259] 4) Customer Point The drone path The first customer point to be served in The drone path The last customer point served in like Figure 3 As shown, Figure 3 (a) indicates ; Figure 3 (b) means ; Figure 3 (c) indicates ; Figure 3 (d) means , for the above four situations, the drone path and Fusion of newly generated drone paths It can be expressed as:
[0260] (15)
[0261] in, Represents the drone path An ordered set of vertices in , Represents the drone path An ordered set of vertices in ;
[0262] Step F7: Check whether the UAV path R generated by the fusion meets the UAV's load constraint and maximum flight distance constraint:
[0263] 1) Check the maximum flight distance constraint: for each vertex in the drone path R , declare variables Indicates the current accumulated flight distance of the drone, and checks from the front to the back to determine whether the conditions are met. , initially, :
[0264] (16)
[0265] If the drone path is calculated The last vertex in , and satisfies the condition , then the drone path The maximum flight distance constraint is met, otherwise, the maximum flight distance constraint of the drone is not met;
[0266] 2) Load constraint check: for the drone path Each vertex in , declare the size to be The one-dimensional array Y represents the path of the drone leaving the drone The set of vertices in The number of packages carried at the time. Declare variables for different customer types and :when For the first type of customer points, ;when For the second or third type of customer points, , initially, , calculate the one-dimensional array Y in order from front to back. When there are multiple customers, Add the number of packages that need to be delivered to the customer point, :
[0267] (17)
[0268] At the same time, it is necessary to calculate the UAV's path R when leaving the UAV. Number of packages carried by each customer:
[0269] (18)
[0270] When the last customer point in the drone path R is calculated, the one-dimensional array is judged For each value in , ensure that the following conditions are met:
[0271] (19)
[0272] If formula (19) holds true, it means that the newly generated UAV path is integrated If the load constraint of the UAV is satisfied, otherwise, the load constraint of the UAV is not satisfied. If the maximum flight distance constraint and load constraint of the UAV are not met at the same time, jump to step F3; if the UAV path If the maximum flight distance constraint and load constraint of the UAV are met, then continue to proceed, such as Figure 4 As shown, Figure 4 (a) Truck path constraint: The UAV path should be visited first Take-off point, then visit its landing point; Figure 4 (b) UAV quantity constraint: The truck carries only two UAVs, but the fusion generated UAV paths But a truck is needed to carry 3 drones;
[0273] Step F8: Determine the drone path Whether the truck-drone collaboration constraints are met: Truck-drone collaboration constraints mainly include: 1) truck path constraints; 2) drone quantity constraints; 3) customer demand constraints:
[0274] 1) Truck path constraint: UAV path The take-off and landing points are different, and the truck visits the drone path first The landing point, then visit its take-off point, then the drone path Not feasible;
[0275] 2) UAV quantity constraint: Assume that the UAV path By truck The UAV on the network visits, and the path of truck h is , that is, truck h visits the truck stop Then, we visited the drone path Take-off point . Let the set of drone paths be for:
[0276] (20)
[0277] In the drone path collection Find the ones with different take-off and landing points. is the set of drone paths for the take-off point and the landing point, respectively. and , that is, truck Leaving a Truck Stop The number of drones carried is To ensure that when a truck arrives at a truck stop Finally, there are drones that can fly from truck stops Take off and execute the drone path , must meet the following requirements:
[0278] (twenty one)
[0279] (twenty two)
[0280] To count the number of drones , you need to get from the truck path Trucks departing from the truck stop are counted in order from the front to the back Number of drones carried , until the number of drones is calculated After stopping, initially, .truck The number of drones leaving the warehouse is:
[0281] (twenty three)
[0282] If at this time ,but that is , otherwise, continue calculating:
[0283] (twenty four)
[0284] (25)
[0285] When calculating the truck After the number of drones leaving the warehouse is calculated, continue to use equations (24) and (25) until .in, Indicates a truck stop with different take-off and landing points is the set of drone paths for the landing point, Indicates a truck stop with different take-off and landing points is the set of drone paths at the take-off point. After the above calculation, if the drone path If the addition of cannot satisfy the constraint of the number of drones, then jump back to step F3, otherwise, continue to proceed as follows. Figure 5 As shown, the fusion generated UAV path Leading to visiting the customer point first , then visit the customer point , in the figure, They represent the take-off point and landing point of the UAV path R, and R represents the UAV path.
[0286] 3) Customer demand constraints: check the drone paths one by one The situation of each customer in the drone path varies according to the type of customer. There are three unfeasible situations: 1) Drone path There is a pair of associated customer points in and , but the drone visits the customer point first , then visit the customer point 2) Drone path There are customer points in , the customer points Point with customers There is a correlation, but the drone on the truck visits the customer point first , then visit the customer point ; 3) Drone path There are customer points in , the customer point and the customer point There is a correlation, but the drone on the truck visits the customer point first , then visit the customer point , if the drone path If the truck-drone collaboration constraint is not met, jump to step F3, otherwise continue to execute;
[0287] Step F9: Collect the drone paths To update:
[0288] (26)
[0289] Step F10: Calculate the drone path and output the drone path set .
[0290] In this example, in order to improve the initial solution, this section introduces in detail four neighborhood structures related to the research problem and their corresponding solution repair strategies. The four neighborhood structures are: (1) 2-Exchange strategy; (2) Delete-Insert strategy; (3) Take-off or landing point modification strategy; (4) Iterative optimization strategy.
[0291] (1) 2-Exchange strategy:
[0292] The 2-Exchange strategy randomly selects two points from the path and swaps their positions. Considering the particularity of the problem of the present invention, it can be mainly divided into the following two cases:
[0293] 1) When both selected points are truck stops, the truck stop Outside the solution, that is, there is a truck stop located in the current solution In addition to the corresponding truck path, such as Figure 6 As shown in (a).
[0294] 2) When the two selected points are both customer points, let the two selected customer points be and , then it is necessary to determine whether exchanging the two customer points will violate the maximum flight distance constraint of the drone, that is, to determine and Are they all less than the maximum flight distance of the drone? If the maximum flight distance constraint of the UAV is met, the exchange can be performed, such as Figure 6 As shown in (b). In the figure, represents the take-off and landing points of the drone path R, Respectively represent customer points and The truck stops that are clustered.
[0295] Repair strategy: After exchanging the selected points, the solution needs to be repaired according to different situations. When the two selected points are truck stops, use equations (6) and (7) to calculate the truck stop set. The Pirm clustering algorithm is used to select a suitable truck stop for each customer point, and then the truck path and the drone path are regenerated. When the two selected points are customer points and meet the drone constraint, it is necessary to use formula (27) to exchange the truck stops to which the two customer points are clustered, and then regenerate the truck path and the drone path:
[0296] (27)
[0297] (2) Deletion-insertion strategy
[0298] The delete-insert strategy randomly selects a point from the current solution, deletes it from its current position, and then randomly inserts it to another position. In the context of the present invention, two types can be distinguished:
[0299] 1) When the selected point is a truck stop in the current truck route: Since there is a certain association between the first type of customers and the second type of customers, if the customer point and Truck stops that are not served by the same drone on the same flight path Must precede truck stop Therefore, the customer point corresponding to the truck stop selected this time is the third type of customer. From the truck route set, randomly select a truck stop, then randomly select a truck route, and randomly insert the stop into the truck route, such as Figure 7 As shown in (a), the truck stop selected is Note that we need to use formula (28) to cluster into truck stops The truck numbers corresponding to all customer points in are changed to the new truck numbers, as shown below:
[0300] (28)
[0301] in, For the truck number selected first, you need to put the truck stop Randomly insert into truck in the path.
[0302] 2) When the selected point is a customer point: From the customer point set Randomly select a customer , reselect a truck stop that is within the maximum flight distance of the drone , and update the truck stop corresponding to the customer point, as shown in formula (29), Figure 7 As shown in (b):
[0303] (29)
[0304] Repair strategy: If the selected point is a truck stop, then according to the above-mentioned drone path generation process, a set of drone paths that meet the constraints can be regenerated based on the truck path; if the selected point is a customer point, it is necessary to regenerate the truck path and drone path based on the clustering results.
[0305] (3) Take-off or landing point modification strategy
[0306] Take-off or landing point modification strategy randomly selects a drone path , the take-off point or landing point of the drone path is changed to other truck stops, which can be divided into the following two cases:
[0307] 1) Modify the take-off point: change the drone path The first customer point The clustered truck stops can be modified by modifying ,like Figure 8 As shown in (a). Assume that The truck stop point randomly selected from the set of truck stops within the maximum flight distance of the drone is , then use formula (30) to update the customer point The corresponding truck stop.
[0308] (30)
[0309] 2) Modify the landing point: change the drone path The corresponding last customer point The clustered truck stops are modified, that is, modified ,like Figure 8 As shown in (b). Assume that The truck stop point randomly selected from the set of truck stops within the maximum flight distance of the drone is , then use formula (31) to update the customer point The corresponding truck stop.
[0310] (31)
[0311] Repair strategy: Modify the drone path After finding the truck stop corresponding to the first or last customer in the cluster, you need to regenerate the solution based on the clustering results.
[0312] (4) Iterative optimization strategy
[0313] The purpose of the iterative optimization strategy is to narrow the search range and prevent the solution from being optimized for a long time. The main idea is to remove the truck stop with the largest removal benefit from the current truck route. The removal cost is defined as: Assume that the removed truck stop , the objective function value corresponding to the regenerated solution is , the removal cost is ,in, is the objective function value corresponding to the original solution. In order to reduce the time of searching for the truck stop with the largest removal cost, let the set The set of truck stops with positive removal costs is initially empty. After the first search, truck stops with positive removal costs are added to As shown below:
[0314] (32)
[0315] Find the most expensive truck stops to remove next time When you are in the collection You can search for it in as follows:
[0316] (33)
[0317] Then, according to the Prim clustering algorithm, the clusters in the set Customer points in the truck stop collection A feasible truck stop is reselected in the , and then the drone path and truck path are regenerated based on the results of Prim clustering.
Claims
1. A multi-truck and multi-UAV task allocation method based on improved variable neighborhood descent, characterized in that: The following steps are involved: S1. Construct an initial solution to the problem of multi-truck and multi-drone collaborative package collection and delivery; The S1 comprises the following steps: S101, according to the given n customer points to be served and the truck stop point location set W, using Prim clustering algorithm, obtain clustering results, the n customer points to be served constitute a customer point set C; S102. Based on the clustering results, the path of each truck is calculated using the minimum marginal cost algorithm. , generate a set of truck routes; S103. Based on the clustering results, a mileage saving algorithm is used to generate a drone path set DR, and an initial solution to the multi-truck and multi-drone collaborative package collection and delivery problem is constructed; The S103 comprises the following steps: C1. According to the clustering results, use the following formula to calculate the savings matrix S of each customer point, and arrange the savings matrix S in descending order according to the savings value: ; ; Among them, S represents the saving matrix, represents the total number of rows of the saving matrix S, and Respectively represent the rth customer point and the kth customer point, Indicates cost savings, Represents a truck stop To customer point The Euclidean distance of Represents a truck stop To customer point The Euclidean distance of Indicates customer point To customer point The Euclidean distance, Indicates customer point The truck stops that were clustered, Indicates customer point The truck stops that were clustered; C2, build the initial drone path set; C3, determine whether the current saving matrix S is empty. If so, the calculation of the drone path ends and the drone path set DR is output. Otherwise, enter C4; C4. Remove the first row of data from the saving matrix S , and find customer points from the initial set of drone paths And customer points One-to-one correspondence between drone paths and : C5. Determine the drone path and drone paths Is it possible to merge? If yes, go to C6, otherwise, return to C3; C6. Change the drone path and drone paths Fusion forms the drone path R: ; in, Represents the drone path An ordered set of vertices in , Represents the drone path An ordered set of vertices in , and Represent the drone paths and The total number of vertices; C7, check whether the fused drone path R satisfies both the drone maximum flight distance constraint and the load constraint. If so, go to C8, otherwise, return to C3; C8. According to the inspection results, determine whether the drone path R satisfies the truck-drone collaboration constraint. If so, proceed to C9. Otherwise, return to C3. The truck-drone collaboration constraint includes the truck path constraint, the drone quantity constraint, and the customer demand constraint. C9, based on the judgment result of C8, updates the drone path set DR, and outputs the drone path set DR, completing the construction of the initial solution to the multi-truck and multi-drone collaborative package collection and delivery problem; S2, initializing the current optimal solution and the current solution, and initializing the current annealing temperature, wherein the current solution is the initial solution constructed in S1; S3, determine whether the current annealing temperature is greater than or equal to the termination temperature, if so, proceed to S4, otherwise, proceed to S7; S4. Based on the current solution, a new solution is obtained using a neighborhood search strategy to regenerate the truck path and the UAV path; The S4 is specifically: According to the current solution, a new solution is obtained by using the 2-Exchange strategy, the deletion-insertion strategy, the take-off point or landing point modification strategy, and the iterative optimization strategy to regenerate the truck path and the drone path. According to the current solution, a new solution is obtained by using the 2-Exchange strategy to regenerate the truck path and the drone path, which is specifically: When two points selected from the truck path are both truck stops, the two points are swapped and a truck stop is selected for each customer point using the Prim clustering algorithm from the truck stop location set, and the truck path and drone path are regenerated; When both points selected from the drone path are customer points, determine whether the position exchange of the two points does not meet the maximum flight path constraint of the drone. If so, reselect the customer point. Otherwise, use the following formula to exchange the truck stops where the two customer points are clustered, and regenerate the truck path and drone path: ; in, , Represents the i-th customer point , the jth customer point The truck stops are clustered. Represents clustering into truck stops The customer point set, Represents clustering into truck stops The customer point set; According to the current solution, a new solution is obtained using the deletion-insertion strategy to regenerate the truck path and the drone path, which are as follows: When the point selected from the current solution is a truck stop in the current truck path, a truck path is randomly selected, the truck stop is randomly inserted into the truck path, and the points are clustered to the truck stop using the following formula: The truck numbers corresponding to all customer points in are modified to the new truck numbers, and the drone paths that meet the constraints are regenerated based on the truck paths: ; in, Indicates customer point By truck Visited by drone, It means truck, Represents clustering into truck stops Customer points in Indicates that it is clustered into truck stops The customer point set; When the point selected from the current solution is a customer point, Randomly select a customer point , use the following formula to reselect a truck stop for the customer within the maximum flight path of the drone, and update the truck stop corresponding to the customer point , and regenerate the truck path and drone path based on the clustering results; ; in, Indicates that it is clustered into truck stops The customer point set; According to the current solution, the take-off point or landing point modification strategy is used to obtain a new solution, and the truck path and the drone path are regenerated, which are as follows: Randomly select a drone path , use the following formula to convert the drone path The first customer point Cluster into truck stops , modify the truck stops and regenerate the truck routes and drone routes based on the clustering results: ; Randomly select a drone path , use the following formula to convert the drone path The corresponding last customer point cj is clustered to the truck stop , modify the truck stops and regenerate the truck routes and drone routes based on the clustering results: ; According to the current solution, an iterative optimization strategy is used to obtain a new solution and regenerate the truck path and drone path, which are as follows: Remove the truck stop with the highest profit from the current truck route and add the removed truck stop to the set of truck stops with positive removal cost. Use Prim's clustering algorithm to reshape the set. The customer point in reselects a feasible truck stop in the truck stop location set, and regenerates the drone path and truck path based on the clustering results, where Indicates that it is clustered into truck stops The customer point set; S5. When the new solution is accepted, update the current optimal solution; The S5 comprises the following steps: S501, using the inferior solution acceptance criteria, determine whether the new solution is accepted, if so, update the variable I and the current solution , and proceed to S503, otherwise, proceed to S502, where the expression of the inferior solution acceptance criterion is as follows: ; in, represents the probability of accepting a new solution, Indicates a new solution, represents the current solution, represents the objective function value of the current solution, represents the objective function value of the new solution, represents the current annealing temperature, and I represents the number of neighborhood structure types; S502, increment the value of variable I by 1, and proceed to S503; S503, update the current optimal solution and enter S6; S6, when the current solution has applied all neighborhood structures, cooling is performed and entering S7; S7. Output the multi-truck and multi-UAV task allocation strategy to complete the multi-truck and multi-UAV task allocation based on improved variable neighborhood descent.
2. The multi-truck and multi-UAV task allocation method based on improved variable neighborhood descent according to claim 1 is characterized in that: The S101 includes the following steps: A1. Based on the given set W of n customer points to be served and truck stop points, obtain a cost matrix D containing the Euclidean distances between each customer point and each truck stop point; A2. According to the cost matrix D, use the Prim clustering algorithm to find a truck stop for each customer point that meets the maximum flight distance constraint of the drone, where the customer point To the top The expression for the shortest distance is as follows: ; in, Indicates customer point To the top The shortest distance, Represents the customer point set C u Truck Stop The nearest customer point, Indicates customer point Corresponding to the clustered truck stops, Represents the set of unclustered customer points. Initially, , Represents a set of customer points A customer point in Represents a set of vertices There is a vertex in indicates a truck stop, represents a set of vertices, represents the set of truck stop locations, Indicates the maximum flight distance of each drone, Represents a vertex and The Euclidean distance between A3. Based on the solution of A2, determine whether a feasible customer point has been found If yes, proceed to A4, otherwise, based on the truck stop location set If no solution is found that satisfies the maximum flight distance constraint of the UAV, the process ends; A4. Collect from customer point Remove the customer point Add to Vertex Collection and update the collection And update customer points The corresponding stops are clustered , The set of truck stops that need to be used to serve all customer points and the initial warehouse points where all trucks are located; A5. Determine the customer point set Is it empty? If so, get the clustering result and go to S102; otherwise, return to A2.
3. The multi-truck and multi-UAV task allocation method based on improved variable neighborhood descent according to claim 1 is characterized in that: The three conditions that must be met for fusion in C5 are: Customer Point And customer points The visit must be made by a drone in the same truck; Customer Point In the drone path The position in is the first customer point or the last customer point; Customer Point In the drone path The position in is the first customer point or the last customer point.
4. The multi-truck and multi-UAV task allocation method based on improved variable neighborhood descent according to claim 3 is characterized in that: The checking of whether the fused drone path R satisfies both the drone maximum flight distance constraint and the load constraint is as follows: Targeting drone paths Each vertex , judge whether it satisfies the , if satisfied , then the drone path Satisfy the maximum flight distance constraint, otherwise, do not satisfy the maximum flight distance constraint of the drone, where d represents the current cumulative flight distance of the drone, and the initial , Indicates the maximum flight distance of each drone; Targeting drone paths Each vertex in , calculate the one-dimensional array Y in order from front to back, and judge whether each value in the one-dimensional array Y makes the following equation true. If so, the load constraint of the drone is satisfied. Otherwise, the load constraint of the drone is not satisfied. When traversing to the first value in the drone path R, Customer point, Add the number of packages that need to be delivered to the customer point, and calculate the number of packages that the drone needs to deliver when it leaves the drone path. Middle The number of packages carried by each customer point, after calculating the drone path When the last customer is found, determine whether the values in the one-dimensional array Y satisfy the following equation: ; in, Indicates that the drone has left the drone path No. The number of packages carried when the vertex is Indicates the maximum package weight that can be carried. Represents the drone path The index of the vertex to access in; If the fused UAV path R does not satisfy the UAV's maximum flight distance constraint and load constraint at the same time, return to C3, otherwise, enter C8.
