Oil product distribution vehicle path optimization method and device based on solution space compression
By calculating the inventory and sales volume of gas stations to determine demand priorities, and using K-means clustering and genetic algorithms to optimize paths, the problem of low efficiency in oil distribution path planning in the existing technology is solved, and more efficient and accurate distribution path planning is achieved. .
Patent Information
- Application Number
- CN202411037285.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-10-11
AI Technical Summary
Existing oil distribution vehicle route planning methods are difficult to match in active distribution scenarios, the algorithm solution efficiency is low, and it cannot effectively combine customer priorities and divide demand levels under limited resources, resulting in inaccurate and low-efficiency distribution.
Determine the demand and priority of oil products by calculating the inventory and sales of gas stations, use K-means clustering to classify demand points, optimize the path based on genetic algorithm and cross-mutation algorithm, build a distribution path optimization model, and consider oil product distribution Demand, time and loop constraints are used to generate optimal distribution routes.
It improves the efficiency and accuracy of oil distribution route planning, ensures that demand priorities are met under limited resources, and improves the stability of oil supply.
Smart Images

Figure CN118761533A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of route optimization, and more specifically, to a route optimization method and device for oil distribution vehicles based on decompression of spatial compression. Background Art
[0002] The distribution of refined oil products is divided into primary and secondary distribution, among which secondary distribution specifically refers to the process of transporting refined oil products from oil depots to gas stations and certain social customers by road. The secondary distribution of refined oil products is much more difficult to solve than the general vehicle routing problem due to the variety of vehicle models and complex routes. In recent years, more and more oil sales companies have shifted from the "order system" based on experience judgment to the "delivery system" driven by data to achieve accurate resource allocation and reasonable inventory planning.
[0003] Secondary distribution under the active distribution model faces many problems and challenges. Oil sales companies are often responsible for the formulation of distribution plans for multiple regions within their jurisdiction. The characteristics of distribution scenarios are complex, and it is necessary to comprehensively consider objective differences in customer demand, resource distribution, distribution constraints, and other aspects between regions to solve the problem of vehicle path planning for multiple trips, multiple parking lots, and multiple vehicle models. In addition, it is also necessary to consider random reasons such as bad weather, traffic congestion, equipment failure, etc., which lead to delayed arrival of vehicles, delayed replenishment of in-transit oil, insufficient supply of oil resources, and inability to fully meet the needs of gas stations. It can be said that the vehicle path planning model under active distribution must not only be compatible with a variety of complex scenarios, but also weigh the priorities of needs.
[0004] At present, the path planning of oil distribution vehicles is mainly carried out through population algorithms and neighborhood algorithms. Among them, the population algorithm makes the search more efficient and covers as much solution space as possible by referring to the preset action guidelines (such as the fastest descent of the objective function, etc.); the neighborhood algorithm divides the solution space into multiple neighborhoods, and searches for more satisfactory solutions through multiple neighborhoods of the current solution, thereby increasing the search range of the algorithm. Although this can improve the solution quality, it will reduce the solution speed. When dispatchers generate distribution plans for multiple areas, the solution time should also be considered.
[0005] In addition, the current division of gas station demand priorities is mainly aimed at the passive distribution model, and gas stations are clustered and divided into multiple levels based on factors such as geographical location and traffic location. Under this processing method, the gas station demand priority is set to a constant. However, with sales fluctuations and inventory differences, the risk of gas station oil outages is not constant.
[0006] In summary, how to effectively combine proactive delivery with customer priorities, divide demand levels under limited resources, consider multiple trips, multiple parking lots, multiple vehicle models and delivery accuracy, build an optimization model with richer compatible scenarios, and design a more efficient solution algorithm is an urgent problem to be solved. Summary of the invention
[0007] In view of this, the present application provides a path optimization method and device for oil distribution vehicles based on solution space compression, which is used to solve the problem that the existing oil distribution vehicle path planning method cannot match the active distribution scenario and the algorithm has low efficiency in solving the distribution vehicle path.
[0008] To achieve the above objectives, the proposed solution is as follows:
[0009] A method for optimizing the path of an oil product distribution vehicle based on solution space compression, comprising:
[0010] The inventory-to-sales ratio of each oil tank is calculated based on the inventory and sales volume of the gas station, and the demand and demand priority of each type of oil product are determined. When the oil tank inventory cannot meet the sales demand, the demand priority is the first priority; when the oil tank inventory can meet the sales demand, the demand priority is the second priority;
[0011] Construct a distribution path optimization model, where the path optimization model includes oil distribution demand constraints, distribution time constraints, loop constraints and objective functions;
[0012] Taking the oil depot as the cluster center and the gas station as the demand point, the demand points are clustered by K-means clustering, and the cluster center is used as the starting point to plan the paths of different types of delivery vehicles, and the path subsets that meet the corresponding constraints in the path optimization model are obtained, where the path subsets correspond to the delivery vehicle categories;
[0013] Based on the genetic algorithm, the routes in each route subset are matched with the delivery vehicles that meet the conditions of the route optimization model to obtain the initial solution;
[0014] Change the order of vehicles, optimize the initial solution based on the crossover mutation algorithm, calculate the fitness of each solution, retain the population with small fitness, and output the optimal delivery route until the preset end conditions are met.
[0015] Preferably, the inventory-to-sales ratio of each oil tank is calculated based on inventory and sales volume, and the demand and demand priority of each type of oil product are determined, including:
[0016] The sales volume of each tank at the gas station is estimated by exponential smoothing method;
[0017] Calculate the inventory-to-sales ratio of oil products of different demand categories based on the inventory and sales of each oil tank, where the demand categories include oil tank accuracy and oil product accuracy;
[0018] Demand priority and demand quantity are determined based on the inventory-to-sales ratio and sales demand of each type of oil product.
[0019] Preferably, constructing a distribution path optimization model includes:
[0020] According to the constraint relationship between the distribution volume and the demand volume, the oil distribution demand constraint of the gas station is constructed;
[0021] According to the constraints between the oil depot oil pick-up time, gas station oil unloading time, delivery vehicle arrival time, gas station oil unloading time and oil stabilization time, the delivery time constraint of the delivery vehicle is constructed;
[0022] Determine the penalty cost based on the delivery volume and the demand volume corresponding to the first priority, and construct the objective function based on the penalty cost and the transportation cost;
[0023] Based on the travel relationship between gas stations, the loop constraints of the delivery vehicle are constructed.
[0024] Preferably, the oil depot is used as the cluster center and the gas station is used as the demand point. K-means clustering is performed to cluster the demand points, and the cluster center is used as the starting point to perform path planning for different types of delivery vehicles, including:
[0025] Taking gas stations as demand points, the distance between every two demand points is calculated based on the geographical coordinates of the demand points and the inventory-to-sales ratio to obtain a distance set;
[0026] Taking the oil depot as the cluster center, the cluster center to which each demand point belongs is determined in descending order of the distance between each demand point and each cluster center;
[0027] Taking the cluster center as the starting point, path planning is performed for different types of delivery vehicles to obtain path subsets that meet the corresponding constraints in the path optimization model. The delivery vehicle categories include single warehouse, two warehouses, three warehouses and above.
[0028] Preferably, the distance between every two demand points is calculated according to the geographical coordinates of the demand points and the inventory-to-sales ratio, including:
[0029] pass Calculate the distance between each demand point, where the geographic coordinates of demand points i and j are (γ i , δ i ) and (γ j , δ j ), are the inventory-to-sales ratios of demand points i and j respectively, and χ is the weight of the difference in inventory-to-sales ratios.
[0030] Preferably, the cluster center is used as the starting point to perform path planning for delivery vehicles of different categories, and path subsets satisfying the corresponding constraints in the path optimization model are obtained, including:
[0031] If the delivery vehicle is a single warehouse, the route planning for the single warehouse tanker is performed based on the delivery time constraint in the route optimization model;
[0032] If the delivery vehicle has two warehouses, the path planning for the two-warehouse tanker is performed based on the oil product constraints and the delivery time constraints in the optimization model;
[0033] If the delivery vehicle has three warehouses or more, the route planning for the delivery vehicle is performed based on the oil product constraints and the delivery time constraints and loop constraints in the route optimization model.
[0034] Preferably, matching the paths in each path subset with a delivery vehicle that meets the path optimization model conditions for delivery based on a genetic algorithm includes:
[0035] Encode the chromosomes, where one chromosome represents a vehicle sorting;
[0036] Based on the number of warehouses of the delivery vehicle, the vehicle order is randomly generated, and the delivery vehicle selects the paths that meet the constraints of the path optimization model from each path subset to fill in the chromosome to obtain the initial solution;
[0037] Preferably, the order of vehicles is changed, the initial solution is optimized based on the crossover mutation algorithm, the fitness of each solution is calculated, and the population with a small fitness is retained, including:
[0038] Changing the order of vehicles without changing the vehicle numbers or quantities;
[0039] Based on subpath crossing and chromosome segment reversal, the initial solution is optimized to obtain the optimal solution;
[0040] Calculate the fitness of each optimization solution based on the objective function in the path optimization model;
[0041] The population with small fitness is retained for iteration until the preset end condition is met, and the optimal delivery path is output. The end condition is that the number of selection generations reaches the preset number or the fitness is lower than the preset threshold.
[0042] A route optimization device for an oil product distribution vehicle based on decompression space compression, comprising:
[0043] The demand calculation unit is used to calculate the inventory-to-sales ratio of each oil tank according to the inventory and sales volume of the gas station, and determine the demand and demand priority of each type of oil product. When the oil tank inventory cannot meet the sales demand, the demand priority is the first priority, and when the oil tank inventory can meet the sales demand, the demand priority is the second priority;
[0044] A model building unit, used to build a distribution path optimization model, wherein the path optimization model includes oil distribution demand constraints, distribution time constraints, loop constraints and objective functions;
[0045] The clustering unit is used to cluster the demand points using the oil depot as the cluster center and the gas station as the demand point, and perform K-means clustering to cluster the demand points. The cluster center is used as the starting point to plan the paths of different types of delivery vehicles, and the path subsets that meet the corresponding constraints in the path optimization model are obtained, where the path subsets correspond to the types of delivery vehicles.
[0046] A path planning unit is used to match the paths in each path subset with a delivery vehicle that meets the path optimization model conditions based on a genetic algorithm to obtain an initial solution;
[0047] The path optimization unit is used to change the order of vehicles, optimize the initial solution based on the crossover mutation algorithm, calculate the fitness of each solution, retain the population with small fitness, and output the optimal delivery path until the preset end conditions are met.
[0048] It can be seen from the above technical solutions that the path optimization method for oil distribution vehicles based on solution space compression provided by this application calculates the inventory-to-sales ratio of each oil tank according to the inventory and sales volume of the gas station, and determines the demand and demand priority of each type of oil; clusters the demand points through K-means clustering, and uses the cluster center as the starting point to plan the paths of distribution vehicles of different categories, and obtains each path subset that meets the corresponding constraints in the path optimization model; distributes the distribution vehicles that meet the conditions of the path optimization model based on the genetic algorithm for path matching; optimizes the initial solution based on the crossover mutation algorithm, calculates the fitness of each solution, retains the population with small fitness, and outputs the optimal distribution path. This application adopts different constraints according to the different categories of distribution vehicles. The search range is limited based on the category of the vehicle, and a feasible solution is generated in a smaller solution space to avoid repeated iterations of invalid constraints. Then, solutions of different categories are combined to improve the solution efficiency of the algorithm.
[0049] The distribution method of the present application takes demand priority into consideration during distribution, and utilizes limited resources to maximize the stability of oil supply. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0051] Figure 1 A flow chart of a method for optimizing the path of an oil distribution vehicle based on decompression space provided in an embodiment of the present application;
[0052] Figure 2 A schematic diagram of chromosome encoding provided in an embodiment of the present application;
[0053] Figure 3 A schematic diagram of a crossover mutation algorithm provided in an embodiment of the present application;
[0054] Figure 4 A schematic diagram of a loop constraint mechanism provided in an embodiment of the present application;
[0055] Figure 5 A schematic structural diagram of a route optimization device for oil distribution vehicles based on decompression of spatial compression provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0057] First, combine Figure 1 The route optimization method for oil product distribution vehicles based on decompression space compression provided in the embodiment of the present application is shown in FIG1 , and the method includes:
[0058] Step S01, calculate the inventory-to-sales ratio of each oil tank based on the inventory and sales volume of the gas station, and determine the demand and demand priority of each type of oil product.
[0059] Specifically, the present application takes into account the situation where the supply of oil products is limited, and calculates the priority of the demand for each oil product at the gas station based on the inventory and demand of each oil product in the gas station.
[0060] First, the sales volume of each oil tank at the gas station is estimated by the exponential smoothing method. Then, the inventory-to-sales ratio of oil products of different demand categories is calculated based on the inventory and sales volume of each oil tank. This application divides the demand into oil tank accuracy and oil product accuracy according to the distribution accuracy. The oil tank accuracy is accurate to the oil tank, and the inventory-to-sales ratio and demand need to be determined based on the sales volume and inventory of each oil tank; the oil product accuracy is because the oil tanks storing the same category of oil products can be called at will, so the sales volume, inventory and other information corresponding to the oil tanks with the same product number need to be integrated and regarded as one tank (called a pseudo tank), and then the inventory-to-sales ratio and demand of the pseudo tank are calculated. The inventory of the oil tank is divided by the sales volume to get the inventory-to-sales ratio d under the oil tank accuracy. np , the inventory and sales volume corresponding to the oil tanks storing the same oil product are integrated and divided to obtain the inventory-to-sales ratio D of various oil products under oil product accuracy. np .
[0061] Determine the demand priority and demand quantity based on the inventory-to-sales ratio and sales demand of each type of oil product. Sales demand is whether the inventory of the oil product can be sold for δ days. It proves that the inventory of the oil product cannot meet the sales demand of the gas station after δ days, and it must be replenished. The demand priority of the oil product is the first priority. At this time, the demand for the oil product is at least equal to the sales volume of δ-d days; if It proves that the inventory of the oil product can meet the sales demand of the gas station after δ days. At this time, if the oil product resources are sufficient, the oil tank can be filled to meet the sales demand for a longer period of time. At this time, the demand priority of the oil product is the second priority. At this time, the calculation of the oil product demand is as follows:
[0062]
[0063] in, is the inventory-to-sales ratio of oil tank g of oil product p at gas station n, is the demand for oil tank g filled with oil product p at gas station n, ω is the total supply of the oil depot, and the total demand for oil tanks must not exceed the total supply of the oil depot. For variables, when hour is 1, otherwise it is 0. is the sales volume of oil tank g containing oil product p at gas station n, is the empty capacity of the oil tank g filled with oil product p at gas station n, P is the set of oil products, P = {p|p = 1, 2, 3, ..., P'}, N is the set of regional gas stations, N = {n|n = 1: 2, 3, ..., N'}, G np = {g np |g np =1, 2, 3, ..., G′ np}.
[0064] Step S02: construct a distribution path optimization model.
[0065] Specifically, first, based on the constraint relationship between the delivery volume and the demand volume, the oil product delivery demand constraint of the gas station is constructed. The delivery volume of the gas station should not be less than the demand volume and not greater than the tank capacity. Therefore, under the requirements of the delivery accuracy of the tank and the oil product, the delivery volume of the gas station should meet the following formulas (3)-(4).
[0066]
[0067] Where K is the set of delivery vehicles, K = {k|k = 1; 2, 3, ...; K'}. A is the set of regional distribution networks, A = {M∪N}, and M is the set of oil depots in the region, M = {m|m = 1, 2, 3, ..., M'}. is the storage capacity of the vehicle k’s compartment c. If the oil tank g can be taken from the oil depot m by vehicle k and delivered, then is 1, otherwise it is 0. If vehicle k picks up oil from tank m and drives to node j, then is 1, otherwise it is 0. If vehicle k of oil depot m travels from node i to node j, then is 1, otherwise it is 0. If the demand for tank g is delivered by vehicle k’s warehouse u, then is 1, otherwise it is 0. If gas station n needs to distribute oil according to the accuracy of oil products (pseudo tank), then l n is 1 if the value is true, otherwise it is 0.
[0068] Formula (3) shows that when l n = 0, the delivery volume of oil tank g of oil product p at gas station n should not exceed the empty capacity of the oil tank; l n = 1, the total delivery volume of oil product p at gas station n should not exceed the total empty capacity of all tanks storing the oil product. Formula (4) shows that when l n = 0, the delivery volume of the tank g at gas station n, which is filled with oil product p, should meet the demand for the tank; when l n =1, the total delivery volume of oil product p at gas station n should meet the total demand for this oil product at the gas station.
[0069] Secondly, according to the constraints between the oil depot oil picking time, gas station oil unloading time, delivery vehicle arrival time, gas station oil unloading time and oil stabilization time, the delivery time constraint of the delivery vehicle is constructed. The time when the delivery vehicle arrives at the oil depot to pick up oil should be within the oil depot oil picking time window, and the time when the delivery vehicle arrives at the gas station and the time after the delivery vehicle completes oil unloading should be within the gas station oil unloading time window.
[0070] Secondly, the penalty cost is determined based on the delivery volume and the demand volume corresponding to the first priority, and the objective function is constructed based on the penalty cost and transportation cost. In order to reduce the risk of gas station outages and ensure that more urgent demands are met first, the penalty cost is set. In addition, the transportation cost cij should be minimized as much as possible. The objective function is constructed based on the penalty cost and the transportation cost as shown in the following formula (5):
[0071]
[0072] Among them, formula (5) indicates that the total cost of the distribution plan should be as small as possible, where the penalty cost is the difference between the total distribution volume and the first priority demand volume. The larger the difference, the lower the first priority demand satisfaction rate of the distribution plan, and the more severe the penalty. Among them, b is a constant used to balance the order of magnitude of the penalty cost.
[0073] Finally, it is necessary to construct loop constraints for delivery vehicles based on the travel relationship between gas stations. To alleviate the problem of too many constraints causing slow solution speed, some constraints with low trigger probability are not considered during solution. After the solution is generated, it is judged again. If it does not meet the constraints, the solution is regenerated. If it meets the constraints, it is retained. This type of constraint is called lazy constraint. Loop constraints can be regarded as lazy constraints. In order to prevent the delivery path of the delivery vehicle from forming a loop between two gas stations, resulting in waste of resources. Loop constraints can be performed using the following formula (6).
[0074]
[0075] Formula (6) indicates that there is at most one-way trip between any two gas stations, and the number of trips between them cannot be greater than 1.
[0076] A path optimization model is constructed based on the above-mentioned distribution demand constraints, distribution time constraints, loop constraints and objective functions, wherein the path optimization model includes the above-mentioned formulas (1)-(6) and the following formulas (7)-(15).
[0077]
[0078]
[0079] in, is the number of vehicles that can pick up oil product p from oil depot m every day. ms , t mf ] is the time window in which oil tank m can extract oil; [t ns , t nf ] is the time window in which gas station n can unload oil; is the time when vehicle k arrives at tank m; is the time when vehicle k arrives at gas station n; ut n is the unloading time of gas station n; st n is the stable oil time of gas station n; J kmin The minimum number of trips for vehicle k; J kmax The maximum number of trips for vehicle k;
[0080] Formula (7) indicates that the number of vehicles that pick up oil product p at oil depot m cannot exceed the number of vehicles that can deliver oil to oil depot m for this type of oil. Formula (8) indicates that vehicle k is prevented from driving from one oil depot to another. Formula (9) indicates that the start time of vehicle k must be within the oil pick-up time of oil depot m. Formula (10) indicates that the service time of gas station n must be within the working time window. Formula (11) indicates that the total number of trips of the vehicle per day shall not be less than the minimum number of trips of the vehicle and shall not exceed the maximum number of trips. Formula (12) indicates that the number of vehicles entering the node is equal to the number of vehicles leaving the node j. Formulas (13)-(15) represent the value constraints of decision variables.
[0081] Step S03, taking the oil depot as the cluster center and the gas station as the demand point, clustering the demand points through K-means clustering, and taking the cluster center as the starting point to plan the paths for delivery vehicles of different categories.
[0082] Specifically, the inventory-to-sales ratio and geographic coordinates of each gas station are imported to construct a coordinate system; n cluster centers are generated with the oil depot as the center. The gas station is the demand point. Before each plan is made to initialize the path subset, the inventory-to-sales ratio of each gas station is first determined. Taking the gas station as the demand point, the distance between each two demand points is calculated based on the geographic coordinates and inventory-to-sales ratio of the demand point to obtain a distance set. This application not only takes into account the spatial position relationship between each demand point, but also the inventory-to-sales ratio of each demand point. Through Calculate the distance between each demand point, where the geographic coordinates of demand points i and j are (γ i , δ i ) and (γ j , δ j ), are the inventory-to-sales ratios of demand points i and j respectively, and χ is the weight of the difference in inventory-to-sales ratios.
[0083] Taking the oil depot as the cluster center, the cluster center to which each demand point belongs is determined in descending order of the distance between each demand point and each cluster center. The demand points are sorted in descending order of the closest distance to the cluster center and assigned to the cluster center in turn. If the time window between the demand point and the nearest cluster center satisfies [t ns , t nf ]∈[t ms , t mf ], it is directly assigned; otherwise, the next closest cluster center is searched until the time window constraint is met.
[0084] Taking the cluster center as the starting point, the paths of different categories of delivery vehicles are planned to obtain path subsets that meet the corresponding constraints in the path optimization model, where the path subsets correspond to the categories of delivery vehicles, including single warehouse, two warehouses, three warehouses and above. In order to avoid searching invalid solution space, the vehicle set is divided into multiple subsets according to the number of warehouses. Then, according to the detection factor RCi that delivery vehicles with different numbers of warehouses need to meet, the detection factor is the constraint in the path optimization model. Taking the cluster center as the starting point, determine the delivery path that meets the corresponding constraints in the path optimization model, and obtain the path subsets of each category of delivery vehicles. The constraints that different categories of delivery vehicles meet are shown in Table 1:
[0085] Table 1
[0086]
[0087] Since the delivery truck is prohibited from mixing gasoline and diesel during the delivery of refined oil, that is, it can only deliver one full truck of gasoline or one full truck of diesel. Therefore, the multi-warehouse truck should meet the oil type constraint on the basis of meeting the corresponding constraints in the path optimization model.
[0088] Step S04, matching the routes in each route subset with a delivery vehicle that meets the route optimization model conditions for delivery based on a genetic algorithm.
[0089] Specifically, there are multiple chromosomes in the population, and each chromosome represents a vehicle sorting. Assume that the maximum number of compartments for a vehicle is a, the maximum number of trips is c, and the number of vehicles is K. The length of the encoding structure is (a+1)*c+1, and the width is a+2, such as Figure 2 shown.
[0090] Based on the number of warehouses of the delivery vehicle, the vehicle sequence is randomly generated, and the paths that meet the constraints of the path optimization model are selected from each path subset for the delivery vehicle to fill in the chromosome to obtain the initial solution. Based on the encoding, the optimal distribution plan is generated. Specifically, based on the number of warehouses of the delivery vehicle, the vehicle sequence is randomly generated, and the path information that meets the constraints is selected for the tank truck to fill in the chromosome to generate the initial solution. The main steps are as follows:
[0091] (1) Screening The path ensures that the full tank of oil can be unloaded;
[0092] (2) Select minσ according to the following formula l (The average inventory-to-sales ratio of demand is the smallest) path, and fill the information into the corresponding position of the delivery vehicle;
[0093]
[0094] Where, σ is the mean of the inventory-to-sales ratio of all demands in step (1), and maxi represents the number of demands in step (1), i.e., the total inventory-to-sales ratio / the number of demands;
[0095] (3) Calculate vehicle delivery time;
[0096] (4) Determine whether the delivery time exceeds the working time. If it exceeds the working time, select the next smallest σ and fill the path into the chromosome until the delivery time constraint is met. Otherwise, continue to execute steps (1) to (3) for subsequent vehicles according to the vehicle sequence until the first trip of all delivery vehicles is matched.
[0097] (5) Determine whether all vehicles meet the trip constraint (Formula 11) or all first-priority demands are met. If not, update the resources, that is, calculate the remaining capacity after the delivery vehicle meets the execution demand. Based on the remaining capacity, return to steps (1) to (5) until the above conditions are met, and output the initial solution.
[0098] Step S05, change the order of vehicles, optimize the initial solution based on the crossover mutation algorithm, calculate the fitness of each solution, retain the population with small fitness, and output the optimal delivery path until the preset end condition is met.
[0099] Specifically, to avoid infeasible solutions, only the order of vehicles is changed during crossover and mutation, without changing the vehicle number and quantity, thereby ensuring that all offspring are feasible solutions. The crossover operator selects subpath crossover, and the mutation operator selects chromosome segment reversal. The schematic diagram of the process of subpath crossover and chromosome segment reversal is shown in Figure 3 As shown. Based on subpath crossing and chromosome segment reversal, the initial solution is optimized to obtain the optimized solution. The optimization goal is to select the chromosome with the minimum fitness value. The fitness of each optimized solution is calculated based on the objective function in the path optimization model. The fitness of each optimized solution is calculated according to the following formula (16).
[0100]
[0101] The population with small fitness is retained for iteration, and the above steps are repeated continuously until the preset end condition is met, and the optimal delivery path is output. The end condition is that the number of iterations reaches the preset number or the fitness is lower than the preset threshold.
[0102] The path optimization method for oil product distribution vehicles based on solution space compression provided in the embodiment of the present application calculates the inventory-to-sales ratio of each oil tank according to the inventory and sales volume of the gas station, determines the demand and demand priority of each type of oil product; clusters the demand points through K-means clustering, and uses the cluster center as the starting point to plan the paths for distribution vehicles of different categories, and obtains each path subset that meets the corresponding constraints in the path optimization model; matches the paths with distribution vehicles that meet the conditions of the path optimization model based on the genetic algorithm for distribution; optimizes the initial solution based on the crossover mutation algorithm, calculates the fitness of each solution, retains the population with small fitness, and outputs the optimal distribution path. The embodiment of the present application adopts different constraints according to the different categories of distribution vehicles. The search range is limited based on the category of the vehicle, and a feasible solution is generated in a smaller solution space to avoid repeated iterations of invalid constraints. Then, solutions of different categories are combined to improve the solution efficiency of the algorithm.
[0103] The distribution method of the embodiment of the present application takes demand priority into consideration during distribution and utilizes limited resources to maximize the stability of oil supply.
[0104] Next, the embodiment of the present application introduces the process of planning the paths of different types of delivery vehicles using the cluster center as the starting point in step S03, and the process is as follows:
[0105] If the delivery vehicle is a single warehouse, the route planning for the single warehouse tanker is performed based on the delivery time constraint in the route optimization model. The specific process is as follows:
[0106] ①RC is used to detect the oil depot mind ij The demand point is checked to see whether its delivery time meets the node working time window. If it does, it means that the demand has passed the RC test and can form a path with the originating oil depot; if it fails to pass the test, the demand is ignored and the above steps are repeated until it passes the test. The delivery vehicle arrival time is calculated as shown in the following formula (17):
[0107]
[0108] Formula (17) indicates that the time for the delivery vehicle to arrive at the gas station is the sum of the driving time and the time for picking up oil, unloading oil, and stabilizing oil. The latest arrival time is the gas station closing time (latest unloading time).
[0109] ② Repeat step ① and put the paths that pass the test into the path subset until the number of subset elements is equal to the number of single-bin vehicles.
[0110] If the delivery vehicle has two warehouses, the path planning for the two-warehouse tanker is performed based on the oil product constraints and the delivery time constraints in the optimization model. Compared with the single-warehouse vehicle, in addition to the delivery time constraints, the multi-warehouse vehicle also needs to meet the oil product type constraints to ensure that the oil products in each warehouse meet the category requirements. Therefore, this application uses a warehouse-by-warehouse matching method to generate the delivery path of the multi-warehouse vehicle. The specific process is as follows:
[0111] ①Select mind ij The demand is to fill in warehouse one and warehouse two.
[0112] ②RC1 is used to detect whether the oil types in the two warehouses meet the category requirements. If they are consistent, the RC1 test passes and proceeds to the RC2 test; otherwise, the warehouse 2 task is adjusted and the above steps are repeated until the test passes.
[0113] ③RC2 is used to detect whether the vehicle delivery time meets the node working time window. If it is within the working time, it means that the demand has passed the RC2 test and can form a path with the originating oil depot; if it fails to pass the test, the demand is ignored and step ② is repeated until it passes the test.
[0114] ④ Repeat steps ① to ③ and put the paths that pass the test into the path subset until the number of elements in the path subset is equal to the number of cars in the two warehouses.
[0115] If the delivery vehicle has three warehouses or more, the route planning for the delivery vehicle is based on the oil product constraints and the delivery time constraints and loop constraints in the route optimization model. Compared with the two-warehouse vehicle, in addition to the delivery time constraints and oil product type constraints, the three-warehouse and above delivery vehicles also need to meet the loop constraints. Based on the above two-warehouse vehicle, after obtaining the initial path, it is also necessary to determine whether there is a loop in the planned path. If there is a loop, adjust the corresponding demand of the vehicle warehouse to break the circle. The mechanism of action is as follows: Figure 4 The judgment process is as follows:
[0116] ① Generate an initial path;
[0117] ② Calculate the |y between the demand points on the path i -γ j |+|δ i -δ j |, if min(|γ i -γ j |+|δ i -δ j |)=0 and i+1≠j, it means there is a loop, then the demand point j and the demand point i+1 positions are swapped and output to the path subset; otherwise, it is directly output to the path subset.
[0118] ③ Repeat steps ①② and put the paths that pass the detection into the path subset until the number of elements is equal to the number of delivery vehicles.
[0119] The embodiment of the present application adopts different constraints according to the different categories of delivery vehicles. The search scope is limited based on the category of the vehicle, and feasible solutions are generated in a smaller solution space to avoid repeated iterations of invalid constraints. Then, solutions of different categories are combined to improve the efficiency of the algorithm.
[0120] The following is a description of a path optimization device for an oil distribution vehicle based on decompression of spatial compression provided in an embodiment of the present application. The path optimization device for an oil distribution vehicle based on decompression of spatial compression described below and the path optimization method for an oil distribution vehicle based on decompression of spatial compression described above can be referenced to each other.
[0121] First combine Figure 5 , the path optimization device of oil distribution vehicles based on solution space compression is introduced, such as Figure 5 As shown, the route optimization device for oil product distribution vehicles based on decompression space compression may include:
[0122] The demand calculation unit 100 is used to calculate the inventory-to-sales ratio of each oil tank according to the inventory and sales volume of the gas station, and determine the demand and demand priority of each type of oil product, wherein when the oil tank inventory cannot meet the sales demand, the demand priority is the first priority, and when the oil tank inventory can meet the sales demand, the demand priority is the second priority;
[0123] The model building unit 200 is used to build a distribution path optimization model, wherein the path optimization model includes oil distribution demand constraints, distribution time constraints, loop constraints and objective functions;
[0124] The clustering unit 300 is used to cluster the demand points by using the oil depot as the cluster center and the gas station as the demand point, and to perform K-means clustering on the demand points, and to perform path planning on the delivery vehicles of different categories by using the cluster center as the starting point, so as to obtain each path subset that satisfies the corresponding constraint conditions in the path optimization model, wherein the path subset corresponds to the delivery vehicle category;
[0125] A path planning unit 400 is used to match the paths in each path subset with a delivery vehicle that meets the path optimization model conditions for delivery based on a genetic algorithm to obtain an initial solution;
[0126] The path optimization unit 500 is used to change the order of vehicles, optimize the initial solution based on the crossover mutation algorithm, calculate the fitness of each solution, retain the population with a small fitness, and output the optimal delivery path until the preset end condition is met.
[0127] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
[0128] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0129] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A route optimization method for oil distribution vehicles based on solution space compression, It is characterized in that include: The inventory-to-sales ratio of each oil tank is calculated based on the inventory and sales volume of the gas station, and the demand and demand priority of each type of oil product are determined. When the oil tank inventory cannot meet the sales demand, the demand priority is the first priority; when the oil tank inventory can meet the sales demand, the demand priority is the second priority; Construct a distribution path optimization model, where the path optimization model includes oil distribution demand constraints, distribution time constraints, loop constraints and objective functions; Taking the oil depot as the cluster center and the gas station as the demand point, the demand points are clustered by K-means clustering, and the cluster center is used as the starting point to plan the paths of different types of delivery vehicles, and the path subsets that meet the corresponding constraints in the path optimization model are obtained, where the path subsets correspond to the delivery vehicle categories; Based on the genetic algorithm, the routes in each route subset are matched with the delivery vehicles that meet the conditions of the route optimization model to obtain the initial solution; Change the order of vehicles, optimize the initial solution based on the crossover mutation algorithm, calculate the fitness of each solution, retain the population with small fitness, and output the optimal delivery route until the preset end conditions are met.
2. The route optimization method for oil product distribution vehicles based on decompression space compression according to claim 1, It is characterized in that Calculate the inventory-to-sales ratio of each oil tank based on inventory and sales volume, and determine the demand and demand priority of each type of oil product, including: The sales volume of each tank at the gas station is estimated by exponential smoothing method; Calculate the inventory-to-sales ratio of oil products of different demand categories based on the inventory and sales of each oil tank, where the demand categories include oil tank accuracy and oil product accuracy; Demand priority and demand quantity are determined based on the inventory-to-sales ratio and sales demand of each type of oil product.
3. The route optimization method for oil product distribution vehicles based on decompression space compression according to claim 1, It is characterized in that Build a delivery route optimization model, including: According to the constraint relationship between the distribution volume and the demand volume, the oil distribution demand constraint of the gas station is constructed; According to the constraints between the oil depot oil pick-up time, gas station oil unloading time, delivery vehicle arrival time, gas station oil unloading time and oil stabilization time, the delivery time constraint of the delivery vehicle is constructed; Determine the penalty cost based on the delivery volume and the demand volume corresponding to the first priority, and construct the objective function based on the penalty cost and the transportation cost; Based on the travel relationship between gas stations, the loop constraints of the delivery vehicle are constructed.
4. The method for optimizing the route of oil distribution vehicles based on decompression of space according to claim 1, It is characterized in that Taking the oil depot as the cluster center and the gas station as the demand point, K-means clustering is performed to cluster the demand points, and the cluster center is used as the starting point to plan the paths of different types of delivery vehicles, including: Taking gas stations as demand points, the distance between every two demand points is calculated based on the geographical coordinates of the demand points and the inventory-to-sales ratio to obtain a distance set; Taking the oil depot as the cluster center, the cluster center to which each demand point belongs is determined in descending order of the distance between each demand point and each cluster center; Taking the cluster center as the starting point, path planning is performed for different types of delivery vehicles to obtain path subsets that meet the corresponding constraints in the path optimization model. The delivery vehicle categories include single warehouse, two warehouses, three warehouses and above.
5. The route optimization method for oil product distribution vehicles based on decompression of space according to claim 4, It is characterized in that Calculate the distance between every two demand points based on the geographic coordinates of the demand points and the inventory-to-sales ratio, including: pass Calculate the distance between each demand point, where the geographic coordinates of demand points i and j are (γ i , δ i ) and (y j , δ j ), are the inventory-to-sales ratios of demand points i and j respectively, and χ is the weight of the difference in inventory-to-sales ratios.
6. The method for optimizing the route of oil distribution vehicles based on decompression of space according to claim 4, It is characterized in that Taking the cluster center as the starting point, we plan the routes for different types of delivery vehicles and obtain the route subsets that meet the corresponding constraints in the route optimization model, including: If the delivery vehicle is a single warehouse, the route planning for the single warehouse tanker is performed based on the delivery time constraint in the route optimization model; If the delivery vehicle has two warehouses, the path planning for the two-warehouse tanker is performed based on the oil product constraints and the delivery time constraints in the optimization model; If the delivery vehicle has three warehouses or more, the route planning for the delivery vehicle is performed based on the oil product constraints and the delivery time constraints and loop constraints in the route optimization model.
7. The method for optimizing the route of oil distribution vehicles based on decompression of space according to claim 1, It is characterized in that Based on the genetic algorithm, the routes in each route subset are matched with the delivery vehicles that meet the conditions of the route optimization model for delivery, including: Encode the chromosomes, where one chromosome represents a vehicle sorting; Based on the number of warehouses of the delivery vehicle, the vehicle order is randomly generated, and the delivery vehicles select the paths that meet the constraints of the path optimization model from each path subset to fill in the chromosome to obtain the initial solution.
8. According to the method for optimizing the route of oil distribution vehicles based on solution space compression in claim 1, the order of vehicles is changed, the initial solution is optimized based on the crossover mutation algorithm, the fitness of each solution is calculated, and the population with small fitness is retained. include: Changing the order of vehicles without changing the vehicle numbers or quantities; Based on subpath crossing and chromosome segment reversal, the initial solution is optimized to obtain the optimal solution; Calculate the fitness of each optimization solution based on the objective function in the path optimization model; The population with small fitness is retained for iteration until the preset end condition is met, and the optimal delivery path is output. The end condition is that the number of iterations reaches the preset number or the fitness is lower than the preset threshold.
9. A route optimization device for oil distribution vehicles based on decompression space compression, It is characterized in that include: The demand calculation unit is used to calculate the inventory-to-sales ratio of each oil tank according to the inventory and sales volume of the gas station, and determine the demand and demand priority of each type of oil product. When the oil tank inventory cannot meet the sales demand, the demand priority is the first priority, and when the oil tank inventory can meet the sales demand, the demand priority is the second priority; A model building unit, used to build a distribution path optimization model, wherein the path optimization model includes oil distribution demand constraints, distribution time constraints, loop constraints and objective functions; The clustering unit is used to cluster the demand points using the oil depot as the cluster center and the gas station as the demand point, and perform K-means clustering to cluster the demand points. The cluster center is used as the starting point to plan the paths of different types of delivery vehicles, and the path subsets that meet the corresponding constraints in the path optimization model are obtained, where the path subsets correspond to the types of delivery vehicles. A path planning unit is used to match the paths in each path subset with a delivery vehicle that meets the path optimization model conditions based on a genetic algorithm to obtain an initial solution; The path optimization unit is used to change the order of vehicles, optimize the initial solution based on the crossover mutation algorithm, calculate the fitness of each solution, retain the population with small fitness, and output the optimal delivery path until the preset end conditions are met.
Citation Information
Cited By
Two-stage vehicle transportation scheme solving method under speed time varying based on heuristic algorithm
CN119599544A
Path planning method for transportation of bulk edible oil tank truck
CN120806321A
A path planning method for bulk edible oil tank truck transportation
CN120806321B
