An ant colony algorithm-based vehicle path optimization method with roads and time windows

By improving the ant colony algorithm and combining it with the Floyd algorithm and roulette wheel selection to select the next target point, the problems of slow convergence speed and easy getting trapped in local optima in vehicle path optimization are solved. This achieves faster solution speed and higher search efficiency, adapts to the actual road environment in the workshop, and improves the quality of the optimal solution.

CN115470651BActive Publication Date: 2025-10-21ZHEJIANG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211216756.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2025-10-21
Estimated Expiration
2042-09-30

AI Technical Summary

Technical Problem

Existing vehicle routing optimization methods suffer from slow convergence, low versatility, susceptibility to local optima, and low solution quality when dealing with constraints such as inter-vehicle roads and time windows. Furthermore, heuristic algorithms lack practicality and optimization efficiency.

Method used

An improved ant colony algorithm is adopted, combined with the Floyd algorithm to construct the shortest distance matrix, and the next target point is selected by roulette wheel selection and an adaptive evaporation factor is used in pheromone updates to balance local and global search capabilities and optimize vehicle paths.

Benefits of technology

It improves the solution speed and search efficiency of vehicle path optimization, escapes local optima, enhances the quality and stability of optimal solutions, and adapts to the actual road environment in the workshop.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115470651B_ABST
    Figure CN115470651B_ABST
Patent Text Reader

Abstract

The application discloses a vehicle path optimization method with roads and time windows based on an ant colony algorithm, and the method comprises the following steps: establishing a target function with the lowest total logistics distribution cost as an objective, constructing an optimization model of a vehicle path problem with time window constraints, and setting constraint conditions; generating a shortest distance matrix conforming to an actual road environment of a workshop according to known distance information of demand points of each work station in the workshop by adopting a Floyd algorithm; designing state transition rules and pheromone updating related parameters of the ant colony algorithm, performing multiple state transition and pheromone updating operations on the obtained distance matrix by adopting an improved ant colony algorithm, gradually making a feasible solution close to an optimal solution through multiple iterations, and thus obtaining an optimal path. The application aims to effectively obtain an excellent vehicle driving route, reduce logistics distribution costs, improve search efficiency and convergence speed of the algorithm, jump out of a local optimal solution, and increase the number of optimal solutions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of vehicle path optimization, and in particular to a vehicle path optimization method with roads and time windows based on an ant colony algorithm. Background Art

[0002] With the rapid development of science and technology, the increasing intelligence and digitalization of enterprises have placed higher demands on logistics and distribution. Enterprises are increasingly paying attention to the actual road environment of the workshop and the level of customer service. Therefore, studying the vehicle routing problem with workshop roads and time windows is of great practical significance.

[0003] The Vehicle Routing Problem (VRP) was first proposed by Dantzig et al. in 1959. This problem generally involves determining a reasonable delivery plan for a vehicle, given the locations of a distribution center, and the demands of each customer. The problem involves optimizing certain objectives (such as minimizing the total distance, minimizing the number of vehicles used, and minimizing costs) while meeting constraints such as vehicle loading capacity and range limits. Solomon defined the Vehicle Routing Problem with a time window as follows: a vehicle departs from a distribution center, delivers goods to each customer, and returns to the distribution center, minimizing the total distance traveled. The Vehicle Routing Problem with inter-departmental roads refers to vehicle routing scheduling that meets the constraints of the actual inter-departmental road environment, rather than simply calculating the Euclidean distance between two points.

[0004] Currently, the main approaches for solving vehicle routing problems (VRPs) are exact algorithms and heuristic algorithms. Exact algorithms can only find exact solutions to small-scale problems in a relatively short time. Therefore, designing effective heuristic algorithms to find approximate solutions to large-scale vehicle routing problems is an important research direction. Classic heuristic algorithms use local search to seek satisfactory solutions. While easy to implement, they are prone to getting stuck in local optima. Intelligent heuristic algorithms use global search to find satisfactory solutions, which can avoid getting stuck in local optima. However, their design is more complex and their parameter settings have a significant impact. Recently developed algorithms such as genetic algorithms, particle swarm optimization algorithms, bat algorithms, and ant colony algorithms are increasingly being applied to the VRP field. However, in practical applications, particle swarm optimization algorithms and artificial neural networks are prone to getting stuck in local optima in the later stages of iterations. The initial population of the genetic algorithm is sensitive and prone to premature maturation. While the ant colony algorithm has strong optimization capabilities, it relies heavily on parameter settings. Therefore, the practicality, efficiency, and application value of heuristic optimization algorithms need to be improved.

[0005] Although domestic and foreign scholars have conducted many studies on vehicle routing problems with time windows, most studies only consider time window constraints. Few studies have addressed vehicle routing problems involving actual workshop roads and time window constraints. However, actual enterprises are subject to workshop channel environment constraints, so in-depth research is needed on this issue. Summary of the Invention

[0006] In order to solve the problems of slow convergence speed, low versatility, inability to jump out of local optimal solutions, poor stability, and low solution quality of current vehicle path optimization methods with vehicle-to-vehicle road and time window constraints, the present invention provides an improved ant colony algorithm with fast solution speed, strong versatility, high search efficiency, the ability to jump out of local optimal solutions, and improved optimal solution quality.

[0007] The object of the present invention is achieved through the following technical solution: a vehicle path optimization method with roads and time windows based on ant colony algorithm, comprising the following steps:

[0008] S1. With the goal of minimizing the total logistics distribution cost, including the vehicle variable distance transportation cost, fixed vehicle transportation cost and vehicle waiting time cost, a vehicle routing optimization model with soft time window constraints was established;

[0009] S2. Based on the actual logistics route of the workshop layout, the distance relationship between each workstation demand point is constructed, and the Floyd algorithm is used to solve the shortest distance matrix;

[0010] S3. The roulette wheel method is added to the state transition rule of the ant colony algorithm to select the next target point to jump out of the local optimal solution; the width of the workstation delivery time window and the length of the vehicle waiting time are added to the state transition probability to affect the selection of the next target point;

[0011] In the pheromone update of the ant colony algorithm, an adaptive volatility factor is used to accelerate the early convergence speed, and the total cost of the best route taken in the current iteration is used instead of the path length as the factor affecting the pheromone update, thus obtaining an improved ant colony algorithm.

[0012] The improved ant colony algorithm is used to perform multiple state transfer and pheromone update operations on the distance matrix obtained in step S2. Through multiple iterations, the feasible solution is gradually brought closer to the optimal solution, thereby obtaining the optimal path for all vehicles.

[0013] Furthermore, the vehicle path optimization model in step (1) is as follows:

[0014] The vehicle routing optimization model includes an objective function of minimizing the total logistics transportation cost and setting constraints;

[0015] The distribution center O has m logistics distribution vehicles with a load capacity of Q. The set of logistics distribution vehicles is K = {k1, k2, ..., km}, the delivery vehicle is responsible for delivering to n demand points, the set of demand points is I, and the cargo demand quality of each demand point i is q i ; C ij represents the variable cost of the delivery vehicle from demand point i to demand point j, where C ij =c1d ij , c1 is the unit cost of vehicle travel distance, d ij is the distance from demand point i to demand point j, t ij is the time from demand point i to demand point j, c2 is the fixed cost of the vehicle; the soft time window to meet demand point i is [E i , L i ], E i is the earliest service time window of demand point i, L i is the latest service time window of demand point i, and the service time of demand point i is S i , is the time when the kth delivery vehicle arrives at the demand point i, T i ’k is the time when the delivery vehicle leaves the demand point i, is the waiting time at demand point i, π1 is the unit cost of lead time penalty, is the service time cost function; the service time cost function is shown in formula (1);

[0016]

[0017] The travel distance cost is reduced under the premise of meeting the maximum vehicle load and time window constraints. Vehicle quantity cost and waiting time penalty cost The goal of this problem is to minimize the total logistics transportation cost; ij k is the value of the kth vehicle from demand point i to demand point j, which can be 0 or 1; x Oj k is the value of the kth vehicle from the distribution center O to the demand point j, which takes a value of 0 or 1. The following objective function is established:

[0018]

[0019] The constraints set for the vehicle routing optimization model are as follows:

[0020]

[0021]

[0022]

[0023] T i 'k =T i k +WT i k +S i ,i∈I,k∈K (6)

[0024] WT i k =max[0,(E i -T i k )],i∈I (7)

[0025]

[0026] T i k ≤L i ,i∈I (9)

[0027] x ij k ∈{0,1},i,j∈I,i≠j,k∈K (10)

[0028] Constraint (3) means that each demand point i must be delivered once by a delivery vehicle, x i k is the number of vehicles passing through demand point i, which can be 0 or 1. Constraint (4) indicates that the number of vehicles arriving at and leaving any point is equal, thus ensuring the continuity of the route. ij k is the value of the kth vehicle from demand point i to demand point j, which can be 0 or 1. ji k is the value of the kth vehicle from demand point j to demand point i, which can be 0 or 1; constraint (5) indicates that the load mass of the delivery vehicle must not exceed the maximum load capacity of the vehicle; constraint (6) indicates that the time to leave demand point i is the sum of the time to arrive at demand point i, the waiting time, and the service time; constraint (7) indicates the waiting time at demand point i; constraint (8) indicates the time to arrive at demand point j, T j k It is the sum of the departure time from demand point i and the travel time of path (i, j); constraint (9) indicates that the arrival time of the vehicle at demand point i cannot exceed the latest time window range of demand point i; constraint (10) indicates that the decision variable is binary.

[0029] Further, in step (2), the Floyd algorithm is used to generate the shortest distance matrix that conforms to the actual road environment of the workshop. The meaning of the actual road environment of the workshop is to replace the idea of directly connecting any two demand points with a straight line with the logistics route combined with the actual layout of the workshop, and solve the shortest distance matrix based on the constraints of the workshop passage nodes, including the following steps:

[0030] Step 2.1, initialize the matrix; initialize the distance matrix according to the number of demand points;

[0031] Step 2.2, record the shortest distance information between known nodes and update the distance matrix;

[0032] Step 2.3, judge and update the distance matrix; if the path distance D(i, h)+D(h, j)<D(i, j), then update the shortest distance matrix D(i, j)=D(i, h)+D(h, j); D(i, h) represents the distance from demand point i to demand point h, D(h, j) represents the distance from demand point h to demand point j, and D(i, j) represents the distance from demand point i to demand point j;

[0033] Step 2.4, judge whether all nodes have been passed through;

[0034] Step 2.5, output the result; solve and obtain the shortest distance matrix with roads.

[0035] Further, the specific steps of step (3) are as follows:

[0036] Step 3.1, initialize the parameters;

[0037] Step 3.2, let the number of iterations NC = 1, randomly place m vehicles at the dispatching center, and set k = 1;

[0038] Step 3.3, reset the set N of visited nodes of the k-th vehicle i ; select the next demand point to visit according to the state transition probability Judge whether the sum of the demand of demand point j and the current vehicle loading capacity exceeds the maximum loading capacity of the k-th vehicle. If it exceeds the maximum loading capacity of the k-th vehicle, then go to step 3.4. If it does not exceed the maximum loading capacity of the k-th vehicle, then update the set N of visited nodes of the k-th vehicle i and the taboo list;

[0039] The state transition probability includes the following content: construct a random number r between 0 and 1, and formulate a parameter r0 that controls the state transition rule; if r ≤ r0, then select the point with the maximum state transition probability as the next point to move forward; if r > r0, then use the roulette method to select the next point to move forward according to the state transition probabilities of each point;

[0040] When r≤r0, the next target point is selected by calculating the state transition probability. The state transition probability formula is as follows:

[0041]

[0042] Among them, P ij k (t) represents the transition probability of selecting the next node, τ ij For section d ij The concentration of pheromone released, α and β represent the influence factors of pheromone and heuristic function respectively, w1 j is the width of the delivery time window for demand point j, w2 j is the waiting time length of the vehicle arriving at demand point j, γ and δ represent the importance factors of the time window span and waiting time respectively, η ij For section d ij The heuristic function of ; the calculation formula of the heuristic function is:

[0043]

[0044] When r>r0, the roulette wheel method is used to randomly select the next point. For points where the sum of the demand of demand point j and the current vehicle load does not exceed the maximum load of the kth vehicle, they are sorted according to the size of the state transition probability and a random number R between 0 and 1 is constructed. If R≥pp(i-1) and R≤pp(i), demand point i is selected as the next point on the path. pp(i) represents the sum of the state transition probabilities of all points sorted before demand point i.

[0045] Step 3.4, if Go to step 3.5; otherwise, k=k+1, go to step 3.3;

[0046] Step 3.5, one-loop stopping criteria: If k>m, stop, record into the global feasible solution set M and go to step 3.6; otherwise, k=k+1 and go to step 3.3;

[0047] Step 3.6, the algorithm stops: if the number of iterations is less than or equal to the preset maximum number of iterations NC max , record all solutions in the global feasible solution set M and go to step 3.7; otherwise, the algorithm terminates and outputs M as the optimal path for all vehicles;

[0048] Step 3.7, solution evaluation: Based on the fitness function F(x) = 1 / Z, determine whether the optimal path S generated in this iteration is better than the previously obtained optimal path S*. If not, do not update S* and return to step 3.3 to search for the optimal solution again. If S is better than S*, update S* to S.

[0049] Step 3.8, update pheromone;

[0050] Step 3.8.1, set the value of the volatility factor ρ. To balance the local and global search capabilities of the algorithm and avoid premature search, this paper sets the volatility factor ρ to the adaptive adjustment method as shown in formula (13):

[0051]

[0052] In step 3.8.2, when the ants find the optimal path in each iteration, they perform a global pheromone update using formula (14):

[0053]

[0054] In this equation, Δτ ij k (t) represents the value of pheromone on path (i, j) at time t, released by the kth vehicle; ρ is the pheromone volatility coefficient;

[0055]

[0056] In formula (15), Q represents the constant for updating pheromone concentration, Cost best Represents the total cost of the k-th vehicle traveling along the optimal path during the current iteration;

[0057] In step 3.9, set NC = NC + 1, reset the taboo table, and proceed to step 3.3.

[0058] Beneficial effects of the present invention:

[0059] A vehicle routing optimization model with time window constraints was established, with the goal of minimizing the total logistics transportation cost, including the travel distance cost, the number of vehicles used cost, and the vehicle waiting time penalty cost. The Floyd algorithm was used to solve the known information to obtain a distribution path that better conforms to the actual road conditions of the workshop. The final distance matrix was used as the input for calling the improved ant colony algorithm to solve the vehicle routing problem. An improved ant colony algorithm was proposed to solve the vehicle routing problem. By improving the state transition rule, the adaptive pheromone volatilization factor, and the improved pheromone update related parameters, the local and global search capabilities of the algorithm were balanced, which improved the algorithm's solution speed and search efficiency, escaped from the local optimal solution, and improved the quality of the optimal solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 This is a flow chart of a vehicle path optimization method with roads and time windows based on an ant colony algorithm provided by an embodiment of the present invention;

[0061] Figure 22 is a schematic diagram of a vehicle waiting time penalty cost function provided by an embodiment of the present invention;

[0062] Figure 3 1 is a flow chart of the Floyd algorithm provided by an embodiment of the present invention;

[0063] Figure 4 1 is a flow chart of an ant colony algorithm according to an embodiment of the present invention;

[0064] Figure 5 This is a schematic diagram of actual road constraints in a workshop provided by an embodiment of the present invention;

[0065] Figure 6 This is a schematic diagram of the minimum cost change trend of each generation provided by an embodiment of the present invention;

[0066] Figure 7 This is the optimal solution path diagram provided by the embodiment of the present invention. DETAILED DESCRIPTION

[0067] The specific embodiments of the present invention are further described in detail below with reference to the accompanying drawings.

[0068] The present invention provides a reference Figure 1 , a vehicle routing optimization method with roads and time windows based on ant colony algorithm, the optimization method steps are as follows:

[0069] Step 1: With the goal of minimizing the total logistics distribution cost, a vehicle routing optimization model with time window constraints is constructed.

[0070] The distribution center O has m logistics distribution vehicles with a load capacity of Q. The set of logistics distribution vehicles is K = {k1, k2, ..., k m}, the delivery vehicle is responsible for delivering to n demand points, the set of demand points is I, and the cargo demand quality of each demand point i is q i ; C ij represents the variable cost of the delivery vehicle from demand point i to demand point j, where C ij =c1d ij , c1 is the unit cost of vehicle travel distance, d ij is the distance from demand point i to demand point j, t ij is the time from demand point i to demand point j, c2 is the fixed cost of the vehicle; the soft time window to meet demand point i is [E i , L i ], E i is the earliest service time window of demand point i, L i is the latest service time window of demand point i, and the service time of demand point i is S i , is the time when the kth delivery vehicle arrives at the demand point i, Ti ’k is the time when the delivery vehicle leaves the demand point i, is the waiting time at demand point i, π1 is the unit cost of lead time penalty, is the service time cost function. The service time cost function is as follows Figure 2 As shown in the figure, a vehicle will pay an early time penalty cost if it arrives before the earliest service time of the demand point, and will not pay any cost if it arrives within the service time window. It is not allowed to arrive beyond the latest service time of the demand point.

[0071]

[0072] The travel distance cost is reduced under the premise of meeting the maximum vehicle load and time window constraints. Vehicle quantity cost and waiting time penalty cost The goal of this problem is to minimize the total logistics transportation cost; ij k is the value of the kth vehicle from demand point i to demand point j, which can be 0 or 1; x Oj k is the value of the kth vehicle from the distribution center O to the demand point j, which takes a value of 0 or 1. The following objective function is established:

[0073]

[0074] The constraints set for the vehicle routing optimization model are as follows:

[0075]

[0076]

[0077]

[0078] T i 'k =T i k +WT i k +S i ,i∈I,k∈K (6)

[0079] WT i k =max[0,(E i -T i k )],i∈I (7)

[0080]

[0081] Ti k ≤ L i , i ∈ I (9)

[0082] x ij k ∈ {0, 1}, i, j ∈ I, i ≠ j, k ∈ K (10)

[0083] Constraint (3) means that each demand point i must be served by a delivery vehicle once, and x i k is the value of the k-th vehicle passing through demand point i, taking values of 0 or 1; Constraint (4) means that the number of vehicles arriving at and leaving any point is equal, thus ensuring the continuity of the route, and x ij k is the value of the k-th vehicle from demand point i to demand point j, taking values of 0 or 1, and x ji k is the value of the k-th vehicle from demand point j to demand point i, taking values of 0 or 1; Constraint (5) means that the loading mass of the delivery vehicle shall not exceed the maximum loading capacity of the vehicle; Constraint (6) means that the time of leaving demand point i is the sum of the time of arriving at demand point i, waiting time and service time; Constraint (7) means the waiting time at demand point i; Constraint (8) means the time T j k of arriving at demand point j is the sum of the departure time from demand point i and the driving time of the path (i, j); Constraint (9) means that the arrival time of the vehicle at demand point i cannot exceed the latest time window range of demand point i; Constraint condition (10) means that the decision variable is binary.

[0084] Step 2: According to the constraints of the actual workshop passage environment, the distance relationship between each workstation demand point is constructed to replace the idea of directly connecting any two workstation demand points with a straight line, and the Floyd algorithm is called to solve and obtain the distance matrix; The process is as Figure 3 shown, and the steps are as follows:

[0085] Step 2.1, initialize the matrix; Initialize the distance matrix according to the number of demand points;

[0086] Step 2.2, record the shortest distance information between known nodes and update the distance matrix;

[0087] Step 2.3, judge and update the distance matrix; If the path distance D(i, h) + D(h, j) < D(i, j), then update the shortest distance matrix D(i, j) = D(i, h) + D(h, j), where D(i, h) represents the distance from demand point i to demand point h, D(h, j) represents the distance from demand point h to demand point j, and D(i, j) represents the distance from demand point i to demand point j;

[0088] Step 2.4, determine whether all nodes have been traversed;

[0089] Step 2.5, output the result; solve and obtain the shortest distance matrix with roads.

[0090] Step 3: Use the improved ant colony algorithm to perform multiple state transfer and pheromone update operations on the distance matrix, and gradually make the feasible solution approach the optimal solution through multiple iterations, so as to obtain the optimal path, such as Figure 4 As shown. It includes the following steps:

[0091] Step 3.1, initialization parameters;

[0092] Step 3.2, set the number of iterations NC = 1, randomly place m vehicles at the dispatch center, and set k = 1;

[0093] Step 3.3, reset the visit node set N of the kth vehicle i ; Select the next demand point to visit based on the state transition probability Determine whether the sum of the demand at demand point j and the current vehicle load exceeds the maximum load of the kth vehicle. If it exceeds the maximum load of the kth vehicle, go to step 3.4. If it does not exceed the maximum load of the kth vehicle, update the access node set N of the kth vehicle. i and taboo tables;

[0094] The state transition probability involves the following: constructing a random number r between 0 and 1 and setting a parameter r0 that controls the state transition rule; if r≤r0, then selecting the point with the highest state transition probability as the next point; if r>r0, then using the roulette wheel method to select the next point based on the state transition probabilities of each point;

[0095] When r≤r0, the next target point is selected by calculating the state transition probability. The state transition probability formula is as follows:

[0096]

[0097] Among them, P ij k (t) represents the transition probability of selecting the next node, τ ij For section d ij The concentration of pheromone released, α and β represent the influence factors of pheromone and heuristic function respectively, w1 j is the width of the delivery time window for demand point j, w2 j is the waiting time length of the vehicle arriving at demand point j, γ and δ represent the importance factors of the time window span and waiting time respectively, η ij For section d ij The heuristic function of ; the calculation formula of the heuristic function is:

[0098]

[0099] When r>r0, the roulette wheel method is used to randomly select the next point. For points where the sum of the demand of demand point j and the current vehicle load does not exceed the maximum load of the kth vehicle, they are sorted according to the size of the state transition probability and a random number R between 0 and 1 is constructed. If R≥pp(i-1) and R≤pp(i), demand point i is selected as the next point on the path. pp(i) represents the sum of the state transition probabilities of all points sorted before demand point i.

[0100] Step 3.4, if Go to step 3.5; otherwise, k=k+1 and go to step 3.3;

[0101] Step 3.5, one-loop stopping criteria: If k>m, stop, record into the global feasible solution set M and go to step 3.6; otherwise, k=k+1 and go to step 3.3;

[0102] Step 3.6, the algorithm stops: if the number of iterations is less than or equal to the preset maximum number of iterations NC max , record all solutions in the global feasible solution set M and go to step 3.7; otherwise, the algorithm terminates and outputs M as the optimal path for all vehicles;

[0103] Step 3.7, solution evaluation: Based on the fitness function F(x) = 1 / Z, determine whether the optimal path S generated in this iteration is better than the previously obtained optimal path S*. If not, do not update S* and return to step 3.3 to search for the optimal solution again. If S is better than S*, update S* to S.

[0104] Step 3.8, update pheromone;

[0105] Step 3.8.1, set the value of the volatility factor ρ. To balance the local and global search capabilities of the algorithm and avoid premature search, this paper sets the volatility factor ρ to the adaptive adjustment method as shown in formula (13):

[0106]

[0107] In step 3.8.2, when the ants find the optimal path in each iteration, they perform a global pheromone update using formula (14):

[0108]

[0109] In this equation, Δτ ij k(t) represents the value of the pheromone on edge (i, j) at time t, which is released by the k-th vehicle; ρ is the pheromone volatility coefficient;

[0110]

[0111] In formula (15), Q represents the constant for updating pheromone concentration, Cost best Represents the total cost of the k-th vehicle traveling along the optimal path during the current iteration;

[0112] In step 3.9, set NC = NC + 1, reset the taboo table, and proceed to step 3.3.

[0113] Example: The automatic workshop of a bathroom heater company has 4 production lines, a total of 24 stations that need to be distributed, and a total of 8 vehicles. The actual road environment of the workshop is as follows: Figure 5 As shown, number 1 is the delivery starting point; numbers 2 to 9 are turning nodes, for a total of 8 turning nodes; numbers 10 to 33 are workstation demand points, for a total of 24 workstation demand points. Their specific information is shown in Table 1. The AGV's operating speed is 1 m / s, its load capacity is 8, its variable cost for distance traveled is 1, its fixed cost for the vehicle is 1000, and its penalty cost for time travel is 1. The requirement is to rationally arrange the vehicles and their delivery routes to minimize the total cost for all vehicles.

[0114] Table 1 Coordinates, demand and service time windows of each point

[0115]

[0116]

[0117] After multiple adjustments, the parameters were finally set to: ant population size m = 50, pheromone importance factor α = 1, heuristic function importance factor β = 3, time window span importance factor γ = 2, waiting time importance factor δ = 0.5, global pheromone constant Q = 5, and parameter r0 of the control state transition rule = 0.5. After implementing the vehicle routing optimization method with workshop roads and time windows based on the improved ant colony algorithm with the goal of minimizing total logistics distribution costs, the following results were obtained: Figure 6 The trend of the minimum cost change of each generation is shown in Figure 1. When the number of iterations reaches 56, the minimum cost no longer changes and the optimal solution is obtained. The path of the optimal distribution plan is as follows: Figure 7 The specific scheduling scheme is shown in Table 2.

[0118] Table 2 Vehicle scheduling scheme of improved ant colony algorithm

[0119]

[0120] The basic ant colony algorithm is called to solve the vehicle routing problem. The specific scheduling scheme is shown in Table 3.

[0121] Table 3 Vehicle scheduling scheme of basic ant colony algorithm

[0122]

[0123] The performance comparison between the improved ant colony algorithm and the basic ant colony algorithm is shown in Table 4.

[0124] Table 4 Performance comparison between improved ant colony algorithm and basic ant colony algorithm

[0125]

[0126]

[0127] Comparative analysis shows that the improved ant colony algorithm outperforms the basic ant colony algorithm in terms of algorithm convergence speed and runtime, and the resulting optimal distribution plan has better results in terms of vehicle utilization, total logistics costs, and average vehicle loading rate. The method described in this invention is highly versatile, efficient, and covers a wide search space, resulting in rapid convergence, while significantly improving the quality and stability of the solution when solving vehicle routing problems with inter-vehicle roads and time windows.

[0128] The above embodiments are used to illustrate the present invention rather than to limit the present invention. Any modifications and changes made to the present invention within the spirit of the present invention and the protection scope of the claims shall fall within the protection scope of the present invention.

Claims

1. A vehicle path optimization method with roads and time windows based on ant colony algorithm, characterized in that: The following steps are involved: S1. To minimize the total logistics distribution cost including the variable distance transportation cost, fixed vehicle transportation cost and vehicle waiting time cost, a vehicle routing optimization model with soft time window constraints is established. S2. Based on the actual logistics route of the workshop layout, the distance relationship between each workstation demand point is constructed, and the Floyd algorithm is used to solve the shortest distance matrix; S3. The roulette wheel method is added to the state transition rule of the ant colony algorithm to select the next target point to jump out of the local optimal solution; the width of the workstation delivery time window and the length of the vehicle waiting time are added to the state transition probability to affect the selection of the next target point; In the pheromone update of the ant colony algorithm, an adaptive volatility factor is used to accelerate the early convergence speed, and the total cost of the best route taken in the current iteration is used instead of the path length as the factor affecting the pheromone update, thus obtaining an improved ant colony algorithm. The improved ant colony algorithm is used to perform multiple state transfers and pheromone update operations on the distance matrix obtained in step S2. Through multiple iterations, the feasible solution is gradually brought closer to the optimal solution, thereby obtaining the optimal path for all vehicles. The specific steps of S3 are as follows: Step 3.1, initialization parameters; Step 3.2, set the number of iterations NC = 1, randomly place m vehicles at the dispatch center, and set k = 1; Step 3.3, reset the visit node set N of the kth vehicle i ; Select the next demand point to visit based on the state transition probability Determine whether the sum of the demand at demand point j and the current vehicle load exceeds the maximum load of the kth vehicle. If it exceeds the maximum load of the kth vehicle, go to step 3.

4. If it does not exceed the maximum load of the kth vehicle, update the access node set N of the kth vehicle. i and taboo tables; The state transition probability involves the following: constructing a random number r between 0 and 1 and setting a parameter r0 that controls the state transition rule; if r≤r0, then selecting the point with the highest state transition probability as the next point; if r>r0, then using the roulette wheel method to select the next point based on the state transition probabilities of each point; When r≤r0, the next target point is selected by calculating the state transition probability. The state transition probability formula is as follows: Among them, P ij k (t) represents the transition probability of selecting the next node, τ ij For section d ij The concentration of pheromone released, α and β represent the influence factors of pheromone and heuristic function respectively, w1 j is the width of the delivery time window for demand point j, w2 j is the waiting time length of the vehicle arriving at demand point j, γ and δ represent the importance factors of the time window span and waiting time respectively, η ij For section d ij The heuristic function of ; the calculation formula of the heuristic function is: When r>r0, the roulette wheel method is used to randomly select the next point. For points where the sum of the demand of demand point j and the current vehicle load does not exceed the maximum load of the kth vehicle, they are sorted according to the size of the state transition probability and a random number R between 0 and 1 is constructed. If R≥pp(i-1) and R≤pp(i), demand point i is selected as the next point on the path. pp(i) represents the sum of the state transition probabilities of all points sorted before demand point i. Step 3.4, if Go to step 3.5; otherwise, k=k+1, go to step 3.3; Step 3.5, one-loop stopping criteria: If k>m, stop, record into the global feasible solution set M and go to step 3.6; otherwise, k=k+1 and go to step 3.3; Step 3.6, the algorithm stops: if the number of iterations is less than or equal to the preset maximum number of iterations NC max , record all solutions in the global feasible solution set M and go to step 3.7; otherwise, the algorithm terminates and outputs M as the optimal path for all vehicles; Step 3.7, solution evaluation: Based on the fitness function F(x) = 1 / Z, determine whether the optimal path S generated by this iteration is better than the previously obtained optimal path S*. If it is not better than the previously obtained solution, do not update S*. If S is better than S*, update S* to S. Step 3.8, update pheromone; Step 3.8.1, set the value of the volatility factor ρ. To balance the local and global search capabilities of the algorithm and avoid premature convergence, the volatility factor ρ is set to the following adaptive adjustment method: In step 3.8.2, when the ant finds the optimal path in each iteration, it performs a global pheromone update using the following formula: In this equation, Δτ ij k (t) represents the value of pheromone on path (i, j) at time t, released by the kth vehicle; ρ is the pheromone volatility coefficient; In the formula, Q represents the constant for updating pheromone concentration, Cost best Represents the total cost of the k-th vehicle traveling along the optimal path during the current iteration; Step 3.9, set NC = NC + 1, reset the taboo list, and go to Step 3.

3.

2. The vehicle path optimization method with roads and time windows based on ant colony algorithm according to claim 1, characterized in that: Step (S1) The vehicle routing optimization model is as follows: The vehicle routing optimization model includes an objective function for minimizing the total logistics transportation cost and set constraint conditions; The distribution center O has m logistics distribution vehicles with a load capacity of Q. The set of logistics distribution vehicles is K = {k1, k2, ..., k m }, the delivery vehicle is responsible for delivering to n demand points, the set of demand points is I, and the cargo demand quality of each demand point i is q i ; C ij represents the variable cost of the delivery vehicle from demand point i to demand point j, where C ij =c1d ij , c1 is the unit cost of vehicle travel distance, d ij is the distance from demand point i to demand point j, t ij is the time from demand point i to demand point j, c2 is the fixed cost of the vehicle; the soft time window to meet demand point i is [E i , L i ], E i is the earliest service time window of demand point i, L i is the latest service time window of demand point i, and the service time of demand point i is S i , T i k is the time when the kth delivery vehicle arrives at the demand point i, T i ’k is the time when the delivery vehicle leaves the demand point i, WT i k is the waiting time at demand point i, π1 is the penalty unit cost for lead time, S(T i k ) is the service time cost function; Among them, the service time cost function is as shown in formula (1); The travel distance cost is reduced under the premise of meeting the maximum vehicle load and time window constraints. Vehicle quantity cost and waiting time penalty cost Minimizing the total logistics transportation cost including x is the goal of the vehicle routing optimization model; ij k is the value of the kth vehicle from demand point i to demand point j, which can be 0 or 1; x Oj k is the value of the kth vehicle from the distribution center O to the demand point j, which takes a value of 0 or 1. The following objective function is established: The constraint conditions of the vehicle routing optimization model are as follows: T i ' k =T i k +WT i k +S i ,i∈I,k∈K (6) WT i k =max[0,(E i -T i k )],i∈I (7) T i k ≤L i ,i∈I (9) x ij k ∈{0,1},i,j∈I,i≠j,k∈K (10) Constraint (3) means that each demand point i must be delivered once by a delivery vehicle, x i k is the number of vehicles passing through demand point i, which can be 0 or 1. Constraint (4) indicates that the number of vehicles arriving at and leaving any point is equal, thus ensuring the continuity of the route. ij k is the value of the kth vehicle from demand point i to demand point j, which can be 0 or 1. ji k is the value of the kth vehicle from demand point j to demand point i, which can be 0 or 1; constraint (5) indicates that the loading mass of the delivery vehicle must not exceed the maximum loading capacity of the vehicle; Constraint (6) indicates that the time to leave demand point i is the sum of the time to arrive at demand point i, the waiting time, and the service time; constraint (7) indicates the waiting time at demand point i; constraint (8) indicates the time to arrive at demand point j, T j k It is the sum of the departure time from demand point i and the travel time of path (i, j); constraint (9) indicates that the arrival time of the vehicle at demand point i cannot exceed the latest time window range of demand point i; constraint (10) indicates that the decision variable is binary.

3. The vehicle path optimization method with roads and time windows based on ant colony algorithm according to claim 2 is characterized in that: In Step (S2), the Floyd algorithm is used to generate the shortest distance matrix that conforms to the actual road environment of the workshop. The meaning of the actual road environment of the workshop is to replace the idea of directly connecting any two demand points with a logistics route combined with the actual layout of the workshop, and solve the shortest distance matrix based on the workshop passage node constraints; it includes the following steps: Step 2.1, initialize the matrix; initialize the distance matrix according to the number of demand points; Step 2.2, record the shortest distance information between known nodes and update the distance matrix; Step 2.3, judge and update the distance matrix; if the path distance D(i, h) + D(h, j) < D(i, j), then update the shortest distance matrix D(i, j) = D(i, h) + D(h, j); D(i, h) represents the distance from demand point i to demand point h, D(h, j) represents the distance from demand point h to demand point j, and D(i, j) represents the distance from demand point i to demand point j; Step 2.4, judge whether all nodes have been traversed; Step 2.5, output the result; solve to obtain the shortest distance matrix with roads.

Citation Information

Patent Citations

  • Method for solving logistic transport vehicle routing problem with soft time windows

    CN104992242A

  • Known environment-based path planning method

    CN108170146A