A pharmaceutical logistics vehicle routing optimization method based on an improved initial solution algorithm

By improving the initial solution algorithm, using the insertion method and neighbor point method to generate the initial solution, and combining the genetic algorithm for optimization, the problem that heuristic algorithms may obtain poor solutions in the path optimization of medical flow vehicles is solved, achieving more efficient path optimization and higher customer satisfaction.

CN114611831BActive Publication Date: 2025-03-18CHONGQING UNIV OF POSTS & TELECOMM +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210314787.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2025-03-18
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

Existing heuristics may obtain poor initial solutions when looking for the vehicle path of a pharmaceutical flow, resulting in poor final approximate optimal solutions.

Method used

The improved initial solution algorithm is adopted to generate the initial solution through the insertion method and the neighbor point method, and input it into the genetic algorithm for deep optimization to obtain the optimal driving path.

Benefits of technology

It effectively improves the results of vehicle path optimization of medical flows, reduces distribution costs, improves distribution efficiency, and improves customer satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114611831B_ABST
    Figure CN114611831B_ABST
Patent Text Reader

Abstract

The present invention relates to a pharmaceutical logistics vehicle path optimization method based on an improved initial solution algorithm, and belongs to the field of vehicle path technology. The method is: using a map API to collect the longitude and latitude information of a pharmaceutical company's route including warehouses and all customer points, and then calculating the distance matrix between each customer point on each route; constructing a pharmaceutical logistics vehicle path optimization model, the optimization goal is to minimize the total distance, the total distance is the total distance of the vehicle starting from the warehouse, traversing all customer points, and finally returning to the warehouse; the vehicle has a capacity limit, no maximum distance limit, and sets constraints on the objective function of the pharmaceutical logistics vehicle path optimization model; designing a heuristic algorithm for improving the initial solution; using the heuristic algorithm for improving the initial solution to solve the objective function of the pharmaceutical logistics vehicle path optimization model. The present invention effectively obtains a good pharmaceutical logistics vehicle driving route and reduces overall costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of vehicle routing and relates to a pharmaceutical logistics vehicle routing optimization method based on an improved initial solution algorithm. Background Art

[0002] In the field of vehicle routing optimization, heuristic algorithms are usually used to solve vehicle routing optimization problems. For NP-hard problems, the general classical algorithm takes too long to solve and is unacceptable. Therefore, a relatively good solution algorithm is used to get as close to the optimal solution as possible and obtain a relatively optimal solution, which is also acceptable in some practical situations of vehicle routing optimization problems. Heuristic algorithms are a technique that allows searching for the best solution within an acceptable computational cost, but it does not necessarily guarantee a feasible solution or an optimal solution.

[0003] Heuristic algorithms usually start from a feasible solution and repeatedly search for better solutions, so that an approximate optimal solution can be found within a reasonable computing time. For large-scale NP-hard problems, heuristic algorithms have shown excellent performance. However, in some special cases, heuristic algorithms will get very bad answers or extremely poor efficiency. Chinese patent application CN110852469A discloses a method for optimizing the design of pharmaceutical logistics distribution paths based on genetic algorithms. The method includes constructing a parallel genetic algorithm framework based on the MapReduce model for the pharmaceutical logistics distribution path problem. However, this method still has the problem that the feasible solution found at the beginning may be poor, resulting in a poor approximate optimal solution in the end.

[0004] Therefore, the present invention can solve the problem that the final approximate optimal solution may be poor by improving the initial feasible solution of the existing algorithm. Summary of the invention

[0005] In view of this, the purpose of the present invention is to provide a pharmaceutical logistics vehicle path optimization method based on an improved initial solution algorithm. It can effectively provide a better initial solution for the heuristic algorithm and effectively improve the results of pharmaceutical distribution path optimization. The present invention can effectively reduce distribution costs, improve distribution efficiency, and enhance customer satisfaction.

[0006] In order to achieve the above object, the present invention provides the following technical solutions:

[0007] A pharmaceutical logistics vehicle path optimization method based on an improved initial solution algorithm, the method comprising the following steps:

[0008] S1: Use the map API to collect the longitude and latitude information of warehouses and customer points on the route of the pharmaceutical company, and then calculate

[0009] S2: Construct a pharmaceutical logistics vehicle route optimization model with the optimization goal of minimizing the total distance;

[0010] The total distance is the distance that the vehicle takes from the warehouse, through all customer points, and finally back to the warehouse;

[0011] The vehicle has a capacity limit, no maximum distance limit, and sets constraints on the objective function of the pharmaceutical logistics vehicle path optimization model;

[0012] S3: Design a heuristic algorithm to improve the initial solution. In the first stage, the insertion method and the neighbor point method are used to generate the initial solution. In the second stage, a genetic algorithm is used to input the initial solution obtained by the insertion method and the neighbor point method in the first stage into the genetic algorithm in the second stage for deep optimization to obtain the optimal driving path. The heuristic algorithm for improving the initial solution is used to solve the objective function of the pharmaceutical logistics vehicle path optimization model.

[0013] Optionally, the S1 is specifically:

[0014] S11: Use the map API to collect the longitude and latitude information of warehouses and customer points included in the route of the pharmaceutical company;

[0015] S12: Calculate the round-trip distance between each two points using the map API and the longitude and latitude information of the queried warehouse and customer points;

[0016] S13: storing the obtained round trip distance in a 2×2 matrix;

[0017] S14: Export the matrix as a csv file, which is the distance matrix containing warehouses and customer points on the pharmaceutical company route.

[0018] Optionally, in S2, the total optimization objective function of the pharmaceutical logistics vehicle path optimization model is:

[0019]

[0020] Wherein, the set of warehouses and all customer points served is N = {0, 1, ..., n}, including the set of warehouse 0 and all customer points served is N' = {1, 2, ..., n}; the set of available vehicles in the warehouse is L = {1, 2, ..., k}; i, j represents a single warehouse or customer point, i, j ∈ N, i ≠ j; d ij represents the distance of the vehicle from point i to point j; is a decision 0-1 variable, which is 1 when the car goes from point i to point j, and 0 otherwise;

[0021] In S2, the objective function of the pharmaceutical logistics vehicle routing optimization model sets the constraints as follows:

[0022]

[0023]

[0024]

[0025]

[0026]

[0027] Among the above constraints:

[0028] Formula (1) means that each customer point is served and only served once;

[0029] Formula (2) indicates that the vehicles arriving and leaving each customer point are balanced;

[0030] Formula (3) indicates that all vehicles coming out of the warehouse will eventually return to the center;

[0031] Formula (4) represents the vehicle capacity constraint;

[0032] Formula (5) represents the elimination of sub-loops;

[0033] In each formula, Q represents the maximum load of the vehicle.

[0034] Optionally, in S3, the first stage of the heuristic algorithm for solving the improved initial solution of the pharmaceutical logistics vehicle path optimization model uses the insertion method and the neighbor point method to generate the initial solution, including the following steps:

[0035] S31: Add the distance matrix obtained in S1 to the worksheet;

[0036] S32: Encode the customer points using natural numbers and number them in sequence according to the natural number sequence; arrange the sequence of numbers using the insertion method and the neighbor point method. The arranged sequence is called a chromosome, and the generated chromosome is also called an initial solution.

[0037] S33: Set the population size, calculate the number of data in a row of the distance matrix, and then subtract the number of warehouses to get the number of customer points, and assign the number of customer points to the size of the population size;

[0038] S34: A chromosome that is 50% of the population size, generated using the insertion method;

[0039] S35: The remaining chromosomes were generated using the neighbor point method;

[0040] S36: Split a complete chromosome into several sequences that meet the conditions according to the constraints;

[0041] S37: The fitness function is set to the inverse of the objective function value Calculate the fitness function value of each chromosome;

[0042] S38: First select the chromosome with the best fitness in the population to ensure that this chromosome enters the next generation; then use the Russian roulette selection method to select the initial population of the next generation based on the fitness value;

[0043] S39: performing crossover and mutation operations on the selected population according to the set crossover rate and mutation rate;

[0044] S310: Set the number of iterations to n, return to S36 before the set number of iterations n is reached, and stop iterating after the set number of iterations n is reached.

[0045] Optionally, in S34, the steps of the insertion method are:

[0046] S341: Select the customer point farthest from the warehouse as the starting point;

[0047] S342: From the remaining customer points, the customer point with the smallest insertion value is selected as the next customer point to be inserted;

[0048] S343: Determine the position where the customer point should be inserted based on the insertion position with the maximum saving value;

[0049] S344: Under vehicle capacity constraints, repeat S342 to S343. When the charging path cannot be expanded any further, another route is established until all customer points are included in the path.

[0050] Optionally, in S35, the steps of the neighbor point method are:

[0051] S351: Set the warehouse as the starting node of the entire loop;

[0052] S352: Find a node closest to the last node just added to the loop, and add it to the path;

[0053] S353: Repeat S352 until all nodes are added to the path;

[0054] S354: Connect the last added node and the starting node to form a loop.

[0055] The beneficial effect of the present invention is that the algorithm in the present invention can effectively provide a better initial solution for the heuristic algorithm and effectively improve the result of the medicine distribution path optimization. The present invention can effectively reduce the distribution cost, improve the distribution efficiency, and enhance customer satisfaction.

[0056] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

[0058] Figure 1 This is a flow chart of the pharmaceutical logistics vehicle route optimization strategy of the present invention.

[0059] Figure 2 Flowchart of the first stage insertion method and neighbor point method in the heuristic algorithm for improving the initial solution of the present invention

[0060] Figure 3 A flowchart of the first-stage insertion method and the neighbor point method insertion method in the heuristic algorithm for improving the initial solution of the present invention;

[0061] Figure 4 A flowchart of the first-stage insertion method and the neighbor point method in the neighbor point method in the heuristic algorithm for improving the initial solution of the present invention;

[0062] Figure 5 A flowchart of the second stage genetic algorithm in the heuristic algorithm for improving the initial solution of the present invention;

[0063] Figure 6 The present invention is a flow chart of the pharmaceutical logistics vehicle path optimization method based on the heuristic algorithm of the improved initial solution. DETAILED DESCRIPTION

[0064] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0065] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0066] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0067] See also Figure 1 to Figure 6 , which is a method for optimizing the medical logistics vehicle routing based on a heuristic algorithm with an improved initial solution, comprising the following steps:

[0068] S1: Use the map API to collect the longitude and latitude information of a certain route of a pharmaceutical company, including warehouses and all customer points, and then calculate the distance matrix between each customer point (including warehouses) on each route.

[0069] S11: Use the map API to collect the longitude and latitude information of a certain route of a pharmaceutical company, including warehouses and all customer points.

[0070] S12: Calculate the round-trip distance between each two points using the map API and the longitude and latitude information of the queried warehouse and customer points.

[0071] S13: Store the queried round-trip distance in a (warehouse + all customer points)^2 matrix.

[0072] S14: Export the matrix as a csv file, which is a distance matrix including warehouses and all customer points on a certain route of a pharmaceutical company.

[0073] S2: Construct a pharmaceutical logistics vehicle path optimization model with the optimization goal of minimizing the total distance, which is the total distance the vehicle travels from the warehouse, traverses all customer points, and finally returns to the warehouse; the vehicle has a capacity limit and no maximum distance limit, and constraints are set on the objective function of the pharmaceutical logistics vehicle path optimization model.

[0074] S21: The overall optimization objective function of the pharmaceutical logistics vehicle routing optimization model described in S2 is:

[0075]

[0076] Wherein, the set of warehouses and all customer points served is N = {0, 1, ..., n}, including the set of warehouse 0 and all customer points served is N' = {1, 2, ..., n}; the set of available vehicles in the warehouse is L = {1, 2, ..., k}; i, j represents a single warehouse or customer point, i, j ∈ N, i ≠ j; d ij represents the distance of the vehicle from point i to point j; is a decision 0-1 variable, which is 1 when the car goes from point i to point j, and 0 otherwise.

[0077] S22: The objective function setting constraints of the pharmaceutical logistics vehicle routing optimization model described in S2 are as follows:

[0078]

[0079]

[0080]

[0081]

[0082]

[0083] Among the above constraints:

[0084] Formula (1) means that each customer point is served and only served once;

[0085] Formula (2) indicates that the vehicles arriving and leaving each customer point are balanced;

[0086] Formula (3) indicates that all vehicles coming out of the warehouse will eventually return to the center;

[0087] Formula (4) represents the vehicle capacity constraint;

[0088] Formula (5) represents the elimination of sub-loops;

[0089] In each formula, Q represents the maximum load of the vehicle.

[0090] S3: Design a heuristic algorithm to improve the initial solution. In the first stage, the insertion method and the neighboring point method are used to generate the initial solution. In the second stage, the genetic algorithm is used to input the initial solution obtained by the insertion method and the neighboring point method in the first stage into the genetic algorithm in the second stage for deep optimization to obtain the optimal driving path. The heuristic algorithm for improving the initial solution is used to solve the objective function of the pharmaceutical logistics vehicle path optimization model.

[0091] The first stage of the heuristic algorithm for solving the improved initial solution of the pharmaceutical logistics vehicle path optimization model described in S3 uses the insertion method and the neighbor point method to generate the initial solution, including the following steps:

[0092] S31: Add the distance matrix obtained in step 1 to the worksheet.

[0093] S32: Use natural numbers to encode customers, and number them in order of natural numbers. Arrange the sequence of numbers using the insertion method and the neighboring point method. Such a sequence is called a chromosome, and the generated chromosome is also called the initial solution;

[0094] S33: Set the population size, calculate the number of data in a row of the distance matrix, subtract the warehouse from the number of data, and then get the number of customer points. The number of customer points is assigned as the size of the population size.

[0095] S34: A chromosome that is 50% of the population size, generated using the insertion method. The steps of the insertion method are:

[0096] S341: Select the customer point farthest from the warehouse as the starting point.

[0097] S342: From the remaining customer points, the customer point with the smallest insertion value is selected as the next customer point to be inserted.

[0098] S343: Determine the position where the customer point should be inserted based on the insertion position with the maximum saving value.

[0099] S344: Under vehicle capacity constraints, repeat S342 to S343. When the charging path cannot be expanded any further, another route is established until all customers are placed in the path.

[0100] S35: The remaining chromosomes are generated using the neighbor point method. The steps of the neighbor point method are:

[0101] S351: Set the warehouse as the starting node of the entire loop;

[0102] S352: Find the node closest to the last node just added to the loop and add it;

[0103] S353: Repeat the previous step until all nodes are added to the path;

[0104] S354: Connect the last added node and the starting node to form a loop.

[0105] S36: Split a complete chromosome into several sequences that meet the conditions according to the constraints;

[0106] S37: The fitness function is set to the inverse of the objective function value, and the fitness function value of each chromosome is calculated;

[0107] S38: First select the chromosome with the best fitness in the population to ensure that this chromosome enters the next generation. Then use the Russian roulette selection method to select the initial population of the next generation based on the fitness value.

[0108] S39: According to the set crossover rate and mutation rate, the selected population is subjected to crossover and mutation operations.

[0109] S310: Set the number of iterations to n, return to S36 before the set number of iterations n is reached, and stop iterating after the set number of iterations n is reached.

[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.

Claims

1. A pharmaceutical logistics vehicle path optimization method based on an improved initial solution algorithm, characterized in that: The method comprises the following steps: S1: Use the map API to collect the longitude and latitude information of warehouses and customer points on the routes of the pharmaceutical company, and then calculate the distance matrix between each customer point including the warehouse on each route; S2: Construct a pharmaceutical logistics vehicle route optimization model with the optimization goal of minimizing the total distance; The total distance is the distance that the vehicle takes from the warehouse, through all customer points, and finally back to the warehouse; The vehicle has a capacity limit, no maximum distance limit, and sets constraints on the objective function of the pharmaceutical logistics vehicle path optimization model; S3: Design a heuristic algorithm to improve the initial solution. In the first stage, the insertion method and the neighboring point method are used to generate the initial solution. In the second stage, the genetic algorithm is used to input the initial solution obtained by the insertion method and the neighboring point method in the first stage into the genetic algorithm in the second stage for deep optimization to obtain the optimal driving path. The heuristic algorithm for improving the initial solution is used to solve the objective function of the pharmaceutical logistics vehicle path optimization model. The S1 is specifically: S11: Use the map API to collect the longitude and latitude information of warehouses and customer points included in the route of the pharmaceutical company; S12: Calculate the round-trip distance between each two points using the map API and the longitude and latitude information of the queried warehouse and customer points; S13: storing the obtained round trip distance in a 2×2 matrix; S14: export the matrix into a csv file, which is a distance matrix containing warehouses and customer points on the pharmaceutical company route; In S2, the total optimization objective function of the pharmaceutical logistics vehicle path optimization model is: Wherein, the set of warehouses and all customer points served is N = {0, 1, ..., n}, including the set of warehouse 0 and all customer points served is N' = {1, 2, ..., n}; the set of available vehicles in the warehouse is L = {1, 2, ..., k}; i, j represents a single warehouse or customer point, i, j ∈ N, i ≠ j; d ij represents the distance of the vehicle from point i to point j; is a decision 0-1 variable, which is 1 when the car goes from point i to point j, and 0 otherwise; In S2, the objective function of the pharmaceutical logistics vehicle routing optimization model sets the constraints as follows: Among the above constraints: Formula (1) means that each customer point is served and only served once; Formula (2) indicates that the vehicles arriving and leaving each customer point are balanced; Formula (3) indicates that all vehicles coming out of the warehouse eventually return to the center; Formula (4) represents the vehicle capacity constraint; Formula (5) represents the elimination of sub-loops; In each formula, Q represents the maximum load of the vehicle; In S3, the first stage of the heuristic algorithm for solving the improved initial solution of the pharmaceutical logistics vehicle path optimization model uses the insertion method and the neighbor point method to generate the initial solution, including the following steps: S31: Add the distance matrix obtained in S1 to the worksheet; S32: Encode the customer points using natural numbers and number them in sequence according to the natural number sequence; arrange the sequence of numbers using the insertion method and the neighbor point method. The arranged sequence is called a chromosome, and the generated chromosome is also called an initial solution. S33: Set the population size, calculate the number of data in a row of the distance matrix, and then subtract the number of warehouses to get the number of customer points, and assign the number of customer points to the size of the population size; S34: A chromosome that is 50% of the population size, generated using the insertion method; S35: The remaining chromosomes were generated using the neighbor point method; S36: Split a complete chromosome into several sequences that meet the conditions according to the constraints; S37: The fitness function is set to the inverse of the objective function value Calculate the fitness function value of each chromosome; S38: First select the chromosome with the best fitness in the population to ensure that this chromosome enters the next generation; then use the Russian roulette selection method to select the initial population of the next generation based on the fitness value; S39: performing crossover and mutation operations on the selected population according to the set crossover rate and mutation rate; S310: Set the number of iterations to n, return to S36 before the set number of iterations n is reached, and stop iterating after the set number of iterations n is reached; In said S34, the steps of the insertion method are: S341: Select the customer point farthest from the warehouse as the starting point; S342: From the remaining customer points, the customer point with the smallest insertion value is selected as the next customer point to be inserted; S343: Determine the position where the customer point should be inserted based on the insertion position with the maximum saving value; S344: Under vehicle capacity constraints, repeat S342 to S343. When the charging path cannot be expanded any further, another route is established until all customer points are placed in the path; In S35, the steps of the neighbor point method are: S351: Set the warehouse as the starting node of the entire loop; S352: Find a node closest to the last node just added to the loop, and add it to the path; S353: Repeat S352 until all nodes are added to the path; S354: Connect the last added node and the starting node to form a loop.

Citation Information

Patent Citations

  • Optimized design method and system for medicine logistics distribution path, and medium

    CN110852469A

  • Dynamic vehicle path optimization method based on two-stage heuristic algorithm

    CN112766614A