Time-varying vehicle delivery route planning method and planning platform considering traffic flow
By combining NSGA-II and ant colony algorithm, time-varying vehicle route planning is optimized, which solves the problem of low delivery efficiency in dynamic road network environment and realizes low-cost and low-carbon emission delivery route planning.
Patent Information
- Application Number
- CN202511417982.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2026-06-30
- Estimated Expiration
- 2045-09-30
AI Technical Summary
Existing technologies for time-varying vehicle routing planning cannot adapt to dynamic road network environments, resulting in low delivery efficiency and an inability to effectively optimize traffic congestion and carbon emissions.
By combining the NSGA-II algorithm and the ant colony algorithm, candidate dual codes are generated through genetic evolution. The delivery route is optimized using time-varying travel time and vehicle speed prediction models. Finally, the optimal delivery route is generated by combining traffic flow prediction and vehicle route planning.
It enables the reasonable avoidance of traffic congestion in a dynamic road network environment, reduces delivery costs and carbon emissions, and improves last-mile delivery efficiency.
Smart Images

Figure CN121258366B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of smart logistics and warehouse management technology, and in particular to time-varying vehicle delivery route planning methods and planning platforms that take into account traffic flow. Background Technology
[0002] The rapid development of the e-commerce industry has driven the rapid rise of the e-commerce logistics system. As the last link for customers to receive logistics services, last-mile delivery is affected by traffic congestion, which not only increases logistics costs but also increases carbon emissions. Last-mile delivery is usually modeled as a vehicle routing problem (also known as the VRP problem). Since vehicle speed is affected by a variety of factors and changes nonlinearly, time-varying vehicle routing (also known as TDVRP) has been proposed based on the VRP problem in related technologies.
[0003] Time-varying vehicle path planning in related technologies focuses on optimizing the shortest travel time based on a given customer node graph. Furthermore, these technologies simplify multi-path selection to a static single arc, which is insufficient for dynamic road network environments. Additionally, the precise algorithms used in these time-varying vehicle path planning technologies are ill-suited for path planning in large-scale and dynamic road network environments.
[0004] Currently, no effective solution has been proposed to address the problem that time-varying vehicle routing planning in related technologies cannot adapt to dynamic road network environments and results in low delivery efficiency of the planned routes. Summary of the Invention
[0005] This application provides a time-varying vehicle delivery route planning method and platform that takes into account traffic flow, so as to at least solve the problems in related technologies where time-varying vehicle route planning cannot adapt to dynamic road network environments and the planned routes have low delivery efficiency.
[0006] In a first aspect, embodiments of this application provide a time-varying vehicle delivery route planning method considering traffic flow, comprising: after encoding multiple delivery nodes and delivery objects to be delivered within a preset planning period into multiple initial dual-code bodies according to preset encoding rules, performing a genetic evolution operation on the multiple initial dual-code bodies using the NSGA-II algorithm to generate multiple candidate dual-code bodies; decoding and generating delivery planning information associated with each delivery object based on the node codes and delivery codes of all the candidate dual-code bodies; and performing time-varying vehicle delivery route planning using a preset ant colony algorithm based on the acquired time-varying travel time and the delivery planning information to generate an intended delivery route corresponding to each delivery object, wherein the delivery planning information is used to characterize the service order of delivery objects corresponding to a delivery code from the delivery center to at least one delivery node corresponding to a node code, one node code corresponds to one delivery code, and the intended delivery route is... The nodes include the delivery nodes and intersection nodes in the delivery network. The time-varying travel time is determined based on the distance between two path nodes and the travel speed within each time step of a preset planning period. The travel speed is predicted using a pre-trained vehicle speed prediction model. Based on the delivery fitness corresponding to the intended delivery path, a corresponding genetic evolution operation is performed on all candidate dual-encoders. Time-varying vehicle delivery path planning is then performed based on the delivery planning information corresponding to the dual-encoders that have completed the genetic evolution operation and the time-varying travel time. The delivery fitness is determined based on the required delivery cost and carbon emissions of the corresponding delivery path. The steps of performing the corresponding genetic evolution operation and time-varying vehicle delivery path planning are repeated until the delivery fitness of the generated intended delivery path is less than a fitness threshold. The intended delivery paths with delivery fitness less than the fitness threshold are then used as the target delivery paths for each delivery object, resulting in a planning result.
[0007] Secondly, embodiments of this application provide a planning platform, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the time-varying vehicle delivery route planning method considering traffic flow as described in the first aspect.
[0008] Compared to related technologies, the time-varying vehicle delivery route planning method and platform considering traffic flow provided in this application embodiment employs the following steps: First, after encoding multiple delivery nodes and delivery objects to be delivered within a preset planning period according to preset encoding rules to generate multiple initial dual-encoders, the NSGA-II algorithm is used to perform genetic evolution operations on the multiple initial dual-encoders to generate multiple candidate dual-encoders. Based on the node encoding and delivery encoding of all candidate dual-encoders, delivery planning information associated with each delivery object is decoded and generated. Then, based on the acquired time-varying travel time and the delivery planning information, a preset ant colony algorithm is used to perform time-varying vehicle delivery route planning, generating the intended delivery route corresponding to each delivery object. Finally, based on the delivery fitness corresponding to the intended delivery route, all... The candidate dual-encoders undergo corresponding genetic evolution operations, and based on the delivery planning information and time-varying travel time corresponding to the dual-encoders that have completed the genetic evolution operations, time-varying vehicle delivery route planning is performed. The steps of performing the corresponding genetic evolution operations and time-varying vehicle delivery route planning are repeated until the delivery fitness of the generated intended delivery route is less than the fitness threshold. The intended delivery routes with delivery fitness less than the fitness threshold are used as the target delivery routes corresponding to each delivery object to obtain the planning results. This solves the problems in related technologies where time-varying vehicle route planning cannot adapt to dynamic road network environments and the planned routes have low delivery efficiency. It achieves the beneficial effects of reasonably avoiding traffic congestion, generating vehicle delivery routes with low delivery costs and low carbon emissions, and improving last-mile delivery efficiency. Attached Figure Description
[0009] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0010] Figure 1 This is a hardware structure block diagram of the terminal of the time-varying vehicle delivery route planning method considering traffic flow according to an embodiment of this application.
[0011] Figure 2 This is a flowchart of a time-varying vehicle delivery route planning method considering traffic flow according to an embodiment of this application;
[0012] Figure 3 A schematic diagram illustrating the crossover operation of the dual-encoding body in an embodiment of this application;
[0013] Figure 4 A schematic diagram of performing a mutation operation on a dual-coded body according to an embodiment of this application;
[0014] Figure 5 Another schematic diagram illustrating the mutation operation performed on the dual-coded body of this application embodiment;
[0015] Figure 6 This is a schematic diagram illustrating the variation optimization of an embodiment of this application;
[0016] Figure 7 This is a structural block diagram of a time-varying vehicle delivery route planning device that takes into account traffic flow, according to an embodiment of this application. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this application clearer, the application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the application. All other embodiments obtained by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application. Furthermore, it is understood that although the efforts made in such a development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, modifications to design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as insufficient disclosure of the content of this application.
[0018] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0019] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "a," "an," "an," "the," and similar words used in this application do not indicate quantity limitation and may indicate singular or plural. The terms "comprising," "including," "having," and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to these processes, methods, products, or devices. "Multiple stages" used in this application refers to two or more stages. "And / or" describes the relationship between related objects, indicating that three relationships may exist; for example, "A and / or B" can represent: A alone, A and B simultaneously, and B alone. The terms "first," "second," "third," etc., used in this application are merely to distinguish similar objects and do not represent a specific ordering of objects.
[0020] Before describing the embodiments of this application, the definitions of some character parameters involved in the embodiments of this application are explained below:
[0021] G represents the delivery network built upon the real road network, also known as the real road network; V represents the nodes in the delivery network, V={O}∪N g ∪N c O represents a distribution center, N represents a distribution center. g N represents the set of delivery nodes. g ={α, β, ..., γ, ...}, where β represents the β-th delivery node; N c Let N represent the set of intersection nodes. c ={1,2,…,m}, where m represents the m-th intersection node; E represents the set of connection arcs for each node in the delivery network, E={E ij |i≠j,i、j∈V}, where i and j represent the i-th node and the j-th node, respectively, E ij d represents the road segment formed by the connecting arcs between the i-th node and the j-th node; ij P represents the distance between node i and node j, where i, j ∈ V; ij Let $\mathbf{i}$ represent the set of feasible delivery paths between any two nodes $i$ and $j$ in non-intersecting nodes, where $i$ ≠ $j$ and $i, j$ ∈ {O} ∪ N$. g ; This represents the nth feasible path between any two nodes i and j in a non-intersection node group, where i ≠ j and i, j ∈ {O} ∪ N. g ; This represents the nth feasible path. The corresponding total travel distance; T represents the total number of time periods that a day can be divided into, T={1,2,…t}; L represents the length of each time period; This indicates that within time period t, the delivery recipient is located on road segment E. ij The average speed of the vehicles, i≠j, i、j∈{O}∪N g ;[e i ,l i [] represents the delivery time range of the i-th delivery node, i∈{O}∪N g ; This indicates that during the t-th time period, the delivery object follows the n-th feasible path. The actual total distance traveled, i≠j, i、j∈{O}∪N g ; This indicates that during the t-th time period, the delivery object follows the n-th feasible path. The actual travel time, i≠j, i, j∈{O}∪N g ; This indicates that during the t-th time period, the delivery target travels along road segment E. ij The actual distance traveled, i≠j, i, j∈V; This indicates that during the t-th time period, the delivery target travels along road segment E. ij The actual travel time, i≠j, i, j∈V; This indicates that the delivery object follows the nth feasible path. The total travel time, i≠j, i, j∈{O}∪N g ;r represents the vehicle type corresponding to the delivery object;k r Represents a collection of delivery objects of type r; Indicates the delivery object k r The time starting from the i-th node, i∈{O}∪N g ; Indicates the delivery object k r The time to reach the j-th node is {O}∪N g ; This indicates that within the t-th time period, the delivery object is on the nth feasible path. Traction power; This represents the nth feasible path. Total traction power; F P This represents the nth feasible path. Total fuel consumption; This represents the delivery object k. r Maximum loading capacity; q i This represents the delivery demand of the i-th delivery node, where i∈N g ;si Let i represent the service time of the i-th delivery node, i∈{O}∪N g ;w r Indicates the maximum number of times a delivery object of type r can be used; This represents the cost of using a delivery object of type r; This represents the unit distance fuel consumption cost for delivery objects of type r; p l Indicates the unit penalty cost for delayed delivery; This represents the carbon emission coefficient of a delivery object of type r; Let k be the decision variable, representing the delivery object. r Is the path from node i to node j along the nth feasible path? Driving, if so =1, otherwise, =0;K t The engine friction coefficient is represented by N; engine speed is represented by D; engine displacement is represented by ε; vehicle transmission efficiency is represented by η; and engine efficiency parameter is represented by P. a The engine's power output represents its additional functions; λ represents the fuel-air ratio; M represents the vehicle's weight; α represents the vehicle's acceleration; v represents the vehicle's speed; θ represents the road gradient; P tr This indicates the traction power of the engine. Indicates pheromone concentration.
[0022] The method embodiments provided in this example can be executed on a terminal, computer, or similar computing device. Taking running on a terminal as an example, Figure 1 This is a hardware structure block diagram of the terminal for a time-varying vehicle delivery route planning method considering traffic flow, according to an embodiment of this application. Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. Optionally, the terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0023] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the time-varying vehicle delivery route planning method considering traffic flow in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0024] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0025] This embodiment provides a time-varying vehicle delivery route planning method that takes traffic flow into account and runs on the aforementioned terminal. Figure 2 This is a flowchart of a time-varying vehicle delivery route planning method considering traffic flow according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps:
[0026] Step S201: After encoding multiple delivery nodes and delivery objects to be delivered within the preset planning period into multiple initial dual-code bodies according to preset encoding rules, the multiple initial dual-code bodies are subjected to genetic evolution operation using the NSGA-II algorithm to generate multiple candidate dual-code bodies.
[0027] In this embodiment, the time-varying vehicle delivery route planning method of this application is implemented on the planning platform or system corresponding to the operator undertaking the last-mile delivery service, but is not limited to the corresponding planning platform or system; at the same time, the objects involved in the time-varying vehicle delivery route planning of this application include a distribution center, multiple delivery nodes (corresponding to customers receiving goods for last-mile delivery; in this embodiment, the smallest unit of a customer is a centralized item delivery point, such as a delivery station or express locker), and various types of delivery vehicles (corresponding to delivery objects). A distribution center, multiple delivery nodes, and various delivery objects participate in the entire last-mile delivery operation process, thereby delivering goods to locations dispersed across the country. Delivery services are provided to customers within the target area. Simultaneously, this embodiment performs single-trip planning within a preset planning period, that is, planning delivery routes for delivery tasks within a set delivery cycle (one shift, one day), so that the delivery objects complete their delivery tasks within the preset planning period according to the planned delivery routes. In this embodiment, after determining which distribution centers need to be delivered to within the preset planning period, the NSGA-II algorithm is first used to plan the delivery of goods to the delivery objects according to the planned service order, that is, for each delivery object (one type of vehicle), which delivery nodes (customers) are to be served. Delivery and the order of delivery are planned. Therefore, based on multiple delivery nodes and delivery objects to be delivered within a preset planning period, they are coded according to preset coding rules to generate corresponding initial dual-code bodies. In this embodiment, a dual-layer coding method is used. The first layer of the dual-layer coding is the delivery node layer (defined as node code), which is the number of the delivery node to be delivered. The second layer is the vehicle type layer (location delivery code), which indicates which type of delivery vehicle (corresponding to the delivery object) is used to deliver to a certain delivery node. For example, a code consisting of 6 / A indicates that delivery node 6 is delivered by vehicle A. After the initial dual encoding, by decoding the corresponding dual encoding, the service path corresponding to the service order of each delivery object can be decoded. For example, if there are delivery vehicles A, B, and C, and vehicle A is planned to deliver to the 6th, 3rd, and 8th delivery nodes, vehicle B to the 5th, 1st, and 2nd delivery nodes, and vehicle C to the 4th and 7th delivery nodes, then three service paths starting from the distribution center (corresponding delivery node code 0) are planned as follows: the service path of vehicle A is 0-6-3-8-0; the service path of vehicle B is 0-5-1-2-0; and the service path of vehicle C is 0-4-7-0.
[0028] In this embodiment, after generating the initial dual-encoder, its random encoding makes it highly unlikely to generate the optimal delivery service order and thus plan the optimal delivery route. By employing the NSGA-II algorithm to perform a genetic evolution operation on the initial dual-encoder, the delivery service order is adjusted to generate candidate dual-encoders, thereby making it possible to plan the optimal delivery route. It's important to understand that whether generating the corresponding dual-encoder in this embodiment is beneficial for subsequent vehicle delivery route planning is determined by using a preset ant colony algorithm based on the generated dual-encoder for specific time-varying vehicle delivery route planning. The fitness value of the objective function corresponding to the specific delivery route planned using the corresponding dual-encoder is calculated to guide the NSGA-II algorithm to perform a genetic evolution operation on the relevant dual-encoder; that is, the NSGA-II algorithm is used to process and generate representations of delivery objects. The dual-encoding of service sequences and the corresponding ant colony algorithm, with the goal of minimizing vehicle travel time, are collaborative in finding the optimal travel path for each service sequence. The fitness value required for the related dual-encoding in the genetic evolution operation is measured by the objective function value (coupling delivery cost and carbon emissions) corresponding to the subsequently planned optimal travel path. The subsequently planned optimal travel path is based on the generated dual-encoding representing the service sequence. That is, based on the service sequence corresponding to the corresponding dual-encoding, the optimal travel path corresponding to each service sequence is found to complete the overall time-varying vehicle delivery route planning. After each optimal travel path is generated, the objective function value corresponding to the optimal travel path is determined, and the objective function value is used to guide the corresponding NSGA-II algorithm to adjust and optimize the service sequence. The corresponding process is repeated cyclically until the corresponding vehicle delivery path is generated.
[0029] Step S202: Based on the node codes and delivery codes of all candidate dual-code bodies, decode and generate delivery planning information associated with each delivery object. Based on the acquired time-varying travel time and delivery planning information, use a preset ant colony algorithm to perform time-varying vehicle delivery route planning, generating the intended delivery route corresponding to each delivery object. The delivery planning information is used to characterize the service order of delivery objects corresponding to a delivery code from the delivery center to at least one delivery node corresponding to a node code. One node code corresponds to one delivery code. The path nodes of the intended delivery route include delivery nodes and intersection nodes in the delivery network. The time-varying travel time is determined based on the distance between two path nodes and the travel speed in each time step within the preset planning period. The travel speed is predicted using a pre-trained vehicle speed prediction model.
[0030] In this embodiment, after generating the corresponding candidate dual-encoding body, the node encoding and delivery encoding corresponding to the candidate dual-encoding body are decoded to generate the corresponding delivery planning information, that is, to obtain the corresponding service path. The delivery planning information represents the service path that each delivery object (delivery vehicle) needs to execute from the delivery center to at least one delivery node.
[0031] In this embodiment, it is important to understand that the real road network corresponding to the target area consists of numerous intersections and complex roads. Therefore, after determining the service path corresponding to a certain delivery object, multiple feasible delivery paths will be generated between at least two delivery nodes for that delivery object. By determining the function value of the objective function corresponding to the multiple feasible delivery paths, the optimal delivery path between the two delivery nodes in the current vehicle delivery path planning is determined based on the function value. Then, the optimal delivery path between two adjacent delivery nodes is determined sequentially, thereby generating the intended delivery path corresponding to each delivery object. For example, vehicle A starts from the service path 0-6-3-8-0. For the range 0-6, delivery path a1 is formed; for the range 6-3, delivery path b3 is formed; for the range 3-8, delivery path c2 is formed; and for the range 8-0, delivery path d1 is formed. Thus, the optimal delivery path generated for delivery object A in the corresponding time-varying vehicle delivery path planning is: a1+b3+c2+d1.
[0032] In this embodiment, given that the delivery service order has been determined, the tabu search theory is used to reduce the selection weight of visited nodes (including delivery nodes and intersection nodes) through a probability suppression mechanism, thereby reducing invalid repeated visits and accelerating the convergence speed. At the same time, the time-sensitive 2-opt operator is introduced to guide the ants to jump out of the local optimum and find a specific path with the shortest travel time.
[0033] In this embodiment, the optimization objective during delivery route planning is to minimize the travel time of the delivery vehicle corresponding to the delivery object. This means finding the shortest travel time required to reach another delivery node from one delivery node via multiple intersecting path nodes. The travel path formed by these intersecting path nodes is the intended delivery path. In this embodiment, the travel time of the corresponding path is determined by calculating the travel time at a certain moment from the starting point of the corresponding path, through multiple intersecting path nodes, to the final delivery node, using a time-varying travel time function (refer to the description of the time-varying travel time function in this document). Simultaneously, when using the time-varying travel time function to determine the travel time, the travel speed is predicted based on a pre-trained vehicle speed prediction model. This vehicle speed prediction model is constructed using an STGCN spatiotemporal graph convolutional network employing ensemble graph convolution and gated temporal convolution. For the STGCN spatiotemporal convolutional network in this embodiment, refer to existing spatiotemporal graph convolutional networks. The training and prediction methods of such spatiotemporal graph convolutional networks are clear to those skilled in the art.
[0034] Step S203: Based on the delivery fitness corresponding to the intended delivery route, perform corresponding genetic evolution operations on all candidate dual-encoders, and perform time-varying vehicle delivery route planning based on the delivery planning information and time-varying travel time corresponding to the dual-encoders that have completed the genetic evolution operation. The delivery fitness is determined based on the delivery cost and carbon emissions required for the corresponding delivery route.
[0035] Step S204: Repeat the steps of performing the corresponding genetic evolution operation and time-varying vehicle delivery route planning until the delivery fitness of the generated intended delivery route is less than the fitness threshold. Then, take the intended delivery route with the delivery fitness less than the fitness threshold as the target delivery route corresponding to each delivery object to obtain the planning result.
[0036] In this embodiment, after generating the intended delivery path corresponding to a certain planning, the delivery fitness corresponding to the objective function of the intended delivery path (refer to the description of the mixed integer programming model) is calculated to determine whether the intended delivery path is the optimal solution. While guiding the time-varying vehicle path planning iteration, the delivery fitness is also fed back as a cooperative parameter to the NSGA-II algorithm to optimize the current candidate dual-encoder through genetic evolution operation, thereby generating a new candidate dual-encoder that can plan an intended delivery path with better delivery fitness.
[0037] In this embodiment, the objective function corresponding to the delivery fitness includes minZ1 and minZ2 in the mixed integer programming model. In this embodiment, the genetic evolution operation and time-varying vehicle delivery route planning are iterated repeatedly until the travel time of the intended delivery route corresponding to each delivery object is minimized, thereby obtaining the target delivery route with the minimum delivery cost and the lowest carbon emissions.
[0038] Through steps S201 to S204, after encoding multiple delivery nodes and delivery objects to be delivered within a preset planning period into multiple initial dual-encoders according to preset encoding rules, genetic evolution operations are performed on the multiple initial dual-encoders using the NSGA-II algorithm to generate multiple candidate dual-encoders. Based on the node encoding and delivery encoding of all candidate dual-encoders, delivery planning information associated with each delivery object is decoded and generated. Based on the acquired time-varying travel time and the delivery planning information, time-varying vehicle delivery route planning is performed using a preset ant colony algorithm to generate the intended delivery route corresponding to each delivery object. Based on the delivery fitness corresponding to the intended delivery route, corresponding genetic evolution operations are performed on all candidate dual-encoders. Finally, time-varying vehicle delivery route planning is performed based on the delivery planning information and time-varying travel time corresponding to the dual-encoders that have completed the genetic evolution operation. The process involves repeatedly performing the corresponding genetic evolution operations and time-varying vehicle delivery route planning until the delivery fitness of the generated intended delivery route is less than the fitness threshold. The intended delivery routes with fitness values less than the fitness threshold are then used as the target delivery routes for each delivery object, yielding the planning results. By combining traffic flow prediction with vehicle route optimization, and using an enhanced spatiotemporal graph convolutional network to predict traffic flow and determine the corresponding dynamic travel time, along with employing the NSGA-II algorithm for delivery node sorting and an improved time-dependent ant colony algorithm for time-varying route planning aimed at minimizing vehicle travel time, this approach achieves the beneficial effects of reasonably avoiding traffic congestion, generating low-cost delivery routes with low carbon emissions, and improving last-mile delivery efficiency. This addresses the problems in related technologies where time-varying vehicle route planning cannot adapt to dynamic road network environments and results in low delivery efficiency.
[0039] It should be noted that this application focuses on the Green Time-Varied Vehicle Problem (G-TDVRP) in urban last-mile delivery. To address the impact of traffic condition changes on delivery efficiency, a framework integrating traffic flow prediction and vehicle path optimization is proposed. First, the classic STGCN model is improved to enhance the prediction accuracy of vehicle speeds on different roads. Second, with the objectives of minimizing total delivery cost and carbon emissions, a green time-varying structural vehicle path optimization model considering path flexibility with time windows is established. To improve solution efficiency while ensuring the superiority of the solution, a hybrid algorithm combining ant colony optimization and NSGA-II is designed. NSGA-II is used to optimize the matching relationship between delivery objects and delivery nodes and the delivery order. Under the premise of a fixed delivery node access order, a probability suppression mechanism and a time-sensitive 2-opt operator are introduced into the ant colony optimization to improve the algorithm's optimization ability, thereby enabling multi-path decision-making.
[0040] To optimize the matching relationship between delivery objects and delivery nodes and the delivery order, in some embodiments, a corresponding genetic evolution operation is performed on the generated dual-encoded body, including the following steps:
[0041] Step 21: Determine the current dual-code body for the current genetic evolution operation, use the preset ant colony algorithm to perform path planning on the delivery planning information corresponding to the current dual-code body, and use the delivery fitness corresponding to the planned intention delivery path as the ranking fitness of the corresponding current dual-code body. The current dual-code body includes one of the following: initial dual-code body or candidate dual-code body.
[0042] In this embodiment, the fitness value of the objective function (maximum delivery cost and minimum carbon emissions) corresponding to the intended delivery path planned using the corresponding dual-code body is used to guide the genetic evolution operation of the relevant dual-code body using the NSGA-II algorithm. That is, the dual-code body generated by the NSGA-II algorithm representing the service order of the delivery object and the corresponding ant colony algorithm are used to find the optimal driving path corresponding to each service order with the shortest vehicle travel time as the optimization objective. The fitness value required for the relevant dual-code body in the genetic evolution operation is measured by the objective function value corresponding to the subsequently planned optimal driving path.
[0043] Step 22: Based on the sorting fitness, use the non-dominated sorting algorithm to perform non-dominated sorting on all current double-encoded bodies, and calculate the crowding degree for all current double-encoded bodies that have completed the non-dominated sorting to obtain the encoding parameters corresponding to each current double-encoded body. The encoding parameters include the non-dominated sorting parameters and the crowding degree.
[0044] In this embodiment, based on sort fitness, a non-dominated sorting algorithm is used to perform non-dominated de-sorting and crowding calculation, which is clear to those skilled in the art. The specific non-dominated sorting can be implemented by referring to any existing non-dominated de-sorting method, which will not be elaborated here.
[0045] Step 23: Based on the non-dominated sorting parameter and crowding degree, select a preset number of first dual-code bodies from all current dual-code bodies, and perform crossover and mutation operations on all first dual-code bodies in sequence to generate second dual-code bodies. The crossover operation includes sequential crossover, and the mutation operation includes hybrid mutation combining local optimization and global search.
[0046] In this embodiment, after determining the non-dominated sorting parameters and crowding, the current double-coding body is classified and classified into at least two categories: those requiring genetic evolution operations and those not requiring genetic evolution operations. In this embodiment, the first double-coding body is classified as the double-coding body requiring genetic evolution operations.
[0047] In some alternative implementations, a preset number of first double-coded bodies are selected from all current double-coded bodies based on the non-dominated sorting parameter and the crowding degree, which is achieved through the following steps:
[0048] Step 231-1: Determine the Pareto fronts of all current dual-encoding bodies based on the non-dominated sorting parameters;
[0049] Step 231-2: Select the current double coding body located at each Pareto front in ascending order of Pareto fronts, and determine the total number of current double coding bodies selected from all current double coding bodies located at multiple Pareto fronts.
[0050] Step 231-3: Determine whether the total number of selections is greater than a set threshold. If the total number of selections is not greater than the set threshold, execute the process of sequentially selecting the current double-encoded body at each Pareto front from all current double-encoded bodies until the total number of selections is not less than the set threshold, and obtain the third double-encoded body. The set threshold is the difference between the total number of current double-encoded bodies and the preset number.
[0051] Step 231-4: Delete the third double code from all current double codes to obtain the first double code.
[0052] In some alternative implementations, a preset number of first double-coded bodies are selected from all current double-coded bodies based on the non-dominated sorting parameter and the crowding degree, which is achieved through the following steps:
[0053] Step 232-1: Determine the Pareto fronts of all current dual-encoding bodies based on the non-dominated sorting parameters;
[0054] Step 232-2: Select the current double coding body located at each Pareto front in ascending order of Pareto front, and determine the total number of current double coding bodies selected from all current double coding bodies located at multiple Pareto fronts.
[0055] Step 232-3: Determine whether the total number of selections is greater than the set threshold. If it is determined that the total number of selections is greater than the set threshold, determine the number of current double-encoded bodies of all Pareto fronts before the largest Pareto front among the selected Pareto fronts, and determine the difference between the set threshold and the number.
[0056] Step 232-4: From all current double-encoded bodies at the maximum Pareto front, select the current double-encoded bodies with the difference corresponding to the number of current double-encoded bodies in descending order of crowding degree;
[0057] Step 232-5: The current double codec selected from the largest Pareto front and the current double codec selected from all Pareto fronts before the largest Pareto front are used as the third double codec.
[0058] Step 232-6: Delete the third double code from all current double codes to obtain the first double code.
[0059] Step 24: Merge all second double codes of all current double codes except the first double code to generate a candidate double code corresponding to the current genetic evolution operation.
[0060] In this embodiment, after the first dual-code body is determined, a genetic evolution operation is performed in accordance with the crossover and mutation operators corresponding to the NSGA-II algorithm to realize the current genetic evolution operation iteration and generate the corresponding candidate dual-code body.
[0061] Through steps 21 to 24 above, genetic evolution operations are iterated based on the currently generated dual-encoder to optimize the matching relationship between delivery objects and delivery nodes and the delivery order.
[0062] Figure 3 This is a schematic diagram illustrating the crossover operation of a dual-code body according to an embodiment of this application. In some embodiments, reference is made to... Figure 3 The crossover operation is performed on all first double-encoded bodies, which is achieved through the following steps:
[0063] Step 31: Select multiple first candidate dual codes from the first dual codes according to the preset crossover probability.
[0064] In this embodiment, after classifying the candidate coding bodies, based on the first dual coding body that needs to undergo genetic evolution operation, the corresponding first candidate dual coding body is selected from the first dual coding body according to the preset crossover probability (fixed selection probability).
[0065] Step 32: After selecting two first candidate double-coded bodies from multiple first candidate double-coded bodies as parent individuals, randomly select multiple node codes at the same node position from all node codes corresponding to the two parent individuals to obtain the target cross node code.
[0066] In this embodiment, reference Figure 3 The two parent individuals selected are Parent1 and Parent2; the multiple target cross nodes randomly selected from the two parent individuals are encoded as follows: Parent1: (4,3,5,7) and Parent2: (4,2,6,1).
[0067] Step 33: Arrange the selected target cross node codes in sequence on the same node positions as the corresponding parent individual's child individual, and take the delivery code corresponding to the node code of another parent individual that is the same as each target cross node code as the delivery code corresponding to the target cross node code of the child individual.
[0068] In this embodiment, reference Figure 3 Define two child individuals as offspring1 and offspring2, and arrange the target node codes (4,3,5,7) at the corresponding node positions in offspring1 (see reference). Figure 3 The node positions between the two arrows in the upper right corner are used to assign a corresponding delivery code to each target node code (4,3,5,7). This is done by obtaining the delivery code corresponding to each target node code from parent individual 2. For example, the delivery code corresponding to target node code 4 in parent individual 2 is delivery code A. The obtained delivery code is then used as the delivery code corresponding to the target node code. At the same time, the target node codes (4,2,6,1) are arranged in the corresponding node positions of offspring2 (refer to...). Figure 3 The node position between the two arrows in the lower right corner), and then assign the corresponding delivery code to each target node code (4,2,6,1). The delivery code corresponding to each target node code is obtained from the parent individual 1. For example, the delivery code corresponding to target node code 6 in parent individual 1 is A. Then the obtained delivery code is used as the delivery code corresponding to the target node code. In this way, the cross-coding of target node codes is achieved.
[0069] Step 34: Randomly arrange all node codes in the parent individual except for the target crossover node code on the remaining node positions of the corresponding child individual. After determining the two delivery codes corresponding to each node code located on the remaining node positions in the two parent individuals, use one of the two delivery codes as the delivery code corresponding to the corresponding node code to generate the child individual that has completed the crossover operation. The second dual-code body includes the child individual that has completed the crossover operation.
[0070] In this embodiment, after the crossover of the target node codes is achieved, the remaining node codes are arranged. In this embodiment, the remaining node codes are randomly arranged on the remaining node positions of the corresponding offspring individuals. Then, the corresponding delivery codes are assigned to the arranged node codes by randomly selecting one of the delivery codes corresponding to the node code in parent individual 1 and parent individual 2. For example, the delivery code corresponding to node code 6 in offspring individual 1 is delivery code A in parent individual 1 and delivery code B in parent individual 2. When randomly selecting, the delivery code corresponding to node code 6 in offspring individual 1 is selected as delivery code B. In this way, the node codes and delivery codes in the remaining positions are completed, and the offspring individuals that have completed the crossover operation are generated, resulting in the corresponding second double-coded body.
[0071] Through steps 31 to 34 above, the crossover operation of the first dual-encoding body is achieved.
[0072] Figure 4 This is a schematic diagram illustrating a mutation operation performed on a dual-coded body according to an embodiment of this application. Figure 5 Another schematic diagram illustrating the mutation operation of a dual-coding body according to an embodiment of this application. In some embodiments, reference is made to... Figure 4 and Figure 5 The mutation operation is performed on all first double-coded bodies, including the following steps:
[0073] Step 41: Based on the preset mutation probability, select multiple second candidate dual codes from the first dual code.
[0074] In this embodiment, after classifying the candidate coding bodies, based on the first dual coding body that needs to undergo genetic evolution operation, the corresponding second candidate dual coding body is selected from the first dual coding body according to a preset mutation probability (fixed selection probability).
[0075] Step 42: Perform a mutation operation on the second candidate dual-code body in one of the following ways to generate a child candidate code body corresponding to the second candidate dual-code body, and use the corresponding child candidate code body as the second dual-code body.
[0076] In this embodiment, a hybrid mutation strategy combining local optimization and global exploration is adopted.
[0077] When using a local optimization mutation strategy: the two gene units of the randomly selected second candidate dual coding body are exchanged to generate the corresponding offspring candidate coding body, wherein the gene unit includes the node code and the delivery code located at the corresponding node position.
[0078] In this embodiment, reference Figure 4 In the second alternative dual-code body ( Figure 4 In the Before stage, two gene units consisting of a "paired node - delivery object" are randomly selected to perform a position swap operation (e.g.: Figure 4 The two gene units 4 / C and 1 / B in the model allocation scheme are used to achieve local optimization of the path structure by adjusting the service order of delivery nodes. Specifically, gene unit 1 / B is swapped to the position corresponding to gene unit 4 / C, and gene unit 4 / C is swapped to the position of gene unit 1 / B, thereby generating the corresponding offspring candidate codes (see reference). Figure 4 (After in the text).
[0079] During global mutation: a target node code is selected from all node codes of the randomly selected second candidate dual coding body, and the delivery code corresponding to the other node code is used as the delivery code corresponding to the target node code. Then, the delivery codes corresponding to all node codes other than the target node code are randomly encoded, and all gene units of the newly formed structure are reordered to generate the corresponding offspring candidate coding bodies.
[0080] In this embodiment, reference Figure 5 Randomly select a node for encoding (e.g.) Figure 5 (node code 1), and replace it with other node codes (e.g. Figure 5 In the node code 4), after ensuring that the delivery code corresponding to node code 1 is maintained as C, a corresponding delivery code is randomly assigned to other node codes. Then, the new gene units consisting of one delivery code for each node code are reordered. During the reordering process, the service order is assigned based on vehicle load constraints. In this way, the corresponding offspring candidate code body is generated (see reference). Figure 5 (After in the text).
[0081] Through steps 41 to 42 above, the mutation operation on the first dual-coding body is achieved.
[0082] In some embodiments, time-varying vehicle delivery route planning includes the following steps:
[0083] Step 51: Decode the current dual-encoding body corresponding to the current vehicle delivery route plan to generate multiple delivery planning information corresponding to the current dual-encoding body, wherein each delivery planning information is associated with a delivery object.
[0084] Step 52: After determining all path nodes in the real road network corresponding to each delivery planning information in the preset area, based on all path nodes corresponding to each delivery planning information, perform initial delivery path planning corresponding to the preset ant colony algorithm to generate an initial delivery path corresponding to each delivery planning information. The end node of the initial delivery path includes the last delivery node delivered by the corresponding delivery object.
[0085] Step 53: Based on all initial delivery routes, the ant colony algorithm is used to perform route construction optimization iterations until the intended delivery route corresponding to each delivery object in the current vehicle delivery route planning is generated. In the route construction optimization iteration, the 2-opt exchange operator is used to perform local search optimization on the constructed delivery routes, and the roulette wheel method and the selection probability determined based on pheromones and joint heuristic information are used to select path nodes. The joint heuristic information includes a time heuristic item determined based on the time-varying travel time corresponding to the two selected path nodes and a distance heuristic item determined based on the travel distance between the two selected path nodes.
[0086] In some embodiments, the path construction optimization iteration using the ant colony algorithm includes the following steps:
[0087] Step 61: Determine the currently generated delivery path and the current pheromone and current joint heuristic information corresponding to the current delivery path. The current delivery path includes one of the following: the initial delivery path or the delivery path generated after completing the previous path construction optimization.
[0088] Step 62: After determining the corresponding current selection probability based on the current pheromone and the current joint heuristic information, based on the current selection probability, the intentional path node is selected from all path nodes corresponding to the delivery planning information corresponding to the current delivery path using the roulette wheel method. Based on all the selected intentional path nodes, the intentional delivery path corresponding to the current path construction optimization is generated. The current pheromone includes one of the following: the initial pheromone, or the pheromone generated after being updated using a preset evaporation mechanism.
[0089] Step 63: After repeating the path construction optimization steps multiple times, select the path segment with the longest total travel time from all path segments of the generated intended delivery path. Here, the path segment is used to represent the path generated by the delivery object traveling through the intersection node located between two delivery nodes, and the total travel time is determined based on multiple time-varying travel times corresponding to the path segment.
[0090] Step 64: Using the 2-opt exchange operator, perform mutation optimization on the path segment with the longest total travel time, and replace the path segment with the longest total travel time with the intention path segment generated by the mutation optimization to obtain the intention delivery path corresponding to each delivery object in the current vehicle delivery route planning.
[0091] In this embodiment, as the number of iterations increases, the ants may get stuck in local optima during the search. To avoid this premature convergence, a time-sensitive 2-opt operator is used to mutate each ant's path, generating new ant paths and escaping local optima. Figure 6 This is a schematic diagram illustrating the variation and optimization of an embodiment of this application. (Refer to...) Figure 6 Choose the option with the longest travel time (for reference). Figure 6 The path segment between the cross path node F and the delivery node 7 is mutated and optimized, for example, from (FCBEH) to (FEBCH).
[0092] In this embodiment, given that the delivery service order has been determined, the selection weight of visited nodes is reduced by a probability suppression mechanism based on tabu search theory, thereby reducing invalid repeated visits and accelerating the convergence speed. At the same time, a time-sensitive 2-opt operator is introduced to guide the ants to escape local optima and find a specific path with the shortest travel time.
[0093] In this embodiment, when an ant is at the current node i (i∈V), the set of candidate path nodes it can access is J, defined as follows: When making a selection in J, to avoid generating inferior solutions due to repeated visits, a penalty coefficient w is added to the nodes that are visited repeatedly. i This reduces the probability of its selection, and then, according to the state transition rule, calculates the probability of going to each candidate path node, and uses a roulette wheel to select the next node to be visited.
[0094]
[0095]
[0096] Among them, w j V represents the penalty coefficient for repeatedly accessing nodes. visited This represents the set of nodes that are repeatedly visited, where Mk represents the delivery node that must be visited currently. This represents the probability of selecting the next node j from the current node i. and These are the weighting coefficients. This indicates the pheromone concentration at which ant k selects candidate node j starting from node i. This indicates that ant k starts from node i and selects a candidate node. pheromone concentration, , Both are forms of spatiotemporal joint heuristic information. , The time heuristic dynamically calculates the travel time from the current node i to the candidate node j; the distance heuristic calculates the travel distance d from the current node i to the candidate node j. ij And candidate node j to the next forced access client node Estimated distance By introducing This guides the selection of path nodes to extend towards the target node, improving the quality of the solution; and For dynamic weighting coefficients, and These are the initial weights; and This is the weighting adjustment coefficient, i.e.: , .
[0097] To accelerate algorithm convergence, in this embodiment, the top 5% of the generated intended delivery paths with the highest delivery fitness are considered elite individuals, and the pheromone concentration is... The update formula is: Where t represents the number of iterations in the intended delivery path iteration, and μ is the pheromone evaporation coefficient on the path, 1 < μ ≤ 1. The incremental pheromones generated for elite individuals, namely: , among which, T k Let b1 be the total travel time after ant k has traversed all paths; b1 be the repetition penalty threshold; Up be the number of non-repeating nodes on the path; and Lp be the total number of nodes on the path.
[0098] The time-varying travel time function constructed in this application is described below:
[0099] Assume the daily working hours of a distribution center are [e0, l0], divided into t time periods, each of length L. Also, the speed of delivery vehicles on the same road segment within the same time period is constant. Therefore, within time period t, the vehicle travels at a constant speed on road segment E. ij The speed of travel on it is And i≠j, i,j∈V; if the delivery vehicle travels within time period t, then the delivery vehicle is on road segment E ij The actual driving distance is And i≠j, i,j∈V, the actual travel distance on several road segments. By summing the results, we can obtain the specific feasible delivery routes for the delivery vehicles within the time period t. The actual driving distance on the road is And i≠j,i,j∈{O}∪N g ,Right now: Therefore, during this time period t, the delivery vehicle travels along a specific feasible delivery route. The actual driving time is And i≠j,i,j∈{O}∪N g ,in It can be divided into several road sections E ij Actual driving time And i≠j, i,j∈V, the specific travel time on different road segments is calculated. By summing these values together, we can obtain the actual travel time within the time period t. ,Right now: The delivery vehicle departs from node i at a certain moment within time period t, along a specific feasible delivery route. The total travel time to reach node j is , where i≠j,i,j∈{O}∪N g ,Right now:
[0100] .
[0101] In summary, delivery vehicle k r exist Starting from node i, along a specific feasible delivery route The time to reach node j is And i, j∈{O}∪N g ,Right now: .
[0102] The calculation of carbon emissions involved in this application is explained below:
[0103] Fuel consumption F is calculated using the Comprehensive Modal Emission Model (CMEM). , where K t Where N is the engine friction coefficient, D is the engine speed, ε is the engine displacement, η is the vehicle transmission efficiency, and P is the engine efficiency parameter. a Power of other engine functions, λ is the fuel-air ratio, M is the vehicle's weight, α is the vehicle's acceleration, v is the vehicle's speed, θ represents the road gradient, and P tr This represents the traction power of the engine when it is running, i.e., P. tr =(Mav+Mgvsinθ+0.5C d Aρv 3 +MgC rcosθv), where g is the acceleration due to gravity;
[0104] In this embodiment, the model makes the following assumptions: the vehicle travels on a level road, and its speed varies at different times and on different road sections, but the vehicle travels at a constant speed throughout, and power consumption during other operations is ignored. Furthermore, since the vehicle speed is a step function, the traction power P at different times and on different road sections... tr There are differences, namely: Therefore, the traction power of the engine when operating along a specific feasible delivery route. for: Therefore, the fuel consumption F on a specific feasible delivery route P for: .
[0105] The mixed-integer programming model involved in the embodiments of this application is described below:
[0106] A certain distribution center O currently has R types of vehicles of different types, where r is a certain type of delivery vehicle, and K... r K is a collection of r-type delivery vehicles. r For any vehicle type, Q r This represents the maximum capacity of the type R delivery vehicle. Delivery vehicle K r Within the working hours of the distribution center [e0, l0], you must depart from the distribution center and follow the specific delivery route. Providing services to various customer locations, delivery personnel must return to the distribution center after completing their delivery tasks. Each customer has a time window for their delivery tasks. i ,l i The requirements are as follows: delayed delivery will incur penalties. Additionally, a fixed service time (s) will be incurred when serving customers. i ,i∈{O}∪N g After completing the service, the delivery vehicle will proceed to the next customer location to provide further service. The goal is to minimize total delivery costs and carbon emissions while adhering to vehicle capacity limitations.
[0107] The mixed-integer programming model is expressed as follows:
[0108] 1. The objective function for minimizing the total delivery cost (minZ1):
[0109] ;
[0110] 2. Objective function for minimizing carbon emissions (minZ2): ;
[0111] The total delivery cost consists of vehicle usage cost, vehicle transportation cost, and penalty cost. , and p l That is the corresponding cost coefficient. This represents the carbon emission coefficient.
[0112] Constraints:
[0113] 1. This constraint indicates that vehicles must depart from and return to the distribution center. The constraint formula is: , .
[0114] 2. Each delivery node can only be served by one vehicle once, with the following constraint: , .
[0115] 3. General time constraints, the constraint formula is: .
[0116] 4. Vehicle entry and exit balance constraint: The number of vehicles entering and leaving the node is the same. The constraint formula is: .
[0117] 5. Loading constraints for vehicle capacity, the constraint formula is: .
[0118] 6. The number of each type of vehicle dispatched by the distribution center cannot exceed its maximum number of vehicles, as stipulated in the following constraint: .
[0119] 7. Vehicle latest working time constraint: The delivery time of a vehicle cannot be later than the working time of the distribution center. The constraint formula is as follows: .
[0120] 8. Decision variable value constraints, the constraints are as follows: .
[0121] This embodiment also provides a time-varying vehicle delivery route planning device that takes into account traffic flow. This device is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the terms "module," "unit," "subunit," etc., can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0122] Figure 7 This is a structural block diagram of a time-varying vehicle delivery route planning device that considers traffic flow according to an embodiment of this application, such as... Figure 7 As shown, the device includes an encoding module 71, a processing module 72, an operation module 73, and a generation module 74, wherein...
[0123] The encoding module 71 is used to generate multiple candidate dual codes by encoding multiple delivery nodes and delivery objects to be delivered within a preset planning period according to a preset encoding rule, and then using the NSGA-II algorithm to perform genetic evolution operations on the multiple initial dual codes to generate multiple candidate dual codes.
[0124] The processing module 72, coupled to the encoding module 71, is used to decode and generate delivery planning information associated with each delivery object based on the node codes and delivery codes of all candidate dual-code bodies. Based on the acquired time-varying travel time and delivery planning information, it uses a preset ant colony algorithm to perform time-varying vehicle delivery route planning and generate the intended delivery route corresponding to each delivery object. The delivery planning information is used to characterize the service order of delivery objects corresponding to a delivery code from the delivery center to at least one delivery node corresponding to a node code. One node code corresponds to one delivery code. The path nodes of the intended delivery route include delivery nodes and intersection nodes in the delivery network. The time-varying travel time is determined based on the distance between two path nodes and the travel speed in each time step within the preset planning period. The travel speed is predicted using a pre-trained vehicle speed prediction model.
[0125] The operation module 73, coupled to the processing module 72, is used to perform corresponding genetic evolution operations on all candidate dual-encoders according to the delivery fitness corresponding to the intended delivery path, and to perform time-varying vehicle delivery path planning based on the delivery planning information and time-varying travel time corresponding to the dual-encoders that have completed the genetic evolution operation. The delivery fitness is determined based on the delivery cost and carbon emissions required for the corresponding delivery path.
[0126] The generation module 74, coupled to the operation module 73, is used to repeatedly execute the steps of performing the corresponding genetic evolution operation and time-varying vehicle delivery route planning until the delivery fitness of the generated intended delivery route is less than the fitness threshold. The intended delivery routes with delivery fitness less than the fitness threshold are used as the target delivery routes corresponding to each delivery object to obtain the planning results.
[0127] This embodiment also provides a planning platform, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0128] Optionally, the planning platform may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0129] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0130] S1. After encoding multiple initial dual-code bodies by encoding multiple delivery nodes and delivery objects to be delivered within the preset planning period according to the preset encoding rules, the NSGA-II algorithm is used to perform genetic evolution operations on the multiple initial dual-code bodies to generate multiple candidate dual-code bodies.
[0131] S2, based on the node codes and delivery codes of all candidate dual-code bodies, decode and generate delivery planning information associated with each delivery object. Based on the acquired time-varying travel time and delivery planning information, use a preset ant colony algorithm to perform time-varying vehicle delivery route planning, generating the intended delivery route corresponding to each delivery object. The delivery planning information is used to characterize the service order of delivery objects corresponding to a delivery code from the delivery center to at least one delivery node corresponding to a node code. One node code corresponds to one delivery code. The path nodes of the intended delivery route include delivery nodes and intersection nodes in the delivery network. The time-varying travel time is determined based on the distance between two path nodes and the travel speed in each time step within the preset planning period. The travel speed is predicted using a pre-trained vehicle speed prediction model.
[0132] S3. Based on the delivery fitness corresponding to the intended delivery route, perform corresponding genetic evolution operations on all candidate dual-encoders, and perform time-varying vehicle delivery route planning based on the delivery planning information and time-varying travel time corresponding to the dual-encoders that have completed the genetic evolution operation. The delivery fitness is determined based on the delivery cost and carbon emissions required for the corresponding delivery route.
[0133] S4. Repeat the steps of performing the corresponding genetic evolution operation and time-varying vehicle delivery route planning until the delivery fitness of the generated intended delivery route is less than the fitness threshold. Then, take the intended delivery route with the delivery fitness less than the fitness threshold as the target delivery route corresponding to each delivery object to obtain the planning result.
[0134] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0135] Furthermore, in conjunction with the time-varying vehicle delivery route planning method considering traffic flow in the above embodiments, this application embodiment can provide a storage medium for implementation. This storage medium stores a computer program; when executed by a processor, the computer program implements any of the time-varying vehicle delivery route planning methods considering traffic flow in the above embodiments.
[0136] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A time-varying vehicle delivery route planning method considering traffic flow, characterized in that, include: After encoding multiple initial dual-code bodies by encoding multiple delivery nodes and delivery objects to be delivered within a preset planning period according to a preset encoding rule, the NSGA-II algorithm is used to perform genetic evolution operations on the multiple initial dual-code bodies to generate multiple candidate dual-code bodies. Based on the node codes and delivery codes of all the candidate dual-code bodies, the delivery planning information associated with each delivery object is decoded and generated. Based on the acquired time-varying travel time and the delivery planning information, a preset ant colony algorithm is used to plan time-varying vehicle delivery routes, generating the intended delivery route corresponding to each delivery object. The delivery planning information is used to characterize the service order of delivery objects corresponding to a delivery code from the delivery center to at least one delivery node corresponding to a node code. One node code corresponds to one delivery code. The path nodes of the intended delivery route include the delivery nodes and intersection nodes in the delivery network. The time-varying travel time is determined based on the distance between two path nodes and the travel speed in each time step within a preset planning period. The travel speed is predicted using a pre-trained vehicle speed prediction model. Based on the delivery fitness corresponding to the intended delivery route, a corresponding genetic evolution operation is performed on all the candidate dual-encoders, and a time-varying vehicle delivery route is planned based on the delivery planning information and the time-varying travel time corresponding to the dual-encoders that have completed the genetic evolution operation. The delivery fitness is determined based on the delivery cost and carbon emissions required for the corresponding delivery route. Repeat the steps of performing the corresponding genetic evolution operation and time-varying vehicle delivery route planning until the delivery fitness of the generated intended delivery route is less than the fitness threshold. Then, take the intended delivery route with the delivery fitness less than the fitness threshold as the target delivery route corresponding to each delivery object to obtain the planning result.
2. The method according to claim 1, characterized in that, Perform the corresponding genetic evolution operations, including: The current dual-code body to be performed in the current genetic evolution operation is determined. A preset ant colony algorithm is used to perform path planning on the delivery planning information corresponding to the current dual-code body. The delivery fitness corresponding to the planned intention delivery path is used as the ranking fitness of the current dual-code body. The current dual-code body includes one of the following: the initial dual-code body and the candidate dual-code body. Based on the sorting fitness, a non-dominated sorting algorithm is used to perform non-dominated sorting on all the current dual-encoding bodies, and the crowding degree is calculated on all the current dual-encoding bodies that have completed the non-dominated sorting to obtain the encoding parameters corresponding to each current dual-encoding body, wherein the encoding parameters include non-dominated sorting parameters and crowding degree. Based on the non-dominated sorting parameter and the crowding degree, a preset number of first dual codes are selected from all the current dual codes, and crossover and mutation operations are performed on all the first dual codes in sequence to generate second dual codes. The crossover operation includes sequential crossover, and the mutation operation includes hybrid mutation combining local optimization and global search. All second double codes of the current double codes, excluding the first double code, are merged to generate the candidate double code corresponding to the current genetic evolution operation.
3. The method according to claim 2, characterized in that, Based on the non-dominated sorting parameter and the crowding degree, a preset number of first dual-code bodies are selected from all the current dual-code bodies, including: Based on the non-dominated sorting parameters, determine the Pareto fronts of all the current dual-encoding bodies; In ascending order of Pareto fronts, select the current double coding bodies that are located at each Pareto front, and determine the total number of current double coding bodies selected that are located at multiple Pareto fronts. Determine whether the total number of selections is greater than a set threshold. If the total number of selections is not greater than the set threshold, perform the following steps: sequentially select the current double codecs that are at each Pareto front from all the current double codecs until the total number of selections is not less than the set threshold to obtain a third double codec. The set threshold is the difference between the total number of current double codecs and the preset number. The third double code is deleted from all the current double codes to obtain the first double code.
4. The method according to claim 3, characterized in that, If it is determined that the total number of selections is greater than a set threshold, the method further includes: Determine the number of the current dual-encoder units of all Pareto fronts preceding the largest Pareto front among the selected Pareto fronts, and determine the difference between the set threshold and the number. From all the current double codes that are at the maximum Pareto front, select the number of current double codes corresponding to the difference in order of congestion from high to low. The current double codec selected from the maximum Pareto front and the current double codec selected from all Pareto fronts preceding the maximum Pareto front are used as the third double codec. The third double code is deleted from all the current double codes to obtain the first double code.
5. The method according to claim 2, characterized in that, Perform an interleaving operation on all of the first dual-encoded blocks, including: According to a preset crossover probability, select multiple first candidate dual codes from the first dual code; After selecting two first candidate double-coded bodies from a plurality of first candidate double-coded bodies as parent individuals, multiple node codes located at the same node position are randomly selected from all the node codes corresponding to the two parent individuals to obtain the target cross node code; The selected target cross node codes are arranged in sequence on the same node positions as the corresponding child individuals of the parent individuals. The delivery code corresponding to the node code of another parent individual that is the same as each target cross node code is used as the delivery code corresponding to the target cross node code of the child individual. All node codes in the parent individuals, except for the target crossover node code, are randomly arranged on the remaining node positions of the corresponding child individuals. After determining the two delivery codes corresponding to each node code located on the remaining node positions in the two parent individuals, one of the two delivery codes is used as the delivery code corresponding to the corresponding node code to generate the child individual that has completed the crossover operation. The second dual-code body includes the child individual that has completed the crossover operation.
6. The method according to claim 5, characterized in that, Mutation operations are performed on all the first dual-codebases, including: Based on a preset mutation probability, a plurality of second candidate dual codes are selected from the first dual code; The second candidate dual-code body is mutated in one of the following ways to generate a child candidate code body corresponding to the second candidate dual-code body, and the corresponding child candidate code body is used as the second dual-code body: The two gene units of the randomly selected second candidate dual coding body are swapped to generate the corresponding offspring candidate coding body, wherein the gene unit includes the node code and the delivery code located at the corresponding node position; After selecting a target node code from all the node codes of the randomly selected second candidate dual coding body, and using the delivery code corresponding to the other node code as the delivery code corresponding to the target node code, the delivery codes corresponding to all the node codes other than the target node code are randomly encoded, and all the newly formed gene units are reordered to generate the corresponding offspring candidate coding body.
7. The method according to claim 2, characterized in that, Perform time-varying vehicle delivery route planning, including: Decode the current dual-encoding body corresponding to the current vehicle delivery route plan to generate multiple delivery planning information corresponding to the current dual-encoding body, wherein each delivery planning information is associated with a delivery object; After determining all the path nodes in the real road network corresponding to each of the delivery planning information in the preset area, based on all the path nodes corresponding to each of the delivery planning information, an initial delivery path is planned according to the preset ant colony algorithm to generate an initial delivery path corresponding to each of the delivery planning information, wherein the end node of the initial delivery path includes the last delivery node delivered to the corresponding delivery object. Based on all the initial delivery paths, the ant colony algorithm is used to perform path construction optimization iterations until the intended delivery path corresponding to each delivery object in the current vehicle delivery path planning is generated. In the path construction optimization iterations, the 2-opt exchange operator is used to perform local search optimization on the constructed delivery path, and the roulette wheel selection method and the selection probability determined based on pheromones and joint heuristic information are used to select the path nodes. The joint heuristic information includes a time heuristic item determined based on the time-varying travel time corresponding to the two selected path nodes and a distance heuristic item determined based on the travel distance between the two selected path nodes.
8. The method according to claim 7, characterized in that, The path construction optimization iteration using the ant colony algorithm includes: The currently generated delivery path is determined, and the current pheromone and current joint heuristic information corresponding to the current delivery path are determined. The current delivery path includes one of the following: the initial delivery path, or the delivery path generated after completing the previous path construction optimization. After determining the corresponding current selection probability based on the current pheromone and the current joint heuristic information, and using the roulette wheel method based on the current selection probability, an intentional path node is selected from all the path nodes corresponding to the delivery planning information corresponding to the current delivery path. Based on all the selected intentional path nodes, the intentional delivery path corresponding to the current path construction optimization is generated. The current pheromone includes one of the following: the initial pheromone, or the pheromone generated after being updated using a preset evaporation mechanism. After repeatedly performing the route construction optimization steps, the route segment with the longest total travel time is selected from all the route segments of the generated intended delivery route. The route segment is used to represent the path generated by the delivery object traveling through the intersection node located between two delivery nodes. The total travel time is determined based on multiple time-varying travel times corresponding to the route segment. Using the 2-opt exchange operator, the path segment with the longest total travel time is mutated and optimized, and the intention path segment generated by the mutated optimization is used to replace the path segment with the longest total travel time, so as to obtain the intention delivery path corresponding to each delivery object in the current vehicle delivery route planning.
9. The method according to claim 1, characterized in that, The vehicle speed prediction model is constructed using the STGCN spatiotemporal graph convolutional network, which employs ensemble graph convolution and gated temporal convolution.
10. A planning platform, comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the steps of the time-varying vehicle delivery route planning method taking into account traffic flow as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Dynamic vehicle pickup-and-delivery route planning method and device based on meme calculation
CN107909228A
Dangerous goods transportation path dynamic planning method based on improved multi-objective algorithm
CN112434849A