An adaptive particle swarm-genetic hybrid optimization algorithm for handling time window constrained multi-depot vehicle routing problem

By combining adaptive particle swarm optimization-genetic algorithm with clustering and multi-segment crossover mutation, the problem of balancing transportation efficiency and cost in multi-warehouse vehicle routing is solved, improving the global search capability and optimization efficiency of route planning, and achieving more efficient vehicle routing optimization.

CN118607620BActive Publication Date: 2026-11-03BEIJING INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410670781.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2026-11-03
Estimated Expiration
2044-05-28

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively balance vehicle transportation efficiency and cost in multi-warehouse vehicle routing problems, especially when time window constraints are present. Heuristic algorithms are prone to getting trapped in local optima, resulting in limited optimization performance.

Method used

An adaptive particle swarm optimization-genetic hybrid algorithm is adopted. The initial routing scheme is generated by clustering customer nodes and a greedy algorithm. Combined with binary bidding selection, multi-segment random length crossover and multi-point mutation, the historical best and global best genes are updated to improve global search capability and optimization efficiency.

Benefits of technology

It significantly improves the global search capability and optimization efficiency of multi-warehouse vehicle route planning, ensures spatiotemporal consistency and real-time optimal gene updates, and makes the optimization results closer to the global optimum.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118607620B_ABST
    Figure CN118607620B_ABST
Patent Text Reader

Abstract

The application provides an adaptive particle swarm-genetic hybrid optimization algorithm for processing a multi-warehouse vehicle path problem with time window constraints, the global search capability of the method is obviously improved by fusing a particle swarm algorithm and a genetic algorithm and introducing the concept of historical optimal genes and global optimal genes, and the real-time performance of updating the two optimal genes is ensured; the heuristic performance of the crossover operation is increased by using a set adaptive crossover length coefficient, modifying the length of the crossover gene fragment based on the iterative optimization condition, and further improving the search capability of the genetic algorithm, and the three-stage crossover operation also improves the optimization efficiency. In addition, the method of the application also designs a customer node clustering mode based on space-time distance, which is helpful to ensure the space-time uniformity of the clustered nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of vehicle routing problem optimization technology, specifically involving a method for handling multi-warehouse vehicle routing problems with time windows based on adaptive particle swarm optimization-hybrid genetic algorithm. Background Technology

[0002] In the logistics industry, balancing transportation efficiency and cost between warehouse and customer nodes is crucial for ensuring efficient operation. Considering the various factors influencing vehicle routes and the timeliness requirements for transportation between multiple warehouses and customers, this problem can be transformed into a multi-warehouse vehicle routing problem with time window constraints. Although the vehicle routing problem is an optimization problem with a finite discrete set, its permutation and combination nature, coupled with constraints such as multiple warehouses and time windows, makes this finite set extremely large, rendering exhaustive search for the optimal solution impractical. Some existing technologies utilize heuristic algorithms, including genetic algorithms, to solve this problem, but their inherent tendency to get trapped in local optima limits their practical effectiveness in route optimization. Summary of the Invention

[0003] In view of this, and to address the technical problems existing in this field, the present invention provides a multi-warehouse vehicle route planning method based on an adaptive particle swarm genetic algorithm, specifically including the following steps:

[0004] Step 1: Using each warehouse as a cluster center, cluster customer nodes based on their spatiotemporal distance relative to the warehouse nodes. Within each customer node cluster, sort the customer nodes from earliest to latest according to their corresponding time windows to obtain a customer node sequence. Connect the first customer node in the sequence to the cluster center warehouse node and calculate the route cost. Then, execute a loop of route selection and route cost calculation based on a greedy algorithm. Simultaneously, gradually insert customer nodes in the sequence into the candidate routes to generate a set of initial routing schemes representing the customer node access order. These routing schemes are connected end to end to form a gene sequence. Other genes in the initial population are generated by shuffling gene fragments based on this gene. The generated initial population is taken as the historically optimal gene population, and the gene sequence with the lowest total route cost is taken as the globally optimal gene.

[0005] Step 2: Using the route cost corresponding to the gene as the gene's fitness, a binary bidding selection algorithm is used to select the parent gene;

[0006] Step 3: Introduce a multi-segment random length crossover algorithm to perform three rounds of adaptive gene crossover. After each crossover operation, calculate the route cost represented by the generated offspring gene and compare it with the route cost represented by the historical best gene. Update the historical best gene based on the comparison result, and then update the global best gene. The crossover process includes: first, performing a gene crossover between parent genes to obtain one round of offspring genes; then, performing a gene crossover between each offspring gene in the first round and the corresponding historical best gene to obtain a second round of offspring genes; finally, performing a crossover between each offspring gene in the second round and the global best gene to obtain a third round of offspring genes.

[0007] Step 4: Perform multi-point random mutation on the three generations of offspring genes to obtain the mutated offspring genes;

[0008] Step 5: Treat the offspring genes as particles and update the historical best gene and the global best gene based on the adaptive particle swarm optimization algorithm. This includes: For the historical best gene, comparing each offspring gene with its corresponding historical best gene and comparing their corresponding route costs. If the cost of the route corresponding to the offspring gene is lower than the cost of the route corresponding to the historical best gene, then the historical best gene is replaced with this offspring gene. For the global best gene, if the historical best gene is updated, comparing the route cost corresponding to the replaced historical best gene with the route cost corresponding to the global best gene. If the former is lower, then the global best gene is replaced with the historical best gene with the lowest route cost.

[0009] Step 6: If the total running time does not exceed the set threshold, return to step 2; otherwise, output the global optimal gene as the optimization result, so that the vehicle travels according to its corresponding route.

[0010] Furthermore, the spatiotemporal distance mentioned in step one is calculated based on the following formula:

[0011]

[0012] Where a represents a real number between 0 and 1, sd i,j This represents the spatial distance between node i and node j.

[0013]

[0014] td i,j The time distance between node i and node j is calculated by the following formula:

[0015]

[0016] Among them, la j =et i +tsi +tl i,j This represents the earliest time that a vehicle can travel from point i to point j, lb. j =lt i +ts i +tl i,j This represents the latest time a vehicle can travel from point i to point j, where et... i and lt i ts represents the start and end points of the service time window at point i, respectively. i tl represents the service time at node i. i,j This represents the travel time between node i and node j;

[0017] Clustering is specifically implemented based on the following formula:

[0018]

[0019] In the formula, Clu k Represents the k-th warehouse node D k Clustering centered on the i-th client node, where i represents the i-th client node, std i,Dk Representing customer point i to warehouse point D k The spacetime distance between them, std i,Dm Representing customer point i to warehouse node D m The spacetime distance between them, V D V represents the set of repository nodes. N Represents a set of client nodes;

[0020] The specific process of the greedy algorithm includes the following steps:

[0021] a. Sort the client nodes in the cluster from earliest to latest according to their time windows to form an initial client node sequence Sv;

[0022] b. Select a customer node in sequence Sv, calculate the total increase in time and space distance of the route caused by inserting the point at the end of a feasible route, which is also the route cost, insert the point at the end of the route with the smallest increase in time and space distance, and delete the customer node from sequence Sv;

[0023] c. Repeat step b. After inserting all points in sequence Sv, connect the generated routes end to end to obtain the initial global optimal gene sequence.

[0024] Furthermore, the gene fitness used in the binary bidding selection algorithm in step two is calculated based on the following formula:

[0025] Fit g =1 / Cost g

[0026] In the formula, Fit g It refers to the fitness of gene g, Cost g It is the route cost corresponding to gene g;

[0027] The selection process for parental genes is as follows: two genes are randomly selected from the offspring population obtained in the previous generation, and the gene with higher fitness is selected as the parental gene for the next iteration.

[0028] Furthermore, in step three, the adaptive crossing includes an adaptive crossing length coefficient s, which is determined by the following formula:

[0029] s = 1 + log 10 (1+9*(D n (i) / gen))

[0030] Among them, D n (i) represents the number of times that the cost of the offspring gene obtained after crossover is lower than the cost of the gene before crossover when performing crossover in the nth round for the i-th gene. gen represents the number of iterations of the genetic algorithm that have been completed. Before performing crossover, the length of the randomly determined crossover gene segment is adjusted. The adjusted gene length is l = min(s*l0,L-1), where l0 is the randomly determined initial crossover gene segment length and L is the total length of the gene sequence.

[0031] Furthermore, in step four, for each of the three-round progeny genes involved in the mutation, three sets of sites are randomly selected, each set containing two sites. The positions of the two sites within each set are swapped to complete the gene mutation and form the mutated progeny gene.

[0032] The multi-warehouse vehicle routing method based on adaptive particle swarm optimization (PSO) and genetic algorithms provided by this invention significantly improves the global search capability by integrating PSO and genetic algorithms and introducing the concepts of historical optimal genes and global optimal genes, while ensuring the real-time updating of both optimal genes. By utilizing a set adaptive crossover length coefficient and modifying the crossover gene segment length based on iterative optimization, the heuristics of the crossover operation are increased, further enhancing the search capability of the genetic algorithm. The three-stage crossover operation also improves optimization efficiency. Furthermore, the method of this invention designs a customer node clustering method based on spatiotemporal distance, which helps ensure the spatiotemporal uniformity of clustered nodes. Attached Figure Description

[0033] Figure 1 A flowchart of the method provided by the present invention;

[0034] Figure 2 This is a schematic diagram of the adaptive crossover step in the method provided by the present invention;

[0035] Figure 3 A schematic diagram of the multi-point mutation step in the method provided by this invention;

[0036] Figure 4 The cost curve for the optimization process in an example of the present invention;

[0037] Figure 5 The diagram shows an optimized effect based on an example of the present invention. Detailed Implementation

[0038] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0039] The multi-warehouse vehicle routing method based on adaptive particle swarm genetic algorithm provided in this invention, such as... Figure 1 As shown, the specific steps include:

[0040] Step 1: Using each warehouse as a cluster center, cluster customer nodes based on their spatiotemporal distance relative to the warehouse nodes. Within each customer node cluster, sort the customer nodes from earliest to latest according to their corresponding time windows to obtain a customer node sequence. Connect the first customer node in the sequence to the cluster center warehouse node and calculate the route cost. Then, execute a loop of route selection and route cost calculation based on a greedy algorithm. Simultaneously, gradually insert customer nodes in the sequence into the candidate routes to generate a set of initial routing schemes representing the customer node access order. These routing schemes are connected end to end to form a gene sequence. Other genes in the initial population are generated by shuffling gene fragments based on this gene. The generated initial population is taken as the historically optimal gene population, and the gene sequence with the lowest total route cost is taken as the globally optimal gene.

[0041] Step 2: Using the route cost corresponding to the gene as the gene's fitness, a binary bidding selection algorithm is used to select the parent gene;

[0042] Step 3: Introduce a multi-segment random length crossover algorithm to perform three rounds of adaptive gene crossover. After each crossover operation, calculate the route cost represented by the generated offspring gene and compare it with the route cost represented by the historical best gene. Update the historical best gene based on the comparison result, and then update the global best gene. The crossover process includes: first, performing a gene crossover between parent genes to obtain one round of offspring genes; then, performing a gene crossover between each offspring gene in the first round and the corresponding historical best gene to obtain a second round of offspring genes; finally, performing a crossover between each offspring gene in the second round and the global best gene to obtain a third round of offspring genes.

[0043] Step 4: Perform multi-point random mutation on the three generations of offspring genes to obtain the mutated offspring genes;

[0044] Step 5: Treat the offspring genes as particles and update the historical best gene and the global best gene based on the adaptive particle swarm optimization algorithm. This includes: For the historical best gene, comparing each offspring gene with its corresponding historical best gene and comparing their corresponding route costs. If the cost of the route corresponding to the offspring gene is lower than the cost of the route corresponding to the historical best gene, then the historical best gene is replaced with this offspring gene. For the global best gene, if the historical best gene is updated, comparing the route cost corresponding to the replaced historical best gene with the route cost corresponding to the global best gene. If the former is lower, then the global best gene is replaced with the historical best gene with the lowest route cost.

[0045] Step 6: If the total running time does not exceed the set threshold, return to step 2; otherwise, output the global optimal gene as the optimization result, so that the vehicle travels according to its corresponding route.

[0046] In a preferred embodiment of the present invention, the clustering process in step one specifically includes:

[0047] First, define two types of nodes: warehouse and customer: warehouse node V. D ={D m |m∈{1,2,……n D}}, where V D Let D be the set of warehouse nodes. m Let n be the m-th warehouse node. D Number of warehouse nodes; V number of customer nodes N ={N i |i∈{1,2,……n N}}, where V N Let N be the set of client nodes. i For the i-th client node n N The number of customer nodes; two types of information are defined for each warehouse node: location information (xDm ,y Dm ), and time window (0, et Dm At the same time, four types of information are defined for each client node: location information (x i ,y i ), demand (q) i ), time window (st i ,et i ) and service time st i For warehouse node q i =st i =0;

[0048] The aforementioned spatiotemporal distance is calculated based on the following formula:

[0049]

[0050] Where a represents a real number between 0 and 1, sd i,j This represents the spatial distance between node i and node j.

[0051]

[0052] td i,j The time distance between node i and node j is calculated by the following formula:

[0053]

[0054] Among them, la j =et i +ts i +tl i,j This represents the earliest time that a vehicle can travel from point i to point j, lb. j =lt i +ts i +tl i,j This represents the latest time a vehicle can travel from point i to point j, where et... i and lt i ts represents the start and end points of the service time window at point i, respectively. i tl represents the service time at node i. i,j This represents the travel time between node i and node j;

[0055] Clustering is specifically implemented based on the following formula:

[0056]

[0057] In the formula, Clu k Represents the k-th warehouse node D k Clustering centered on the i-th client node, where i represents the i-th client node, stdi,Dk Representing customer point i to warehouse point D k The spacetime distance between them, std i,Dm Representing customer point i to warehouse node D m The spacetime distance between them, V D V represents the set of repository nodes. N Represents a set of client nodes;

[0058] The specific process of the greedy algorithm includes the following steps:

[0059] a. Sort the client nodes in the cluster from earliest to latest according to their time windows to form an initial client node sequence Sv;

[0060] b. Select a customer node in sequence Sv, calculate the total increase in time and space distance of the route caused by inserting the point at the end of a feasible route, which is also the route cost, insert the point at the end of the route with the smallest increase in time and space distance, and delete the customer node from sequence Sv;

[0061] c. Repeat step b. After inserting all points in sequence Sv, connect the generated routes end to end to obtain the initial global optimal gene sequence.

[0062] In a preferred embodiment of the present invention, the gene fitness used in the binary bidding selection algorithm in step two is calculated based on the following formula:

[0063] Fit g =1 / Cost g

[0064] In the formula, Fit g It refers to the fitness of gene g, Cost g It is the route cost corresponding to gene g.

[0065] The parent gene selection process is as follows: Two genes are randomly selected from the initialized gene population or the offspring gene population retained from the previous generation. Their fitness is compared, and the gene with higher fitness is selected as the parent gene. This selection continues until the number of selected parent genes reaches P*Gap, where P is the number of genes in the initialized gene population, and Gap is the selection probability, typically set to 0.9.

[0066] In a preferred embodiment of the present invention, step three involves an adaptive crossover length coefficient s, determined by the following formula:

[0067] s = 1 + log 10 (1+9*(D n (i) / gen))

[0068] Among them, D n (i) represents the number of times that the cost of the offspring gene obtained after crossover is lower than the cost of the gene before crossover when performing crossover in the nth round for the i-th gene. gen represents the number of iterations of the genetic algorithm that have been completed. Before performing crossover, the length of the randomly determined crossover gene segment is adjusted. The adjusted gene length is l = min(s*l0,L-1), where l0 is the randomly determined initial crossover gene segment length and L is the total length of the gene sequence. Figure 2 The adaptive crossover operation process is shown.

[0069] In a preferred embodiment of the present invention, step four specifically involves randomly selecting, for each of the three-round progeny genes involved in the mutation, as follows: Figure 3 The three sets of points shown each contain two points. By swapping the positions of the two points within each set, the gene mutation is completed and a mutant offspring gene is formed.

[0070] In an example based on this invention, simulation software is used to model the multi-warehouse vehicle routing problem with time windows, and algorithm simulation is performed. Figure 4 The algorithm's total route cost convergence curve is shown for a specific instance of a multi-warehouse vehicle routing problem with a time window. Figure 5 This is a roadmap for the optimization results of the corresponding instances.

[0071] It should be understood that the sequence number of each step in the embodiments of the present invention does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0072] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A multi-warehouse vehicle routing method based on adaptive particle swarm genetic algorithm, characterized by: Specifically, the following steps are included: Step 1: Using each warehouse as a cluster center, cluster customer nodes based on their spatiotemporal distance relative to the warehouse nodes. Within each customer node cluster, sort the customer nodes from earliest to latest according to their corresponding time windows to obtain a customer node sequence. Connect the first customer node in the sequence to the cluster center warehouse node and calculate the route cost. Then, execute a loop of route selection and route cost calculation based on a greedy algorithm. Simultaneously, gradually insert customer nodes in the sequence into the candidate routes to generate a set of initial routing schemes representing the customer node access order. These routing schemes are connected end to end to form a gene sequence. Other genes in the initial population are generated by shuffling gene fragments based on this gene. The generated initial population is taken as the historically optimal gene population, and the gene sequence with the lowest total route cost is taken as the globally optimal gene. Step 2: Using the route cost corresponding to the gene as the gene's fitness, a binary bidding selection algorithm is used to select the parent gene; Step 3: Introduce a multi-segment random length crossover algorithm to perform three rounds of adaptive gene crossover. After each crossover operation, calculate the route cost represented by the generated offspring gene and compare it with the route cost represented by the historical best gene. Update the historical best gene based on the comparison results, and then update the global best gene. The crossover process includes the following steps: First, a crossover is performed between parent genes to obtain one round of offspring genes; then, a crossover is performed between each offspring gene in the first round and its corresponding historical best gene to obtain a second round of offspring genes; finally, a crossover is performed between each offspring gene in the second round and its globally best gene to obtain a third round of offspring genes. Step 4: Perform multi-point random mutation on the three generations of offspring genes to obtain the mutated offspring genes; Step 5: Treat the offspring genes as particles and update the historical best gene and the global best gene based on the adaptive particle swarm optimization algorithm. This includes: For the historical best gene, comparing each offspring gene with its corresponding historical best gene and comparing their corresponding route costs. If the cost of the route corresponding to the offspring gene is lower than the cost of the route corresponding to the historical best gene, then the historical best gene is replaced with this offspring gene. For the global best gene, if the historical best gene is updated, comparing the route cost corresponding to the replaced historical best gene with the route cost corresponding to the global best gene. If the former is lower, then the global best gene is replaced with the historical best gene with the lowest route cost. Step 6: If the total running time does not exceed the set threshold, return to step 2; otherwise, output the global optimal gene as the optimization result, so that the vehicle travels according to its corresponding route.

2. The method as described in claim 1, characterized in that: The spatiotemporal distance mentioned in step one is calculated based on the following formula: Where a represents a real number between 0 and 1, sd i,j This represents the spatial distance between node i and node j. td i,j The time distance between node i and node j is represented by the following formula: Among them, la j =et i +ts i +tl i,j This represents the earliest time that a vehicle can travel from point i to point j, lb. j =lt i +ts i +tl i,j This represents the latest time a vehicle can travel from point i to point j, where et... i and lt i ts represents the start and end points of the service time window at point i, respectively. i tl represents the service time at node i. i,j This represents the travel time between node i and node j; Clustering is specifically implemented based on the following formula: In the formula, Clu k Represents the k-th warehouse node D k Clustering centered on the i-th client node, where i represents the i-th client node, std i,Dk Representing customer point i to warehouse point D k The spacetime distance between them, std i,Dm Representing customer point i to warehouse node D m The spacetime distance between them, V D V represents the set of repository nodes. N Represents a set of client nodes; The specific process of the greedy algorithm includes the following steps: a. Sort the client nodes in the cluster from earliest to latest according to their time windows to form an initial client node sequence Sv; b. Select a customer node in sequence Sv, calculate the total increase in time and space distance of the route, i.e., the increase in route cost, caused by inserting the point at the end of all non-empty routes and one empty route, insert the point at the end of the route with the smallest increase in time and space distance, and delete the customer node from sequence Sv; c. Repeat step b. After inserting all points in sequence Sv, connect the generated routes end to end to obtain the initial global optimal gene sequence.

3. The method as described in claim 1, characterized in that: The gene fitness used in the binary bidding selection algorithm in step two is calculated based on the following formula: Fit g =1 / Cost g In the formula, Fit g It refers to the fitness of gene g, Cost g It is the route cost corresponding to gene g; The selection process for parental genes is as follows: two genes are randomly selected from the offspring population obtained in the previous generation, and the gene with higher fitness is selected as the parental gene for the next iteration.

4. The method as described in claim 1, characterized in that: In step three, the adaptive crossing includes an adaptive crossing length coefficient s, which is determined by the following formula: s=1+log 10 (1+9*(D n (i) / gen)) Among them, D n (i) represents the number of times that the cost of the offspring gene obtained after crossover is lower than the cost of the gene before crossover when performing crossover in the nth round for the i-th gene. gen represents the number of iterations of the genetic algorithm that have been completed. Before performing crossover, the length of the randomly determined crossover gene segment is adjusted. The adjusted gene length is l = min(s*l0,L-1), where l0 is the randomly determined initial crossover gene segment length and L is the total length of the gene sequence.

5. The method as described in claim 1, characterized in that: In step four, for each of the three progeny genes involved in the mutation, three sets of sites are randomly selected, with each set containing two sites. The positions of the two sites within each set are swapped to complete the gene mutation and form the mutated progeny gene.

Citation Information

Patent Citations

  • Integrated learning-based path planning method for vehicle distribution task with time window

    CN117391573A

  • Tramcar layout method based on particle swarm optimization

    CN117688968A