Vehicle scheduling path optimization method and device
Through the destruction and repair mechanism of intelligent optimization algorithms and objective functions, combined with multiple initial solution generation methods and operator selection, the problems of low resolution efficiency and poor flexibility in vehicle scheduling path optimization are solved, and efficient and flexible path planning is achieved.
Patent Information
- Application Number
- CN202411178643.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-11-01
AI Technical Summary
The prior art is in vehicle scheduling path optimization, especially in large-scale problems, and the solution efficiency is low and multiple solutions cannot be output simultaneously, and the code structure is poor, which cannot meet actual business needs.
Using intelligent optimization algorithm and objective function, iteratively optimizes the initial solution through the destruction and repair operator, generates multiple target paths, and combines multiple initial solution generation methods and the selection of destruction operators and repair operators to improve the algorithm's self-direction Adaptation ability and solution efficiency.
It has achieved efficient solution to the problem of large-scale vehicle scheduling paths, and can output multiple paths at the same time to meet actual business needs, which has improved the flexibility and implementation of path optimization.
Smart Images

Figure CN118886582A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of path planning, and in particular to a vehicle scheduling path optimization method and device. Background Art
[0002] In the logistics distribution and transportation scenario, there is usually a distribution center (or warehouse) and multiple discretely distributed collection and dispatch nodes. The vehicle starts from the distribution center and passes through each collection and dispatch node in turn to unload or load the corresponding amount of goods. The collection and dispatch efficiency can be improved by optimizing the vehicle scheduling route.
[0003] In the related technologies, one is to manually dispatch vehicles according to the pickup and dispatch address, which is inefficient; the other is to use open source solving tools to optimize vehicle dispatch paths and find vehicle-cargo matching and path planning that balances transportation costs and transportation experience. However, when the scale of the problem being solved is large, the efficiency of this open source solving tool drops significantly, and it is unable to output multiple solutions at the same time. When targeting specific problems, the flexibility of improving the code structure is poor. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a vehicle scheduling path optimization method and device, which can efficiently solve large-scale path planning problems, can output multiple paths at the same time, and has good feasibility and flexibility.
[0005] To achieve the above object, according to one aspect of an embodiment of the present invention, a vehicle dispatch path optimization method is provided, comprising:
[0006] Get the node information corresponding to the current station, the starting point of the path, and the vehicle information of various vehicle types;
[0007] According to the initial solution generation method of this round, an initial solution is generated by combining the vehicle information, the node information and the path starting point, wherein the initial solution includes multiple candidate paths and a vehicle type corresponding to each candidate path, and each candidate path includes one or more nodes;
[0008] Based on the intelligent optimization algorithm and the objective function, a destruction operator and a repair operator are selected to destroy and repair the initial solution to obtain a current solution and a current optimal solution; a destruction operator and a repair operator are reselected to destroy and repair the current solution, and the current solution and the current optimal solution are updated in an iterative cycle. The current optimal solution of this round is determined based on the updated current solution and the current optimal solution; the current optimal solution includes multiple target paths and the vehicle type corresponding to each target path.
[0009] Optionally, the method further includes: constructing constraints of the objective function based on the vehicle information and the node information.
[0010] Optionally, constructing the constraint condition of the objective function based on the vehicle information and the node information includes:
[0011] Acquire the maximum load and maximum load capacity of each vehicle type from the vehicle information, and construct the load constraint and load capacity constraint of the delivery vehicle according to the maximum load and maximum load capacity of each vehicle type;
[0012] Obtaining the maximum number of nodes and the maximum distance traveled for each type of vehicle from the vehicle information, and constructing the node number constraint and the distance constraint of the delivery vehicle according to the maximum number of nodes and the maximum distance traveled for each type of vehicle;
[0013] Constructing the constraint of the path starting point according to the vehicle information, wherein the constraint of the path starting point includes that the number of vehicles of each vehicle type departing from the path starting point is less than or equal to the total number of vehicles of each vehicle type;
[0014] A node constraint is constructed according to the node information, wherein the node constraint includes a vehicle quantity constraint corresponding to the node and a flow balance constraint of the node.
[0015] Optionally, constructing the constraint condition of the objective function based on the vehicle information and the node information further includes:
[0016] Acquire the loading capacity of each vehicle type from the vehicle information, and construct a first scenario constraint according to the loading capacity, wherein the first scenario constraint includes that the loading volume of each vehicle type is greater than or equal to the loading capacity;
[0017] A loop elimination constraint is constructed, wherein the loop elimination constraint includes eliminating path loops constructed by more than three nodes.
[0018] Optionally, according to the initial solution generation method of this round, the initial solution is generated by combining the vehicle information, the node information and the path starting point, including:
[0019] Obtaining the demand and location of each node from the node information, and obtaining the constraint conditions of each vehicle type from the vehicle information;
[0020] The distance between any two nodes is calculated based on the position of each node in the node information;
[0021] For any vehicle, the initial solution is generated according to the starting point of the path, the distance between any two nodes, the demand of each node and the constraint conditions of the vehicle type corresponding to the any vehicle, and combined with the initial solution generation method of this round.
[0022] Optionally, select destruction and repair operators, including:
[0023] Get the score of each destruction operator and the score of each repair operator after the last iteration;
[0024] Calculate a first weight of each destruction operator according to the score of each destruction operator and the sum of the scores of all destruction operators;
[0025] Calculating a second weight of each repair operator according to a numerator of each repair operator and a score of each repair operator;
[0026] A destruction operator and a repair operator are selected according to the first weight and the second weight, respectively.
[0027] Optionally, updating the current solution and the current optimal solution, and determining the current optimal solution of this round according to the updated current solution and the current optimal solution, includes:
[0028] Calculate the objective function value of the current solution and the objective function value of the current optimal solution according to the objective function;
[0029] Selecting a destruction operator and a repair operator to destroy and repair the current solution to obtain a new solution; calculating the objective function value of the new solution according to the objective function;
[0030] When the objective function value of the new solution is better than the objective function value of the current solution, updating the current solution to the new solution;
[0031] When the objective function value of the new solution is better than the objective function value of the current optimal solution, updating the current optimal solution to the new solution;
[0032] When the iteration converges, the new solution is used as the current optimal solution of this round.
[0033] Optionally, the initial solution generation method is at least one of a random generation method, a nearest neighbor generation method, and a generation method based on a conservation algorithm.
[0034] According to another aspect of the embodiments of the present invention, a vehicle dispatching path optimization device is provided, comprising:
[0035] The acquisition module obtains the node information corresponding to the current station, the starting point of the path, and the vehicle information of various vehicle types;
[0036] A generation module, which generates an initial solution according to the initial solution generation method of this round, combining the vehicle information, the node information and the path starting point, wherein the initial solution includes multiple candidate paths and a vehicle type corresponding to each candidate path, and each candidate path includes one or more nodes;
[0037] A determination module selects a destruction operator and a repair operator to destroy and repair the initial solution based on an intelligent optimization algorithm and an objective function to obtain a current solution and a current optimal solution; reselects a destruction operator and a repair operator to destroy and repair the current solution, iterates in a loop, updates the current solution and the current optimal solution, and determines the current optimal solution of this round according to the updated current solution and the current optimal solution; the current optimal solution includes multiple target paths and the vehicle type corresponding to each target path.
[0038] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the vehicle scheduling path optimization method provided by the present invention.
[0039] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the vehicle scheduling path optimization method provided by the present invention is implemented.
[0040] One embodiment of the above invention has the following advantages or beneficial effects: the vehicle dispatching path optimization method of the embodiment of the present invention generates an initial solution by acquiring the corresponding node information of the current station, the path starting point and the vehicle information of various vehicle types, combined with the initial solution generation method of this round; through the intelligent optimization algorithm and the objective function, the initial solution is destroyed and repaired to obtain the current solution, and the current solution is destroyed and repaired in a continuous loop iteration, the current solution and the current optimal solution are updated to obtain the current optimal solution of this round, and the final planned paths are obtained after the iteration. This method uses an intelligent optimization algorithm combined with an objective function to optimize the vehicle dispatching path, which can meet actual business needs, make the solution result more reasonable, and has good implementation; this method uses a variety of initial solution generation methods and a variety of destruction operators and repair operators to improve the algorithm's adaptability, improve solution efficiency and flexibility, and improve path optimization efficiency.
[0041] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0043] Figure 1 is a schematic diagram of the main process of a vehicle dispatch path optimization method according to an embodiment of the present invention;
[0044] Figure 2is a schematic diagram of the main process of another vehicle dispatch path optimization method according to an embodiment of the present invention;
[0045] Figure 3 It is a flow chart of a vehicle dispatching path optimization method according to an embodiment of the present invention;
[0046] Figure 4 is an algorithm iteration diagram of a vehicle dispatch path optimization method according to an embodiment of the present invention;
[0047] Figure 5 A vehicle path diagram obtained based on a vehicle scheduling path optimization method according to an embodiment of the present invention;
[0048] Figure 6 is a schematic diagram of main modules of a vehicle dispatching path optimization device according to an embodiment of the present invention;
[0049] Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0050] Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0052] In the urban distribution transportation scenario, there is usually a pick-up point (distribution center / warehouse) and multiple discretely distributed pick-up and dispatch nodes. The vehicle loaded with the delivery goods starts from the pick-up point, passes through several pick-up and dispatch nodes in turn, and unloads the corresponding amount of goods. This problem can be abstracted as a vehicle routing problem (VRP) with multiple models. In the related technology, the vehicle is dispatched manually according to the delivery point address. Then, in order to improve efficiency, the open source solution tool Jsprit is used for solution. The vehicle is dispatched considering factors such as node address, vehicle volume, and delivery distance. On the basis of the current solution tool, relevant constraints and objects are added, such as vehicle access distance constraints and more models, so as to find the vehicle-cargo matching and path planning that balances transportation costs and transportation experience. However, the open source solution tool needs to load various components. When the scale of the problem to be solved is large, the solution efficiency will drop significantly; the tool may have certain scalability limitations when dealing with the vehicle scheduling path optimization problem, such as the inability to output multiple solutions at one time and view the iterative optimization process of the optimal solution; the code structure of the tool is not flexible enough when improving specific problems.
[0053] Therefore, the embodiment of the present invention provides a vehicle dispatching path optimization method, which can efficiently solve the vehicle dispatching path and has good visualization function and flexibility.
[0054] Figure 1 is a schematic diagram of the main process of a vehicle dispatch path optimization method according to an embodiment of the present invention, such as Figure 1 As shown, the following steps are included:
[0055] Step S101: Obtaining node information corresponding to the current station, path starting point, and vehicle information of multiple vehicle types;
[0056] Step S102: Generate an initial solution based on the initial solution generation method of this round, combining vehicle information, node information and path starting point, the initial solution includes multiple candidate paths and the vehicle type corresponding to each candidate path, and each candidate path includes one or more nodes;
[0057] Step S103: Based on the intelligent optimization algorithm and the objective function, a destruction operator and a repair operator are selected to destroy and repair the initial solution to obtain the current solution and the current optimal solution; the destruction operator and the repair operator are reselected to destroy and repair the current solution, and the current solution and the current optimal solution are updated in an iterative cycle. The current optimal solution of this round is determined based on the updated current solution and the current optimal solution; the current optimal solution includes multiple target paths and the vehicle type corresponding to each target path.
[0058] In an embodiment of the present invention, the vehicle dispatching path optimization method can be applied to vehicle dispatching path planning for a scenario problem in which a vehicle loaded with goods arrives at each delivery node from a distribution center to unload the goods, or to vehicle dispatching path optimization for a scenario problem in which a vehicle arrives at each collection node from a distribution center to collect the goods. The embodiment of the present invention is described by taking the scenario in which a vehicle loaded with goods departs from a distribution center to each delivery node to unload the goods as an example.
[0059] In an embodiment of the present invention, since different route scenario rules may have different scenario constraints, vehicle information, node information, etc., firstly, the route scenario rules corresponding to the current station are obtained. According to the route scenario rules, the node information, the path starting point and the vehicle information of various vehicle types corresponding to the current station within the preset time can be obtained. The preset time can be customized, such as the current day. That is, the corresponding relationship between the vehicle information, the demand point information and the path starting point of various vehicle types corresponding to each route scenario rule is pre-configured. The path starting point is the pick-up point (distribution center or warehouse), that is, the starting point of the vehicle. The pick-up point (depot) is represented by the pick-up point mark, and the geographical location of the pick-up point is represented by the longitude and latitude; the node is the receiving node, that is, the delivery node or the demand node, which is used to receive the goods corresponding to the node demand; the vehicle information of various vehicle types includes the vehicle type and the vehicle data corresponding to each vehicle type.
[0060] Among them, the node information includes the weight and volume of the goods required for each node, as well as the geographical location of each node, which is represented by longitude and latitude, and can also include the identifier of the node, that is, the node number. The vehicle data corresponding to each vehicle type includes the identifier of the vehicle type, the vehicle name, and also includes the starting price of the vehicle type, the basic number of string points, the string point price, the maximum loading volume, the maximum loading weight, the maximum number of string points, the departure location, the corresponding pick-up point identifier, the number of vehicles of this vehicle type, the identifier of each vehicle, and other information. Among them, the string point number is the number of nodes passed by the path, the basic string point number, that is, when the string point number is less than or equal to the basic string point number, no string point fee will be incurred; the string point price, that is, when the string point number is greater than the basic string point number, the vehicle fee = (string point number - basic string point number) * string point price.
[0061] In an embodiment of the present invention, after obtaining vehicle information and node information of multiple vehicle types at the current site and the starting point of the path, the initial solution generation method of this round is obtained, and the initial solution is generated in combination with the initial solution generation method. The initial solution includes multiple candidate paths and the vehicle type corresponding to each candidate path, as well as each node corresponding to each candidate path and the node order of each node.
[0062] Specifically, Figure 2As shown, according to the initial solution generation method of this round, the initial solution is generated by combining vehicle information, node information and path starting point, including:
[0063] Step S201: obtaining the demand and location of each node from the node information, and obtaining the constraint conditions of each vehicle type from the vehicle information;
[0064] Step S202: Calculate the distance between any two nodes according to the position of each node in the node information;
[0065] Step S203: For any vehicle, an initial solution is generated according to the path starting point, the distance between any two nodes, the demand of each node and the constraint conditions of the vehicle type corresponding to any vehicle, and combined with the initial solution generation method of this round.
[0066] In the embodiment of the present invention, the initial solution generation method is at least one of a random generation method, a nearest neighbor generation method, and a generation method based on a conservation algorithm (conservation mileage method, CV algorithm). The initial solution generation method of this round can be randomly selected from the random generation method, the nearest neighbor generation method, and the generation method based on the conservation algorithm to generate the initial solution, and the initial solution generation method of the next round can be different from that of the previous round to improve the quality of the initial solution.
[0067] Specifically, the distance between any two nodes is calculated based on the geographic coordinates of each node, and a distance matrix is constructed. The distance between any two nodes can be obtained later through the distance matrix. The initial solution is generated based on the constraints and the initial solution generation method. The initial solution is the current solution and the current optimal solution. The constraints include constraints on vehicles of different models and paths.
[0068] If the initial solution generation method is random generation, a vehicle of a vehicle type is randomly selected, a first node is randomly selected from all nodes as the path corresponding to the vehicle type, and then a second node is selected. It is determined whether to add the second node to the path according to the constraint conditions. For example, if the sum of the weights of the required goods of the two nodes is greater than the maximum load of the vehicle type, the second node cannot be added to the path; then a third node is selected. If the third node meets the constraint conditions, the third node is inserted into the path. During the insertion process, a random insertion method can be used, and so on, until the initial path corresponding to the vehicle type is obtained. Then a vehicle is selected from the remaining vehicles to create a new path until all nodes are added to the path. This initial solution generation method has greater randomness and higher efficiency.
[0069] If the initial solution is generated by the nearest neighbor generation method, randomly select a vehicle of a vehicle type, randomly select a first node from all nodes as the path corresponding to the vehicle type, find the node closest to the last node of the current path, and insert it to the end of the path while satisfying the constraints, that is, the last node is the inserted node, and so on, until the path is completed; select the remaining vehicles, create a new path, and repeat the above process until all nodes are added to the path. The initial solution obtained by this initial solution generation method is relatively stable.
[0070] If the initial solution generation method is the mileage saving method (CW algorithm), first calculate the distance between each node and the pickup point, randomly select a vehicle of a vehicle type, randomly select a first node, calculate the path saving value of other nodes inserted into the path from the first node to the pickup point, find the node with the largest path saving value, insert the node with the largest path saving value into the path from the first node to the pickup point, and so on, until the path is completed. Then select the remaining vehicles, create a new path, and repeat the above process until all nodes are added to the path. This initial solution generation method generates a higher quality initial solution.
[0071] In an embodiment of the present invention, in this round of iteration, after obtaining the initial solution, the vehicle dispatch path optimization is performed based on the intelligent optimization algorithm and the objective function. The intelligent optimization algorithm may be a meta-heuristic algorithm, such as the Adaptive Large Neighborhood Search (ALNS) algorithm. Specifically, a destruction operator is selected to destroy the initial solution, and a repair operator is selected to repair the destroyed initial solution to obtain the current solution and the current optimal solution. That is, the current optimal solution is determined by calculating the objective function value of the current solution and the objective function value of the initial solution. That is, if the objective function value of the current solution is better than the objective function value of the initial solution, then the current optimal solution is the current solution, otherwise, the current optimal solution is the initial solution. The objective function value of the current solution is calculated by inputting the current solution into the objective function.
[0072] After destroying and repairing the initial solution to obtain the current solution and the current optimal solution, continue to select the destruction operator and the repair operator to destroy and repair the current solution, iterate cyclically, the current solution and the current optimal solution, the number of iterations can be preset, when the maximum number of iterations is reached, the iteration stops, and the current optimal solution of this round is obtained. The current optimal solution includes multiple target paths and the vehicle type corresponding to each target path.
[0073] In the embodiment of the present invention, the weight of the destruction operator and the weight of the repair operator are updated after each round of iteration, and the updated weight of the destruction operator and the weight of the repair operator are used for the next round of iteration, so that the next round selects the destruction operator and the repair operator according to the updated weight of the destruction operator and the weight of the repair operator. The destruction operator can be a random destruction operator or a worst destruction operator, and the repair operator can be a random repair operator, a greedy repair operator, or a regretful repair operator. In each round of iteration, the destruction operator for each iteration in the round of iteration is selected according to the weight of each destruction operator, and the repair operator for each iteration in the round of iteration is selected according to the weight of each repair operator.
[0074] In the embodiment of the present invention, selecting a destruction operator and a repair operator includes:
[0075] Get the score of each destruction operator and the score of each repair operator after the last iteration;
[0076] Calculate a first weight of each destruction operator according to the score of each destruction operator and the sum of the scores of all destruction operators;
[0077] Calculating a second weight of each repair operator according to a numerator of each repair operator and a score of each repair operator;
[0078] A destruction operator and a repair operator are selected according to the first weight and the second weight, respectively.
[0079] Specifically, for each iteration within this round, the selection of destruction operators and repair operators is determined based on the first weight of each destruction operator and the second weight of each repair operator, that is, the higher the weight of the operator, the greater the probability of the operator being selected and the more times it is selected. First, obtain the score of each destruction operator and the score of each repair operator after the end of the previous round of iteration, then calculate the sum of the scores of all destruction operators and the group sum of all repair operators, and use the ratio of the score of each destruction operator to the sum of the scores of all destruction operators as the first weight of each destruction operator, and use the ratio of the score of each repair operator to the sum of the scores of all repair operators as the second weight of each repair operator.
[0080] The score of each destruction operator and the score of each repair operator are obtained in the following way: in each iteration process within each round, if a destruction operator and a repair operator are selected to destroy and repair the current solution to obtain a new solution, if the objective function value of the new solution is better than the objective function value of the current optimal solution, then r1 points are added to the scores of the destruction operator and the repair operator respectively; if the objective function value of the new solution is better than the objective function value of the current solution, then r2 points are added to the scores of the destruction operator and the repair operator respectively; if the objective function value of the new solution is not better than the objective function value of the current solution, then r3 points are added to the scores of the destruction operator and the repair operator respectively, where r1>r2>r3.
[0081] In the embodiment of the present invention, the objective function is constructed by minimizing the path cost. The objective function includes the path cost of each vehicle. The path cost of each vehicle includes the starting price of each vehicle and the connecting point fee. The minimized objective function is shown in formula (1):
[0082] , formula (1),
[0083] Among them, m represents the mth type of vehicle, M represents the type of delivery vehicle, i.e., vehicle type, k represents vehicle k, K represents the set of delivery vehicles, and C represents the set of all nodes; It indicates the starting price of vehicle k of category m, i.e. the starting delivery fee; Representation Node Is it indicated by Class of vehicle If so, the value is , otherwise, the value is ; represents the starting point of vehicle k of class m, It represents the serial point fee of vehicle k of category m.
[0084] In an embodiment of the present invention, the vehicle dispatch path optimization method further includes: constructing constraint conditions of the objective function based on vehicle information and node information.
[0085] Specifically, the constraints of the objective function are constructed based on vehicle information and node information, including:
[0086] The maximum load and maximum capacity of each vehicle type are obtained from the vehicle information, and the load constraint and capacity constraint of the delivery vehicle are respectively constructed according to the maximum load and maximum capacity of each vehicle type;
[0087] The maximum number of nodes and the maximum distance traveled for each type of vehicle are obtained from the vehicle information, and the node number constraint and the distance constraint of the delivery vehicle are respectively constructed according to the maximum number of nodes and the maximum distance traveled for each type of vehicle;
[0088] Constructing the constraints of the path starting point according to the vehicle information, the constraints of the path starting point include that the number of vehicles of each vehicle type departing from the path starting point is less than or equal to the total number of vehicles of each vehicle type;
[0089] Node constraints are constructed based on node information. Node constraints include the number of vehicles corresponding to the node and the flow balance constraint of the node.
[0090] In an embodiment of the present invention, in order to obtain multiple paths that meet the constraint conditions according to the objective function, the constraint conditions of the objective function are constructed based on vehicle information and demand point information. The constraint objects of the constraint conditions include the departure warehouse, node, delivery vehicle and loop. When the constraint object is the departure warehouse, i.e., the starting point of the path, for each vehicle type, the number of vehicles departing from the departure warehouse is less than or equal to the total number of vehicles of each vehicle type, as shown in formula (2). When the constraint object is a node, the node constraint includes the constraint on the number of vehicles corresponding to the node, i.e., each node can only be visited by one vehicle, as shown in formula (3); and also includes a flow balance constraint, i.e., a vehicle entering a node must leave the node, as shown in formulas (4) and (5). When the constraint object is a delivery vehicle, it is necessary to impose load constraints, capacity constraints, travel node quantity constraints and distance constraints on the delivery vehicle. That is, the load constraint is constructed based on the maximum load of each vehicle type, that is, the maximum loading weight, as shown in formula (6); the capacity constraint is constructed based on the maximum load capacity of each vehicle type, that is, the maximum loading volume, as shown in formula (7); the node quantity constraint is constructed based on the maximum number of nodes visited by each vehicle, as shown in formula (8); and the distance constraint is constructed based on the maximum distance traveled by each vehicle, as shown in formula (9).
[0091] Specifically, the constraints of the objective function are constructed based on vehicle information and node information, and also include:
[0092] Obtaining the loading volume of each vehicle type from the vehicle information, and constructing a first scenario constraint according to the loading volume, wherein the first scenario constraint includes that the loading volume of each vehicle type is greater than the loading volume;
[0093] Construct a loop elimination constraint, which includes eliminating path loops constructed by more than three nodes.
[0094] That is, eliminating loop constraints means eliminating path loops consisting of three or more nodes, as shown in formula (10). The first scenario constraint is that the loading volume of each vehicle, that is, the volume of shipment, needs to be greater than the starting volume of the vehicle, as shown in formula (11). The constraints of the objective function also include the second scenario constraint. For different vehicle types, the number of string points and the driving distance are different. For example, for small vehicles, try to constrain the path without many string points and long distances, and for large vehicles, try to constrain the path without few string points and short distances. Other constraints can also be included, such as the actual maximum load of a vehicle of a certain type is smaller than the given maximum load.
[0095]
[0096] , formula (3),
[0097] , formula (4),
[0098] , formula (5),
[0099] , formula (6),
[0100] , formula (7),
[0101] , formula (8),
[0102] , formula (9),
[0103] , formula (10),
[0104] , formula (11),
[0105] Among them, in formulas (2)-(11), V represents the set of all nodes and pickup points, O represents the distribution center, represents the number of vehicles of type m, express Maximum load of the vehicle type; express The maximum load capacity of the vehicle, Indicates the minimum loading quantity for class M vehicles; Representation Node Required weight; Representation Node Required volume; express The maximum distance traveled by a vehicle of this type; express The maximum number of points that a vehicle can travel is the maximum number of points in a series; Represents a slave node To Node distance; Represents a slave node To Node Whether to adopt Class of vehicle If selected, the value is , otherwise the value is ; is the number of waypoints on the path.
[0106] In the embodiment of the present invention, updating the current solution and the current optimal solution, and determining the current optimal solution of this round according to the updated current solution and the current optimal solution, includes:
[0107] Calculate the objective function value of the current solution and the objective function value of the current optimal solution according to the objective function;
[0108] Select a destruction operator and a repair operator to destroy and repair the current solution to obtain a new solution; calculate the objective function value of the new solution according to the objective function;
[0109] When the objective function value of the new solution is better than the objective function value of the current solution, the current solution is updated to the new solution;
[0110] When the objective function value of the new solution is better than the objective function value of the current optimal solution, the current optimal solution is updated as the new solution;
[0111] When the iteration converges, the new solution is taken as the current optimal solution of this round.
[0112] In an embodiment of the present invention, when updating the current solution and the current optimal solution and determining the current optimal solution of this round, the objective function value of the current solution and the objective function value of the current optimal solution are calculated according to the objective function, and the destruction operator and the repair operator are selected to destroy and repair the current solution to obtain a new solution, and the objective function value of the new solution is calculated, and the objective function value of the new solution is compared with the objective function value of the current solution. If the objective function value of the new solution is better than the objective function value of the current solution, the new solution is set as the current solution, wherein, when the objective function is the path cost, that is, the path cost of the new solution is lower than the path cost of the current solution, the new solution is better, and if the path cost of the new solution is higher than the path cost of the current solution, but the difference is within a preset range, it also means that the new solution is better, and the new solution is set as the current solution. If the objective function value of the new solution is better than the objective function value of the current optimal solution, the new solution is the current optimal solution; the iteration is repeated until the maximum number of iterations is reached to obtain the current optimal solution of this round. The current optimal solution of this round is the global optimal solution, which is used as the current optimal solution of the first iteration of the next round.
[0113] Figure 3 A flow chart of a vehicle dispatch path optimization method according to an embodiment of the present invention. After generating an initial solution according to the initial solution generation method, a destruction operator is selected to destroy the initial solution, and then a repair operator is selected to generate a new solution, and it is determined whether the new solution is better than the current solution. If so, the current solution is updated to the new solution, and if not, the current solution remains unchanged;
[0114] Determine whether the new solution is better than the current optimal solution. If so, update the current optimal solution to the new solution. If not, the current optimal solution remains unchanged.
[0115] Determine whether the iteration stops. If so, output the current optimal solution. If not, jump to selecting the destruction operator to destroy the solution and repeat the above steps.
[0116] Figure 4 is an algorithm iteration diagram in a vehicle dispatch path optimization method according to an embodiment of the present invention, Figure 5 The vehicle path diagram is obtained. The current site includes 27 nodes. It can be seen from the algorithm iteration diagram that the objective function value gradually decreases with the increase of the number of iterations. When the algorithm iterates 50 times, the objective function value is no longer updated and remains stable. The vehicle path diagram includes 3 paths corresponding to 3 vehicles, and the 3 paths are distinguished by different colors. The vehicle path diagram can more intuitively check the rationality of the path.
[0117] The method of the embodiment of the present invention and the open source solving tool are respectively used to optimize the vehicle dispatching path, and the running time of the two optimization methods with different string point numbers is obtained. For example, when the string point number is 15, the running time of the open source solving tool is 5.176 seconds, while the running time of the method of the embodiment of the present invention is 1.33 seconds. The results are similar when the string point number is other. It shows that under the same problem scale, the solving efficiency of the method of the embodiment of the present invention is significantly higher than that of the open source solving tool.
[0118] The vehicle dispatching path optimization method of the embodiment of the present invention generates an initial solution by acquiring vehicle information and node information of various vehicle types at the current station and path starting point information, combined with the initial solution generation method of this round; the initial solution is destroyed and repaired to obtain the current solution through the intelligent optimization algorithm and the objective function, and the current solution is destroyed and repaired in a continuous and iterative cycle to update the current solution and the current optimal solution to obtain the current optimal solution of this round, and the final planned paths are obtained after the iteration. This method uses an intelligent optimization algorithm and combines the objective function to optimize the vehicle dispatching path, which can meet actual business needs, make the solution result more reasonable, and has good implementation; this method uses a variety of initial solution generation methods and a variety of destruction operators and repair operators to improve the algorithm's adaptability, improve solution efficiency and flexibility, and improve path optimization efficiency.
[0119] According to another aspect of the embodiment of the present invention, Figure 6 As shown, a vehicle dispatching path optimization device 600 is provided, comprising
[0120] Acquisition module 601, acquiring node information corresponding to the current station, path starting point and vehicle information of multiple vehicle types;
[0121] A generation module 602 generates an initial solution according to the initial solution generation method of this round, combining vehicle information, node information and path starting point, wherein the initial solution includes multiple candidate paths and a vehicle type corresponding to each candidate path, and each candidate path includes one or more nodes;
[0122] Determination module 603, based on the intelligent optimization algorithm and the objective function, selects a destruction operator and a repair operator to destroy and repair the initial solution to obtain a current solution and a current optimal solution; reselects a destruction operator and a repair operator to destroy and repair the current solution, iterates in a loop, updates the current solution and the current optimal solution, and determines the current optimal solution of this round based on the updated current solution and the current optimal solution; the current optimal solution includes multiple target paths and the vehicle type corresponding to each target path.
[0123] In an embodiment of the present invention, the device further includes a construction module, which is used to: construct constraint conditions of the objective function based on vehicle information and node information.
[0124] In the embodiment of the present invention, the construction module is further used to: obtain the maximum load and maximum load capacity of each vehicle type from the vehicle information, and respectively construct the load constraint and load capacity constraint of the delivery vehicle according to the maximum load and maximum load capacity of each vehicle type;
[0125] The maximum number of nodes and the maximum distance traveled for each type of vehicle are obtained from the vehicle information, and the node number constraint and the distance constraint of the delivery vehicle are respectively constructed according to the maximum number of nodes and the maximum distance traveled for each type of vehicle;
[0126] Constructing the constraints of the path starting point according to the vehicle information, the constraints of the path starting point include that the number of vehicles of each vehicle type departing from the path starting point is less than or equal to the total number of vehicles of each vehicle type;
[0127] Node constraints are constructed based on node information. Node constraints include the number of vehicles corresponding to the node and the flow balance constraint of the node.
[0128] In an embodiment of the present invention, the construction module is further used to: obtain the loading volume of each vehicle type from the vehicle information, and construct a first scenario constraint according to the loading volume, wherein the first scenario constraint includes that the loading volume of each vehicle type is greater than or equal to the loading volume;
[0129] Construct a loop elimination constraint, which includes eliminating path loops constructed by more than three nodes.
[0130] In the embodiment of the present invention, the generation module 602 is further used to: obtain the demand and location of each node from the node information, and obtain the constraint conditions of each vehicle type from the vehicle information;
[0131] The distance between any two nodes is calculated based on the position of each node in the node information;
[0132] For any vehicle, an initial solution is generated based on the path starting point, the distance between any two nodes, the demand of each node, and the constraints of the vehicle type corresponding to any vehicle, combined with the initial solution generation method of this round.
[0133] In an embodiment of the present invention, the determination module 603 is further used to: obtain the score of each destruction operator and the score of each repair operator after the end of the previous round of iteration; calculate the first weight of each destruction operator based on the score of each destruction operator and the sum of the scores of all destruction operators; calculate the second weight of each repair operator based on the numerator of each repair operator and the sum of the scores of each repair operator; select the destruction operator and the repair operator according to the first weight and the second weight, respectively.
[0134] In an embodiment of the present invention, the determination module 603 is further used to: calculate the objective function value of the current solution and the objective function value of the current optimal solution according to the objective function; select a destruction operator and a repair operator to destroy and repair the current solution to obtain a new solution; calculate the objective function value of the new solution according to the objective function; if the objective function value of the new solution is better than the objective function value of the current solution, update the current solution to the new solution; if the objective function value of the new solution is better than the objective function value of the current optimal solution, update the current optimal solution to the new solution; when the iteration converges, use the new solution as the current optimal solution of this round.
[0135] In an embodiment of the present invention, the initial solution generation method is at least one of a random generation method, a nearest neighbor generation method, and a generation method based on a conservation algorithm.
[0136] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the vehicle scheduling path optimization method provided by the present invention.
[0137] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the vehicle scheduling path optimization method provided by the present invention is implemented.
[0138] Figure 7 An exemplary system architecture 700 is shown to which the vehicle dispatching path optimization method or vehicle dispatching path optimization device according to the embodiment of the present invention can be applied.
[0139] like Figure 7As shown, system architecture 700 may include terminal devices 701, 702, 703, network 704 and server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0140] The user can use the terminal devices 701, 702, 703 to interact with the server 705 through the network 704 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 701, 702, 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0141] The terminal devices 701 , 702 , and 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0142] The server 705 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 701, 702, and 703. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only an example) to the terminal device.
[0143] It should be noted that the vehicle dispatching path optimization method provided in the embodiment of the present invention is generally executed by the server 705 , and accordingly, the vehicle dispatching path optimization device is generally arranged in the server 705 .
[0144] It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0145] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 800 of a terminal device suitable for implementing an embodiment of the present invention. Figure 8 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0146] like Figure 8As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 to a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0147] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.
[0148] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.
[0149] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0150] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0151] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, they may be described as: a processor includes an acquisition module, a generation module and a determination module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the acquisition module may also be described as "a module for acquiring node information corresponding to the current station, the starting point of the path and vehicle information of multiple vehicle types".
[0152] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: obtaining node information corresponding to the current station, path starting point and vehicle information of multiple vehicle types; generating an initial solution according to the initial solution generation method of this round, combining vehicle information, node information and path starting point, the initial solution includes multiple candidate paths and the vehicle type corresponding to each candidate path, and each candidate path includes one or more nodes; based on the intelligent optimization algorithm and the objective function, selecting a destruction operator and a repair operator to destroy and repair the initial solution to obtain the current solution and the current optimal solution; reselecting a destruction operator and a repair operator to destroy and repair the current solution, iterating in a loop, updating the current solution and the current optimal solution, and determining the current optimal solution of this round according to the updated current solution and the current optimal solution; the current optimal solution includes multiple target paths and the vehicle type corresponding to each target path.
[0153] According to the technical solution of the embodiment of the present invention, the vehicle dispatching path optimization method of the embodiment of the present invention generates an initial solution by obtaining the node information corresponding to the current station, the path starting point and the vehicle information of various vehicle types, combined with the initial solution generation method of this round; through the intelligent optimization algorithm and the objective function, the initial solution is destroyed and repaired to obtain the current solution, and the current solution is destroyed and repaired in a continuous loop iteration, the current solution and the current optimal solution are updated to obtain the current optimal solution of this round, and the final planned paths are obtained after the iteration. This method uses an intelligent optimization algorithm and combines the objective function to optimize the vehicle dispatching path, which can meet actual business needs, make the solution result more reasonable, and have good implementation; this method uses a variety of initial solution generation methods and a variety of destruction operators and repair operators to improve the algorithm's adaptability, improve solution efficiency and flexibility, and improve path optimization efficiency.
[0154] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A vehicle dispatching path optimization method, characterized in that: include: Get the node information corresponding to the current station, the starting point of the path, and the vehicle information of various vehicle types; According to the initial solution generation method of this round, an initial solution is generated by combining the vehicle information, the node information and the path starting point, wherein the initial solution includes multiple candidate paths and a vehicle type corresponding to each candidate path, and each candidate path includes one or more nodes; Based on the intelligent optimization algorithm and the objective function, a destruction operator and a repair operator are selected to destroy and repair the initial solution to obtain a current solution and a current optimal solution; Reselect the destruction operator and the repair operator to destroy and repair the current solution, iterate in a loop, update the current solution and the current optimal solution, and determine the current optimal solution of this round according to the updated current solution and the current optimal solution; the current optimal solution includes multiple target paths and the vehicle type corresponding to each target path.
2. The method according to claim 1, characterized in that The method further comprises: The constraint conditions of the objective function are constructed based on the vehicle information and the node information.
3. The method according to claim 2, characterized in that Constructing the constraint condition of the objective function based on the vehicle information and the node information includes: Acquire the maximum load and maximum load capacity of each vehicle type from the vehicle information, and construct the load constraint and load capacity constraint of the delivery vehicle according to the maximum load and maximum load capacity of each vehicle type; Obtaining the maximum number of nodes and the maximum distance traveled for each type of vehicle from the vehicle information, and constructing the node number constraint and the distance constraint of the delivery vehicle according to the maximum number of nodes and the maximum distance traveled for each type of vehicle; Constructing the constraint of the path starting point according to the vehicle information, wherein the constraint of the path starting point includes that the number of vehicles of each vehicle type departing from the path starting point is less than or equal to the total number of vehicles of each vehicle type; A node constraint is constructed according to the node information, wherein the node constraint includes a vehicle quantity constraint corresponding to the node and a flow balance constraint of the node.
4. The method according to claim 3, characterized in that Constructing the constraint condition of the objective function based on the vehicle information and the node information also includes: Acquire a loading quantity of each vehicle type from the vehicle information, and construct a first scenario constraint according to the loading quantity, wherein the first scenario constraint includes that a loading volume of each vehicle type is greater than or equal to the loading quantity; A loop elimination constraint is constructed, wherein the loop elimination constraint includes eliminating path loops constructed by more than three nodes.
5. The method according to claim 1, characterized in that: According to the initial solution generation method of this round, the initial solution is generated by combining the vehicle information, the node information and the path starting point, including: Obtaining the demand and location of each node from the node information, and obtaining the constraint conditions of each vehicle type from the vehicle information; The distance between any two nodes is calculated based on the position of each node in the node information; For any vehicle, the initial solution is generated according to the starting point of the path, the distance between any two nodes, the demand of each node and the constraint conditions of the vehicle type corresponding to the any vehicle, and combined with the initial solution generation method of this round.
6. The method according to claim 1, characterized in that Select destruction and repair operators, including: Get the score of each destruction operator and the score of each repair operator after the last iteration; Calculate a first weight of each destruction operator according to the score of each destruction operator and the sum of the scores of all destruction operators; Calculating a second weight of each repair operator according to a numerator of each repair operator and a score of each repair operator; A destruction operator and a repair operator are selected according to the first weight and the second weight, respectively.
7. The method according to claim 1, characterized in that Updating the current solution and the current optimal solution, and determining the current optimal solution of this round according to the updated current solution and the current optimal solution, including: Calculate the objective function value of the current solution and the objective function value of the current optimal solution according to the objective function; Selecting a destruction operator and a repair operator to destroy and repair the current solution to obtain a new solution; calculating the objective function value of the new solution according to the objective function; When the objective function value of the new solution is better than the objective function value of the current solution, updating the current solution to the new solution; When the objective function value of the new solution is better than the objective function value of the current optimal solution, updating the current optimal solution to the new solution; When the iteration converges, the new solution is used as the current optimal solution of this round.
8. The method according to claim 1, characterized in that The initial solution generation method is at least one of a random generation method, a nearest neighbor generation method, and a generation method based on a conservation algorithm.
9. A vehicle dispatching path optimization device, characterized in that: include: The acquisition module obtains the node information corresponding to the current station, the starting point of the path, and the vehicle information of various vehicle types; A generation module, which generates an initial solution according to the initial solution generation method of this round, combining the vehicle information, the node information and the path starting point, wherein the initial solution includes multiple candidate paths and a vehicle type corresponding to each candidate path, and each candidate path includes one or more nodes; A determination module selects a destruction operator and a repair operator to destroy and repair the initial solution based on an intelligent optimization algorithm and an objective function, so as to obtain a current solution and a current optimal solution; Reselect the destruction operator and the repair operator to destroy and repair the current solution, iterate in a loop, update the current solution and the current optimal solution, and determine the current optimal solution of this round according to the updated current solution and the current optimal solution; the current optimal solution includes multiple target paths and the vehicle type corresponding to each target path.
10. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
11. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Different-vehicle-type multi-cabin vehicle path planning method and device based on multi-strategy iteration local search
CN119721389A
A method and device for path planning of vehicles with different types and multiple cabins based on multi-strategy iterative local search
CN119721389B
Expressway accident collaborative scheduling optimization method
CN121236912A
