A vehicle path optimization method based on dynamic constraint evaluation strategy multi-objective ant colony algorithm
Patent Information
- Application Number
- CN202311823269.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-12-27
AI Technical Summary
[0006]一种基于动态约束评价策略多目标蚁群算法的车辆路径优化方法,其特征在于确定车辆路径优化问题的优化目标,采用动态约束评价蚁群算法,获取车辆调度方案,解决客户时间窗约束下,车辆路径优化过程中难以获得可行解及解集多样性差的问题,实现车辆数目和总行驶距离同时最优,包括以下步骤:
[0081]本发明针对车辆路径优化过程中,考虑多约束条件时,难以获得最优解的问题,使用多目标蚁群算法,同时对车辆数目和总行驶距离进行优化。
Smart Images

Figure CN117875823B_ABST
Abstract
Description
Technical Field
[0001] This invention addresses the vehicle route optimization problem from logistics centers to customers in the supply chain logistics field. It designs a vehicle route optimization method based on a dynamic constraint evaluation strategy and a multi-objective ant colony algorithm, obtaining a multi-objective vehicle route optimization scheme under multiple constraints. This achieves simultaneous optimization of the number of vehicles and the total travel distance, effectively improving logistics distribution efficiency and reducing enterprise logistics transportation costs. This method belongs to both the field of intelligent information and the field of logistics. Background Technology
[0002] Vehicle routing optimization is a problem that involves planning the routes of a group of vehicles under specific conditions to maximize or minimize certain performance indicators. This type of problem frequently occurs in logistics, transportation, and distribution, and its optimization objectives are typically to reduce costs, shorten travel distances, save time, or maximize the fulfillment of specific constraints. Researching and applying vehicle routing optimization can bring economic, environmental, and social benefits, and is of significant practical importance for saving logistics and transportation costs for enterprises and promoting the development of the logistics and transportation industry. With the expansion of the logistics and distribution industry, vehicle routing problems in supply chain logistics scenarios are increasingly characterized by multiple objectives and constraints. First, to improve resource utilization, it is necessary to balance the number of vehicles used and the travel distance, maintaining the simultaneous optimization of both objectives. Second, in addition to vehicle load limitations, vehicle routing optimization in specific logistics and transportation scenarios is subject to more time window constraints. For example, delivery personnel need to deliver goods within the customer's specified service time window, and the uncertainty of the number, location, and service time of delivery personnel makes the constraints more complex. Therefore, under complex time window constraints, determining the number of vehicles used and coordinating the delivery routes of each vehicle to obtain a vehicle scheduling scheme that satisfies all constraints is a major challenge in the field of supply chain logistics. The dynamic constraint evaluation ant colony algorithm exhibits good convergence and versatility, enabling efficient solutions to multi-constraint, multi-objective optimization problems. This provides a novel method for solving the aforementioned vehicle routing optimization problem. Therefore, this invention has broad application prospects in vehicle routing optimization.
[0003] This invention proposes a vehicle route optimization method based on a multi-objective ant colony algorithm with dynamic constraint evaluation strategy. It takes the number of vehicles and the total driving distance of vehicles as optimization objectives, considers multiple constraints, optimizes the customer service order, and obtains the optimal vehicle route plan, providing an effective method to improve logistics and distribution efficiency and service quality. Summary of the Invention
[0004] This invention provides a vehicle path optimization method based on a multi-objective ant colony algorithm with a dynamic constraint evaluation strategy. The method aims to minimize the number of vehicles and the total travel distance. It determines a multi-constraint vehicle path optimization model, divides the ant colony into two sub-populations according to the dynamic constraint evaluation strategy, guides the ant colony to search using the sub-population with evolutionary advantage, and improves the diversity of the solution set by using high-quality infeasible solutions to obtain the optimal path solution, thereby improving the utilization rate of logistics transportation resources and saving logistics costs for enterprises.
[0005] The present invention adopts the following technical solution and implementation steps:
[0006] A vehicle routing optimization method based on a dynamic constraint evaluation strategy and a multi-objective ant colony algorithm is characterized by determining the optimization objective of the vehicle routing optimization problem, employing a dynamic constraint evaluation ant colony algorithm to obtain a vehicle scheduling scheme, and addressing the problems of difficulty in obtaining feasible solutions and poor solution set diversity during vehicle routing optimization under customer time window constraints. This method achieves simultaneous optimization of the number of vehicles and the total travel distance, and includes the following steps:
[0007] Step 1: Define the optimization objective of the vehicle routing problem:
[0008] Assume there is K max All transport vehicles of the same model are parked in a logistics center, ready to provide one-way delivery services to N customers. The vehicle load limit is Q, the logistics center opening time is L, and the logistics center closing time is E. Each customer corresponds to one order record, including customer number i, customer location coordinates (x, y, y). i ,y i The weight q of the goods for the i-th customer i The earliest service start time for the i-th customer l i The latest start time e for the i-th customer i The service duration s for the i-th customer i Where i = 0 represents a logistics center; the optimization objective of this vehicle routing optimization problem is to minimize the following objective function:
[0009] f1=K (1)
[0010]
[0011] Where f1 is the total number of vehicles K used in the delivery process, and f2 is the total distance traveled by the vehicles; 0 <K<K max d ij Let x be the distance between customer i and customer j. ijk Indicates whether the k-th car travels from i to j, x ijk =1 is true, x ijk =0 indicates no, i,j=0,…,N,k=1,…,K;
[0012] Each vehicle must meet the following conditions during the delivery process, and each customer must be delivered by only one vehicle:
[0013]
[0014]
[0015] Each vehicle departs from the logistics center, completes its delivery task according to the corresponding customer service sequence, and then returns to the logistics center:
[0016]
[0017]
[0018] The total customer demand for the kth vehicle should not exceed Q:
[0019]
[0020] The time a for the vehicle to arrive at the location of customer i bi,t Vehicles should be present within their service time window and should return to the logistics center before it closes.
[0021] l i ≤a bi,t ≤e i (8)
[0022] L≤a b0,t ≤E (9)
[0023] Calculate the time a for the vehicle with solution b to reach position i in generation t after passing through j. bi,t :
[0024]
[0025] Among them, w bj,t For the time the vehicle waits for customer j, w bj,t ≥0, χ 0i χ represents the time it takes to travel from the logistics center to the customer. ji χ represents the time it takes for customer j to travel to customer i. j0 This indicates the time it takes for customer j to travel from the customer j to the logistics center;
[0026] Step 2: Obtain distance and time data for the vehicle routing optimization problem.
[0027] Calculate the distance between customer i and customer j:
[0028]
[0029] Where, x i and yi Let x and y represent the x and y coordinates of customer i, respectively. j and y j Let x and y represent the x and y coordinates of customer j's position, respectively; calculate the coordinates corresponding to d based on the average vehicle speed v. ij Travel time χi j :
[0030]
[0031] Step 3: Design a multi-objective ant colony algorithm based on a dynamic constraint evaluation strategy.
[0032] Step 3.1 Parameter settings and population initialization:
[0033] The maximum number of generations in the multi-objective ant colony algorithm is set to T, T = 1000; the pheromone importance factor is α, α = 1; the heuristic function importance factor is β, β = 3; the constraint importance factor is γ, γ = 2; the pheromone volatility factor is ρ, ρ = 0.85; the pheromone concentration update factor is U, U = 5; the variance threshold is Th, Th = 0.5; the population size is H, H is an integer in the range [10, 500]; each solution represents a vehicle scheduling scheme; and the initial population P0 is randomly generated.
[0034]
[0035] Among them, P b,0 This is the b-th solution of the initial population, where b = 1, ..., H;
[0036] Step 3.2 Determining the number of feasible solutions:
[0037] Population P in generation t t Represented as:
[0038]
[0039] P b,t =[P b1,t ,…,P bu,t ,…,P bN,t (15)
[0040] Among them, P b,t For the b-th solution of the t-th generation population, P bu,t Let u be the u-th dimension of the b-th solution in the t-th generation population; t = 0, ..., T, P bu,t =1,…,N,u=1,…,N; Considering vehicle capacity and customer start time, a distribution center is inserted into each solution in the population to obtain K delivery routes r. k k is the route number, k = 1, ..., K, K ≤ K max ;
[0041] Calculate the constraint violation degree for each solution.
[0042]
[0043] Among them, a bi,t Let e be the arrival time of the vehicle with solution b in generation t for the i-th customer. This value is calculated using formula (10). i This is the latest start time for the i-th customer; this value is read from the database; it is set to satisfy... The solution is feasible. The solution is infeasible, according to statistics P. t The total number of feasible solutions is n t ;
[0044] Step 3.3 Design of dynamic constraint violation index:
[0045] Calculate the proportion P of feasible solutions in the population. t :
[0046]
[0047] Where, n t H represents the number of feasible solutions in the population, and H represents the population size.
[0048] Calculate the variance ζ of the constraint violation rate of the population. t :
[0049]
[0050] in, The constraint violation degree of the b-th solution obtained by formula (16) is... H is the average value of constraint violation in the population obtained by formula (16), and H is the population size.
[0051] Calculate the dispersion degree δ of the population t :
[0052]
[0053] Where Th is the variance threshold, Th = 0.5. The maximum constraint violation in the population is obtained from formula (16). The average value of constraint violation in the population is obtained from formula (16).
[0054] Based on the proportion and dispersion of feasible solutions in the population, the dynamic constraint evaluation index ε is calculated. t :
[0055]
[0056] The current population is classified according to the dynamic constraint evaluation index. If the constraint violation degree of the solutions in the population is less than or equal to the dynamic constraint evaluation index, it is considered to be a subpopulation P with evolutionary advantage. t EA If the constraint violations of solutions in a population are all greater than the dynamic constraint evaluation index, then the subpopulation P is considered to have a strong constraint violation degree. t HCV :
[0057]
[0058] If the b-th solution in the population belongs to a subpopulation with an evolutionary advantage, then after executing step 3.4, execute step 3.6. If the b-th solution in the population belongs to a subpopulation with a strong constraint violation, then after executing step 3.5, execute step 3.6.
[0059] Step 3.4 Evolutionary strategy based on dynamic state transition probabilities:
[0060] Calculate the state transition probability P ij,t :
[0061]
[0062] Where, τ ij,t η represents the pheromone concentration between customers i and j in generation t. ij,t Let be the reciprocal of the distance between customers i and j in generation t. Let be the constraint violation degree between customers i and j in generation t, and allowed be the set of customer points that customer i has not visited. The next customer point is selected using a roulette wheel algorithm based on the state transition probability.
[0063] Step 3.5 Gaussian Mutation-Based Evolutionary Strategy
[0064] Calculate the weight ω of unvisited customer points j :
[0065]
[0066] Where c is the weight parameter of the Gaussian function, c = 0.5, N allowed Let P be the number of unvisited customers. Calculate the probability P of selecting each unvisited customer point based on its weight. j :
[0067]
[0068] Based on the obtained probability P j The next customer selects their turn using a roulette wheel.
[0069] Step 3.6 Cost calculation of each solution
[0070] Considering the vehicle capacity and the starting service time of customers, distribution centers are inserted into each solution in the population to obtain K b,t distribution routes r k , where k is the route number, k=1,…,K,K≤K max . Calculate the total distance D on the distribution route of the b-th solution b,t :
[0071]
[0072] wherein, d ij is the distance between customer i and customer j. The distribution cost F is calculated according to the total distance of distribution routes and the number of distribution routes of this solution b,t :
[0073] F b,t =ω D ·D b,t +ω K ·K b,t (26)
[0074] wherein, ω D is the weight of the total distance of distribution routes, ω D =1, ω K is the weight of the number of distribution routes, ω K =1000. The solution with the minimum distribution cost is taken as the optimal route in the current generation.
[0075] Step 3.7 Collaborative optimization mechanism based on ant colony pheromone update strategy
[0076] After the distribution routes are generated, the ant colony pheromone needs to be updated to better guide the construction of distribution routes in the next generation, and the updated pheromone τ ij,t+1 :
[0077]
[0078] Step 3.8 Judging the termination condition of the algorithm:
[0079] If t<T, let t=t+1 and repeat steps 3.2 to 3.7; if t=T, stop the calculation and output the optimal vehicle scheduling scheme.
[0080] The innovation of the present invention is reflected in:
[0081] Aiming at the problem that it is difficult to obtain the optimal solution when multiple constraints are considered in the vehicle path optimization process, the present invention uses a multi-objective ant colony algorithm to optimize both the number of vehicles and the total driving distance.
[0082] The design incorporates a dynamic constraint violation index, dividing the ant population into two categories. The subpopulation with evolutionary advantage guides the ants' search, improving the convergence of the optimal solution and quickly obtaining vehicle path optimization schemes. For the subpopulation with strong constraint violations, a Gaussian mutation-based evolutionary strategy is implemented to fully utilize information from infeasible solutions, increasing the diversity of optimal solutions and obtaining vehicle path optimization schemes with good diversity. Furthermore, for the subpopulation with strong constraint violations, pheromone updates are performed considering the constraint violation rate.
[0083] This invention optimizes vehicle paths by taking the number of vehicles and the total travel distance as the optimization objectives, using a constrained multi-objective ant colony algorithm, designing a dynamic constraint violation index, implementing different evolutionary strategies based on different subpopulations, and employing an ant colony pheromone update strategy based on constraint violation. Any research on vehicle path optimization that adopts the optimization objectives and algorithms of this invention should fall within the scope of this invention. Attached Figure Description
[0084] Figure 1 This is the vehicle dispatching route map in the optimization results of this invention. Detailed Implementation
[0085] The data sample used in this invention is C101, which belongs to the Solomon dataset. As shown in Table 1, the first to seventh columns represent the customer number i and the x-coordinate of the customer's location, respectively. i and the vertical coordinate y i Customer's demand for goods q i Earliest start time i The latest start time of service is e i Service time s i , where i=0 corresponds to logistics center information.
[0086] This invention selects the number of vehicles and the total travel distance as optimization objectives; it adopts the following technical solution and implementation steps:
[0087] The specific steps of a vehicle path optimization method based on a multi-objective ant colony algorithm with dynamic constraint evaluation strategy are as follows:
[0088] Step 1: Define the optimization objective of the vehicle routing problem:
[0089] Assume there are 36 identical transport vehicles parked in a logistics center, ready to provide one-way delivery services to 100 customers. Each vehicle has a capacity of 200. The logistics center's opening and closing times are 0, 12, 3, and 6 respectively. Each customer corresponds to one order record, including customer ID i = 0, ..., N, and customer location (x). i ,y i The weight q of the goods for the i-th customeri The earliest service start time for the i-th customer l i The latest start time e for the i-th customer i The service duration s for the i-th customer i , where i = 0 represents a logistics center;
[0090] The objective function for this vehicle routing optimization problem is:
[0091] f1=K (1)
[0092]
[0093] Where f1 is the total number of vehicles K used in the delivery process, and f2 is the total distance traveled by the vehicles; 0 <K<K max d ij Let x be the distance between customer i and customer j. ijk Indicates whether the k-th car travels from i to j, x ijk =1 is true, x ijk =0 indicates no, j=0,…,N,k=1,…,K;
[0094] Each vehicle must meet the following conditions during the delivery process, and each customer must be delivered by only one vehicle:
[0095]
[0096]
[0097] Each vehicle departs from the logistics center, completes its delivery task according to the corresponding customer service sequence, and then returns to the logistics center:
[0098]
[0099]
[0100] The total customer demand for vehicle k should not exceed 200.
[0101]
[0102] The time a for the vehicle to arrive at the location of customer i i Vehicles should be present within their service time window and should return to the logistics center before it closes.
[0103] l i ≤a bi,t ≤e i (8)
[0104] 0≤a b0,t ≤1236 (9)
[0105] Calculate the time a for the vehicle with solution b to reach position i in generation t after passing through j. bi,t :
[0106]
[0107] Among them, w bj,t For the time the vehicle waits for customer j, w bj,t ≥0, χ 0i χ represents the time it takes to travel from the logistics center to the customer. ji χ represents the time it takes for customer j to travel to customer i. j0 This indicates the time it takes for customer j to travel from the customer j to the logistics center;
[0108] Step 2: Obtain distance and time data for the vehicle routing optimization problem.
[0109] Calculate the distance between customer i and customer j:
[0110]
[0111] Where, x i and y i Let x and y represent the x and y coordinates of customer i, respectively. j and y j Let x and y represent the x and y coordinates of customer j's position, respectively; calculate the coordinates corresponding to d based on the average vehicle speed v. ij Travel time χi j :
[0112]
[0113] Step 3: Design a multi-objective ant colony algorithm based on a dynamic constraint evaluation strategy.
[0114] Step 3.1 Parameter settings and population initialization:
[0115] The maximum number of generations for the multi-objective differential evolution algorithm is set to 1000, the pheromone importance factor is 1, the heuristic function importance factor is 3, the constraint importance factor is 2, the pheromone volatility factor is 0.85, the update pheromone concentration factor is 5, the variance threshold is 0.5, the population size is 100, and the initial population P0 is randomly generated.
[0116]
[0117] Among them, P b,0 Let b be the b-th solution of the initial population, where b = 1, ..., 100;
[0118] Step 3.2 Determining the number of feasible solutions:
[0119] Population P in generation t t Represented as:
[0120]
[0121] P b,t =[P b1,t ,…,P bu,t ,…,P b100,t (15)
[0122] Among them, P b,t For the b-th solution of the t-th generation population, P bu,t Let P be the u-th dimension component of the b-th solution in the t-th generation population; t = 0, ..., 1000. bu,t =1,…,100,u=1,…,100; Considering vehicle capacity and customer start time, a distribution center is inserted into each solution in the population to obtain K delivery routes r. k k is the route number, k = 1, ..., K, K ≤ 36;
[0123] Calculate the constraint violation degree for each solution.
[0124]
[0125] Among them, a bi,t Let e be the arrival time of the vehicle with solution b in generation t for the i-th customer. This value is calculated using formula (10). i This is the latest start time for the i-th customer; this value is read from the database; it is set to satisfy... The solution is feasible. The solution is infeasible, according to statistics P. t The total number of feasible solutions is n t ;
[0126] Step 3.3 Design of dynamic constraint violation index:
[0127] Calculate the proportion P of feasible solutions in the population. t :
[0128]
[0129] Where, n t H represents the number of feasible solutions in the population, and H represents the population size.
[0130] Calculate the variance ζ of the constraint violation rate of the population. t :
[0131]
[0132] in, The constraint violation degree of the b-th solution obtained by formula (16) is... H is the average value of constraint violation in the population obtained by formula (16), and H is the population size.
[0133] Calculate the dispersion degree δ of the population t :
[0134]
[0135] Where Th is the variance threshold, Th = 0.5. The maximum constraint violation in the population is obtained from formula (16). The average value of constraint violation in the population is obtained from formula (16).
[0136] Based on the proportion and dispersion of feasible solutions in the population, the dynamic constraint evaluation index ε is calculated. t :
[0137]
[0138] The current population is classified according to the dynamic constraint evaluation index. If the constraint violation degree of the solutions in the population is less than or equal to the dynamic constraint evaluation index, it is considered to be a subpopulation P with evolutionary advantage. t EA If the constraint violations of solutions in a population are all greater than the dynamic constraint evaluation index, then the subpopulation P is considered to have a strong constraint violation degree. t HCV :
[0139]
[0140] If the b-th solution in the population belongs to a subpopulation with an evolutionary advantage, then after executing step 3.4, execute step 3.6. If the b-th solution in the population belongs to a subpopulation with a strong constraint violation, then after executing step 3.5, execute step 3.6.
[0141] Step 3.4 Evolutionary strategy based on dynamic state transition probabilities:
[0142] Calculate the state transition probability P ij,t :
[0143]
[0144] Where, τ ij,t η represents the pheromone concentration between customers i and j in generation t. ij,t Let be the reciprocal of the distance between customers i and j in generation t. Let be the constraint violation degree between customers i and j in generation t, and allowed be the set of customer points that customer i has not visited. The next customer point is selected using a roulette wheel algorithm based on the state transition probability.
[0145] Step 3.5 Gaussian Mutation-Based Evolutionary Strategy
[0146] The weight ω of unvisited customer points is calculated using a Gaussian function. j :
[0147]
[0148] Where c is the weight parameter of the Gaussian function, c = 0.5, N allowed Let P be the number of unvisited customers. Calculate the probability P of selecting each unvisited customer point based on its weight. j :
[0149]
[0150] Based on the obtained probability P j The next customer selects their turn using a roulette wheel.
[0151] Step 3.6 Cost Calculation for Each Solution
[0152] Considering vehicle capacity and customer start times, a distribution center is inserted into each solution in the population to obtain K. b,t Delivery routes r k k is the route number, k = 1, ..., K, K ≤ K max Calculate the total distance D along the delivery route for the b-th solution. b,t :
[0153]
[0154] Where, d ij Let be the distance between customers i and j. Calculate the delivery cost F based on the total delivery route distance and the number of delivery routes in this solution. b,t :
[0155] F b,t =ω D ·D b,t +ω K ·K b,t (26)
[0156] Where, ω D ω represents the weight of the total distance of the delivery route. D =1, ω K ω is the weight for the number of delivery routes. K =1000. The path with the lowest delivery cost will be the optimal path in the current generation.
[0157] Step 3.7 Collaborative Optimization Mechanism Based on Ant Colony Pheromone Update Strategy
[0158] After the delivery route is generated, the ant colony pheromones need to be updated to better guide the construction of delivery routes in the next generation. The updated pheromone τ ij,t+1 :
[0159]
[0160] Step 3.8 Determine the termination condition of the algorithm:
[0161] If t < 1000, then let t = t + 1, and repeat steps 3.2 to 3.7. If t = T, then stop the calculation and output the vehicle scheduling scheme with the minimum number of vehicles and the minimum vehicle travel distance, along with the corresponding route planning diagram, as shown in Table 2. Figure 1 As shown in Table 2, the logistics center dispatched 10 vehicles to serve 100 customers, corresponding to a total travel distance of 828.94 kilometers for the optimal vehicle dispatch plan. Figure 1 The corresponding vehicle route planning map is provided.
[0162] Table 1. Routing optimization data for vehicle C101
[0163]
[0164]
[0165] Table 2. Optimal Vehicle Dispatch Scheme
[0166]
Claims
1. A vehicle path optimization method based on a multi-objective ant colony algorithm with dynamic constraint evaluation strategy, characterized in that, Comprising the following steps: Step 1: Determine the optimization objective of the vehicle routing problem: Assume there is K max All transport vehicles of the same model are parked in a logistics center, ready to provide one-way delivery services to N customers. The vehicle load limit is Q, the logistics center opening time is L, and the logistics center closing time is E. Each customer corresponds to one order record, including customer number i, customer location coordinates (x, y, y). i ,y i The weight q of the goods for the i-th customer i The earliest service start time for the i-th customer l i The latest start time e for the i-th customer i The service duration s for the i-th customer i Where i = 0 represents a logistics center; the optimization objective of this vehicle routing optimization problem is to minimize the following objective function: f1 = K (1) Where f1 is the total number of vehicles K used in the delivery process, and f2 is the total distance traveled by the vehicles; 0 <K<K max d ij Let x be the distance between customer i and customer j. ijk Indicates whether the k-th car travels from i to j, x ijk =1 is true, x ijk =0 indicates no, i,j=0,…,N,k=1,…,K; Each vehicle shall meet the following conditions during distribution: each customer is only provided distribution service by one vehicle: Each vehicle departs from the logistics center, completes the distribution task according to the corresponding customer service sequence, and then returns to the logistics center: The total customer demand of the k-th vehicle shall not exceed Q: The time a for the vehicle to arrive at the location of customer i bi,t Vehicles should be present within their service time window and should return to the logistics center before it closes. l i ≤a bi,t ≤e i (8) L≤a b0,t ≤E (9) Calculate the time a for the vehicle with solution b to reach position i in generation t after passing through j. bi,t : Among them, w bj,t For the time the vehicle waits for customer j, w bj,t ≥0, χ 0i χ represents the time it takes to travel from the logistics center to the customer. ji χ represents the time it takes for customer j to travel to customer i. j0 This indicates the time it takes for customer j to travel from the customer j to the logistics center; Step 2: Obtain distance and time data of the vehicle routing problem: Calculate the distance between customer i and customer j: Where, x i and y i Let x and y represent the x and y coordinates of customer i, respectively. j and y j Let x and y represent the x and y coordinates of customer j's position, respectively; calculate the coordinates corresponding to d based on the average vehicle speed v. ij Travel time χ ij : Step 3: Design a multi-objective ant colony algorithm based on dynamic constraint evaluation strategy: Step 3.1: Parameter setting and population initialization: Set the maximum number of evolutionary generations of the multi-objective ant colony algorithm as T, where T = 1000; set the pheromone importance factor as α, where α = 1; set the heuristic function importance factor as β, where β = 3; set the constraint importance factor as γ, where γ = 2; set the pheromone volatilization factor as ρ, where ρ = 0.85; set the pheromone concentration updating factor as U, where U = 5; set the variance judgment threshold Th, where Th = 0.5; set the population size as H, where H is an integer within the range of [10, 500]. Each solution represents a vehicle scheduling scheme, and an initial population P0 is randomly generated: Among them, P b,0 This is the b-th solution of the initial population, where b = 1, ..., H; Step 3.2: Judgment of the number of feasible solutions: Population P in generation t t Represented as: P b,t =[P b1,t ,...,P bu,t ,…,P bN,t ] (15) Among them, P b,t For the b-th solution of the t-th generation population, P bu,t Let u be the u-th dimension of the b-th solution in the t-th generation population; t = 0, ..., T, P bu,t =1,…,N,u=1,…,N; Considering vehicle capacity and customer start time, a distribution center is inserted into each solution in the population to obtain K delivery routes r. k k is the route number, k = 1, ..., K, K ≤ K max ; Calculate the constraint violation degree for each solution. Among them, a bi,t Let e be the arrival time of the vehicle with solution b in generation t for the i-th customer. This value is calculated using formula (10). i This is the latest start time for the i-th customer; this value is read from the database; it is set to satisfy... The solution is feasible. The solution is infeasible, according to statistics P. t The total number of feasible solutions is n t ; Step 3.3: Design of dynamic constraint violation degree index: Calculate the proportion P of feasible solutions in the population. t : Where, n t H represents the number of feasible solutions in the population, and H is the population size. Calculate the variance ζ of the constraint violation rate of the population. t : in, The constraint violation degree of the b-th solution obtained by formula (16) is... H is the average value of constraint violation in the population obtained by formula (16), and H is the population size. Calculate the dispersion degree δ of the population t : Where Th is the variance threshold, Th = 0.
5. The maximum constraint violation in the population is obtained from formula (16). The average value of constraint violation in the population is obtained from formula (16); Based on the proportion and dispersion of feasible solutions in the population, the dynamic constraint evaluation index ε is calculated. t : The current population is classified according to the dynamic constraint evaluation index. If the constraint violation degree of the solutions in the population is less than or equal to the dynamic constraint evaluation index, it is considered to be a subpopulation P with evolutionary advantage. t EA If the constraint violations of solutions in a population are all greater than the dynamic constraint evaluation index, then the subpopulation P is considered to have a strong constraint violation degree. t HCV : If the b-th solution in the population belongs to the sub-population with evolutionary advantage, perform step 3.4 and then perform step 3.6; if the b-th solution in the population belongs to the sub-population with high constraint violation degree, perform step 3.5 and then perform step 3.6; Step 3.4: Evolutionary strategy based on dynamic state transition probability: Calculate the state transition probability P ij,t : Where, τ ij,t η represents the pheromone concentration between customers i and j in generation t. ij,t Let be the reciprocal of the distance between customers i and j in generation t. Let be the constraint violation degree between customers i and j in generation t, and allowed be the set of customer points that customer i has not visited; the next customer point is selected using the roulette wheel method based on the state transition probability. Step 3.5: Evolutionary strategy based on Gaussian mutation Calculate the weight ω of unvisited customer points j : Where c is the weight parameter of the Gaussian function, c = 0.5, N allowed The number of unvisited customers; calculate the probability P of each unvisited customer point being selected based on its weight. j : Based on the obtained probability P j The next customer selects their turn using a roulette wheel. Step 3.6: Cost calculation of each solution Considering vehicle capacity and customer start times, a distribution center is inserted into each solution in the population to obtain K. b,t Delivery routes r k k is the route number, k = 1, ..., K, K ≤ K max ; Calculate the total distance D along the delivery route for the b-th solution. b,t : Where, d ij Let i be the distance between customers i and j; calculate the delivery cost F based on the total delivery route distance and the number of delivery routes in this solution. b,t : F b,t =ω D ·D b,t +oh K ·K b,t (26) Where, ω D ω represents the weight of the total distance of the delivery route. D =1, ω K ω is the weight for the number of delivery routes. K =1000; the path with the lowest delivery cost will be the optimal path in the current generation; Step 3.7: Cooperative optimization mechanism based on ant colony pheromone updating strategy After the delivery route is generated, the ant colony pheromones need to be updated to better guide the construction of delivery routes in the next generation. The updated pheromone τ ij,t+1 : Step 3.8: Judge the termination condition of the algorithm: If t < T, let t = t + 1, repeat steps 3.2 to 3.7; if t = T, stop the calculation and output the optimal vehicle scheduling scheme.