A logistics distribution path acquisition method, device, equipment and storage medium
By modeling the logistics delivery route as a CVRP model and using a large language model to generate a destructive heuristic strategy to disrupt and reconstruct the delivery route, the efficiency and stability problems of existing path optimization algorithms are solved, and efficient and stable path optimization is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN UNIV
- Filing Date
- 2026-04-13
- Publication Date
- 2026-06-16
AI Technical Summary
In large-scale urban logistics and distribution scenarios, existing technologies for path optimization algorithms are insufficient in terms of solution efficiency, search capability, and algorithm stability, making it difficult to obtain high-quality delivery solutions.
The logistics delivery route planning is modeled as a CVRP model. By generating randomly inserted initial solutions, a disruption heuristic strategy is generated using a large language model (LLM) to disrupt and reconstruct the delivery route. Combined with local search optimization, the disruption parameters are adaptively adjusted to obtain the optimal solution.
It achieves efficient and stable route optimization in large-scale delivery scenarios, avoiding redundant calculations and inefficient searches, and ensuring high-quality delivery routes.
Smart Images

Figure CN122022659B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of software technology, and in particular relates to a method, apparatus, equipment and storage medium for obtaining logistics delivery routes. Background Technology
[0002] In modern urban logistics and distribution systems, multiple delivery vehicles are typically dispatched to provide delivery services to customers located in different geographical areas. Each customer corresponds to a certain number of delivery requests, while delivery vehicles usually have fixed loading capacity and delivery range limitations. During actual delivery, the system needs to plan reasonable delivery routes for multiple vehicles based on information such as customer location, demand quantity, and vehicle capacity to meet the needs of all customers while minimizing overall transportation distance or costs. With the rapid development of e-commerce and instant logistics, the number of customers in urban delivery networks is constantly increasing, and delivery demands are characterized by large scale, complex distribution, and rapid dynamic changes. In large-scale delivery scenarios, how to plan high-quality delivery routes for multiple vehicles within a reasonable timeframe has become a key optimization problem in logistics systems. Since the number of delivery route combinations grows exponentially with the number of customers, directly solving the problem through exhaustive search is computationally infeasible. Therefore, efficient route optimization algorithms are needed to obtain near-optimal delivery solutions.
[0003] Current research on delivery route optimization mainly includes manually designed heuristic algorithms, neural network-driven combinatorial optimization methods, and methods using large language models to assist algorithm design. Traditional heuristic algorithms typically adjust delivery routes to obtain better solutions by manually designing specific search rules or neighborhood operations. Neural combinatorial optimization methods train deep neural networks to learn path generation strategies, enabling the model to directly generate delivery routes based on information such as customer location. In recent years, with the development of large language models, some studies have begun to explore using large language models to generate heuristic strategies or assist the optimization process, reducing reliance on manual rule design. However, in large-scale urban logistics delivery scenarios, existing methods still have significant shortcomings in terms of solution efficiency, search capability, and algorithm stability. For example, heuristic search rules rely on manual design and have limited adaptability; neural network-generated paths are prone to accumulating errors and are difficult to consistently obtain high-quality delivery solutions; and existing large language model-assisted methods lack stable optimization coordination mechanisms, which can easily lead to instability in the search process, thus affecting the overall solution efficiency and quality. Summary of the Invention
[0004] The purpose of this invention is to provide a method, apparatus, device, and storage medium for obtaining logistics delivery routes, in order to solve the problem of poor efficiency in obtaining logistics delivery routes due to the inability of existing technologies to provide an effective method for obtaining logistics delivery routes.
[0005] In a first aspect, the present invention provides a method for obtaining logistics delivery routes, the method comprising the following steps:
[0006] The system receives the optimization objective and constraints of the logistics delivery route planning, and models the logistics delivery route planning as a CVRP (Capacitated Vehicle Routing Problem) model based on the optimization objective and constraints. The optimization objective is to minimize the total travel distance of all vehicle delivery routes.
[0007] Based on the location of the customers to be delivered, the delivery volume of each customer, and the capacity of the delivery vehicle, a CVRP model instance is generated, and a random insertion initial solution is obtained for the CVRP model instance.
[0008] Based on the CVRP model instance and a preset number of first path destruction heuristics, the delivery path corresponding to the randomly inserted initial solution is destroyed and reconstructed to obtain the coarse-grained solution of the CVRP model instance.
[0009] Based on the CVRP model instance and a preset number of second path violation heuristics, a local search is performed on the delivery path corresponding to the coarse-grained solution to obtain the fine-grained solution of the CVRP model instance.
[0010] The fine-grained solution is determined as the optimal solution for the CVRP model instance, and the optimal logistics delivery route is determined based on the optimal solution.
[0011] In some embodiments, the step of obtaining a randomly inserted initial solution for the CVRP model instance includes:
[0012] Initialize the set of unvisited customer nodes based on the location of the customers to be delivered and the delivery volume of each customer;
[0013] Starting from the distribution center, construct vehicle delivery routes one by one. Under the constraint of delivery vehicle capacity, calculate the distance increment caused by inserting each unvisited customer node into different positions of the current vehicle delivery route.
[0014] Select a number of candidate nodes whose distance increment is less than a preset increment, and randomly select one of the candidate nodes to insert into the corresponding position of the current vehicle delivery path. When the current vehicle delivery path can no longer insert customer nodes, start the next vehicle delivery path until all customer nodes have been visited, and obtain the initial solution of random insertion.
[0015] In some embodiments, the step of breaking and reconstructing the delivery path corresponding to the randomly inserted initial solution based on the CVRP model instance and a preset number of first path breaking heuristics to obtain a coarse-grained solution of the CVRP model instance includes:
[0016] A predetermined number of destruction parameter matrices are generated using the predetermined number of first path destruction heuristics. Each destruction parameter matrix represents the number of consecutive destructions, the destruction starting index of each destruction-reconstruction iteration, and the sub-path length.
[0017] Based on each of the destruction parameter matrices, the delivery path corresponding to the randomly inserted initial solution is continuously destroyed and reconstructed in parallel based on the CVRP model instance to obtain the coarse-grained solution.
[0018] Further, in some embodiments, before the step of breaking and reconstructing the delivery path corresponding to the randomly inserted initial solution based on the CVRP model instance and a preset number of first path breaking heuristics to obtain a coarse-grained solution of the CVRP model instance, the following steps are included:
[0019] Step a: Prompt the first LLM to generate a preset number of parent heuristics by repeatedly using the first optimization strategy prompt word;
[0020] Step b: Based on the parent heuristic and multiple different path evolution strategies, use the first evolution strategy prompt to prompt the first LLM to generate a preset number of descendant heuristics for each path evolution strategy;
[0021] Step c: Use training instances in the training set to evaluate the fitness of all the parent heuristics and descendant heuristics. Set the heuristic with the highest fitness value as the next generation parent. Determine whether the first iteration number has been reached. If yes, set the next generation parent as the first path-breaking heuristic. Otherwise, jump to step b. The preset value and the preset number are the same.
[0022] In some embodiments, the step of performing a local search on the delivery path corresponding to the coarse-grained solution to obtain the fine-grained solution of the CVRP model instance based on the CVRP model instance and a preset number of second path violation heuristics includes:
[0023] Based on the CVRP model instance and the coarse-grained solution, a candidate node matrix is generated using the second path violation heuristic.
[0024] Based on the CVRP model instance, a preset number of 2-opt operations guided by the candidate node matrix are performed on each coarse-grained solution to obtain the corresponding fine-grained solution.
[0025] Furthermore, in some embodiments, before the step of performing a local search on the delivery path corresponding to the coarse-grained solution based on the CVRP model instance and a preset number of second path violation heuristics, the following steps are included:
[0026] Step a: Prompt the second LLM to generate a preset number of parent heuristics by repeatedly using the second optimization strategy prompt words;
[0027] Step b: Based on the parent heuristic and multiple different path evolution strategies, use the second evolution strategy prompt to prompt the second LLM to generate a preset number of descendant heuristics for each path evolution strategy;
[0028] Step c: Use training instances in the training set to evaluate the fitness of all the parent heuristics and offspring heuristics. Set the heuristic with the highest fitness value as the next generation parent. Determine whether the second iteration number has been reached. If yes, set the next generation parent as the second path-breaking heuristic. Otherwise, jump to step b. The preset value and the preset number are the same. The second optimization strategy prompt and the second evolution strategy prompt are generated based on the 2-opt operation.
[0029] Further, in some embodiments, the step of generating a candidate node matrix using the second path violation heuristic based on the CVRP model instance and the coarse-grained solution includes:
[0030] Based on the CVRP model instance, the neighborhood of each node is determined according to the position of the node in the coarse-grained solution;
[0031] Within each neighborhood, the score of each neighborhood node is calculated using the second path disruption heuristic. The top-K nodes with the highest scores are set as candidate nodes for the current node, and a candidate node matrix is generated based on the candidate nodes of each node.
[0032] Secondly, the present invention provides a logistics distribution route acquisition device, the device comprising:
[0033] The planning and modeling unit is used to receive the optimization objective and constraints of the logistics delivery route planning, and to model the logistics delivery route planning into a CVRP model based on the optimization objective and constraints. The optimization objective is to minimize the total driving distance of all vehicle delivery routes.
[0034] The first solution acquisition unit is used to generate a CVRP model instance based on the location of the customer to be delivered, the delivery quantity of each customer to be delivered, and the capacity of the delivery vehicle, and to obtain the random insertion initial solution of the CVRP model instance.
[0035] The second solution acquisition unit is used to destroy and reconstruct the delivery path corresponding to the randomly inserted initial solution based on the CVRP model instance and a preset number of first path destruction heuristics, so as to obtain the coarse-grained solution of the CVRP model instance.
[0036] The third solution acquisition unit is used to perform a local search on the delivery path corresponding to the coarse-grained solution based on the CVRP model instance and a preset number of second path destruction heuristics, so as to obtain the fine-grained solution of the CVRP model instance.
[0037] The optimal path determination unit is used to determine the fine-grained solution as the optimal solution of the CVRP model instance, and determine the optimal logistics delivery path based on the optimal solution.
[0038] Thirdly, the present invention also provides a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described above.
[0039] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above.
[0040] In this embodiment of the invention, during logistics delivery route planning, the logistics delivery route planning is modeled as a CVRP model based on the optimization objective and constraints. A CVRP model instance is generated based on the location of the customer to be delivered, the delivery volume of each customer, and the capacity of the delivery vehicle. A randomly inserted initial solution for the CVRP model instance is obtained. Based on the CVRP model instance and a preset number of first path disruption heuristics, the delivery path corresponding to the randomly inserted initial solution is disrupted and reconstructed to obtain a coarse-grained solution for the CVRP model instance. Based on the CVRP model instance and a preset number of second path disruption heuristics, a local search is performed on the delivery path corresponding to the coarse-grained solution to obtain a fine-grained solution for the CVRP model instance. The fine-grained solution is determined as the optimal solution for the CVRP model instance. The optimal logistics delivery route is determined based on the optimal solution. Thus, while achieving global structural optimization and local solution reuse of the delivery route, the disruption parameters are adaptively adjusted according to the scale of the delivery nodes, maintaining high-quality sub-paths and avoiding redundant calculations and inefficient searches. Attached Figure Description
[0041] Figure 1 This is a flowchart illustrating the logistics delivery route acquisition method provided in Embodiment 1 of the present invention;
[0042] Figure 2 This is a flowchart illustrating step S103 in the logistics distribution route acquisition method provided in Embodiment 1 of the present invention;
[0043] Figure 3 This is a flowchart illustrating the process of obtaining a preset number of first path disruption heuristics in the logistics distribution path acquisition method provided in Embodiment 2 of the present invention;
[0044] Figure 4 This is a flowchart illustrating step S104 of the logistics distribution route acquisition method provided in Embodiment 3 of the present invention;
[0045] Figure 5 This is a flowchart illustrating the process of obtaining a preset number of second path disruption heuristics in the logistics distribution path acquisition method provided in Embodiment 3 of the present invention;
[0046] Figure 6 This is a schematic diagram of the logistics distribution route acquisition device provided in Embodiment 4 of the present invention;
[0047] Figure 7 This is a schematic diagram of the structure of the computing device provided in Embodiment 5 of the present invention. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0049] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described feature, integral, step, operation, element, and / or component, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. Furthermore, the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise. The terms "first," "second," and similar words do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Words such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Above," "below," "left," "right," etc., are used only to indicate relative positional relationships, which may change accordingly when the absolute position of the described object changes.
[0050] To keep the following description of the embodiments of the present invention clear and concise, detailed descriptions of some known functions and known components are omitted in this specification.
[0051] The specific implementation of the present invention will be described in detail below with reference to specific embodiments:
[0052] Example 1:
[0053] Figure 1 The implementation flow of the logistics delivery route acquisition method provided in Embodiment 1 of the present invention is illustrated. For ease of explanation, only the parts related to the embodiments of the present invention are shown, and are described in detail below:
[0054] In step S101, the optimization objective and constraints of the logistics distribution route planning are received, and the logistics distribution route planning is modeled as a CVRP model based on the optimization objective and constraints.
[0055] The embodiments of the present invention are applicable to computing devices, such as personal computers, servers, or vehicle-mounted devices with computing capabilities, to realize the acquisition or planning of logistics delivery routes, such as route planning in urban logistics delivery.
[0056] Specifically, in this embodiment of the invention, all logistics delivery vehicles depart from and return to the distribution center. The optimization objective of logistics delivery route planning is to minimize the total travel distance of all vehicle delivery routes, thereby reducing the overall transportation cost of logistics delivery. To ensure the feasibility of delivery in actual execution, the constraints of logistics delivery route planning include: the sum of the cargo loads of each vehicle must not exceed the maximum loading capacity of the vehicle; all customers to be delivered to (customer nodes) must be visited; and each customer node must be visited exactly once, and the customer sets served by different vehicles do not overlap, thereby ensuring that the logistics delivery task can be completed completely and without duplication. As an example, the constructed CVRP model can be represented as follows.
[0057] The optimization objective is expressed as:
[0058] The constraints are expressed as follows:
[0059] ;
[0060] ;
[0061] .
[0062] in, m Indicates the number of vehicles. Indicates the first Delivery routes of the delivery vehicles Indicate delivery route The Middle Each customer node Indicates the first k Path accessed by delivery vehicles The first ini One customer node, | | Indicates the delivery route The number of customer nodes included. This indicates the maximum loading capacity of the delivery vehicle. Indicate delivery route The Middle Delivery demand at each customer node Indicates the distribution center node. Represents the set of client nodes. , where n is the number of client nodes.
[0063] In step S102, a CVRP model instance is generated based on the location of the customer to be delivered, the delivery quantity of each customer to be delivered, and the capacity of the delivery vehicle, and the initial random insertion solution of the CVRP model instance is obtained.
[0064] In this embodiment of the invention, after obtaining the location of the customer to be delivered, the delivery quantity of each customer to be delivered, and the capacity of the delivery vehicle, a CVRP model instance is generated based on the CVRP model according to the location of the customer to be delivered, the delivery quantity of each customer to be delivered, and the capacity of the delivery vehicle, and then the random insertion initial solution of the CVRP model instance is obtained.
[0065] In some embodiments, when obtaining the initial solution for random insertion of a CVRP model instance, an unvisited customer node set is initialized based on the location of the customers to be delivered and the delivery volume of each customer. Vehicle delivery routes are constructed one by one, starting from the delivery center. Under the constraint of delivery vehicle capacity, the distance increment generated by inserting each unvisited customer node into different positions of the current vehicle delivery route is calculated. Several candidate nodes with distance increments less than a preset increment are selected. One of the candidate nodes is randomly selected and inserted into the corresponding position of the current vehicle delivery route. When the current vehicle delivery route cannot continue to insert customer nodes, the next vehicle delivery route is started until all customer nodes are visited, and the initial solution for random insertion is obtained.
[0066] In step S103, based on the CVRP model instance and a preset number of first path destruction heuristics, the delivery path corresponding to the randomly inserted initial solution is destroyed and reconstructed to obtain a coarse-grained solution of the CVRP model instance.
[0067] In this embodiment of the invention, a preset number of first path disruption heuristics are obtained in advance. Based on the CVRP model instance and the preset number of first path disruption heuristics, the delivery path corresponding to the randomly inserted initial solution is disrupted and reconstructed to obtain a coarse-grained solution of the CVRP model instance. As an example, the first path disruption heuristics can be generated by a large language model (LLM).
[0068] In step S104, based on the CVRP model instance and a preset number of second path destruction heuristics, a local search is performed on the delivery path corresponding to the coarse-grained solution to obtain the fine-grained solution of the CVRP model instance.
[0069] In this embodiment of the invention, a predetermined number of second path violation heuristics are obtained in advance. Based on the CVRP model instance and the predetermined number of second path violation heuristics, a local search is performed on the delivery path corresponding to the coarse-grained solution to obtain the fine-grained solution of the CVRP model instance. As an example, the second path violation heuristics can also be generated by a large language model (LLM).
[0070] In step S105, the fine-grained solution is determined as the optimal solution for the CVRP model instance, and the optimal logistics delivery route is determined based on the optimal solution.
[0071] In this embodiment of the invention, the optimal solution is restored to obtain the optimal logistics delivery path represented by the actual delivery customer and the warehouse as nodes.
[0072] In this embodiment of the invention, during logistics delivery route planning, the logistics delivery route planning is modeled as a CVRP model based on the optimization objective and constraints. A CVRP model instance is generated based on the location of the customer to be delivered, the delivery volume of each customer, and the capacity of the delivery vehicle. A randomly inserted initial solution for the CVRP model instance is obtained. Based on the CVRP model instance and a preset number of first path disruption heuristics, the delivery path corresponding to the randomly inserted initial solution is disrupted and reconstructed to obtain a coarse-grained solution for the CVRP model instance. Based on the CVRP model instance and a preset number of second path disruption heuristics, a local search is performed on the delivery path corresponding to the coarse-grained solution to obtain a fine-grained solution for the CVRP model instance. The fine-grained solution is determined as the optimal solution for the CVRP model instance. The optimal logistics delivery route is determined based on the optimal solution. Thus, while achieving global structural optimization and local solution reuse of the delivery route, the disruption parameters are adaptively adjusted according to the scale of the delivery nodes, maintaining high-quality sub-paths and avoiding redundant calculations and inefficient searches.
[0073] Example 2:
[0074] Figure 2 The implementation flow of step S103 in the logistics delivery route acquisition method provided in Embodiment 1 of the present invention is shown. For ease of explanation, only the parts related to the embodiment of the present invention are shown, and are described in detail below:
[0075] In step S201, a preset number of destruction parameter matrices are generated using a preset number of first path destruction heuristics. Each destruction parameter matrix represents the number of consecutive destructions, the destruction starting index of each destruction-reconstruction iteration, and the sub-path length.
[0076] In this embodiment of the invention, after obtaining a preset number of first path disruption heuristics, a corresponding disruption parameter matrix is generated using these first path disruption heuristics. Each disruption parameter matrix represents the number of consecutive disruptions, the disruption starting index of each disruption-reconstruction iteration, and the sub-path length. As an example, the first path disruption heuristic is generated using LLM, and the corresponding disruption parameter matrix can be represented as follows:
[0077]
[0078] in, , Represents the number of consecutive destructions, each row in the matrix. Specify the The destruction start index of the second destruction-reconstruction iteration. with subpath length , Indicates the first i The first path breaks the heuristic. N This represents the preset quantity.
[0079] In step S202, based on each destruction parameter matrix, the delivery path corresponding to the randomly inserted initial solution is continuously destroyed and reconstructed in parallel based on the CVRP model instance to obtain a coarse-grained solution.
[0080] In this embodiment of the invention, disrupting the delivery path means splitting the delivery path into sub-paths. After obtaining the corresponding number of disruption parameter matrices, based on each disruption parameter matrix, the delivery path corresponding to the randomly inserted initial solution is disrupted and reconstructed in parallel using a CVRP model instance, thereby improving the efficiency of obtaining coarse-grained solutions. Specifically, when disrupting and reconstructing the randomly inserted initial solution based on the current disruption parameter matrix, the randomly inserted initial solution is split into multiple sub-paths, and each disrupted sub-path is reconstructed in parallel. Each reconstructed sub-path replaces the atomic path only when a shorter path is generated, thereby ensuring that the overall path quality does not decrease. Afterwards, after obtaining the path after the current parallel disruption and reconstruction, the obtained path continues to be disrupted and reconstructed. After several successive destruction-reconstruction iterations, a coarse-grained solution is obtained.
[0081] In this embodiment of the invention, before disrupting and reconstructing the delivery path corresponding to the randomly inserted initial solution, a preset number of first path disruption heuristics need to be obtained in advance. In some embodiments, such as Figure 3 As shown, when obtaining a preset number of first path breaking heuristics, the following steps are used:
[0082] In step S301, the first optimization strategy prompt word is used multiple times to prompt the first LLM to generate a preset number of parent heuristics.
[0083] In this embodiment of the invention, the first optimization strategy prompt is used multiple times to prompt the first LLM to generate a preset number of parent heuristics, each heuristic containing a unique violation strategy and corresponding code. As an example, the first optimization strategy prompt can be:
[0084] "You are designing a strategy to fix a non-optimal Traveling Salesman Problem (TSP) solution. The TSP path has been perturbed by splitting it into several sub-paths. Your goal is to generate two lists of integers: a list of sub-path lengths and a list of sub-path starting points, used to define the starting position and length of each split sub-path, respectively. These sub-paths will then be fixed using a deep learning model. Please design a novel and efficient parameter generation algorithm to minimize the gap between the fixed solution and the optimal TSP solution. First, describe your new algorithm and its main steps in one sentence, enclosed in curly braces. Next, implement the algorithm in Python, defining a parameter named `generate_params`." This function takes two input parameters: problem size and budget number of iterations. It returns two outputs: a list of subpath lengths and a list of subpath starting points. The budget number of iterations represents the number of fix iterations. Both the subpath length list and the subpath starting point list are integer lists of the same length, and their lengths must equal the budget number of iterations. The subpath length list [i] represents the length of the i-th subpath to be split, and the subpath starting point list [i] represents the starting index of that subpath within the path. The value of the subpath length list [i] must be between the smaller of 4, the problem size, and 2000; values outside this range are considered invalid. The subpath starting point list [i] must be a valid starting index within the TSP path length range. All elements in both lists must be integers. Please do not provide additional explanations.
[0085] In step S302, based on the parent heuristic and multiple different path evolution strategies, the first evolution strategy prompt word prompts the first LLM to generate a preset number of descendant heuristics for each path evolution strategy.
[0086] In this embodiment of the invention, multiple different path evolution strategies are pre-set to improve the diversity and accuracy of subsequent path generation. Then, based on the parent heuristic and the multiple different path evolution strategies, a first evolution strategy prompt is used to prompt the first LLM to generate a preset number of descendant heuristics for each path evolution strategy. Based on the example of the first optimization strategy prompt in step S301, the first evolution strategy prompt can, for example, be:
[0087] "You are designing a strategy to fix a non-optimal Traveling Salesman Problem (TSP) solution. The TSP path has been perturbed by being split into several sub-paths. Your goal is to generate two lists of integers: a list of sub-path lengths and a list of sub-path starting points, used to define the starting position and length of each split sub-path, respectively. These sub-paths will then be fixed by a deep learning model. Please design a novel and efficient parameter generation algorithm to minimize the gap between the fixed solution and the optimal TSP solution. I have two existing heuristic algorithms and their code here, as follows: Heuristic Algorithm 1, Heuristic Algorithm 2. Please help me create a completely new algorithm, whose form is completely different from the given algorithms, but which can draw design inspiration from the existing algorithms. First, identify the common core idea in the given algorithms; second, based on this core idea, describe your new algorithm in one sentence, with the description enclosed in curly braces; third, implement the algorithm in Python, writing a code named generate_params." The function takes two input arguments: the problem size and the budgeted number of iterations, and returns two outputs: a list of subpath lengths and a list of subpath starting points. The budgeted number of iterations represents the number of fix iterations. The subpath length list and the subpath starting point list are both integer lists of the same length, and their lengths must equal the budgeted number of iterations. The subpath length list [i] specifies the length of the i-th subpath to be split, and the subpath starting point list [i] specifies its starting index within the path. The value of the subpath length list [i] must be between 4 and the smaller of the problem size and 2000; values outside this range are considered invalid. The subpath starting point list [i] must be a valid starting index within the TSP path length range. All elements in both lists must be integers. Please do not provide additional explanations.
[0088] The first evolutionary strategy prompt above, "Please help me create a completely new algorithm, whose form is completely different from the given algorithm, but which can draw design inspiration from existing algorithms," is a specific prompt corresponding to different path evolutionary strategies. It can be replaced with four other prompts to generate diverse path evolutionary strategies, thereby producing diverse offspring heuristics. As an example, the other four prompts are as follows:
[0089] E1: Please generate a new algorithm that is completely different from the existing algorithm.
[0090] M1: Please refactor the algorithm logic / control flow to achieve the same functionality in a completely new way, focusing on structural transformation or new heuristic strategies, rather than superficial modifications.
[0091] M2: Please identify the core parameters of the algorithm, modify the parameter settings of the scoring function, and generate a new algorithm.
[0092] M3: Please identify the core components of the function, analyze whether the components are overfitting the samples within the distribution, and simplify redundant components to improve generalization ability.
[0093] In step S303, the fitness of all parent heuristics and offspring heuristics is evaluated using training instances in the training set, and the heuristic with the highest fitness value is set as the next generation parent.
[0094] In this embodiment of the invention, the preset value in step S303 and the preset quantity in steps S301 and S302 can be the same. Specifically, when evaluating the heuristic, the training set can consist of 16 randomly generated 5000-node TSP instances. These instances are completely randomly generated and are only used to evaluate the quality of the path destruction strategy; they do not provide solutions for specific instances. For each training instance, a randomly inserted initial solution is first obtained. Then, a destruction parameter matrix is generated from the parent heuristic and the descendant heuristic to be evaluated. The destruction parameter matrix guides the destruction-reconstruction process of the path corresponding to the randomly inserted initial solution. Afterward, the coarse-grained solutions obtained from all training instances are evaluated based on the average path length, which is used as the fitness of the heuristic. The smaller the average path length, the higher the fitness.
[0095] In step S304, it is determined whether the first iteration number has been reached. If so, step S305 is executed to set the next generation parent as the first path to break the heuristic; otherwise, the process jumps to step S302.
[0096] In an embodiment of the present invention, based on an example of the first evolutionary strategy prompt word in step S302, the generated first path destruction heuristic can be divided into two parts, wherein the first part is a language description of the first path destruction heuristic (algorithm), and the second part is a Python implementation of the first path destruction heuristic.
[0097] In step S305, the next generation parent is set as the first path breaking heuristic.
[0098] In this embodiment of the invention, a coordinated multi-step destruction strategy is automatically generated using the heuristic generated by LLM to perform parallel destruction and reconstruction on the delivery path corresponding to the randomly inserted initial solution. This achieves global structure optimization and local solution reuse. By setting the destruction parameters to adapt to the delivery scale, high-quality sub-paths are maintained while avoiding redundant calculations and inefficient searches.
[0099] Example 3:
[0100] Figure 4 The implementation flow of step S104 in the logistics distribution route acquisition method provided in Embodiment 3 of the present invention is shown. For ease of explanation, only the parts related to the embodiments of the present invention are shown, and are described in detail below:
[0101] In step S401, a candidate node matrix is generated based on the CVRP model instance and the coarse-grained solution using the second path destruction heuristic.
[0102] In this embodiment of the invention, the second path disruption heuristic can be generated by LLM. After obtaining a preset number of second path disruption heuristics, the corresponding candidate node matrix is generated using the second path disruption heuristic. The candidate node matrix stores the Top-K candidate nodes with scores corresponding to each node in the coarse-grained solution. The scores are calculated based on distance.
[0103] In some embodiments, when generating the candidate node matrix, based on the CVRP model instance, the neighborhood of each node is determined according to the position of the node in the coarse-grained solution. Within each neighborhood, the score of each neighboring node is calculated using the second path disruption heuristic, and the top-K nodes with the highest scores are set as candidate nodes for the current node. A candidate node matrix is then generated based on the candidate nodes of each node. In this way, local neighborhoods can be adaptively defined based on the coarse-grained solution, and each node can be scored. The top-K high-scoring nodes are selected as candidate exchange objects for subsequent 2-opt operations. This effectively focuses optimization on inefficient local structural regions while ensuring computational controllability, balancing path accuracy and computational cost.
[0104] In step S402, based on the CVRP model instance, a preset number of 2-opt operations guided by the candidate node matrix are performed on each coarse-grained solution to obtain the corresponding fine-grained solution.
[0105] In this embodiment of the invention, after obtaining the candidate node matrix, based on the CVRP model instance, a preset number of 2-opt operations guided by the candidate node matrix are performed on each coarse-grained solution to obtain the corresponding fine-grained solution. In each 2-opt operation, cross-checking is performed following the candidate structure constraints in the candidate node matrix. Specifically, starting from the first row of the candidate node matrix, the edges corresponding to each node are checked according to the order defined in the coarse-grained solution. For the target node, only the candidate nodes listed in the corresponding row of the candidate node matrix are considered as potential swapping targets. Once an improved cross-check is found, a 2-opt swap is immediately performed, the path is updated, and the scan restarts from the first row of the candidate node matrix. This "repeat from the beginning" mechanism ensures that each successful swap is fully propagated before checking subsequent cross-checks. This process continues until exactly the preset number of 2-opt swaps have been performed.
[0106] In this embodiment of the invention, fine-grained optimization of coarse-grained solutions is achieved through local neighborhood candidate edge scoring, Top-K node selection, and 2-opt guided iteration. Unlike traditional 2-opt, which requires global pairwise edge swapping or neighborhood calculation based on Euclidean distance, this embodiment of the invention uses a second path destruction heuristic to adaptively define local neighborhoods based on coarse-grained solutions and scores each node, selecting Top-K high-scoring nodes as candidate swapping objects for subsequent 2-opt operations. This ensures computational controllability while effectively focusing optimization on inefficient local structural regions, balancing path accuracy and computational overhead.
[0107] In this embodiment of the invention, before performing a local search on the delivery path corresponding to the coarse-grained solution, a preset number of second path destruction heuristics need to be obtained in advance. In some embodiments, such as Figure 5 As shown, when obtaining a preset number of second path breaking heuristics, the following steps are used:
[0108] In step S501, the second optimization strategy prompt is used multiple times to prompt the second LLM to generate a preset number of parent heuristics.
[0109] In this embodiment of the invention, the second optimization strategy prompt is used multiple times to prompt the second LLM to generate a preset number of parent heuristics, each heuristic containing a unique violation strategy and corresponding code. As an example, the second optimization strategy prompt can be:
[0110] "You are designing a novel scoring function to evaluate all candidate nodes that can be connected from a given node, in order to filter high-quality edges in the 2-opt repair algorithm for the Traveling Salesman Problem. Nodes with higher scores are more likely to be selected in the 2-opt search process. First, describe your new algorithm and its main steps in one sentence, enclosed in curly braces. Then, implement the algorithm in Python, defining a function named `score`. This function takes two input parameters: the current node and all nodes, and returns one output: the score. The current node is a one-dimensional NumPy array of shape (2,), all nodes are two-dimensional NumPy arrays of shape (N, 2), and the score is a one-dimensional array of length N, representing the connection priority of each node (higher values indicate higher priority). To avoid time-consuming computations and ensure consistent results, add `import numpy as np` and `@jit (nopython=True)` before the function. No further explanation is provided."
[0111] In step S502, based on the parent heuristic and multiple different path evolution strategies, the second evolution strategy prompt word prompts the second LLM to generate a preset number of descendant heuristics for each path evolution strategy.
[0112] In this embodiment of the invention, multiple different path evolution strategies are pre-set to improve the diversity and accuracy of subsequent path generation. Then, based on the parent heuristic and multiple different path evolution strategies, a second evolution strategy prompt is used to prompt the second LLM to generate a preset number of descendant heuristics for each path evolution strategy. The second optimization strategy prompt and the second evolution strategy prompt are generated based on a 2-opt operation. Based on the example of the second optimization strategy prompt in step S501, as an example, the second evolution strategy prompt can be:
[0113] "You are designing a novel scoring function to evaluate all candidate nodes that can be connected from a given node, in order to filter high-quality edges during the 2-opt repair process of the Traveling Salesman Problem. Nodes with higher scores are more likely to be selected in the 2-opt search. I currently have two heuristic algorithms and their code as follows: Heuristic Algorithm 1 Heuristic Algorithm 2 Please help me create a completely new algorithm, whose form is completely different from the given algorithm, but can be inspired by the existing algorithm. First, find the core common idea of the provided algorithms; second, based on this core idea, describe your new algorithm in one sentence, with the description enclosed in curly braces; third, implement the algorithm in Python, defining a function named `score`. This function should receive two input parameters: the current node and all nodes, and return one output result: the score result, where the current node is a one-dimensional NumPy array of shape (2,), all nodes are two-dimensional NumPy arrays of shape (N, 2), and the score result is a one-dimensional array of length N, representing the connection preference (higher values are better). To avoid time-consuming calculations and ensure consistency of results, add `import` before the function." The `numpy as np` and `@jit (nopython=True)` directives are not explained further.
[0114] The prompt "Please help me create a completely new algorithm that is completely different from the given algorithm, but can be inspired by existing algorithms" in the second evolutionary strategy prompt is a specific prompt corresponding to different path evolutionary strategies. It can be replaced with the other four prompts in the aforementioned embodiment two to generate diverse path evolutionary strategies, thereby generating diverse offspring heuristics.
[0115] In step S503, the fitness of all parent heuristics and offspring heuristics is evaluated using training instances in the training set, and the heuristic with the highest fitness value is set as the next generation parent.
[0116] In this embodiment of the invention, the preset value and the preset number are the same. When evaluating the heuristic, specifically, the heuristic to be evaluated scores each node in the neighborhood of the target node, selects the Top-K nodes as candidate edges, and performs a preset number of rounds of 2-opt operation based on the candidate edges. The average path length of the fine-grained solutions of all training instances is used as the fitness of the heuristic, and the heuristic with the highest fitness value is set as the next generation parent.
[0117] In step S504, it is determined whether the second iteration number has been reached. If yes, step S505 is executed; otherwise, step S502 is skipped.
[0118] In step S505, the next generation parent is set as the second path breaking heuristic.
[0119] In this embodiment of the invention, based on the example of the second evolutionary strategy prompt word in step S502, the generated second path destruction heuristic can be divided into two parts, wherein the first part is the language description of the second path destruction heuristic (algorithm), and the second part is the Python implementation of the second path destruction heuristic.
[0120] Example 4:
[0121] Figure 6 The structure of the logistics delivery route acquisition device provided in Embodiment 4 of the present invention is shown. For ease of explanation, only the parts related to the embodiments of the present invention are shown, including:
[0122] The planning modeling unit 61 is used to receive the optimization objective and constraints of the logistics delivery route planning, and to model the logistics delivery route planning into a CVRP model based on the optimization objective and constraints. The optimization objective is to minimize the total driving distance of all vehicle delivery routes.
[0123] The first solution acquisition unit 62 is used to generate CVRP model instances based on the location of the customers to be delivered, the delivery quantity of each customer to be delivered, and the capacity of the delivery vehicle, and to obtain the random insertion initial solution of the CVRP model instance.
[0124] The second solution acquisition unit 63 is used to destroy and reconstruct the delivery path corresponding to the randomly inserted initial solution based on the CVRP model instance and a preset number of first path destruction heuristics, so as to obtain the coarse-grained solution of the CVRP model instance.
[0125] The third solution acquisition unit 64 is used to perform a local search on the delivery path corresponding to the coarse-grained solution based on the CVRP model instance and a preset number of second path violation heuristics, to obtain the fine-grained solution of the CVRP model instance; and
[0126] The optimal path determination unit 65 is used to determine the fine-grained solution as the optimal solution of the CVRP model instance, and to determine the optimal logistics delivery path based on the optimal solution.
[0127] In this embodiment of the invention, for the sake of convenience and brevity, only the division of the above-described functional units and modules is used as an example. In practical applications, the above functions can be allocated to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to achieve all or part of the functions described above. Each unit and module of the device can be implemented by corresponding hardware or software units. Each unit and module can be an independent hardware or software unit, or it can be integrated into a single hardware or software unit, which is not intended to limit the invention. In addition, the specific names of each functional unit and module are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the device can be referred to the corresponding description in the foregoing method embodiments, and will not be repeated here.
[0128] Example 5:
[0129] Figure 7 The structure of the computing device provided in Embodiment 5 of the present invention is shown. For ease of explanation, only the parts related to the embodiments of the present invention are shown.
[0130] The computing device 7 of this embodiment includes a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70. When the processor 70 executes the computer program 72, it implements the steps described in the various method embodiments above, for example... Figure 1 Steps S101 to S105 are shown. Alternatively, when processor 70 executes computer program 72, it implements the functions of each unit in the above-described device embodiment, for example... Figure 6 The functions of each unit are shown.
[0131] The computing device in this embodiment of the invention can be a personal computer, a server, or a vehicle-mounted device with computing capabilities. The steps implemented by the processor 70 in the computing device 7 when executing the computer program 72 to achieve the logistics delivery route acquisition method can be referred to the description of the foregoing method embodiments, and will not be repeated here.
[0132] Example 6:
[0133] In this embodiment of the invention, a computer-readable storage medium is provided, which stores a computer program. When executed by a processor, the computer program implements the steps in the above-described embodiment of the logistics delivery route acquisition method, for example... Figure 1 The steps S101 to S105 are shown. Alternatively, when the computer program is executed by the processor, it implements the functions of each unit in the above-described device embodiment, for example... Figure 6 The functions of each unit are shown.
[0134] In this embodiment of the invention, during logistics delivery route planning, the logistics delivery route planning is modeled as a CVRP model based on the optimization objective and constraints. A CVRP model instance is generated based on the location of the customer to be delivered, the delivery volume of each customer, and the capacity of the delivery vehicle. A randomly inserted initial solution for the CVRP model instance is obtained. Based on the CVRP model instance and a preset number of first path disruption heuristics, the delivery path corresponding to the randomly inserted initial solution is disrupted and reconstructed to obtain a coarse-grained solution for the CVRP model instance. Based on the CVRP model instance and a preset number of second path disruption heuristics, a local search is performed on the delivery path corresponding to the coarse-grained solution to obtain a fine-grained solution for the CVRP model instance. The fine-grained solution is determined as the optimal solution for the CVRP model instance. The optimal logistics delivery route is determined based on the optimal solution. Thus, while achieving global structural optimization and local solution reuse of the delivery route, the disruption parameters are adaptively adjusted according to the scale of the delivery nodes, maintaining high-quality sub-paths and avoiding redundant calculations and inefficient searches.
[0135] The computer-readable storage medium of this invention can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EEPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0136] The above embodiments are merely illustrative of the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the scope of disclosure involved in the above embodiments is not limited to technical solutions formed by specific combinations of the above technical features, but should also cover other technical solutions formed by arbitrary combinations of the above technical features or their equivalent features without departing from the above-disclosed concept. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0137] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the invention. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
Claims
1. A method for obtaining logistics delivery routes, characterized in that, The method includes the following steps: The system receives the optimization objective and constraints of the logistics delivery route planning, and models the logistics delivery route planning as a CVRP model based on the optimization objective and constraints. The optimization objective is to minimize the total driving distance of all vehicle delivery routes. Based on the location of the customers to be delivered, the delivery volume of each customer, and the capacity of the delivery vehicle, a CVRP model instance is generated, and a random insertion initial solution is obtained for the CVRP model instance. Based on the CVRP model instance and a first preset number of first path destruction heuristics, the delivery path corresponding to the randomly inserted initial solution is destroyed and reconstructed to obtain the coarse-grained solution of the CVRP model instance. Based on the CVRP model instance and a second preset number of second path violation heuristics, a local search is performed on the delivery path corresponding to the coarse-grained solution to obtain a fine-grained solution of the CVRP model instance. This includes: generating a candidate node matrix using the second path violation heuristics based on the CVRP model instance and the coarse-grained solution; and performing a preset number of 2-opt operations guided by the candidate node matrix on each coarse-grained solution based on the CVRP model instance to obtain the corresponding fine-grained solution. The fine-grained solution is determined as the optimal solution for the CVRP model instance, and the optimal logistics delivery route is determined based on the optimal solution. Before the step of breaking and reconstructing the delivery path corresponding to the randomly inserted initial solution based on the CVRP model instance and a first preset number of first path breaking heuristics to obtain the coarse-grained solution of the CVRP model instance, the following steps are included: Step a1: Prompt the first LLM to generate the first preset number of parent heuristics by repeatedly using the first optimization strategy prompt word; Step b1: Based on the parent heuristics and multiple different path evolution strategies, prompt the first LLM to generate the first preset number of descendant heuristics for each path evolution strategy using the first evolution strategy prompt word; Step c1: Use training instances in the training set to evaluate the fitness of all the parent heuristics and descendant heuristics, set the heuristic with the highest fitness value as the next generation parent, determine whether the first iteration number has been reached, if so, set the next generation parent as the first path destruction heuristic, otherwise jump to step b1, wherein the first preset value and the first preset number are the same. Before the step of performing a local search on the delivery path corresponding to the coarse-grained solution based on the CVRP model instance and a second preset number of second path violation heuristics, the following steps are included: Step a2: Prompt the second LLM to generate the second preset number of parent heuristics by repeatedly using the second optimization strategy prompt word; Step b2: Based on the parent heuristics and multiple different path evolution strategies, prompt the second LLM to generate the second preset number of descendant heuristics for each path evolution strategy using the second evolution strategy prompt word; Step c2: Use training instances in the training set to evaluate the fitness of all the parent and descendant heuristics, set the heuristic with the second preset value in fitness as the next generation parent, determine whether the second iteration number has been reached, if so, set the next generation parent as the second path destruction heuristic, otherwise jump to step b2, wherein the second preset value and the second preset number are the same, and the second optimization strategy prompt word and the second evolution strategy prompt word are generated based on the 2-opt operation; Based on the CVRP model instance and the coarse-grained solution, the step of generating a candidate node matrix using the second path violation heuristic includes: Based on the CVRP model instance, the neighborhood of each node is determined according to the position of the node in the coarse-grained solution; within each neighborhood, the score of each neighborhood node is calculated using the second path destruction heuristic, and the Top-K nodes of the scores are set as candidate nodes of the current node, and a candidate node matrix is generated based on the candidate nodes of each node.
2. The method as described in claim 1, characterized in that, The steps for obtaining the random insertion initial solution of the CVRP model instance include: Initialize the set of unvisited customer nodes based on the location of the customers to be delivered and the delivery volume of each customer; Starting from the distribution center, construct vehicle delivery routes one by one. Under the constraint of delivery vehicle capacity, calculate the distance increment caused by inserting each unvisited customer node into different positions of the current vehicle delivery route. Select a number of candidate nodes whose distance increment is less than a preset increment, and randomly select one of the candidate nodes to insert into the corresponding position of the current vehicle delivery path. When the current vehicle delivery path can no longer insert customer nodes, start the next vehicle delivery path until all customer nodes have been visited, and obtain the initial solution of random insertion.
3. The method as described in claim 1, characterized in that, The steps for obtaining a coarse-grained solution to the CVRP model instance by disrupting and reconstructing the delivery path corresponding to the randomly inserted initial solution based on the CVRP model instance and a first preset number of first path disruption heuristics include: The first preset number of first path destruction heuristics are used to generate a first preset number of destruction parameter matrices. Each destruction parameter matrix represents the number of consecutive destructions, the destruction starting index of each destruction-reconstruction iteration, and the sub-path length. Based on each of the destruction parameter matrices, the delivery path corresponding to the randomly inserted initial solution is continuously destroyed and reconstructed in parallel based on the CVRP model instance to obtain the coarse-grained solution.
4. A logistics distribution route acquisition device, characterized in that, The device includes: The planning and modeling unit is used to receive the optimization objective and constraints of the logistics delivery route planning, and to model the logistics delivery route planning into a CVRP model based on the optimization objective and constraints. The optimization objective is to minimize the total driving distance of all vehicle delivery routes. The first solution acquisition unit is used to generate a CVRP model instance based on the location of the customer to be delivered, the delivery quantity of each customer to be delivered, and the capacity of the delivery vehicle, and to obtain the random insertion initial solution of the CVRP model instance. The second solution acquisition unit is used to destroy and reconstruct the delivery path corresponding to the randomly inserted initial solution based on the CVRP model instance and a first preset number of first path destruction heuristics, so as to obtain the coarse-grained solution of the CVRP model instance. The third solution acquisition unit is used to perform a local search on the delivery path corresponding to the coarse-grained solution based on the CVRP model instance and a second preset number of second path violation heuristics to obtain a fine-grained solution for the CVRP model instance. This includes: generating a candidate node matrix based on the CVRP model instance and the coarse-grained solution using the second path violation heuristics; performing a preset number of 2-opt operations guided by the candidate node matrix on each coarse-grained solution based on the CVRP model instance to obtain the corresponding fine-grained solution; and... The optimal path determination unit is used to determine the fine-grained solution as the optimal solution of the CVRP model instance, and determine the optimal logistics delivery path based on the optimal solution. The device further includes: The first path disrupts the heuristic acquisition unit, used for execution: Step a1: Prompt the first LLM to generate the first preset number of parent heuristics by repeatedly using the first optimization strategy prompt word; Step b1: Based on the parent heuristics and multiple different path evolution strategies, prompt the first LLM to generate the first preset number of descendant heuristics for each path evolution strategy using the first evolution strategy prompt word; Step c1: Use training instances in the training set to evaluate the fitness of all the parent heuristics and descendant heuristics, set the heuristic with the highest fitness value as the next generation parent, determine whether the first iteration number has been reached, if so, set the next generation parent as the first path destruction heuristic, otherwise jump to step b1, wherein the first preset value and the first preset number are the same. The first path disrupts the heuristic acquisition unit, used for execution: Step a2: Prompt the second LLM to generate the second preset number of parent heuristics by repeatedly using the second optimization strategy prompt word; Step b2: Based on the parent heuristics and multiple different path evolution strategies, prompt the second LLM to generate the second preset number of descendant heuristics for each path evolution strategy using the second evolution strategy prompt word; Step c2: Use training instances in the training set to evaluate the fitness of all the parent and descendant heuristics, set the heuristic with the second preset value in fitness as the next generation parent, determine whether the second iteration number has been reached, if so, set the next generation parent as the second path destruction heuristic, otherwise jump to step b2, wherein the second preset value and the second preset number are the same, and the second optimization strategy prompt word and the second evolution strategy prompt word are generated based on the 2-opt operation; The third solution acquisition unit, when generating a candidate node matrix based on the CVRP model instance and the coarse-grained solution using the second path violation heuristic, includes: Based on the CVRP model instance, the neighborhood of each node is determined according to the position of the node in the coarse-grained solution; within each neighborhood, the score of each neighborhood node is calculated using the second path destruction heuristic, and the Top-K nodes of the scores are set as candidate nodes of the current node, and a candidate node matrix is generated based on the candidate nodes of each node.
5. The apparatus as described in claim 4, characterized in that, The first solution acquisition unit, when acquiring the random insertion initial solution of the CVRP model instance, includes: Initialize the set of unvisited customer nodes based on the location of the customers to be delivered and the delivery volume of each customer; Starting from the distribution center, construct vehicle delivery routes one by one. Under the constraint of delivery vehicle capacity, calculate the distance increment caused by inserting each unvisited customer node into different positions of the current vehicle delivery route. Select a number of candidate nodes whose distance increment is less than a preset increment, and randomly select one of the candidate nodes to insert into the corresponding position of the current vehicle delivery path. When the current vehicle delivery path can no longer insert customer nodes, start the next vehicle delivery path until all customer nodes have been visited, and obtain the initial solution of random insertion.
6. The apparatus as claimed in claim 4, characterized in that, The second solution acquisition unit, when destroying and reconstructing the delivery path corresponding to the randomly inserted initial solution based on the CVRP model instance and a first preset number of first path destruction heuristics to obtain a coarse-grained solution for the CVRP model instance, includes: The first preset number of first path destruction heuristics are used to generate a first preset number of destruction parameter matrices. Each destruction parameter matrix represents the number of consecutive destructions, the destruction starting index of each destruction-reconstruction iteration, and the sub-path length. Based on each of the destruction parameter matrices, the delivery path corresponding to the randomly inserted initial solution is continuously destroyed and reconstructed in parallel based on the CVRP model instance to obtain the coarse-grained solution.
7. A computing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 3.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Automatic algorithm design method for solving vehicle path planning problem by using large language model
CN120106324A
Logistics goods taking and delivering path optimization method and system
CN120106325A