Delivery and pickup vehicle path optimization method and system with time window, and storage medium
Through the improved non-dominant sorting genetic algorithm, the priority of the objective function and the constraint function is adjusted, and the problem of difficult to balance multi-objective and multi-constraints in the prior art is solved, and efficient vehicle path optimization is achieved.
Patent Information
- Application Number
- CN202411324277.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-02-25
AI Technical Summary
The prior art is difficult to effectively solve the problem of path optimization of delivery and pick-up vehicles with time windows, especially in the balance between multiple goals and multiple constraints, making it difficult to find a set of balanced solutions.
The improved non-dominant sorting genetic algorithm is adopted to guide populations to move towards feasible domains by assigning higher priority to the target at the early stage of evolution and lower priority to the target at the late stage of evolution.
Under the balance between multi-objective and multi-constraint, the vehicle path is effectively optimized, the quality and feasibility of understanding are improved, and the problem of high-dimensional multi-objective delivery and pick-up vehicle paths with time window can be better handled.
Smart Images

Figure CN119515239A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of logistics scheduling, and specifically relates to a method, system and storage medium for optimizing the path of a delivery and pickup vehicle with a time window. Background Art
[0002] The vehicle routing problem (VRP) has been widely studied in the past few decades. VRP is an optimization problem that is widely found in the fields of transportation, supply chain management, production planning, etc. Many algorithms have been proposed for the VRP problem. Most algorithms are efficient in solving the traditional single-objective vehicle routing problem (VRP), which belongs to the traditional vehicle routing problem. However, in the current vehicle routing planning (VRP), it is necessary to optimize multiple conflicting objectives such as the number of vehicles, total driving distance, total completion time, total waiting time, and total delay time. Due to the existence of multiple conflicting objectives in VRP, the goal of solving VRP is not to find a single optimal solution, but to find a set of equilibrium solutions. Therefore, the VRP problem poses a major challenge to traditional algorithms that are good at solving multi-objective VRP.
[0003] As a challenging combinatorial optimization problem, multi-objective vehicle routing problem (MVRP) has attracted extensive attention due to its wide applicability. VRP includes various variants that incorporate additional constraints beyond multi-objective optimization. For example, VRP involves the consideration of multiple customers, each of which has its own time windows, which are constraints on the time allowed for the specified service. Specifically, in the field of logistics, vehicle routing with time windows (VRPTW) must meet these specified conditions, ensuring that each customer's service is provided within their respective time windows, while also ensuring that the designated vehicles have sufficient capacity to carry all the goods on the customer's route. Importantly, the vehicle routing problem for delivery and pickup with time windows (VRPSDPTW) considers all constraints and optimizes multiple objectives simultaneously. It is a bidirectional logistics problem involving the coordination of delivery and pickup activities within the time windows. VRPSDPTW poses significant challenges, especially for most existing unconstrained VRP algorithms. In recent years, most researchers have focused on metaheuristics to effectively solve the VRPSDPTW problem. Deep reinforcement learning (DRL) methods have been widely used to solve vehicle routing problems. Compared with traditional meta-heuristic methods, DRL can automatically learn search rules to produce higher quality solutions. For the vehicle routing problem (CVRP) with capacity constraints, a DRL method based on attention mechanism is proposed.
[0004] VRPTW takes the total travel distance or delivery time as the main optimization objective. For example, some hybrid genetic algorithms have been proposed for the travel cost optimization problem of single-objective VRPTW. For the total travel cost problem, a hybrid binary integer programming model based on a coevolutionary genetic algorithm is proposed. The algorithm takes the delivery time as the optimization objective. However, in practical scenarios, only considering the total travel distance may ignore the important characteristics of VRP (i.e., the number of vehicles, total travel distance, makespan, total waiting time, and total delay time).
[0005] Therefore, some researchers regard these multi-objectives as optimization objectives with different hierarchical approaches and consider all possible time windows provided by customers, namely VRPSDPTW. A three-stage algorithm is proposed for two optimization objectives (total travel cost and service level). One stage indicates that each customer will be assigned to a warehouse. In contrast, the second and third stages need to optimize the total travel cost and service level, respectively. Different priorities are given to the three optimization objectives of the number of served customers, total distance, and number of vehicles, and a genetic algorithm is used for optimization. A four-objective optimization problem is proposed that comprehensively considers transportation cost, travel distance, vehicle utilization, and load balancing. Travel distance has a higher priority than other objectives. Finally, for the five-objective research, although the previous work on solving VRPSDPTW has made amazing progress, there is still much room for improvement to better handle VRPSDPTW. Summary of the invention
[0006] In view of the above-mentioned technical problems, the purpose of the present invention is to provide a delivery and pickup vehicle path optimization method, system and storage medium with a time window. The method can balance constraints and objectives during the evolution process, and guide the population to move to the feasible domain by giving constraints a higher priority to objectives in the early stage of evolution and a lower priority to objectives in the later stage of evolution.
[0007] The technical solution of the present invention is:
[0008] A method for optimizing delivery and pickup vehicle routes with time windows includes the following steps:
[0009] S01: Construct a mathematical model based on the vehicle routing problem with a time window, the mathematical model includes multiple objectives and multiple constraints;
[0010] S02: using an improved non-dominated sorting genetic algorithm to solve the objective function of the constructed mathematical model; the improved non-dominated sorting genetic algorithm comprises:
[0011] Set a weight value vector for the constraint function;
[0012] Adjust the priorities of the objective function and constraint function during the search process, give the constraint function a higher priority over the objective function in the early stage of evolution, and give the constraint function a lower priority over the objective function in the later stage of evolution, so as to guide the population to move towards the feasible domain;
[0013] Two mating parents are selected from the parent population through the tournament selection method, and new offspring solutions are generated using crossover and mutation operations.
[0014] In the preferred technical solution, constructing a mathematical model in step S01 includes:
[0015] Objective function:
[0016] Min F(x)={f1(x, t), f2(x, t),..., f5(x, t)}
[0017] Among them, f1(x, t), f2(x, t), ..., f5(x, t) are five targets representing: number of vehicles, total driving distance, total completion time, total waiting time and total delay time;
[0018] Constraints:
[0019] k≤CM
[0020]
[0021] Where k is the number of service vehicles, CM is the maximum number of vehicles, and g i is the delivery demand of customer i, N m is the number of customers served by vehicle m, C is the capacity of the vehicle, and C i The capacity of the vehicle serving customer i, p i The service time for customer i, dt i is the vehicle delay time of customer i, md is the maximum delay time, at m is the time when vehicle m arrives at the parking lot, e m is the closing time of the depot, cv1(x) is the vehicle restriction constraint, cv2(x) is the capacity constraint of the vehicle to meet the delivery needs of each route, cv3(x) is the capacity constraint of the vehicle to reach all customers, cv4(x) is the delay time constraint, and cv5(x) is the time constraint for the vehicle to return to the depot before the closing time.
[0022] In the preferred technical solution, the method of setting the weight value vector for the constraint function in step S02 includes:
[0023] Set the maximum weight vector Z max and the minimum weight vector Z min :
[0024]
[0025] in, is the maximum violation value of the ith constraint; is the minimum violation value of the ith constraint, i∈{1,2,3,4,5};
[0026] The constraints for each solution are defined as:
[0027]
[0028] CV(x) represents the constraint value of solution x. If CV(x) = 0, solution x is a feasible solution; otherwise, it is an infeasible solution.
[0029]
[0030] in, is the normalized constraint violation value.
[0031] In the preferred technical solution, step S02 further includes:
[0032] Merge the population and subpopulation into a temporary archive set, where feasible releases are put into the set S c Infeasible release is added to the set S I In the process, according to the size of the population N, a new population P is selected from the temporary archive set.
[0033] In the preferred technical solution, the method of selecting a new population P from the temporary archive set includes:
[0034] If S c The size of is N, then S c Each solution of will be copied to the new population P;
[0035] If S c The size is less than N, first choose the feasible solution S c , the rest are of size N-|S c |The solution is selected from the infeasible solutions, where |S c |It is S c The size of the set S I Arrange the set S in ascending order according to the constraint values. I The solutions in are added to the new population P until its size is N;
[0036] If S c The size of S is greater than N. For feasible solutions, the fast non-dominated sorting method is used to sort the set S c Divide into several non-dominated levels F1, F2, ...; add the solutions of the non-dominated levels to an empty P until
[0037] |P|+|Fi | > N, where P contains from F1 to F i-1 , if P < N, use the truncation method to select from F i Select N - |P| solutions and copy them to the new population P.
[0038] In the preferred technical solution, in step S02, two mating parents are selected from the parent population by the tournament selection method, and the method of generating new offspring solutions using the crossover operation and the mutation operation includes:
[0039] Randomly select two solutions from the parent population P. If a solution x can constraint-dominate a solution y, the solution x will be selected as the mating parent; if the two solutions cannot constraint-dominate each other, randomly select one mating parent from them;
[0040] Randomly select 2 paths from 2 parent solutions respectively; delete the customers in the two parent solutions that conflict with the selected customers. If all the customers in the path conflict with the selected customers, delete all the customers and paths from the parent solution, and copy the selected paths to different parent solutions respectively to generate two new solutions;
[0041] Perform the mutation operation. The mutation operation includes partial exchange, merging of two paths, division of a long path, and partial mutation. For partial exchange, the parent solution randomly selects two paths to exchange some of their customers; the merging of two paths is used to reduce the number of vehicles; the longer path is divided into multiple paths; local mutation is performed on the paths of the vehicles.
[0042] The present invention also discloses a vehicle routing optimization system for distribution and pickup with time windows, including:
[0043] A model construction module constructs a mathematical model according to the vehicle routing problem with time windows. The mathematical model includes multiple objectives and multiple constraints;
[0044] A solution module uses an improved non-dominated sorting genetic algorithm to solve the objective function of the constructed mathematical model; the improved non-dominated sorting genetic algorithm includes:
[0045] Set a weight value vector for the constraint function;
[0046] Adjust the priorities of the objective function and the constraint function during the search process. Assign a higher priority to the constraint function over the objective function in the initial stage of evolution, and a lower priority to the constraint function over the objective function in the later stage of evolution to guide the population to move towards the feasible region;
[0047] Select two mating parents from the parent population by the tournament selection method, and use the crossover operation and the mutation operation to generate new offspring solutions.
[0048] In the preferred technical solution, constructing a mathematical model in the model construction module includes:
[0049] Objective function:
[0050] Min F(x)={f1(x,t),f2(x,t),...,f5(x,t)}
[0051] Among them, f1(x, t), f2(x, t), ..., f5(x, t) are five targets representing: number of vehicles, total driving distance, total completion time, total waiting time and total delay time;
[0052] Constraints:
[0053] k≤CM
[0054]
[0055]
[0056] Where k is the number of service vehicles, CM is the maximum number of vehicles, and g i is the delivery demand of customer i, N m is the number of customers served by vehicle m, C is the capacity of the vehicle, and C i The capacity of the vehicle serving customer i, p i The service time for customer i, dt i is the vehicle delay time of customer i, md is the maximum delay time, at m is the time when vehicle m arrives at the parking lot, e m is the closing time of the depot, cv1(x) is the vehicle restriction constraint, cv2(x) is the capacity constraint of the vehicle to meet the delivery needs of each route, cv3(x) is the capacity constraint of the vehicle to reach all customers, cv4(x) is the delay time constraint, and cv5(x) is the time constraint for the vehicle to return to the depot before the closing time.
[0057] In the preferred technical solution, the method for setting the weight value vector for the constraint function in the solution module includes:
[0058] Set the maximum weight vector Z max and the minimum weight vector Z min :
[0059]
[0060] in, is the maximum violation value of the ith constraint; is the minimum violation value of the ith constraint, i∈{1,2,3,4,5};
[0061] The constraints for each solution are defined as:
[0062]
[0063] CV(x) represents the constraint value of solution x. If CV(x) = 0, solution x is a feasible solution; otherwise, it is an infeasible solution.
[0064]
[0065] in, is the normalized constraint violation value.
[0066] The present invention further discloses a computer storage medium on which a computer program is stored. When the computer program is executed, the above-mentioned method for optimizing the delivery and pickup vehicle path with a time window is implemented.
[0067] Compared with the prior art, the present invention has the following beneficial effects:
[0068] 1. This paper proposes a constrained evolutionary optimization algorithm CEOA to effectively deal with the VRPSDPTW problem. CEOA mainly drives the population to move to the feasible domain of VRPSDPTW by designing a constraint processing technology.
[0069] 2. In order to balance the multiple constraints and multiple objectives in VRPSDPTW, a constrained evolutionary optimization strategy is proposed. A new weight value vector is designed to adjust the priority of objectives and constraints during the search process. The weight value vector is designed according to the constraint satisfaction, and the constraints or optimization objectives are adaptively selected to guide the population to move towards the feasible area, and promising solutions are automatically selected during the evolution process.
[0070] 3. According to the data characteristics of VRPSDPTW, crossover and mutation operations with local search are designed to better improve the performance of the solution. The two operation methods use the restricted mating selection mechanism to select suitable mating parents, which can explore promising areas and improve population diversity. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:
[0072] Figure 1 This is a flow chart of the method for optimizing the delivery and pickup vehicle route with time windows in this embodiment;
[0073] Figure 2 This is a principle block diagram of the delivery and pickup vehicle route optimization system with time windows in this embodiment;
[0074] Figure 3 It is the framework of the constrained evolutionary optimization algorithm (CEOA) of this embodiment;
[0075] Figure 4 This is an example diagram of the crossover operation of this embodiment;
[0076] Figure 5 This is an example diagram of the variation operation of this embodiment;
[0077] Figure 6a-6f It is the average HV line graph of CEOA, NSGA-II, MOEA / D and SPEA2+SDE algorithms in different parameters of this embodiment. DETAILED DESCRIPTION
[0078] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, the description of well-known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.
[0079] Example
[0080] like Figure 1 As shown, a delivery pickup vehicle path optimization method with a time window includes the following steps:
[0081] S01: Construct a mathematical model based on the vehicle routing problem with a time window, the mathematical model includes multiple objectives and multiple constraints;
[0082] S02: using an improved non-dominated sorting genetic algorithm to solve the objective function of the constructed mathematical model; the improved non-dominated sorting genetic algorithm comprises:
[0083] Set a weight value vector for the constraint function;
[0084] Adjust the priorities of the objective function and constraint function during the search process, give the constraint function a higher priority over the objective function in the early stage of evolution, and give the constraint function a lower priority over the objective function in the later stage of evolution, so as to guide the population to move towards the feasible domain;
[0085] Two mating parents are selected from the parent population through the tournament selection method, and new offspring solutions are generated using crossover and mutation operations.
[0086] In a preferred embodiment, the step S01 of constructing a mathematical model includes:
[0087] Objective function:
[0088] Min F(x)={f1(x,t),f2(x,t),...,f5(x,t)}
[0089] Among them, f1(x, t), f2(x, t), ..., f5(x, t) are five targets representing: number of vehicles, total driving distance, total completion time, total waiting time and total delay time;
[0090] Constraints:
[0091] k≤CM
[0092]
[0093]
[0094] Where k is the number of service vehicles, CM is the maximum number of vehicles, and g i is the delivery demand of customer i, N m is the number of customers served by vehicle m, C is the capacity of the vehicle, and C i The capacity of the vehicle serving customer i, p i The service time for customer i, dt i is the vehicle delay time of customer i, md is the maximum delay time, at m is the time when vehicle m arrives at the parking lot, e m is the closing time of the depot, cv1(x) is the vehicle restriction constraint, cv2(x) is the capacity constraint of the vehicle to meet the delivery needs of each route, cv3(x) is the capacity constraint of the vehicle to reach all customers, cv4(x) is the delay time constraint, and cv5(x) is the time constraint for the vehicle to return to the depot before the closing time.
[0095] In a preferred embodiment, the method of setting the weight value vector for the constraint function in step S02 includes:
[0096] Set the maximum weight vector Z max and the minimum weight vector Z min :
[0097]
[0098] in, is the maximum violation value of the ith constraint; is the minimum violation value of the ith constraint, i∈{1,2,3,4,5};
[0099] The constraints for each solution are defined as:
[0100]
[0101] CV(x) represents the constraint value of solution x. If CV(x) = 0, solution x is a feasible solution; otherwise, it is an infeasible solution.
[0102]
[0103] Among them, is the normalized constraint violation value.
[0104] In a preferred embodiment, step S02 further includes:
[0105] Merge the population and the sub-population into a temporary archive set, where the feasible solutions are put into set S c and the infeasible solutions are put into set S I . Select a new population P from the temporary archive set according to the size N of the population.
[0106] In a preferred embodiment, the method of selecting a new population P from the temporary archive set includes:
[0107] If the size of S c is N, then each solution in S c will be copied into the new population P;
[0108] If the size of S c is less than N, first select the feasible solutions S c , and the remaining N - |S c | solutions are selected from the infeasible solutions, where |S c | is the size of S c ; sort the set S I in ascending order of the constraint values, and add the solutions in the set S I to the new population P until its size is N;
[0109] If the size of S c is greater than N, for the feasible solutions, use the fast non-dominated sorting method to divide the set S c into several non-dominated levels F1, F2,...; add the solutions of the non-dominated levels to an empty P until
[0110] |P| + |F i | > N, where P contains from F1 to F i-1 , if P < N, use the truncation method to select N - |P| solutions from F i and copy them to the new population P.
[0111] In a preferred embodiment, the method of selecting two mating parents from the parent population by the tournament selection method and generating new offspring solutions using the crossover operation and the mutation operation includes:
[0112] Randomly select two solutions from the parent population P. If a solution x can constrain-dominate a solution y, solution x will be selected as the mating parent. If the two solutions cannot constrain-dominate each other, a mating parent is randomly selected from them.
[0113] Randomly select 2 paths from 2 parent solutions respectively; delete the customers in the two parent solutions that conflict with the selected customers. If all customers in the path conflict with the selected customers, delete all customers and paths from the parent solution, copy the selected paths to different parent solutions respectively, and generate two new solutions;
[0114] Perform mutation operations, including partial exchange, merging of two paths, division of long paths and partial mutation. For partial exchange, the parent solution randomly selects two paths to exchange some of its customers; the merger of two paths is used to reduce the number of vehicles; a longer path is divided into multiple paths; and the vehicle's path is locally mutated.
[0115] In another embodiment, a computer storage medium stores a computer program, and when the computer program is executed, the above-mentioned method for optimizing the delivery and pickup vehicle path with a time window is implemented. The specific method is consistent with the above-mentioned method for optimizing the delivery and pickup vehicle path with a time window, and will not be repeated here.
[0116] In another embodiment, if Figure 2 As shown, a delivery and pickup vehicle path optimization system with a time window includes:
[0117] A model building module builds a mathematical model based on a vehicle routing problem with a time window, wherein the mathematical model includes multiple objectives and multiple constraints;
[0118] The solution module uses an improved non-dominated sorting genetic algorithm to solve the objective function of the constructed mathematical model; the improved non-dominated sorting genetic algorithm includes:
[0119] Set a weight value vector for the constraint function;
[0120] Adjust the priorities of the objective function and constraint function during the search process, give the constraint function a higher priority over the objective function in the early stage of evolution, and give the constraint function a lower priority over the objective function in the later stage of evolution, so as to guide the population to move towards the feasible domain;
[0121] Two mating parents are selected from the parent population through the tournament selection method, and new offspring solutions are generated using crossover and mutation operations.
[0122] The following is a detailed description of the workflow of the delivery and pickup vehicle routing optimization system with time windows using a best practice example:
[0123] The real-world VRPSDPTW contains various constraints that are crucial to obtain a better solution. Therefore, when dealing with VRPSDPTW, the Constrained Evolutionary Optimization Algorithm (CEOA) for the high-dimensional multi-objective delivery pickup vehicle routing problem with time windows needs to consider the balance between multi-objective optimization and satisfying multiple constraints. The algorithm deals with the real-world VRPSDPTW based on constraint satisfaction.
[0124] The variable table for the vehicle routing problem with time windows is as follows:
[0125]
[0126]
[0127] Constructing mathematical models includes:
[0128] Objective function:
[0129] Min F(x)={f1(x, t), f2(x, t),..., f5(x, t)} (1)
[0130] Among them, f1(x, t), f2(x, t), ..., f5(x, t) are five targets representing: number of vehicles, total driving distance, total completion time, total waiting time and total delay time;
[0131] Constraints:
[0132] k≤CM (2)
[0133]
[0134] Where k is the number of service vehicles, CM is the maximum number of vehicles, and g i is the delivery demand of customer i, N m is the number of customers served by vehicle m, C is the capacity of the vehicle, and C i The capacity of the vehicle serving customer i, p i The service time for customer i, dt i is the vehicle delay time of customer i, md is the maximum delay time, at m is the time when vehicle m arrives at the parking lot, e m is the closing time of the depot, cv1(x) is the vehicle restriction constraint, cv2(x) is the capacity constraint of the vehicle to meet the delivery needs of each route, cv3(x) is the capacity constraint of the vehicle to reach all customers, cv4(x) is the delay time constraint, and cv5(x) is the time constraint for the vehicle to return to the depot before the closing time.
[0135] Constraint (2) CM represents the maximum number of vehicles. Therefore, the number of vehicles k used cannot exceed CM;
[0136] Constraint (3) indicates that the capacity C of the vehicle must be greater than the total capacity required by the user;
[0137] Constraint (4) indicates that the vehicle arrives at customer i with a capacity of C i . According to the customer's needs in delivery and pickup, delivery needs require unloading, and pickup needs require loading from the vehicle.
[0138] Constraint (5) means that after the vehicle arrives at the customer's time window, the delay time generated is less than the maximum delay time. Constraint (6) means that after the vehicle has served all customers, it must return to the parking lot before closing.
[0139] In constraint (7), cv1 is the vehicle limit constraint, cv2 is the capacity constraint of the vehicle to meet the delivery demand of each route, cv3 is the capacity constraint of the vehicle to reach all customers, cv4 is the delay time constraint, and cv5 is the time constraint for the vehicle to return to the depot before the closing time.
[0140] The main process of CEOA algorithm is as follows Figure 3 shown.
[0141] The specific process of CEOA algorithm is as follows:
[0142] Step 1: The main idea of the environment selection method in CEOA is based on the non-dominated sorting genetic algorithm (NSGA-II). This algorithm is used to select some solutions with good convergence and diversity. Before explaining the environment selection strategy, we first define a management technique based on constraint functions. Solutions that do not meet the requirements of the management technique are considered infeasible solutions; otherwise, they are considered feasible solutions.
[0143] Set the maximum weight vector Z max and the minimum weight vector Z min :
[0144]
[0145] in, is the maximum violation value of the ith constraint; is the minimum violation value of the ith constraint, i∈{1,2,3,4,5};
[0146] The constraints for each solution are defined as:
[0147]
[0148] CV(x) represents the constraint value of solution x. If CV(x) = 0, solution x is a feasible solution; otherwise it is an infeasible solution. The larger the CV(x) value, the worse the quality of solution x.
[0149]
[0150] Among them, is the normalized constraint violation value.
[0151] Then, the population and sub-populations are merged into a temporary archive, and the solutions that meet the constraint violation value (feasible solutions) are put into the set S c and the infeasible solutions are put into the set S I . According to the size N of the population, a new population P is selected from the temporary archive set. The specific implementation steps are as follows:
[0152] (1) If the size of S c is N (i.e., the predefined population size), then each solution in S c will be copied into P.
[0153] (2) If the size of S c is less than N, it means that the new population P consists of feasible solutions and infeasible solutions. First, select the feasible solutions S c . The remaining solutions with a size of N - |S c |, where |S c | is the size of S c , are selected from the infeasible solutions. It should be noted that all infeasible solutions are saved in the set S I . In particular, S I is sorted in ascending order according to the constraint value. The solutions in S I are added to the new population P until its size is N.
[0154] (3) If S c > N, then all solutions in P are feasible. For the feasible solutions, the fast non-dominated sorting method is used to divide S c into several non-dominated levels (i.e., F1, F2,...). For the solutions at the non-dominated levels, they will be added to an empty P until |P| + |F i | > N, where P contains solutions from F1 to F i-1 . If P < N, we use the truncation method to select N - |P| solutions from F i and copy them into P.
[0155] The second step: Generation of sub-populations. The main idea of the offspring reproduction process is to generate elite solutions through crossover operations and mutation operations. First, two mating parents are selected from the parent population P by the tournament selection method. Then, we use crossover operations and mutation operations to generate new offspring solutions. For convenience, we provide Figure 4 and 5as a sample of crossover and mutation operations. It is worth mentioning that each number in the circle represents a node. The route of the vehicle consists of ordered nodes, such as Figure 4 Solution 1 includes three routes: (0,2,7,0), (0,1,4,6,0), and (0,3,8,5,0).
[0156] (1) Crossover operation: In this paper, we use the crossover operation to generate new solutions. First, 2 paths are randomly selected from 2 parent solutions respectively: before copying the selected paths to different parent solutions respectively, we need to delete the customers in the two parent solutions that conflict with the selected customers. If all customers in the path conflict with the selected customer, these customers and the path will be deleted from the parent solution. In this way, two solutions will be generated.
[0157] To explain the crossover process of the two solutions, we provide an example, see Figure 4 Assuming that solution 1 and solution 2 are two parent solutions, the ordered red circles represent Figure 4 Then, the path (0,2,7,0) selected in solution 1 will be copied to solution 2. Therefore, the node (2,7) in solution 2 that conflicts with the selected path will be deleted. Therefore, a new solution will be created in the crossover operation, namely Figure 4 New solution 1 and new solution 2. Another new solution was created with a similar idea.
[0158] (2) Mutation operation: First, the mutation operation adopts four methods (partial exchange, two route merging, long route division and partial mutation); for partial exchange, the parent solution randomly selects two routes to exchange part of its customers. It is worth noting that the merging of two routes can reduce the number of vehicles. For longer routes, we need to divide the longer route into two routes. It is important to note that the vehicle's driving route needs to be locally mutated.
[0159] For convenience, we Figure 5 An example is provided in which eight subgraphs are placed in four rows and two columns to illustrate the process of mutation operation. For partial exchange, we randomly select two routes to exchange some nodes. For example, in Figure 5 In the first row of , solution 2 is composed of (2,7) and (1,4) of solution 1, where (2,7) and (1,4) of solution 1 are randomly selected. For the second method, we randomly select two smaller routes, such as Figure 5 The second row, (2,7) and (1,4,6), will be merged into a long route (2,7,1,4,6), where solution 1 is the parent solution and solution 2 is in Figure 5For the third way, we find a longer route, such as (3,8,5), which will be divided into two routes, such as (3) and (8,5), where the examples of the two routes come from Figure 5 For the fourth way, we randomly select a route, such as (1,4,6), which will change the sequence in a random way, such as (4,6,1), where the examples of two routes come from Figure 5 The fourth line of .
[0160] (3) Tournament selection: Binary tournament selection is to obtain the best mating parent solution. First, two solutions are randomly selected from the parent population P. If a solution x can constrain-dominate a solution y, solution x will be selected as the mating parent. Specifically, if two solutions cannot constrain-dominate each other, a mating parent is randomly selected from them.
[0161] Experimental setup
[0162] In order to test the performance of the proposed algorithm, real examples of cdp, rcdp, and rdp are used. i Set to 10, 20 or 30. The algorithm evolved for 200 generations and there were 500 individuals in the population. In order to verify the effectiveness of the proposed algorithm, three classic algorithms were selected as comparison algorithms. The three comparison algorithms are: Pareto-based multi-objective optimization algorithm (NSGA-II), weight vector-based multi-objective optimization algorithm (MOEA / D) and diversity preservation and density estimation algorithm (SPEA2+SDE).
[0163] In order to compare the algorithms fairly, some key parameters of CEOA and other algorithms are briefly described. The population size is set to 495, the community size of MOEA / D is set to 20, the maximum delay time is set to 30min, the independent run parameter is set to 20, and the number of iterations is set to 200.
[0164] The performance of evolutionary algorithms depends heavily on their parameter settings. To study the impact of parameter settings on algorithm performance, we set the population size to 126, 210, 330, and 495, and the total number of generations to 100, 200, and 300. Parameter C is a combination of population size and total number of generations. The parameter configurations for sensitivity analysis are shown in Table 2. cdp101, cdp201, rcdp101, rcdp201, rdp101, and rdp201 were selected as test cases to test the sensitivity analysis of evolutionary parameters.
[0165] Table 2: Parameter configuration
[0166] C Population size Total Algebra C1 126 100 C2 210 100 C3 330 100 C4 495 100 C5 126 200 C6 210 200 C7 330 200 C8 495 200 C9 126 300 C10 210 300 C11 330 300 C12 495 300
[0167] To investigate the sensitivity of parameters to algorithm performance, Figure 6 plots the average HV of each algorithm at different parameters (cdp101, cdp201, rcdp101, rcdp201, rdp101, rdp201). As can be seen from Figure 6, different parameters control the performance of the evolutionary algorithms. All algorithms are easily affected by parameter settings. Smaller population sizes can produce better results. CEOA significantly outperforms NSGA-II, MOEA / D, and SPEA2+SDE under different parameter settings. Therefore, the setting of parameters affects the performance of the algorithm. This effect suggests that CEOA can benefit from the current parameter settings.
[0168] It should be understood that the above specific embodiments of the present invention are only used to illustrate or explain the principles of the present invention, and do not constitute a limitation of the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. In addition, the appended claims of the present invention are intended to cover all changes and modifications that fall within the scope and boundaries of the appended claims, or the equivalent forms of such scope and boundaries.
Claims
1. A delivery and pickup vehicle route optimization method with a time window, characterized in that: The following steps are involved: S01: Construct a mathematical model based on the vehicle routing problem with a time window, the mathematical model includes multiple objectives and multiple constraints; S02: using an improved non-dominated sorting genetic algorithm to solve the objective function of the constructed mathematical model; the improved non-dominated sorting genetic algorithm comprises: Set a weight value vector for the constraint function; Adjust the priorities of the objective function and constraint function during the search process, give the constraint function a higher priority over the objective function in the early stage of evolution, and give the constraint function a lower priority over the objective function in the later stage of evolution, so as to guide the population to move towards the feasible domain; Two mating parents are selected from the parent population through the tournament selection method, and new offspring solutions are generated using crossover and mutation operations.
2. The method for optimizing delivery and pickup vehicle routes with time windows according to claim 1, characterized in that: The construction of the mathematical model in step S01 includes: Objective function: Min F(x)={f1(x, t), f2(x, t),..., f5(x, t)} Among them, f1(x, t) = , f2(x, t), ..., f5(x, t) are five targets representing: number of vehicles, total driving distance, total completion time, total waiting time and total delay time; Constraints: k≤CM Where k is the number of service vehicles, CM is the maximum number of vehicles, and g i is the delivery demand of customer i, N m is the number of customers served by vehicle m, C is the capacity of the vehicle, and C i The capacity of the vehicle serving customer i, p i The service time for customer i, dt i is the vehicle delay time of customer i, md is the maximum delay time, at m is the time when vehicle m arrives at the parking lot, e m is the closing time of the depot, cv1(x) is the vehicle restriction constraint, cv2(x) is the capacity constraint of the vehicle to meet the delivery needs of each route, cv3(x) is the capacity constraint of the vehicle to reach all customers, cv4(x) is the delay time constraint, and cv5(x) is the time constraint for the vehicle to return to the depot before the closing time.
3. The method for optimizing delivery and pickup vehicle routes with time windows according to claim 1, characterized in that: The method of setting the weight value vector for the constraint function in step S02 includes: Set the maximum weight vector Z max and the minimum weight vector Z min : in, is the maximum violation value of the ith constraint; is the minimum violation value of the ith constraint, i∈{1,2,3,4,5}; The constraints for each solution are defined as: CV(x) represents the constraint value of solution x. If CV(x) = 0, solution x is a feasible solution; otherwise, it is an infeasible solution. in, is the normalized constraint violation value.
4. The method for optimizing delivery and pickup vehicle routes with time windows according to claim 1, characterized in that: Step S02 also includes: Merge the population and subpopulation into a temporary archive set, where feasible releases are put into the set S c Infeasible release is added to the set S I In the process, according to the size of the population N, a new population P is selected from the temporary archive set.
5. The method for optimizing delivery and pickup vehicle routes with time windows according to claim 4, characterized in that: Methods for selecting a new population P from the temporary archive set include: If S c The size of S is N, then c Each solution of will be copied to the new population P; If S c The size is less than N, first choose the feasible solution S c , the rest are of size N-|S c |The solution is selected from the infeasible solutions, where |S c |It is S c The size of the set S I Arrange the set S in ascending order according to the constraint values. I The solutions in are added to the new population P until its size is N; If S c The size of S is greater than N. For feasible solutions, the fast non-dominated sorting method is used to sort the set S c Divide into several non-dominated levels F1, F2, ...; add the solutions of the non-dominated levels to an empty P until |P| + |F i | > N, where P contains from F1 to F i-1 , if P < N, use the truncation method to select from F i Select N - |P| solutions and copy them to the new population P.
6. The method for optimizing delivery and pickup vehicle routes with time windows according to claim 1, characterized in that: In step S02, two mating parents are selected from the parent population by the tournament selection method, and a method for generating a new offspring solution by using a crossover operation and a mutation operation includes: Randomly select two solutions from the parent population P. If a solution x can constrain-dominate a solution y, solution x will be selected as the mating parent. If the two solutions cannot constrain-dominate each other, a mating parent is randomly selected from them. Randomly select 2 paths from 2 parent solutions respectively; delete the customers in the two parent solutions that conflict with the selected customers. If all customers in the path conflict with the selected customers, delete all customers and paths from the parent solution, copy the selected paths to different parent solutions respectively, and generate two new solutions; perform mutation operations, which include partial exchange, merging of two paths, division of long paths, and partial mutation. For partial exchange, the parent solution randomly selects two paths to exchange some of its customers; the merging of two paths is used to reduce the number of vehicles; the longer path is divided into multiple paths; and the vehicle's path is locally mutated.
7. A delivery and pickup vehicle route optimization system with time windows, characterized in that: include: A model building module builds a mathematical model based on a vehicle routing problem with a time window, wherein the mathematical model includes multiple objectives and multiple constraints; The solution module uses an improved non-dominated sorting genetic algorithm to solve the objective function of the constructed mathematical model; the improved non-dominated sorting genetic algorithm includes: Set a weight value vector for the constraint function; Adjust the priorities of the objective function and constraint function during the search process, give the constraint function a higher priority over the objective function in the early stage of evolution, and give the constraint function a lower priority over the objective function in the later stage of evolution, so as to guide the population to move towards the feasible domain; Two mating parents are selected from the parent population through the tournament selection method, and new offspring solutions are generated using crossover and mutation operations.
8. The delivery and pickup vehicle route optimization system with time windows according to claim 7 is characterized in that: The mathematical model building in the model building module includes: Objective function: Min F(x)={f1(x, t), f2(x, t),..., f5(x, t)} Among them, f1(x, t), f2(x, t), ..., f5(x, t) are five targets representing: number of vehicles, total driving distance, total completion time, total waiting time and total delay time; Constraints: k≤CM Where k is the number of service vehicles, CM is the maximum number of vehicles, and g i is the delivery demand of customer i, N m is the number of customers served by vehicle m, C is the capacity of the vehicle, and C i The capacity of the vehicle serving customer i, p i The service time for customer i, dt i is the vehicle delay time of customer i, md is the maximum delay time, at m is the time when vehicle m arrives at the parking lot, e m is the closing time of the depot, cv1(x) is the vehicle restriction constraint, cv2(x) is the capacity constraint of the vehicle to meet the delivery needs of each route, cv3(x) is the capacity constraint of the vehicle to reach all customers, cv4(x) is the delay time constraint, and cv5(x) is the time constraint for the vehicle to return to the depot before the closing time.
9. The delivery and pickup vehicle route optimization system with time windows according to claim 1, characterized in that: The methods for setting the weight value vector for the constraint function in the solution module include: Set the maximum weight vector Z max and the minimum weight vector Z min : in, is the maximum violation value of the ith constraint; is the minimum violation value of the ith constraint, i∈{1,2,3,4,5}; The constraints for each solution are defined as: CV(x) represents the constraint value of solution x. If CV(x) = 0, solution x is a feasible solution; otherwise, it is an infeasible solution. in, is the normalized constraint violation value.
10. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, the method for optimizing the delivery and pickup vehicle path with a time window as described in any one of claims 1 to 6 is implemented.