Tobacco logistics real-time distribution line optimization method and system

By improving the K-Means clustering and TSP algorithms, combined with the GLS algorithm, the tobacco logistics distribution routes are dynamically optimized, which solves the problems of static route planning and insufficient computational efficiency, and realizes real-time and globally optimized distribution route generation.

CN120745979APending Publication Date: 2025-10-03SHANDONG INSPUR DIGITAL BUSINESS TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510886589.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

The existing tobacco logistics distribution route planning is static, relies on manual experience and has insufficient computational efficiency. It cannot dynamically respond to fluctuations in order volume and changes in vehicle status, resulting in a failure to meet real-time requirements.

Method used

An improved K-Means clustering algorithm and the traveling salesman problem (TSP) algorithm are combined with the guided local search (GLS) algorithm to dynamically generate the optimal distribution area and path. The distribution route is optimized through real-time road network data and dynamic allocation is performed in combination with vehicle resource constraints.

Benefits of technology

It realizes the dynamic generation of optimal distribution routes based on real-time data, reduces the average distribution distance and time, improves computing efficiency and global optimization capabilities, and meets the real-time requirements of tobacco logistics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120745979A_ABST
    Figure CN120745979A_ABST
Patent Text Reader

Abstract

The invention discloses a tobacco logistics real-time distribution route optimization method and system, and belongs to the technical field of logistics distribution optimization, and the method comprises the steps: obtaining order data, vehicle data, retailer geographic information and real-time road network data in real time; an improved K-Means clustering algorithm is adopted to dynamically cluster retailers, a plurality of distribution areas are generated, and constraints of the upper and lower bounds of the number of distribution households and the upper and lower bounds of the distribution amount are introduced in the clustering process; calculating the geometric center of each distribution area, and generating a global optimal path between the areas based on a traveling salesman problem algorithm; carrying out real-time path planning on retailers in each distribution area by adopting a two-stage optimization algorithm; and according to the vehicle loading capacity and the maximum number of delivery households, distribution tasks are dynamically distributed, and a distribution line on that day is generated. According to the method, the optimal route can be generated in real time according to the order, the vehicle state and the retailer position of the day, cross-vehicle and cross-region order-vehicle matching is realized, and the calculation complexity is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of logistics distribution optimization, in particular to a method and system for optimizing tobacco logistics real-time distribution routes. Background Art

[0002] At present, the tobacco logistics distribution routes have the following problems:

[0003] 1. Fixed route allocation: Existing technologies typically use static route planning, pre-binding retailers to fixed vehicles and routes. This makes it impossible to dynamically respond to fluctuations in order volume, changes in vehicle status (such as failures), or traffic anomalies.

[0004] 2. Dependence on manual experience: Route adjustments rely on the dispatcher’s experience, which is inefficient and difficult to ensure global optimization.

[0005] 3. Insufficient computing efficiency: Traditional algorithms (such as genetic algorithms and conservation algorithms) have response delays in large-scale real-time computing and cannot meet daily dynamic needs. Summary of the Invention

[0006] The technical task of the present invention is to address the above shortcomings and provide a tobacco logistics real-time distribution route optimization method and system, which can generate the optimal route in real time based on the day's orders, vehicle status, and retailer location, realize cross-vehicle and cross-regional order-vehicle matching, reduce computational complexity, and meet real-time requirements.

[0007] The technical solution adopted by the present invention to solve its technical problem is:

[0008] A method for optimizing tobacco logistics real-time distribution routes, the implementation of which includes the following steps:

[0009] (1) Real-time acquisition of order data, vehicle data, retailer geographic information, and real-time road network data;

[0010] (2) An improved K-Means clustering algorithm is used to dynamically cluster retailers and generate multiple distribution areas. The clustering process introduces upper and lower bounds on the number of distribution households and the upper and lower bounds on the distribution volume.

[0011] (3) Calculate the geometric center of each distribution area and generate the global optimal path between the areas based on the traveling salesman problem (TSP) algorithm;

[0012] (4) For retailers within each distribution area, a two-stage optimization algorithm is used for real-time route planning, including:

[0013] Phase 1: Based on the real-time road network matrix, the minimum arc path algorithm is used to generate the initial feasible solution;

[0014] The second stage: the guided local search (GLS) algorithm is used to optimize the initial solution to obtain the final delivery order;

[0015] (5) Dynamically allocate delivery tasks based on vehicle loading capacity and the maximum number of delivery households, and generate delivery routes for the day.

[0016] Furthermore, the improved K-Means clustering algorithm includes:

[0017] When initializing the cluster center, a minimum distance threshold is set to ensure that the initial cluster center meets the spatial distribution requirements;

[0018] The objective function is to minimize the overall distance cost, and the constraints include the upper and lower bounds of the number of delivery households and the upper and lower bounds of the delivery volume.

[0019] Furthermore, the improved K-Means clustering algorithm is specifically implemented as follows:

[0020] Generate random centroids: First, determine a cluster center distance threshold and initialize the cluster centers. Calculate the distance between cluster centers. If the minimum distance between cluster centers is greater than the threshold, use the currently generated cluster center as the initial region center. Otherwise, regenerate the cluster center until a cluster center that meets the requirements is obtained.

[0021] Define the target constraint: The linear programming model of the constrained clustering algorithm is as follows:

[0022] Assume that there are n retailers in the distribution area of ​​the transfer station, and the retailer is represented by i, i∈{1,2,…,n}; the distribution area of ​​the transfer station needs to be divided into m areas, and the cluster center of each area is represented by k, k∈{1,2,…,m}; the demand for goods of retailer i is l i ; The distance from retailer i to cluster center k is d ik ;h low , h up They represent the lower and upper bounds of the number of households delivered to each sub-region, respectively, w low , w up Respectively represent the lower and upper bounds of the distribution volume of each sub-region; x ik is a decision variable, indicating whether retailer i belongs to cluster center k:

[0023]

[0024] Then the objective function is:

[0025]

[0026] The constraints are:

[0027]

[0028] Among them, formula (1) represents the objective function to be optimized, that is, the minimum overall distance cost;

[0029] Formula (2) indicates that the number of households delivered to each sub-region does not exceed the upper and lower bounds of the number of households delivered to each district;

[0030] Formula (3) indicates that the distribution volume of each sub-region does not exceed the upper and lower bounds of the distribution volume specified for each district;

[0031] Formula (4) indicates that each retailer is assigned to a certain cluster center and can only belong to one cluster center;

[0032] Formula (5) represents the decision variables of each retailer.

[0033] Furthermore, the step (3) is specifically implemented as follows:

[0034] Calculate the geometric center of each delivery area, using the precise coordinates of retailers on the delivery area boundary to determine the geometric center point of the delivery area. Use the geometric center point as the representative of the delivery area for route planning.

[0035] A globally optimal path between regions is generated based on the traveling salesman problem (TSP) algorithm. The geometric center points are connected in series with key sites in the tobacco logistics distribution system, including logistics centers, transfer stations, and docking points, to construct a complete distribution network, in which each node represents an important link in the logistics process. Using the traveling salesman problem (TSP) algorithm, with tobacco sites as the starting and ending points, a path with the shortest total distance is obtained through calculation and optimization, traversing the geometric center points and distribution sites of all distribution regions.

[0036] Furthermore, in step (4), a clustered TSP algorithm is used for retailers within the region to achieve real-time optimization of global paths; the implementation includes:

[0037] Starting from the starting node, iteratively select the unvisited node closest to the end node of the current path, and gradually expand the path until all retailers are covered;

[0038] Identify key features in the local optimal solution and impose penalties to guide the algorithm out of the local optimum; optimize the global performance of the delivery path by dynamically adjusting the objective function.

[0039] Furthermore, the step (4) is specifically implemented as follows:

[0040] (4.1) Calculate the real-time road network matrix:

[0041] All retailers within the distribution area are added to a point set. Based on the location coordinates of each retailer, the road distance from each point to all other points in the set is calculated, ultimately forming an n×n road distance network matrix. Mainstream internet map road network data can be used, which is updated promptly. Real-time traffic information is also referenced during calculations to effectively avoid the impact of uncertainties such as road congestion, bad weather, and periodic markets on the calculation results. The road network matrix is ​​regularly updated, including new retailers joining the matrix, cancelled retailers being removed from the matrix, and distance changes caused by road and bridge construction.

[0042] (4.2) Quickly find the initial solution based on the minimum arc path algorithm:

[0043] Using the minimum arc path algorithm, starting from the route's "start" node, connecting it to the node that produces the cheapest route segment, and then expanding the route by iteratively adding to the last node of the route. Similar to the greedy algorithm, it is top-down and iterative, with the characteristics of simple algorithm and short time consumption. Through the calculation of this stage, the general direction of the delivery route is determined;

[0044] (4.3) The final solution is obtained based on the guided local search heuristic algorithm:

[0045] The guided local search algorithm (GLS) is often the most effective metaheuristic algorithm for solving vehicle routing problems. A metaheuristic algorithm is a method that layers on top of a local search algorithm to modify its behavior. GLS establishes penalties during the search process, using them to help the local search algorithm escape local minima and plateaus. When a given local search algorithm reaches a local optimum, the GLS modifies the objective function using a specific solution. When the local search algorithm returns to a local minimum, the GLS penalizes all features with the highest utility present in that solution (by increasing their penalties). By penalizing features present in the local minimum, the GLS allows the local search algorithm to escape the local minimum. This allows the algorithm to find a globally optimal or near-optimal delivery route solution within a specified timeframe, meeting the real-time requirements of tobacco logistics. The algorithm is adaptable to diverse delivery scenarios and constraints, navigating complex and changing logistics environments by adjusting the penalty mechanism and local search strategy. Furthermore, the GLS avoids getting stuck in local optima by introducing a penalty mechanism, improving the algorithm's robustness and global search capabilities.

[0046] By combining local search algorithms and metaheuristic strategies, the GLS algorithm can effectively escape from the local optimal solution and explore a wider solution space, thereby finding the global optimal or approximately optimal delivery route.

[0047] Furthermore, the step (5), real-time line optimization is specifically implemented as follows:

[0048] Combine vehicle resource constraints (such as loading capacity and maximum number of serviceable customers) and dynamic operational needs to break down global routes into executable same-day delivery tasks.

[0049] When the cumulative delivery volume reaches the vehicle's maximum load, the current node is recorded as a potential cutoff point. Through flexible cutoff and dynamic allocation, the vehicle loading rate is ensured to reach the set value (close to 100%), reducing empty trips and duplicate deliveries.

[0050] If the number of customers served in a single day exceeds the vehicle capacity (e.g. a single vehicle can serve a maximum of 100 households), the line must be cut off when the set threshold is reached.

[0051] The present invention also claims protection for a tobacco logistics real-time distribution route optimization system, comprising:

[0052] Data input module, used to obtain real-time order data, vehicle data, retailer geographic information and real-time road network data;

[0053] Dynamic clustering module, which uses the improved K-Means clustering algorithm to dynamically cluster retailers and generate multiple distribution areas;

[0054] The inter-region routing module is used to calculate the geometric center of each delivery region and generate the global optimal path between regions based on the traveling salesman problem (TSP) algorithm;

[0055] The real-time optimization module is used to perform real-time route planning for retailers within each distribution area using a two-stage optimization algorithm to determine the final delivery sequence.

[0056] The flexible computing module is used to dynamically allocate delivery tasks based on vehicle load and the maximum number of delivery households, and generate delivery routes for the day;

[0057] The system specifically realizes route optimization of real-time tobacco logistics distribution through the above method.

[0058] The present invention also claims protection for a tobacco logistics real-time distribution route optimization device, comprising: at least one memory and at least one processor;

[0059] The at least one memory is configured to store a machine-readable program;

[0060] The at least one processor is configured to call the machine-readable program to implement the above method.

[0061] The present invention also claims protection for a computer-readable medium having computer instructions stored thereon, which are capable of implementing the above method when executed by a processor.

[0062] Compared with the prior art, the tobacco logistics real-time distribution route optimization method and system of the present invention have the following beneficial effects:

[0063] The present invention can completely abandon historical route binding and start from scratch every day; dynamically generate a distance matrix based on real-time traffic network data; and reduce the average delivery distance and delivery time. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 This is a flowchart of a method for optimizing tobacco logistics real-time distribution routes provided by one embodiment of the present invention;

[0065] Figure 2 It is a diagram showing a specific implementation of a tobacco logistics distribution route provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0066] The present invention will be further described below with reference to specific embodiments.

[0067] The embodiment of the present invention provides a method for optimizing tobacco logistics real-time distribution routes, the implementation of which includes the following steps:

[0068] 1. Obtain order data, vehicle data, retailer geographic information and real-time road network data in real time.

[0069] 2. An improved K-Means clustering algorithm is used to dynamically cluster retailers and generate multiple delivery areas. The clustering process introduces upper and lower bounds on the number of delivery households and the upper and lower bounds on the delivery volume.

[0070] 3. Calculate the geometric center of each delivery area and generate the global optimal path between areas based on the traveling salesman problem (TSP) algorithm.

[0071] 4. For retailers within each distribution area, a two-stage optimization algorithm is used for real-time route planning, including:

[0072] Phase 1: Based on the real-time road network matrix, the minimum arc path algorithm is used to generate the initial feasible solution;

[0073] The second stage: The guided local search (GLS) algorithm is used to optimize the initial solution to obtain the final delivery order.

[0074] Dynamically allocate delivery tasks and generate delivery routes for the day based on vehicle loading capacity and the maximum number of delivery households.

[0075] The improved K-Means clustering algorithm includes:

[0076] When initializing the cluster center, a minimum distance threshold is set to ensure that the initial cluster center meets the spatial distribution requirements; the objective function is to minimize the overall distance cost, and the constraints include the upper and lower bounds of the number of delivery households and the upper and lower bounds of the delivery volume.

[0077] A clustered TSP algorithm is used for retailers within the region to achieve real-time global path optimization; specifically, the following are included:

[0078] Starting from the starting node, the algorithm iteratively selects the unvisited node closest to the current path's end node, gradually expanding the path until all retailers are covered. Key features are identified and penalties are applied within the local optimal solution to guide the algorithm out of the local optimum. By dynamically adjusting the objective function, the global performance of the delivery path is optimized.

[0079] The specific implementation process of this method is as follows:

[0080] 1. Data input.

[0081] Obtain the data needed for the algorithm, including orders, vehicles, retailer geographic information, and real-time road networks.

[0082] Orders: Actual daily tobacco marketing orders are transferred and pushed to tobacco logistics. Route optimization requires the use of order retailers and order quantities.

[0083] Vehicle: Currently available vehicles, including license plate number, cigarette loading capacity (cartons), and number of loading households.

[0084] Retailer geographic information: Mars coordinate system, accuracy required within 10 meters, roads cannot be exceeded.

[0085] Real-time road network: Using real-time road network information from AutoNavi and Baidu, including point-to-point distance, congestion conditions, etc.

[0086] 2. Dynamic clustering.

[0087] The purpose of dynamic clustering is to reduce the amount of calculation, cluster all retailers into several areas, achieve smooth routes between areas, and optimize routes within areas in real time.

[0088] This method uses a constrained modified K-Means clustering algorithm based on the longitude and latitude of retailers. The basic idea of ​​the K-Means algorithm is to select K data objects as initial cluster centers and iteratively divide the data objects into different clusters, so that the similarity between objects within a cluster is high and the similarity between objects between clusters is low. The specific implementation includes:

[0089] (1) Generate random centroids:

[0090] The K-Means algorithm is improved. On the one hand, the method of selecting the initial cluster center is improved. First, a cluster center distance threshold is determined and the cluster center is initialized. The distance between each cluster center is calculated. If the minimum distance between cluster centers is greater than the threshold, the currently generated cluster center is used as the initial regional center. Otherwise, it needs to be regenerated until a cluster center that meets the requirements is obtained.

[0091] (2) Define target constraints:

[0092] The linear programming model of the constrained clustering algorithm is as follows:

[0093] Assume that there are n retailers in the distribution area of ​​the transfer station, and the retailer is represented by i, i∈{1,2,…,n}; Assume that the distribution area of ​​the transfer station needs to be divided into m areas, and the cluster center of each area is represented by k, k∈{1,2,…,m}; the demand for goods of retailer i is l i ; The distance from retailer i to cluster center k is d ik ;h low ,h up They represent the lower and upper bounds of the number of households delivered to each sub-region, respectively, w low ,w up They represent the lower and upper bounds of the delivery volume of each sub-region respectively.

[0094] x ik is a decision variable, indicating whether retailer i belongs to cluster center k:

[0095]

[0096] Then the objective function is:

[0097]

[0098] The constraints are:

[0099]

[0100] Among them, formula (1) represents the objective function to be optimized, that is, the minimum overall distance cost;

[0101] Formula (2) indicates that the number of households delivered to each sub-region does not exceed the upper and lower bounds of the number of households delivered to each district;

[0102] Formula (3) indicates that the distribution volume of each sub-region does not exceed the upper and lower bounds of the distribution volume specified for each district;

[0103] Formula (4) indicates that each retailer is assigned to a certain cluster center and can only belong to one cluster center;

[0104] Formula (5) represents the decision variables of each retailer.

[0105] 3. The roads between areas are smooth.

[0106] In the process of logistics distribution planning and optimization, especially when it comes to large-scale route planning between multiple regions, the core strategy often focuses on two key points: one is how to accurately select the center point of each region, and the other is how to efficiently use the inter-regional path planning algorithm (such as the TSP algorithm) to determine the optimal delivery route.

[0107] Specifically, the outer boundary of a cluster typically appears as an irregular convex polygon in geographic space. To determine the center of such a polygonal area, this method uses the precise coordinates of retailers on the boundary to derive the geometric center of the polygonal cluster. This geometric center point serves as the representative of the cluster area for subsequent route planning.

[0108] After determining the center point of each area, the next task is to connect the center point of each area with the key stations in the tobacco logistics and distribution system, including logistics centers, transfer stations, and docking points. The goal is to build a complete distribution network, in which each node represents an important link in the logistics process.

[0109] To find the optimal delivery path in the distribution network, this method introduces the TSP algorithm (Traveling Salesman Algorithm). The TSP algorithm uses tobacco stations as the starting and ending points and, through calculation and optimization, finds a path that traverses all regional centers and distribution stations with the shortest total distance.

[0110] By accurately selecting regional centers and efficiently using the TSP algorithm, we can build an optimal general distribution route between regions, providing strong support for the optimization of subsequent links.

[0111] 4. Real-time optimization.

[0112] For retailers within the region, a clustered TSP algorithm is used, which specifically includes three stages: the first stage calculates the road network matrix; the second stage uses an approximate algorithm to obtain the initial feasible solution; the third stage uses a meta-heuristic algorithm to obtain a better local optimal solution. The local search algorithm in the last two stages can shorten the optimization time, while improving the solution convergence speed, and maintain the global optimal optimization direction, thereby obtaining better results. The two-stage (second and third stage) local search algorithm is also very consistent with the actual distribution idea of ​​tobacco logistics terminal distribution, that is, first determine the general distribution direction, and then complete the distribution of surrounding retailers along the general direction. The specific implementation is as follows:

[0113] (1) Calculate the real-time road network matrix.

[0114] All retailers within the distribution area are added to a point set. Based on the coordinates of each retailer, the road distance from each point to all other points in the set is calculated, ultimately forming an n×n road distance network matrix. This method uses timely updated road network data from mainstream internet maps to calculate road distances. This data is also factored into real-time traffic information, effectively mitigating the impact of uncertainties such as traffic congestion, inclement weather, and periodic markets. The network matrix requires regular updates, including those caused by new retailers joining the matrix, deregistered retailers being removed from the matrix, and distance changes due to road and bridge construction.

[0115] (2) Quickly find the initial solution based on the minimum arc path algorithm.

[0116] This is the first stage of a two-stage local search algorithm. Using a minimum arc path algorithm, we begin at the route's "start" node and connect it to the node that yields the cheapest route segment. We then extend the route by iteratively adding to the last node in the route. This approach, similar to a greedy algorithm, uses a top-down, step-by-step approach, resulting in a simple and time-efficient algorithm. This phase of the algorithm determines the approximate direction of the delivery route.

[0117] (3) Find the final solution based on the guided local search heuristic algorithm:

[0118] This section is the second stage of a two-stage local search algorithm. A guided local search algorithm (GLS) is used. This algorithm is often the most effective metaheuristic for solving vehicle routing problems. A metaheuristic algorithm is a method that layers on top of a local search algorithm to modify its behavior. GLS establishes penalties during the search process, using them to help the local search algorithm escape local minima and plateaus. When a given local search algorithm reaches a local optimum, the GLS modifies the objective function using a specific solution. When the local search algorithm returns to a local minimum, the GLS penalizes all features with the highest utility present in the solution (by increasing their penalties). By penalizing features present in the local minimum, the GLS allows the local search algorithm to escape the local minimum. This allows the algorithm to find a globally optimal or near-optimal delivery route solution within a specified timeframe, meeting the real-time requirements of tobacco logistics. The algorithm is adaptable to diverse delivery scenarios and constraints, adapting to complex and changing logistics environments by adjusting the penalty mechanism and local search strategy. The penalty mechanism is introduced to prevent regression into local optima, improving the algorithm's robustness and global search capabilities.

[0119] By combining local search algorithms and metaheuristic strategies, the GLS algorithm can effectively escape from the local optimal solution and explore a wider solution space, thereby finding the global optimal or approximately optimal delivery route.

[0120] 5. Flexible computing

[0121] After completing the global optimization of the delivery routes for all tobacco retailers, it is necessary to further combine vehicle resource constraints (such as loading capacity and maximum number of serviceable customers) and dynamic operational needs to break down the global routes into executable same-day delivery tasks.

[0122] When the cumulative delivery volume reaches the vehicle's maximum load, the current node is recorded as a potential cutoff point. Through flexible cutoff and dynamic allocation, the vehicle loading rate is ensured to be close to 100%, reducing empty runs and duplicate deliveries.

[0123] If the number of customers served in a single day exceeds the vehicle capacity (e.g. a single vehicle can serve a maximum of 100 households), the line must be cut off when approaching the threshold.

[0124] At this point, the real-time line optimization is completed.

[0125] One implementation of this method is as follows:

[0126] S1. Receive the carried-over order data every morning.

[0127] S2. Call the dynamic clustering algorithm to generate the delivery area.

[0128] S3. Calculate the general direction of the series connection between regions.

[0129] S4. Optimize the delivery routes in the delivery area in real time.

[0130] S5. Make flexible delivery dispatch according to vehicle conditions.

[0131] This method completely abandons historical route binding and calculates from scratch every day; it dynamically generates a distance matrix based on real-time traffic network data; and the average delivery distance and delivery time are reduced.

[0132] The embodiment of the present invention further provides a tobacco logistics real-time delivery route optimization system, which specifically realizes tobacco logistics real-time delivery route optimization through the tobacco logistics real-time delivery route optimization method described in the above embodiment.

[0133] The system includes:

[0134] 1. Data input module, used to obtain real-time order data, vehicle data, retailer geographic information and real-time road network data. The specific implementation is as follows:

[0135] Obtain the data needed for the algorithm, including orders, vehicles, retailer geographic information, and real-time road networks.

[0136] Orders: Actual daily tobacco marketing orders are transferred and pushed to tobacco logistics. Route optimization requires the use of order retailers and order quantities.

[0137] Vehicle: Currently available vehicles, including license plate number, cigarette loading capacity (cartons), and number of loading households.

[0138] Retailer geographic information: Mars coordinate system, accuracy required within 10 meters, roads cannot be exceeded.

[0139] Real-time road network: Using real-time road network information from AutoNavi and Baidu, including point-to-point distance, congestion conditions, etc.

[0140] 2. Dynamic clustering module: uses the improved K-Means clustering algorithm to dynamically cluster retailers and generate multiple distribution areas. The specific implementation is as follows:

[0141] (1) Generate random centroids:

[0142] Based on the longitude and latitude of retailers, a constrained modified K-Means clustering algorithm is used. The basic idea of ​​the K-Means algorithm is to select K data objects as initial cluster centers and iteratively divide the data objects into different clusters, so that the similarity between objects within a cluster is high and the similarity between objects in different clusters is low.

[0143] The K-Means algorithm is improved. On the one hand, the method of selecting the initial cluster center is improved. First, a cluster center distance threshold is determined and the cluster center is initialized. The distance between each cluster center is calculated. If the minimum distance between cluster centers is greater than the threshold, the currently generated cluster center is used as the initial regional center. Otherwise, it needs to be regenerated until a cluster center that meets the requirements is obtained.

[0144] (2) Define target constraints:

[0145] The linear programming model of the constrained clustering algorithm is as follows:

[0146] Assume that there are n retailers in the distribution area of ​​the transfer station, and the retailer is represented by i, i∈{1, 2, ..., n}; Assume that the distribution area of ​​the transfer station needs to be divided into m areas, and the cluster center of each area is represented by k, k∈{1, 2, ..., m}; the demand for goods of retailer i is l i ; The distance from retailer i to cluster center k is d ik ;h low , h up They represent the lower and upper bounds of the number of households delivered to each sub-region, respectively, w low , w up They represent the lower and upper bounds of the delivery volume of each sub-region respectively.

[0147] x ik is a decision variable, indicating whether retailer i belongs to cluster center k:

[0148]

[0149] Then the objective function is:

[0150]

[0151] The constraints are:

[0152]

[0153] Among them, formula (1) represents the objective function to be optimized, that is, the minimum overall distance cost;

[0154] Formula (2) indicates that the number of households delivered to each sub-region does not exceed the upper and lower bounds of the number of households delivered to each district;

[0155] Formula (3) indicates that the distribution volume of each sub-region does not exceed the upper and lower bounds of the distribution volume specified for each district;

[0156] Formula (4) indicates that each retailer is assigned to a certain cluster center and can only belong to one cluster center;

[0157] Formula (5) represents the decision variables of each retailer.

[0158] 3. The inter-region routing module is used to calculate the geometric center of each distribution area and generate the global optimal path between regions based on the Traveling Salesman Problem (TSP) algorithm. The specific implementation is as follows:

[0159] Calculate the geometric center of each distribution area: The outer boundary of a cluster typically appears as an irregular convex polygon in geographic space. To determine the center of such a polygon, use the precise coordinates of retailers on the boundary to determine the geometric center of the polygon cluster. This geometric center point serves as the representative of the cluster and is used for subsequent route planning.

[0160] The global optimal path between regions is generated based on the Traveling Salesman Problem (TSP) algorithm. After determining the center point of each region, the next task is to connect the center point of each region with key stations in the tobacco logistics and distribution system, including logistics centers, transfer stations, and docking points. The goal is to build a complete distribution network, in which each node represents an important link in the logistics process.

[0161] In order to find the optimal delivery path in the distribution network, the system introduces the TSP algorithm (Traveling Salesman Algorithm). The TSP algorithm uses tobacco stations as the starting and ending points, and through calculation and optimization, obtains a path that traverses all regional centers and distribution stations with the shortest total distance.

[0162] By accurately selecting regional centers and efficiently using the TSP algorithm, we can build an optimal general distribution route between regions, providing strong support for the optimization of subsequent links.

[0163] 4. Real-time optimization module, which uses a two-stage optimization algorithm to perform real-time route planning for retailers within each distribution area to obtain the final delivery sequence.

[0164] For retailers within the region, a clustered TSP algorithm is used. It specifically includes three parts: the first is to calculate the road network matrix; the second is to use an approximate algorithm to obtain the initial feasible solution; and the third is to use a meta-heuristic algorithm to obtain a better local optimal solution. The local search algorithm in the last two stages can shorten the optimization time, while improving the convergence speed of the solution, and maintaining the global optimal optimization direction, thereby obtaining better results. The two-stage local search algorithm is also very consistent with the actual distribution idea of ​​tobacco logistics terminal distribution, that is, first determine the general distribution direction, and then complete the distribution of surrounding retailers along the general direction. The specific implementation is as follows:

[0165] (1) Calculate the real-time road network matrix.

[0166] All retailers within the distribution area are added to a point set. Based on the coordinates of each retailer, the road distance from each point to all other points in the set is calculated, ultimately forming an n×n road distance network matrix. This method uses timely updated road network data from mainstream internet maps to calculate road distances. This data is also factored into real-time traffic information, effectively mitigating the impact of uncertainties such as traffic congestion, inclement weather, and periodic markets. The network matrix requires regular updates, including those caused by new retailers joining the matrix, deregistered retailers being removed from the matrix, and distance changes due to road and bridge construction.

[0167] (2) Quickly find the initial solution based on the minimum arc path algorithm.

[0168] This is the first stage of a two-stage local search algorithm. Using a minimum arc path algorithm, we begin at the route's "start" node and connect it to the node that yields the cheapest route segment. We then extend the route by iteratively adding to the last node in the route. This approach, similar to a greedy algorithm, uses a top-down, step-by-step approach, resulting in a simple and time-efficient algorithm. This phase of the algorithm determines the approximate direction of the delivery route.

[0169] (3) Find the final solution based on the guided local search heuristic algorithm:

[0170] This section is the second stage of a two-stage local search algorithm. A guided local search algorithm (GLS) is used. This algorithm is often the most effective metaheuristic for solving vehicle routing problems. A metaheuristic algorithm is a method that layers on top of a local search algorithm to modify its behavior. GLS establishes penalties during the search process, using them to help the local search algorithm escape local minima and plateaus. When a given local search algorithm reaches a local optimum, the GLS modifies the objective function using a specific solution. When the local search algorithm returns to a local minimum, the GLS penalizes all features with the highest utility present in the solution (by increasing their penalties). By penalizing features present in the local minimum, the GLS allows the local search algorithm to escape the local minimum. This allows the algorithm to find a globally optimal or near-optimal delivery route solution within a specified timeframe, meeting the real-time requirements of tobacco logistics. The algorithm is adaptable to diverse delivery scenarios and constraints, adapting to complex and changing logistics environments by adjusting the penalty mechanism and local search strategy. The penalty mechanism is introduced to prevent regression into local optima, improving the algorithm's robustness and global search capabilities.

[0171] By combining local search algorithms and metaheuristic strategies, the GLS algorithm can effectively escape from the local optimal solution and explore a wider solution space, thereby finding the global optimal or approximately optimal delivery route.

[0172] 5. Flexible computing module, used to dynamically allocate delivery tasks and generate daily delivery routes based on vehicle loading capacity and the maximum number of delivery households.

[0173] After completing the global optimization of the delivery routes for all tobacco retailers, it is necessary to further combine vehicle resource constraints (such as loading capacity and maximum number of serviceable customers) and dynamic operational needs to break down the global routes into executable same-day delivery tasks.

[0174] When the cumulative delivery volume reaches the vehicle's maximum load, the current node is recorded as a potential cutoff point. Through flexible cutoff and dynamic allocation, the vehicle loading rate is ensured to be close to 100%, reducing empty runs and duplicate deliveries.

[0175] If the number of customers served in a single day exceeds the vehicle capacity (e.g. a single vehicle can serve a maximum of 100 households), the line must be cut off when approaching the threshold.

[0176] At this point, the real-time line optimization is completed.

[0177] An embodiment of the present invention further provides a tobacco logistics real-time distribution route optimization device, comprising: at least one memory and at least one processor;

[0178] The at least one memory is configured to store a machine-readable program;

[0179] The at least one processor is configured to call the machine-readable program to implement the tobacco logistics real-time distribution route optimization method described in the above embodiment.

[0180] Embodiments of the present invention further provide a computer-readable medium storing computer instructions that, when executed by a processor, cause the processor to execute the method for optimizing tobacco logistics real-time delivery routes described in the aforementioned embodiments. Specifically, a system or device equipped with a storage medium storing software program code that implements the functions of any of the aforementioned embodiments can be provided, and a computer (or CPU or MPU) of the system or device can be configured to read and execute the program code stored in the storage medium.

[0181] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute part of the present invention.

[0182] Examples of storage media for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code can be downloaded from a server computer via a communication network.

[0183] In addition, it should be clear that the functions of any of the above embodiments can be achieved not only by executing the program code read by the computer, but also by enabling the operating system operating on the computer to complete part or all of the actual operations based on the instructions of the program code.

[0184] In addition, it can be understood that the program code read from the storage medium is written into the memory provided in the expansion board inserted into the computer or into the memory provided in the expansion unit connected to the computer, and then based on the instructions of the program code, the CPU installed on the expansion board or expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above embodiments.

[0185] The present invention has been shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review methods in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the scope of protection of the present invention.

Claims

1. A tobacco logistics real-time distribution route optimization method, characterized in that: The implementation of this method includes the following steps: (1) Real-time acquisition of order data, vehicle data, retailer geographic information, and real-time road network data; (2) An improved K-Means clustering algorithm is used to dynamically cluster retailers and generate multiple distribution areas. The clustering process introduces upper and lower bounds on the number of distribution households and the upper and lower bounds on the distribution volume. (3) Calculate the geometric center of each delivery area and generate the global optimal path between the areas based on the traveling salesman problem algorithm; (4) For retailers within each distribution area, a two-stage optimization algorithm is used for real-time route planning, including: Phase 1: Based on the real-time road network matrix, the minimum arc path algorithm is used to generate the initial feasible solution; The second stage: using guided local search algorithm to optimize the initial solution and obtain the final delivery order; (5) Dynamically allocate delivery tasks based on vehicle loading capacity and the maximum number of delivery households, and generate delivery routes for the day.

2. A tobacco logistics real-time distribution route optimization method according to claim 1, characterized in that: The improved K-Means clustering algorithm includes: When initializing the cluster center, a minimum distance threshold is set to ensure that the initial cluster center meets the spatial distribution requirements; The objective function is to minimize the overall distance cost, and the constraints include the upper and lower bounds of the number of delivery households and the upper and lower bounds of the delivery volume.

3. A tobacco logistics real-time distribution route optimization method according to claim 2, characterized in that: The improved K-Means clustering algorithm is specifically implemented as follows: Generate random centroids: First, determine a cluster center distance threshold and initialize the cluster centers. Calculate the distance between cluster centers. If the minimum distance between cluster centers is greater than the threshold, use the currently generated cluster center as the initial region center. Otherwise, regenerate the cluster center until a cluster center that meets the requirements is obtained. Define the target constraint: The linear programming model of the constrained clustering algorithm is as follows: Assume that there are n retailers in the distribution area of ​​the transfer station, and the retailer is represented by i, i∈{1, 2, ..., n}; the distribution area of ​​the transfer station needs to be divided into m areas, and the cluster center of each area is represented by k, k∈{1, 2, ..., m}; the demand for goods of retailer i is l i ; The distance from retailer i to cluster center k is d ik ;h low , h up They represent the lower and upper bounds of the number of households delivered to each sub-region, respectively, w low ,w up Respectively represent the lower and upper bounds of the distribution volume of each sub-region; x ik is a decision variable, indicating whether retailer i belongs to cluster center k: Then the objective function is: The constraints are: Among them, formula (1) represents the objective function to be optimized, that is, the minimum overall distance cost; Formula (2) indicates that the number of households delivered to each sub-region does not exceed the upper and lower bounds of the number of households delivered to each district; Formula (3) indicates that the distribution volume of each sub-region does not exceed the upper and lower bounds of the distribution volume specified for each district; Formula (4) indicates that each retailer is assigned to a certain cluster center and can only belong to one cluster center; Formula (5) represents the decision variables of each retailer.

4. A tobacco logistics real-time distribution route optimization method according to claim 1, characterized in that: The step (3) is specifically implemented as follows: Calculate the geometric center of each delivery area, using the precise coordinates of retailers on the delivery area boundary to determine the geometric center point of the delivery area. Use the geometric center point as the representative of the delivery area for route planning. The global optimal path between regions is generated based on the traveling salesman problem algorithm: the geometric center points are connected in series with the key stations in the tobacco logistics distribution system, including logistics centers, transfer stations, and docking points, to build a complete distribution network; through the traveling salesman problem algorithm, with tobacco stations as the starting point and end point, after calculation and optimization, a path that traverses the geometric center points and distribution stations of all distribution areas and has the shortest total distance is obtained.

5. A tobacco logistics real-time distribution route optimization method according to claim 1 or 4, characterized in that: In step (4), a clustered TSP algorithm is used for retailers within the region to achieve real-time optimization of global paths; Its implementation includes: Starting from the starting node, iteratively select the unvisited node closest to the end node of the current path, and gradually expand the path until all retailers are covered; Identify key features in the local optimal solution and impose penalties to guide the algorithm out of the local optimum; optimize the global performance of the delivery path by dynamically adjusting the objective function.

6. A tobacco logistics real-time distribution route optimization method according to claim 5, characterized in that: The step (4) is specifically implemented as follows: (4.1) Calculate the real-time road network matrix: Add all retailers in the distribution area to a point set, calculate the road distance from each point to all other points in the set based on the location coordinates of each retailer, and finally form an n×n road distance network matrix; The road network matrix is ​​updated regularly, including new retailers joining the matrix, cancelled retailers being removed from the matrix, and distance changes caused by road and bridge construction; (4.2) Quickly find the initial solution based on the minimum arc path algorithm: Use the minimum arc path algorithm, starting from the route's "start" node, connecting it to the node that produces the cheapest route segment, and then extending the route by iteratively adding to the last node of the route to determine the general direction of the delivery route; (4.3) The final solution is obtained based on the guided local search heuristic algorithm: The guided local search algorithm establishes penalties during the search, and uses penalties to help the local search algorithm escape from local minima and plateaus: when a given local search algorithm reaches a local optimum, the guided local search algorithm uses a specific solution to modify the objective function; when the local search algorithm returns a local minimum, the guided local search algorithm penalizes all those features with maximum utility that exist in the solution, and by penalizing the features that exist in the local minimum, it allows it to guide the local search algorithm out of the local minimum; thereby finding the global optimal or approximately optimal distribution route solution within a specified time, meeting the real-time requirements of tobacco logistics distribution.

7. A tobacco logistics real-time distribution route optimization method according to claim 1, characterized in that: The step (5), real-time line optimization is specifically implemented as follows: Combine vehicle resource constraints and dynamic operational needs to break down global routes into executable same-day delivery tasks; When the cumulative delivery volume reaches the vehicle's maximum load, the current node is recorded as a potential cutoff point; through flexible cutoff and dynamic allocation, the vehicle loading rate is ensured to reach the set value; If the number of customers served in a single day exceeds the vehicle capacity, the route will be cut off when the set threshold is reached.

8. A tobacco logistics real-time distribution route optimization system, characterized by: include: Data input module, used to obtain real-time order data, vehicle data, retailer geographic information and real-time road network data; Dynamic clustering module, which uses the improved K-Means clustering algorithm to dynamically cluster retailers and generate multiple distribution areas; The inter-region routing module is used to calculate the geometric center of each delivery area and generate the global optimal path between regions based on the traveling salesman problem algorithm; The real-time optimization module is used to perform real-time route planning for retailers within each distribution area using a two-stage optimization algorithm to determine the final delivery sequence. The flexible computing module is used to dynamically allocate delivery tasks based on vehicle load and the maximum number of delivery households, and generate delivery routes for the day; The system specifically realizes route optimization of real-time tobacco logistics distribution through the method described in any one of claims 1 to 7.

9. A tobacco logistics real-time distribution route optimization device, characterized in that: include: at least one memory and at least one processor; The at least one memory is configured to store a machine-readable program; The at least one processor is configured to call the machine-readable program to implement the method according to any one of claims 1 to 7.

10. A computer-readable medium, characterized in that The computer readable medium stores computer instructions, which, when executed by a processor, can implement the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Tobacco industry distribution line optimization method, system, equipment and medium

    CN116862091A