CN115310676A - Path optimization method and device under time-varying road network and storage medium - Google Patents
Path optimization method and device under time-varying road network and storage medium Download PDFInfo
- Publication number
- CN115310676A CN115310676A CN202210839946.1A CN202210839946A CN115310676A CN 115310676 A CN115310676 A CN 115310676A CN 202210839946 A CN202210839946 A CN 202210839946A CN 115310676 A CN115310676 A CN 115310676A
- Authority
- CN
- China
- Prior art keywords
- population
- target
- fitness
- client
- customer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
- G06Q10/047—Optimisation of routes or paths, e.g. travelling salesman problem
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/12—Computing arrangements based on biological models using genetic models
- G06N3/126—Evolutionary algorithms, e.g. genetic algorithms or genetic programming
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- Biophysics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Human Resources & Organizations (AREA)
- Health & Medical Sciences (AREA)
- Theoretical Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Strategic Management (AREA)
- Economics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Development Economics (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Evolutionary Computation (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Biomedical Technology (AREA)
- Artificial Intelligence (AREA)
- General Health & Medical Sciences (AREA)
- Genetics & Genomics (AREA)
- Game Theory and Decision Science (AREA)
- Physiology (AREA)
- Entrepreneurship & Innovation (AREA)
- Marketing (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- General Business, Economics & Management (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a method, a device and a storage medium for optimizing paths under a time-varying road network, wherein the method comprises the following steps: acquiring target data, and generating an initial population according to a preset rule; taking the initial population as a target population; carrying out fitness calculation on the target population to obtain a fitness data set; according to the fitness data set, carrying out selection operator processing on the target population through an elite retention strategy and a roulette selection strategy to obtain a second population; performing crossover operator processing and mutation operator processing on the second population to obtain a third population; taking the third population as a target population; then returning to the step of calculating the fitness of the target population to obtain a fitness data set; determining a target individual according to the fitness data set until a preset termination condition is reached; and confirming the target delivery scheme according to the target individual. The invention can be applied to the actual urban and rural network through the improved adaptive genetic algorithm, thereby realizing scientific path planning and rapid delivery scheduling and being widely applied to the technical field of path optimization.
Description
Technical Field
The invention relates to the technical field of path optimization, in particular to a method, a device and a storage medium for path optimization under a time-varying road network.
Background
With the development of science and technology, the development of urban and rural logistics is driven by the great improvement of urban and rural traffic conditions. However, the current urban and rural logistics transportation mode is mainly single-pass transportation, and the idling rate is high when vehicles return, so that the transportation cost is greatly wasted. Vehicle Routing Problem (VRP) is a combinatorial problem that finds the optimal route for a given set of customers. The simultaneous pick-and-place vehicle routing problem (VRPSPD) is an important variant of VRP.
Study of the vehicle routing problem with time windows and its variants, each customer is assigned a predefined time interval for extracting and delivering time windows in the VRPSPD. Angelelli and Mansini proposed this problem, and proposed a branch-and-cut-and-price algorithm for this problem. Yong Wang CMDPLN optimization based on soft time window and load separation relates to a multi-station goods taking and distributing vehicle path problem under a customer demand segmentation strategy and time window constraint; amin Chaabane proposes a reverse logistics path problem for recycling a new scrapped vehicle with a time window. An effective heuristic is developed to address large and real-scale instances in a reasonable amount of time.
Although the research results on the path problem of the freight vehicles are quite abundant, certain limitations still exist, and the distribution research cannot be carried out on a specific urban and rural network.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, and a storage medium for path optimization in a time-varying network, which can implement scientific path planning and fast delivery scheduling.
In one aspect, an embodiment of the present invention provides a method for optimizing a path in a time-varying road network, including:
acquiring target data, and generating an initial population according to a preset rule; taking the initial population as a target population; the target data comprises vehicle information, position information of a customer point, distribution demand information, goods picking demand information and a service time window;
calculating the fitness of the target population to obtain a fitness data set;
according to the fitness data set, carrying out selection operator processing on the target population through an elite retention strategy and a roulette selection strategy to obtain a second population;
performing crossover operator processing and mutation operator processing on the second population to obtain a third population; taking the third population as a target population; then returning to the step of calculating the fitness of the target population to obtain a fitness data set; determining a target individual according to the fitness data set until a preset termination condition is reached;
and confirming a target delivery scheme according to the target individual.
Optionally, the obtaining of the target data and generating the initial population according to a preset rule include the following steps:
step1: sequencing the client points according to the service time window to obtain a first client sequence set, and selecting the client points with initial sequence numbers of the first client sequence set as target client points;
step2: determining a first delivery cost and selecting a second customer point according to the position information of the customer point, the delivery demand information and the pick-up demand information based on the target customer point, and incorporating the second customer point into a path plan; taking the second customer point as a target customer point;
step3: judging whether the vehicle of the path planning reaches the capacity constraint or not according to the distribution demand information, the goods picking demand information and the vehicle information, if so, turning to Step5, otherwise, turning to Step4;
step4: determining second distribution cost and selecting a third customer point according to the position information of the customer point, the distribution demand information and the delivery demand information and bringing the third customer point into a path plan; taking the third client point as a target client point, and turning to Step3;
step5: judging whether any client point is not involved in the path planning or not, if so, sequencing the client points which are not involved in the path planning according to the service time window to obtain a second client sequence set, selecting the client point with the initial sequence number of the second client sequence set as a target client point, and turning to Step2; otherwise, generating an initial population.
Optionally, the calculating the fitness of the target population to obtain a fitness dataset includes:
carrying out fitness calculation on the target population through a fitness function to obtain a fitness data set;
wherein the fitness function has an expression as follows:
wherein f represents the fitness, d (c) i ,c i+1 ) Representing customer points c i To the customer site c i+1 N represents the number of customer points.
Optionally, the performing, according to the fitness dataset, a selection operator process on the target population through an elite retention strategy and a roulette selection strategy to obtain a second population includes:
performing a victory and a disadvantage elimination operation on the target population through an elite retention strategy according to the fitness dataset, and retaining a first individual population with the target population fitness higher than a preset threshold;
obtaining a second individual group by playing the individuals except the first individual group in the target group in a roulette mode;
obtaining a second population according to the first population and the second population;
wherein, the probability expression of individual heredity in the target population is as follows:
in the formula, q i Representing the genetic probability of an individual i in the target population, f i The fitness of the individual i is represented, and n represents the population size of the target population.
Optionally, the method further comprises:
and calculating to obtain the distribution time information of the target population by a road section running time calculation method of the time-varying road network.
Optionally, the performing crossover operator processing and mutation operator processing on the second population to obtain a third population includes:
performing crossover operator processing on the second population through partial matching crossover operation;
selecting a plurality of search operators as mutation operators, and performing mutation operator processing on the second population through the mutation operators;
wherein the search operators comprise a 1-opt crossover search operator, a 2-opt crossover search operator, and a 3-opt crossover search operator.
Optionally, the determining a target individual according to the fitness data set until a preset termination condition is reached includes:
and when the iteration times reach the preset iteration times, selecting the individual with the maximum fitness in the target population as a target individual.
In another aspect, an embodiment of the present invention provides a path optimization device under a time-varying road network, including:
the system comprises a first module, a second module and a third module, wherein the first module is used for acquiring target data and generating an initial population according to a preset rule; taking the initial population as a target population; the target data comprises vehicle information, position information of a customer point, distribution demand information, goods picking demand information and a service time window;
the second module is used for calculating the fitness of the target population to obtain a fitness data set;
a third module, configured to perform selection operator processing on the target population through an elite retention strategy and a roulette selection strategy according to the fitness dataset to obtain a second population;
a fourth module, configured to perform crossover operator processing and mutation operator processing on the second population to obtain a third population; taking the third population as a target population; then returning to the step of calculating the fitness of the target population to obtain a fitness data set; determining a target individual according to the fitness data set until a preset termination condition is reached;
and a fifth module for confirming a target delivery scheme according to the target individual.
In another aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory;
the memory is used for storing programs;
the processor executes the program to implement the method as described above.
In another aspect, an embodiment of the present invention provides a computer-readable storage medium, where a program is stored, and the program is executed by a processor to implement the method as described above.
The embodiment of the invention also discloses a computer program product or a computer program, which comprises computer instructions, and the computer instructions are stored in a computer readable storage medium. The computer instructions may be read by a processor of a computer device from a computer-readable storage medium, and the computer instructions executed by the processor cause the computer device to perform the foregoing method.
The embodiment of the invention firstly obtains target data and generates an initial population according to a preset rule; taking the initial population as a target population; the target data comprises vehicle information, position information of a customer point, distribution demand information, goods picking demand information and a service time window; calculating the fitness of the target population to obtain a fitness data set; according to the fitness data set, carrying out selection operator processing on the target population through an elite retention strategy and a roulette selection strategy to obtain a second population; performing crossover operator processing and mutation operator processing on the second population to obtain a third population; taking the third population as a target population; then returning to the step of calculating the fitness of the target population to obtain a fitness data set; determining a target individual according to the fitness data set until a preset termination condition is reached; and confirming a target delivery scheme according to the target individual. The invention can fit the actual urban and rural network to plan the path by the improved adaptive genetic algorithm, thereby realizing scientific path planning and rapid delivery scheduling.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart illustrating the overall steps provided by an embodiment of the present invention;
fig. 2 is a schematic diagram of a network mode for picking up, delivering and distributing goods simultaneously in urban and rural logistics according to an embodiment of the invention;
FIG. 3 is a schematic diagram of the driving speed of a vehicle on a road section r in each time period according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart of an IAGA according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a chromosome structure provided by an embodiment of the invention;
FIG. 6 is a schematic illustration of chromosome decoding provided by an embodiment of the present invention;
FIG. 7 is a schematic diagram of a crossover operation provided by an embodiment of the present invention;
FIG. 8 is a schematic diagram illustrating the principles of three search operators according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a convergence curve of an optimal IAGA solution provided by an embodiment of the present invention;
FIG. 10 is a schematic of the convergence curve of the GA optimal solution;
FIG. 11 is a graph showing the variation trend of the total cost and the carbon emission cost of example 1 and the difference between the total cost and the carbon emission cost;
FIG. 12 is a graph showing the trend of the total cost and the carbon emission cost of example 2 and the difference therebetween, according to an embodiment of the present invention;
FIG. 13 is a graph of the trend of the total cost and the penalty cost in different proportions of the soft and hard time windows in the computational example 1 according to the present invention;
FIG. 14 is a graph of the trend of the total cost and the penalty cost in different proportions of the soft and hard time windows in the computational example 2 according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
To solve the problems in the prior art, in one aspect, an embodiment of the present invention provides a method for optimizing a path in a time-varying road network, with reference to fig. 1, including:
acquiring target data, and generating an initial population according to a preset rule; taking the initial population as a target population; the target data comprises vehicle information, position information of a customer point, distribution demand information, goods picking demand information and a service time window;
calculating the fitness of the target population to obtain a fitness data set;
according to the fitness data set, carrying out selection operator processing on the target population through an elite retention strategy and a roulette selection strategy to obtain a second population;
performing crossover operator processing and mutation operator processing on the second population to obtain a third population; taking the third population as a target population; then returning to the step of calculating the fitness of the target population to obtain a fitness data set; determining a target individual according to the fitness data set until a preset termination condition is reached;
and confirming the target delivery scheme according to the target individual.
Optionally, the obtaining of the target data and the generating of the initial population according to the preset rule include:
step1: according to the service time window, sequencing the client points to obtain a first client sequence set, and selecting the client points with initial sequence numbers of the first client sequence set as target client points;
step2: determining first distribution cost and selecting a second customer point according to the position information, the distribution demand information and the goods picking demand information of the customer point based on the target customer point, and incorporating the second customer point into the path planning; taking the second customer point as a target customer point;
step3: judging whether the vehicle with the planned path reaches the capacity constraint or not according to the distribution demand information, the goods picking demand information and the vehicle information, if so, turning to Step5, and if not, turning to Step4;
step4: determining a second distribution cost and selecting a third customer point according to the position information, the distribution demand information and the delivery demand information of the customer point and the target customer point, and bringing the third customer point into the path planning; taking the third client point as a target client point, and turning to Step3;
step5: judging whether any client point is not involved in the path planning or not, if so, sequencing the client points which are not involved in the path planning according to a service time window to obtain a second client sequence set, selecting the client point with the initial sequence number of the second client sequence set as a target client point, and turning to Step2; otherwise, generating an initial population.
Optionally, the fitness calculation is performed on the target population to obtain a fitness data set, including:
carrying out fitness calculation on the target population through a fitness function to obtain a fitness data set;
wherein the fitness function has the expression:
wherein f represents the fitness, d (c) i ,c i+1 ) Representing customer points c i To the customer site c i+1 N represents the number of customer points.
Optionally, according to the fitness dataset, performing selection operator processing on the target population through an elite retention strategy and a roulette selection strategy to obtain a second population, including:
performing a winning and rejecting operation on the target population through an elite reservation strategy according to the fitness data set, and reserving a first population group with the target population fitness higher than a preset threshold;
obtaining a second individual group by playing the individuals except the first individual group in the target group in a roulette mode;
obtaining a second population according to the first population and the second population;
wherein, the probability expression of individual heredity in the target population is as follows:
in the formula, q i Representing the genetic probability of an individual i in the target population, f i The fitness of the individual i is represented, and n represents the group size of the target population.
Optionally, the method further comprises:
and calculating to obtain the distribution time information of the target population by a road section driving time calculation method of the time-varying road network.
Optionally, performing crossover operator processing and mutation operator processing on the second population to obtain a third population, including:
performing cross operator processing on the second population through a partial matching cross operation;
selecting a plurality of search operators as mutation operators, and performing mutation operator processing on the second population through the mutation operators;
the search operators comprise 1-opt exchange search operators, 2-opt exchange search operators and 3-opt exchange search operators.
Optionally, until a preset termination condition is reached, determining a target individual according to the fitness data set, including:
and when the iteration times reach the preset iteration times, selecting the individual with the maximum fitness in the target population as the target individual.
In another aspect, an embodiment of the present invention provides a path optimization device under a time-varying road network, including:
the system comprises a first module, a second module and a third module, wherein the first module is used for acquiring target data and generating an initial population according to a preset rule; taking the initial population as a target population; the target data comprises vehicle information, position information of a customer point, distribution demand information, goods picking demand information and a service time window;
the second module is used for calculating the fitness of the target population to obtain a fitness data set;
the third module is used for carrying out selection operator processing on the target population through an elite reservation strategy and a roulette selection strategy according to the fitness data set to obtain a second population;
the fourth module is used for carrying out crossover operator processing and mutation operator processing on the second population to obtain a third population; taking the third population as a target population; then returning to the step of calculating the fitness of the target population to obtain a fitness data set; determining a target individual according to the fitness data set until a preset termination condition is reached;
and the fifth module is used for confirming the target distribution scheme according to the target individual.
The content of the method embodiment of the present invention is applicable to the apparatus embodiment, the functions specifically implemented by the apparatus embodiment are the same as those of the method embodiment, and the beneficial effects achieved by the apparatus embodiment are also the same as those achieved by the method.
Another aspect of the embodiments of the present invention further provides an electronic device, which includes a processor and a memory;
the memory is used for storing programs;
the processor executes the program to implement the method as before.
The contents of the embodiment of the method of the present invention are all applicable to the embodiment of the electronic device, the functions specifically implemented by the embodiment of the electronic device are the same as those of the embodiment of the method, and the beneficial effects achieved by the embodiment of the electronic device are also the same as those achieved by the method.
Yet another aspect of the embodiments of the present invention provides a computer-readable storage medium storing a program, the program being executed by a processor to implement the method as above.
The contents of the embodiment of the method of the present invention are all applicable to the embodiment of the computer-readable storage medium, the functions specifically implemented by the embodiment of the computer-readable storage medium are the same as those of the embodiment of the method described above, and the advantageous effects achieved by the embodiment of the computer-readable storage medium are also the same as those achieved by the method described above.
The embodiment of the invention also discloses a computer program product or a computer program, which comprises computer instructions, and the computer instructions are stored in a computer readable storage medium. The computer instructions may be read by a processor of a computer device from a computer-readable storage medium, and the computer instructions executed by the processor cause the computer device to perform the foregoing method.
The following describes in detail the implementation principle of the path optimization under the time-varying road network of the present invention:
the logistics network is provided with a distribution center, a plurality of rural service points and a plurality of urban customer nodes. The distribution center has a plurality of types of vehicles, each of which has a limited number and is not allowed to be overloaded during transportation. Customer demand information is known, each customer having one or two demand characteristics, delivery and pickup, all of which must be satisfied and always unloaded and picked when served at the same node. In addition, since customers have different requirements for service time, a mixed time window strategy is adopted, and a time penalty coefficient is introduced. Customers with hard time windows may receive early delivery services, but late deliveries will be rejected and a huge penalty cost is incurred; for customers with soft time windows, the time opportunity cost is paid early and the delay cost is paid late.
As shown in fig. 2, the vehicle starts from the distribution center, firstly, the delivery of industrial products, daily necessities and other materials is completed at a rural service point, then fresh agricultural products are loaded to the city client for distribution and recovery, and then the vehicle returns to the distribution center.
For ease of analysis and study, the following assumptions were made:
(1) The distribution center has enough product supply capacity; (2) The rural service point has enough agricultural product supply capacity to provide service for urban customers; (3) The positions of all the nodes are known, all the nodes are connected in a straight line, and the distance is calculated according to an Euclidean formula; (4) In the transportation process of the vehicle, the running speed is influenced by the traffic jam condition; (5) When the car is not served within the time window required by the customer, penalty cost deviating from the time window is generated or rejected; (6) The starting position and the ending position of each route are distribution centers, and each demand point is only visited once; (7) The same customer order has the same time window for picking and delivering the goods.
A variety of traffic conditions may occur during the delivery of vehicles, each of which may persist for some time. During this time, the vehicle maintains a constant speed, which is inversely proportional to the traffic congestion index. In order to quantify the degree of road congestion, the invention introduces a real-time congestion indexTo describe the actual traffic situation.
The compound of the formula (1),is the vehicle speed in a congestion situation, v 0 The vehicle speed is the vehicle speed when the road is clear.
Different road types may also affect the congestion index in each time segment. Therefore, the invention provides a method for calculating the travel time in different time periods under each road type. When the road type is in class, a graph of the traveling speed from node to node is shown in fig. 3.
Based on the above, the time spent by the vehicle in the driving process is calculated, and the specific steps are as follows:
and Step1, dividing the road type. The invention divides the road types into three types according to two geographical types of cities and rural areas, and if the road type of a node j is in r type, the road type of a vehicle from an i node to the j node is in r type.
And Step2, dividing the service time into a sections a, and keeping the vehicle speed unchanged in the same time section under the same road type. Therefore, when analyzing the travel time from node i to node j, only whether the vehicle crosses the time period needs to be considered.
And Step3, calculating the driving time. The invention takes the example of two time periods to be crossed for analysis, namely the vehicle running time t ij And calculating the time period and the path distance when the vehicle departs. The distribution distance between arcs (i, j) is d ij The departure time is S i ,S i ∈a-1=[S a-1 ,E a-1 ]. Depending on whether the departure time and the arrival time are in the same time period, the following two cases may arise:
(1) the running speed of the vehicle always belongs to the same speed sectionThe delivery time t between arcs (i, j) ij Is calculated by the formula
(2) The departure time and the arrival time of the vehicle are in different time periods, the departure time of the vehicle is in a-1 time period, the departure time of the vehicle is in a time period a when the vehicle arrives at a customer point, the running speed of the vehicle changes from the a-1 time period to the a time period, and then the calculation formula of the total running time between arcs is as follows
The invention proposes the following model construction:
wherein, N: the set of all nodes in the distribution network, N = {0,1,2, \8230 =, s, s +1, \8230;, s + N }, where N is 0 = 0 represents a single distribution center; a: a set of rural service points, a = {1,2, \8230;, s }, a ∈ N; a. The 1 : set of rural service points for hard time window requirements, A 1 ∈A;A 2 : set of rural service points for soft time window requirements, A 2 E is A; b: a set of city client nodes, B = {1,2, \8230;, N }, B ∈ N; b is 1 : set of city client nodes with hard time window requirements, B 1 ∈B;B 2 : set of city client nodes with soft time window requirements, B 2 Belongs to B; l: set of all vehicle types at the distribution center, L = {1,2, \8230 =, L }; q l : representing the maximum load capacity, Q, of a type I vehicle L ={Q 1 ,Q 2 ,…,Q l };K l : a collection of the number of i types of vehicles for the distribution center; k: represents the set of all vehicles in the distribution center, K = { K = { 1 ,k 2 ,…,k l }; r: the road types divided on the distribution route belong to R; t: a ∈ T in the service period of the distribution center; q. q.s i : the delivery demand of customer i; p is a radical of i : the pick-up collection amount of the customer i; d is a radical of ij : the travel distance from node i to node j;the road section congestion coefficients from the node i to the node j in the r-type a time period; s. the a : the start time of the a-th time period; e a : the end time of the a-th time period; w is a group of ijlk : accessing the total amount of undelivered goods loaded on the vehicle before the kth vehicle of the l type reaches the node j after the node i is accessed; p is ijlk : accessing a node i and then accessing a kth vehicle of the l type to the collected total goods loaded on the vehicle before the kth vehicle reaches a node j; t is t ij : when the vehicle travels from node i to node jA (c) is added;the driving speed of the kth vehicle of the l type from the node i to the node j in the a time period of the r section; v. of 0 : speed of the road when the road is unblocked; e.g. of the type 0 : unit carbon emission cost; e.g. of the type f : a unit carbon emission coefficient;the unit distance no-load fuel consumption of the kth vehicle of the l-th type;a unit distance full fuel consumption of the kth vehicle of the l-th type; [ ET i ,LT i ]: the earliest and latest service time ranges requested by client i; [ T ] 0 ,T 1 ]: the service time range of the distribution center; t is a unit of ilk : the time when the kth vehicle of the l-th type reaches the node i; ST (ST) i : the service time of customer i;the departure cost coefficient of the kth vehicle of the l type;a transportation cost coefficient per unit time for the kth vehicle of the l-th type;vehicle unit early cost for soft time windows;vehicle units for soft time windows are late to cost;vehicle unit early cost for hard time windows;vehicle units for hard time windows are late to cost; c: the average price of fresh agricultural products; δ: the spoilage rate of fresh agricultural products;
equation (4) is an objective function of the present invention, including vehicle use cost, vehicle transportation cost, carbon emission cost, cargo loss cost, and time window penalty cost; equation (5) indicates that the total cargo load of the vehicle during transport does not exceed the maximum load capacity of the vehicle; equation (6) represents a vehicle number of use constraint; equations (7) and (8) represent the flow constraints for pick and delivery requirements in the vehicle path; equation (9) indicates that each customer can only be serviced by one vehicle; formulas (10) and (11) represent flow balance constraints, so that the vehicle is ensured to reach a client needing to provide service, and the vehicle must leave the client after the service is finished; equations (12) - (14) ensure that the vehicle service sequence is distribution center-rural customer-city customer-distribution center; the formula (15) limits the vehicle running track to be a simple circle, and avoids the generation of a sub-loop; (16) indicating the time of arrival of the vehicle at the customer; the formula (17) ensures that all services are carried out within the starting time period of the distribution center; equation (18) shows that the cargo capacity of the vehicle leaving the distribution center can meet the demands of the rural customers and does not exceed the maximum cargo capacity of the vehicle; equation (19) indicates that the amount of cargo taken from the rural customer can meet the demand of the urban customer and does not exceed the maximum load capacity of the vehicle.
The problem environment considered by the invention is that the system has a mixed time window, the vehicle running speed is continuously changed, the types of client nodes are various, the system belongs to NP-hard problems, and the problem is difficult to solve by using an accurate algorithm, so a meta-heuristic method is considered to solve the problem. The genetic algorithm is an efficient method for solving the mixed integer programming model, has fast and random global search capability, and can find a solution of an NP-hard problem in reasonable time. However, the search of Genetic Algorithm (GA) is blind, inefficient and time consuming. Therefore, the Improved Adaptive Genetic Algorithm (IAGA) provided by the invention uses two selection mechanisms of elite reservation and roulette to keep the excellence of the population, and uses three neighborhood search operators as mutation operators, so that the large-scale and low-efficiency optimization searching capability can be kept, the problem of low efficiency can be solved, and the solving capability of the algorithm can be further Improved. The specific flow of IAGA is shown in fig. 4.
Chromosome coding rules:
the invention adopts integer coding, and because the model established by the invention has a specified distribution sequence, the vehicle needs to serve the client set A first and then the client set B. If two client sets are coded together, many infeasible solutions are generated due to cross-mutation, resulting in inefficient algorithms. Therefore, the two types of clients adopt segmented coding, the client set A is in front of the client set B, and the respective cross variation of the client set A and the client set B does not influence each other. The chromosome structure is shown in FIG. 5. The distribution center is denoted by 0, and 1 to 8 denote customer nodes. Each gene has an index value of the vector and is linked to four rows of parameter chromosomes. These chromosomes contain customer locations, delivery demands, pick-up demands, and nodes that provide delivery services. The main chromosome is connected to form a goods taking and delivering route by judging the same vehicle index (k) on the chromosome, and each vehicle stops at a node to meet the service requirement of the node. The first row of the parameter chromosome shows the node index that does not contain the distribution center. The second row represents delivery demand. The third row represents the pick-up demand. The fourth row represents the node index (containing the distribution center) that provides the distribution service for the nodes in the first row. The numbers represent vehicle indices, each vehicle traveling in the order of nodes on the parameter chromosome corresponding to the vehicle index.
Generating an initial population:
the quality of the initial solution influences the solving quality of the algorithm, if the initial population is generated randomly, more invalid solutions are easily caused, and the convergence of the algorithm is accelerated. In order to improve the generation probability of a feasible solution, when an initial seed group is generated, chromosomes with the length being the number of the client points are randomly generated, and the idea of a greedy algorithm is introduced to generate the initial seed group, wherein the specific idea is as follows:
stage one: first, the rural customers and the city customers served by the rural customers are divided into a group.
Step1: randomly dispatching a vehicle, sequencing the earliest service time corresponding to the rural client points in each group from small to large, and selecting the group corresponding to the rural client with the smallest earliest service time for service;
step2: judging whether the current vehicle reaches the capacity constraint, if so, turning to Step4, otherwise, carrying out the next Step;
step3: calculating the arrival time of all rural clients with the minimum number in the rest client groups by taking the current rural client as a starting point, judging whether the arrival time is in the client time window, selecting the client with the minimum service starting time from all the client groups meeting the condition to insert into the path, if the calculated arrival time is earlier than the starting time of the time window, selecting the rural client with the arrival time closest to the starting time of the time window and the corresponding client group to insert into the current path, and turning to Step2;
step4: and judging whether the remaining client groups exist or not, if so, turning to Step1, and otherwise, generating an initial population.
And a second stage: the time of arrival of the vehicle at each customer site and the time of departure and return to the distribution center are calculated.
The method comprises the steps of firstly calculating the distance between a first customer and a distribution center on each route, and calculating the time when the vehicle leaves the distribution center according to the earliest starting time of the first customer served by each vehicle as the time when the first customer arrives at the customer. And calculating the time of the vehicle reaching each customer point according to the distance and the speed between the customer points on each route. And finally, calculating the distance between the last client on the route and the distribution center, and calculating the time for returning to the distribution center.
FIG. 6 is a chromosome decoding process, generating an initial solution according to the above steps: the number 0 is first inserted before the customer site where service is initiated, representing the vehicle from the distribution center at that time, and the customers are then grouped. After grouping, all the clients are sorted from morning to evening according to the service time, the client 2 with the minimum earliest service time is selected from the clients 1 to 4 to serve as the first client of the vehicle 1, the client 5 served by the client 2 is also arranged in the path, the arrival time from the client 2 to the client which is not served in the numbers 1 to 4 is calculated, and the optimal client 3 is selected to serve. And sequentially selecting subsequent customers from 1-4 according to the same method, and returning the vehicles to the distribution center until the vehicle capacity constraint is met. As shown in fig. 6, the vehicle 1 starts from the distribution center, first serves the customer 2, goes to the customer 3, finally returns to the distribution center after serving the customer 5, and so on, and obtains an initial solution.
And (3) fitness calculation:
randomly generating n chromosomes with the length of the customer point number, and calculating the current customer point c i To the next customer site c i+1 A distance d (c) therebetween i ,c i+1 ) Then the total distance of an initial path is:
taking the reciprocal of the sum of the distances as the fitness of the corresponding individual, the fitness function f is:
designing a genetic operator:
(1) Selection operator
In genetic algorithms, to improve the quality of the solution of the algorithm, elite retention and roulette selection are combined in the selection operation. In order to avoid the situation that some individuals with larger fitness value are eliminated with small probability when the roulette method is adopted during evolution, an elite reservation strategy can be used for carrying out the selection and elimination operation, and a certain number of individuals with the highest fitness in each generation of population are selected to directly enter the next generation. And (4) carrying out roulette selection on non-elite individuals and carrying out cross mutation operation. This selection strategy can preserve the excellent individuals in the population from being lost due to cross-mutation. Let the population size be N, the fitness f of the individual i i Then the probability that the individual i is selected to be inherited to the next generation is:
roulette selection can be simulated using the following sub-process: (1) in the [0,1 ]]Generating a random number h which is uniformly distributed in the interval; (2) if h is less than or equal to p 1 ,p 1 Representation of chromosome x 1 The cumulative probability of (2), then chromosome x 1 Selecting the selected plants; (3) if p is k-1 <h≤p k (2. Ltoreq. K. Ltoreq.N), then chromosome x k And (6) selecting. Wherein p is i Referred to as chromosome x i (i =1, 2...., n) is calculated as:
wherein q is j Representing chromosome x j The probability of being selected, i, represents the ith chromosome in the population.
(2) Crossover operators and mutation operators
The invention adopts an improved self-adaptive genetic algorithm and self-adaptively adjusts the crossover and mutation probability according to the population fitness value.
Wherein, P c 、P m Respectively, cross and mutation probabilities, P c1 Represents the maximum value of the cross probability, P c2 Denotes the minimum value of the cross probability, P m1 Representing the maximum value of the probability of variation, P m2 Minimum value of the probability of variation, f m Is the maximum fitness value of the population,f * is an individual fitness value, f a Is the population average fitness value, and f is the individual fitness.
1) Interleaving
The invention adopts a method of partial matching and crossing operation, and the partial matching and crossing repairs crossed chromosomes by establishing a mapping relation between different chromosome genes after the crossing operation is executed. Here, a partial matching intersection with an intersection point of 2 is selected, and the specific operation is as follows: two intersections are randomly selected in the chromosome, a region between the two points is defined as a matching region, and the codes in the matching region are subjected to position exchange, as shown in fig. 7. For genes outside the matching region in the offspring 1 and the offspring 2, if the occurrence of the gene which is completely exchanged with the gene occurs repeatedly, the genes are exchanged one by one according to the positions in the matching region.
2) Mutation operation
The present invention randomly selects one of the following three variation modes to be executed when performing the variation operation, as shown in fig. 8. The concrete introduction is as follows:
mode 1:1-opt exchange search operator, namely randomly intercepting one gene point and inserting the gene point into another position in the path; mode 2:2-opt exchange search operator, namely randomly selecting two gene point exchange positions; mode 3:3-opt crossover search operators, randomly selected 3 gene points, and the positions of the gene points are sequentially exchanged from front to back.
Example analysis:
(1) Parameter setting
The IAGA proposed by the present invention is programmed via MATLAB 2018 b. The parameters of the algorithm are set as follows, depending on the scale of the example. The initial population NIND is 50, the maximum iteration number MAXGEN is 1000, the crossing probability Pc interval is [0.45,0.95], the variation probability Pm interval is [0.001,0.1], and the value of the surrogate channel GGAP is 0.9. When the mutation probabilities are [0.001,0.025], (0.025, 0.05 ]), and (0.05, 0.1], the mutation operations are performed by selecting the methods 1,2, and 3, respectively.
(2) Basic data
Example 1 the data of orders related to the services of a logistics company in M city a is taken as a test set, which includes 1 distribution center and 20 customer orders, and the basic data of the distribution center and the position coordinates, the demand, the expected time window and the like of each demand point are shown in table 1. Wherein 0 represents a distribution center, the numbers 1-12 represent city customer nodes, and the numbers 13-20 represent rural distribution points. Example 2 is data generated randomly, and assuming that coordinates of a distribution center are (25, 25), 50 customer nodes are generated randomly, wherein horizontal and vertical coordinates are generated randomly within the ranges of [26,50], [30,60], respectively. The information of the delivery and pick-up demand of the city client and the information of the delivery demand of the rural client are randomly generated within 0.5,2, and the pick-up demand information of the rural client is determined according to the information of the delivery demand required by the city client served by the rural client. The time window of the rural client is randomly generated between [7, 00, 10. Wherein 0 represents a distribution center, the numbers 1-30 represent city customer nodes, and the numbers 31-50 represent rural distribution points. Other data information is shown in tables 2 and 3.
TABLE 1
TABLE 2
TABLE 3
Based on massive traffic travel data, vehicle track data and position data on a Baidu map, the regional road type distribution published by an M city traffic planning network is combined, and the next day congestion index can be predicted by utilizing big data. The road type is judged by two geographical distribution positions of a city and a countryside, the road type of the city node is I type, the geographical position of the countryside is complex, wherein, the road section with the countryside client number of 13-16 is changed into II type in the calculation example 1, the road section with the number of 17-20 is changed into III type, the road section with the number of 31-40 is changed into II type in the calculation example 2, the road section with the number of 41-50 is changed into III type, and the predicted traffic jam indexes of different periods under each road type are shown in the table 4.
TABLE 4
(3) Algorithm performance analysis
In the experiment, the performance of the IAGA and the performance of the GA are respectively evaluated by using two groups of data of the calculation example 1 and the calculation example 2, and the solving performance of the IAGA is verified to be better. Table 5 gives the test results, taking the optimal solution for 10 runs. Fig. 9 and 10 are convergence curves of IAGA and GA solutions for example 1 and example 2, respectively. In table 5, VN represents the number of vehicles used, TC represents the total cost of the distribution scheme, CV represents the total transportation cost, CF represents the carbon emission cost, CE represents the total damage cost, CT represents the total cost of violating the time window, TT represents the total transportation time of the distribution scheme, TD represents the total transportation distance of the distribution scheme, CPUT represents the program operation time, and GS is the improvement ratio.
As can be seen from Table 5, the IAGA designed in this study has a better optimization effect than GA at the optimal cost. In terms of the quality of the solution, the total delivery costs generated by the two algorithms based on the optimal delivery strategy were compared: in example 1, the total distribution cost of IAGA is 15.14% lower than GA; in example 2, the reduction was 8.92%. The solution effect of the IAGA is better than that of the GA. Meanwhile, the research also finds that the optimization effect of the IAGA on the penalty cost is better, the penalty cost is reduced by 56.05% and 31.04% respectively, and the satisfaction degree of the customer on the distribution service is favorably improved. Compared with the solving speed of the two algorithms by the CPUT calculation result, the time consumption of the IAGA is less, and 38.35 percent and 58.49 percent are saved respectively. Therefore, the IAGA can provide a better solution scheme quickly, which is beneficial to reducing cost and improving efficiency of enterprises.
TABLE 5
As can be seen from fig. 9 and 10, the IAGA solution in abacus 1 and abacus 2 stabilized in the 100 th generation and 310 th generation, respectively; in contrast, GA reached stability in 240 th and 780 th generations. The result shows that the algorithm has better performance in the aspects of convergence speed and solution stability.
In order to verify the validity of the way in which the vehicles depart from the distribution center at different times, a comparison is made with the way in which the vehicles depart uniformly at 7 points, while keeping the other parameters of the algorithm unchanged. The experiment was conducted using two sets of data, namely, example 1 and example 2, and the results of the path planning for different starting modes of the vehicle are shown in table 6. Mode 1 represents a vehicle departing at different times. Mode 2 shows that the vehicles start from the distribution center at 7 points collectively. The remaining symbols have the same meanings as in Table 5. Tables 7 and 8 list the optimal distribution path schemes of examples 1 and 2 in mode 1. CN denotes a vehicle number, RN denotes a Route, start denotes a time when the vehicle departs from the distribution center, route denotes a Route distribution order, distance denotes a travel Distance of the vehicle under each Route, km, and Back denotes a time when the vehicle returns to the distribution center.
As can be seen from Table 6, the results of TC determination in the mode 1 are significantly better than those in the mode 2 in the two sets of calculation examples, and the average savings are 26.53% and 33.1%. The contrast is more obvious in the difference expression of the result of solving CT, and the savings are 72.38% and 81.4%. Experiments show that the mode of starting from different moments can serve the client at proper time, the probability that the vehicle violates the client time window is reduced, and the total cost is reduced. The total service time of the two modes in the vehicle service is not greatly different, and although the unified departure mode has one less vehicle in the vehicle use number than the departure mode at different moments, the total cost and other costs are not reduced. Therefore, the mode of starting at different moments is adopted, the logistics cost can be effectively reduced, the customer satisfaction degree is improved, and the method has reasonability and effectiveness.
In tables 7 and 8, as can be seen from Start, the vehicle departs at different times to serve the customer on each route; according to Route, vehicles follow the service requirements of the research, firstly deliver to rural customers and then serve to urban customers, the agricultural product delivery requirements of the rural customers to the appointed urban customers can be met, and the effectiveness of the method and the model of the research is proved. The Distance shows that the total Distance traveled by each path is not very different, which shows that the algorithm proposed by the research can reasonably distribute clients. As can be seen from Back, the moment of return to the distribution centre is before the latest time required by the distribution centre, illustrating the effectiveness of the algorithm of the present study.
TABLE 6
TABLE 7
TABLE 8
CN | RN | Start | | Distance | Back | |
2 | 1 | 7:15 | 0→43→34→1→17→16→0 | 87.76 | 10:40 | |
2 | 2 | 7:44 | 0→49→45→28→22→21→20→0 | 119.39 | 12:01 | |
1 | 3 | 7:36 | 0→44→19→18→0 | 53.49 | 9:46 | |
3 | 4 | 7:38 | 0→41→32→40→6→11→9→13→12→0 | 93.54 | 11:37 | |
3 | 5 | 7:16 | 0→50→33→38→29→2→30→10→0 | 98.36 | 11:21 | |
1 | 6 | 7:39 | 0→37→39→3→4→0 | 71.13 | 10:18 | |
2 | 7 | 8:04 | 0→35→46→31→23→7→8→0 | 83.04 | 11:20 | |
1 | 8 | 7:38 | 0→48→27→42→26→14→15→0 | 97.26 | 11:42 | |
2 | 9 | 7:39 | 0→47→36→25→5→24→0 | 98.3 | 10:46 |
And (3) sensitivity analysis:
(1) Analysis of different congestion indices
The influence of traffic jam of different degrees on the model is discussed by setting four different conditions. The four cases are respectively: case1 represents a time-varying speed, and Case2, case3, and Case4 represent fixed values of the traffic congestion indexes 1.2, 1.4, and 1.75, respectively. And calculating the vehicle running speed according to a formula, and solving the model of the research by adopting IAGA. Table 9 shows the optimal distribution scheme and the time consumption for solving under different congestion indexes. GAP1 obtains the relative error between the optimal solution and the optimal solution at a time-varying speed when the congestion index is constant, and GAP2 obtains the relative error between the optimal solution and the optimal solution at a time-varying speed when the congestion index is constant. The remaining symbols are as in Table 5.
TABLE 9
As can be seen from table 9, when the congestion index is fixed, the total cost of logistics distribution gradually increases as the urban road congestion index rises. Under the same calculation example, the optimal solution obtained under different congestion indexes has a certain error with the optimal solution obtained under the time-varying speed. The errors of example 1 are: -6.69%, -3.23%, 43.46%, wherein the error between the result of the solution at a congestion index of 1.4 and the result of the solution at a time-varying speed is minimal; the errors of the calculation example 2 are: -2.05%, -0.05%, 1.38%, wherein the result of the solution at a congestion index of 1.4 has the smallest error with the result of the solution at time-varying speed. The larger or smaller congestion index and the error of the solution result at the time-varying speed are increased. Because the road congestion can influence the vehicle speed, the consideration of the congestion degree of the road has important significance on the establishment of the distribution scheme.
As can be seen from table 9, the time consumed for solving the two sets of examples is more than the time consumed for solving the two sets of examples at the time-varying speed when the speed is constant, which can reflect that the algorithm set by the research can solve the time-varying speed model faster. Thus, considering time-varying speeds saves time cost for algorithm implementation. Under the time-varying speed, the solution time of the formula 1 and the formula 2 is 95.4061 seconds and 137.3125 seconds respectively. The distribution center typically makes a distribution plan based on the existing orders the day before distribution, so algorithmic time cost at time-varying speeds is feasible.
(2) Carbon emission analysis
Since the carbon emission cost is a fraction of the total cost, variations in the cost per unit of carbon emission will have some impact on the total cost. Within a certain range, when the unit carbon emission cost is increased, the carbon emission amount is slowly reduced, and the environment is more friendly. For both sets of equations, the trends for TC, CF and IR are shown in fig. 11 and 12, respectively, when the cost per carbon emission increases from 0.3 yuan/kg, with IR being the difference between TC and CF.
As can be seen from fig. 11 and 12, when the carbon tax is at [0.3,10], the total cost and the total carbon emission cost are always on the rising trend as the carbon tax increases. Therefore, in order to reduce carbon emissions, it is essential to establish a reasonable carbon emission tax quota. The difference IR between the total cost and the carbon emission cost also has a slow rising trend, which means that the increase of carbon tax will also have a negative impact on other costs, and the profit of the enterprise will be reduced. Therefore, from the perspective of the above experiments, the enterprise should analyze the impact of carbon taxes on the overall cost performance, thereby improving the economic, environmental, and sustainable development of the enterprise.
(3) Analysis of different mixing time window ratios
In order to verify the influence of the change of the proportion of the soft and hard time windows on the establishment of a distribution scheme, the research respectively sets the proportion of the number of clients of 5 kinds of soft and hard time windows according to different client scales, and calculates each proportion 10 times by using the algorithm provided by the research, and then obtains the optimal result. FIG. 13 is a graph of the trend of the total cost and the time window penalty cost solved in the calculation examples 1 and 2, respectively, and the symbols are shown in the same tables 4-5.
As can be seen from fig. 13 and fig. 14, under the same calculation example, the penalty cost caused by violating the time window is in direct proportion to the total cost of the optimal distribution scheme, and as the proportion of the hard time window increases, the optimal solutions of the penalty cost and the total cost also increase, and the variation difference caused by different calculation example ranges also differs. Therefore, when the total size of the customers is fixed, if the customer proportion of the hard time window is relatively large, the service requirements of the customers can be met firstly in the process of preparing the distribution scheme, and the penalty cost caused by violating the customer time window or the huge loss caused by rejection is reduced, so that the distribution total cost of the enterprise is reduced.
The invention aims at the problem of simultaneous goods taking and delivery under the urban and rural background, and the logistics demand party is of two types, namely urban and rural. In the distribution mode, the problem of the path of the goods taking and delivering vehicle is different from that of the ordinary goods taking and delivering vehicle at the same time, and service and served relations exist among nodes. The invention considers that the vehicle running speed can change along with time under different road conditions, provides the problem of taking and delivering the goods vehicle path with a mixed time window under a time-varying road network, establishes an optimization model aiming at minimizing the total cost, designs an improved adaptive genetic algorithm for solving the delivery scheme, and verifies the effectiveness by utilizing experiments. The results show that: (1) In order to reduce logistics cost and reduce environmental pollution, an enterprise can comprehensively consider the existing logistics resources, logistics distribution modes, time windows, traffic network conditions and other factors for scientific optimization when planning the distribution vehicle paths, reasonably plan travel modes and routes, and reduce the total cost and the time window punishment cost. (2) The improved adaptive genetic algorithm is stable in calculation result and performance, and the effectiveness of the algorithm provided by the invention is proved. (3) Traffic congestion can affect vehicle speed and thus vehicle path planning. The higher the vehicle speed, the lower the total cost is not necessarily, and therefore a suitable travel speed is selected to reduce the total distribution cost. (4) For different mixing time window proportions, the smaller the customer number proportion of the hard time window is, the lower the distribution total cost is under the same customer scale; (5) The increase of carbon tax will not only affect the carbon emission cost but also negatively affect other costs, reducing the profit of the enterprise. The invention provides ideas for realizing scientific path planning, rapid delivery scheduling and total delivery cost optimization of urban and rural bidirectional logistics and simultaneous delivery and delivery and delivery, and has important practical guiding significance.
In alternative embodiments, the functions/acts noted in the block diagrams may occur out of the order noted in the operational illustrations. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality/acts involved. Furthermore, the embodiments presented and described in the flow charts of the present invention are provided by way of example in order to provide a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed, and in which sub-operations described as part of larger operations are performed independently.
Furthermore, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the described functions and/or features may be integrated in a single physical device and/or software module, or one or more functions and/or features may be implemented in a separate physical device or software module. It will also be appreciated that a detailed discussion of the actual implementation of each module is not necessary for an understanding of the present invention. Rather, the actual implementation of the various functional modules in the apparatus disclosed herein will be understood within the ordinary skill of an engineer, given the nature, function, and internal relationship of the modules. Accordingly, those of ordinary skill in the art will be able to practice the invention as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative of and not intended to limit the scope of the invention, which is defined by the appended claims and their full scope of equivalents.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following technologies, which are well known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In the description of the specification, reference to the description of "one embodiment," "some embodiments," "an example," "a specific example," or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (10)
1. A method for optimizing a path in a time-varying road network, comprising:
acquiring target data, and generating an initial population according to a preset rule; taking the initial population as a target population; the target data comprises vehicle information, position information of a customer point, distribution demand information, goods picking demand information and a service time window;
calculating the fitness of the target population to obtain a fitness data set;
according to the fitness dataset, carrying out selective operator processing on the target population through an elite retention strategy and a roulette selection strategy to obtain a second population;
performing crossover operator processing and mutation operator processing on the second population to obtain a third population; taking the third population as a target population; then returning to the step of calculating the fitness of the target population to obtain a fitness data set; determining a target individual according to the fitness data set until a preset termination condition is reached;
and confirming a target delivery scheme according to the target individual.
2. The method for optimizing the paths under the time-varying road network according to claim 1, wherein the step of obtaining the target data and generating the initial population according to the preset rule comprises the following steps:
step1: sequencing the client points according to the service time window to obtain a first client sequence set, and selecting the client points with initial sequence numbers of the first client sequence set as target client points;
step2: determining a first delivery cost and selecting a second customer point according to the position information of the customer point, the delivery demand information and the pick-up demand information based on the target customer point, and incorporating the second customer point into a path plan; taking the second customer point as a target customer point;
step3: judging whether the vehicle of the path planning reaches the capacity constraint or not according to the distribution demand information, the goods picking demand information and the vehicle information, if so, turning to Step5, otherwise, turning to Step4;
step4: determining second distribution cost and selecting a third customer point according to the position information of the customer point, the distribution demand information and the delivery demand information and bringing the third customer point into a path plan; taking the third client point as a target client point, and turning to Step3;
step5: judging whether client points are not included in the path plan or not, if so, sequencing the client points which are not included in the path plan according to the service time window to obtain a second client sequence set, selecting the client point with the initial serial number of the second client sequence set as a target client point, and turning to Step2; otherwise, generating an initial population.
3. The method according to claim 1, wherein the performing fitness calculation on the target population to obtain a fitness dataset comprises:
carrying out fitness calculation on the target population through a fitness function to obtain a fitness data set;
wherein the fitness function has an expression as follows:
wherein f represents the fitness, d (c) i ,c i+1 ) Representing customer points c i To the customer site c i+1 N represents the number of customer points.
4. The method of claim 1, wherein the performing a selection operator process on the target population according to the fitness dataset by an elite retention strategy and a roulette selection strategy to obtain a second population comprises:
performing a victory and a disadvantage elimination operation on the target population through an elite retention strategy according to the fitness dataset, and retaining a first individual population with the target population fitness higher than a preset threshold;
obtaining a second individual group by playing the individuals except the first individual group in the target group in a roulette mode;
obtaining a second population according to the first population and the second population;
wherein, the probability expression of individual heredity in the target population is as follows:
in the formula, q i Representing the genetic probability of an individual i in the target population, f i The fitness of the individual i is represented, and n represents the group size of the target population.
5. The method of claim 1, further comprising the steps of:
and calculating to obtain the distribution time information of the target population by a road section running time calculation method of the time-varying road network.
6. The method according to claim 1, wherein the performing crossover operator processing and mutation operator processing on the second population to obtain a third population comprises:
performing crossover operator processing on the second population through partial matching crossover operation;
selecting a plurality of search operators as mutation operators, and performing mutation operator processing on the second population through the mutation operators;
wherein the search operators comprise a 1-opt crossover search operator, a 2-opt crossover search operator, and a 3-opt crossover search operator.
7. The method for optimizing paths under a time-varying road network according to claim 1, wherein the determining target individuals according to the fitness dataset until a preset termination condition is reached comprises:
and when the iteration times reach the preset iteration times, selecting the individual with the maximum fitness in the target population as a target individual.
8. A path optimization device under a time-varying road network, comprising:
the system comprises a first module, a second module and a third module, wherein the first module is used for acquiring target data and generating an initial population according to a preset rule; taking the initial population as a target population; the target data comprises vehicle information, position information of a customer point, distribution demand information, goods picking demand information and a service time window;
the second module is used for calculating the fitness of the target population to obtain a fitness data set;
a third module, configured to perform selection operator processing on the target population through an elite retention strategy and a roulette selection strategy according to the fitness dataset to obtain a second population;
a fourth module, configured to perform crossover operator processing and mutation operator processing on the second population to obtain a third population; taking the third population as a target population; then returning to the step of calculating the fitness of the target population to obtain a fitness data set; determining a target individual according to the fitness data set until a preset termination condition is reached;
and the fifth module is used for confirming the target distribution scheme according to the target individual.
9. An electronic device comprising a processor and a memory;
the memory is used for storing programs;
the processor executing the program realizes the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the storage medium stores a program, which is executed by a processor to implement the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210839946.1A CN115310676A (en) | 2022-07-18 | 2022-07-18 | Path optimization method and device under time-varying road network and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210839946.1A CN115310676A (en) | 2022-07-18 | 2022-07-18 | Path optimization method and device under time-varying road network and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115310676A true CN115310676A (en) | 2022-11-08 |
Family
ID=83856542
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210839946.1A Pending CN115310676A (en) | 2022-07-18 | 2022-07-18 | Path optimization method and device under time-varying road network and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115310676A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116822773A (en) * | 2023-08-30 | 2023-09-29 | 山东福富新材料科技有限公司 | Freight path prediction method and system based on big data |
-
2022
- 2022-07-18 CN CN202210839946.1A patent/CN115310676A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116822773A (en) * | 2023-08-30 | 2023-09-29 | 山东福富新材料科技有限公司 | Freight path prediction method and system based on big data |
CN116822773B (en) * | 2023-08-30 | 2023-11-14 | 山东福富新材料科技有限公司 | Freight path prediction method and system based on big data |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112836892B (en) | Multi-target vehicle distribution path determining method and system based on improved genetic algorithm | |
CN111860754B (en) | AGV scheduling method based on ant colony and genetic algorithm | |
US7363126B1 (en) | Core area territory planning for optimizing driver familiarity and route flexibility | |
CN110334838B (en) | AGV trolley cooperative scheduling method and system based on ant colony algorithm and genetic algorithm | |
CN109002902A (en) | Subregion multistage fresh agricultural products dynamic vehicle method for optimizing route | |
CN103593747A (en) | Large-scale client point classified dispatching method based on meanshift classification | |
CN116187896B (en) | Green vehicle path problem solving method, device, computer equipment and medium | |
CN114331220B (en) | Passenger vehicle transport vehicle scheduling method and device based on order dynamic priority | |
Ren et al. | Improved ant colony optimization for the vehicle routing problem with split pickup and split delivery | |
CN110084390B (en) | Multi-vehicle collaborative carpooling path optimization method based on improved drosophila algorithm | |
CN110674968A (en) | Vehicle path optimization method for dynamic change of customer demands in express delivery process | |
CN112418514B (en) | Method for optimizing campus bus route planning by using ant colony system | |
CN113673922A (en) | Fishbone type warehouse layout-based multi-vehicle picking path problem optimization method and system | |
CN112766614A (en) | Dynamic vehicle path optimization method based on two-stage heuristic algorithm | |
CN115310676A (en) | Path optimization method and device under time-varying road network and storage medium | |
CN113344267A (en) | Logistics network resource allocation optimization method based on cooperation | |
CN115470651A (en) | Ant colony algorithm-based vehicle path optimization method with road and time window | |
CN112613701A (en) | Finished cigarette logistics scheduling method | |
CN116358593A (en) | Electric vehicle path planning method, device and equipment considering nonlinear energy consumption | |
CN116797126A (en) | Rural terminal logistics site selection-path planning method based on double-layer planning | |
CN110674967A (en) | Express vehicle path robust optimization method under uncertain driving time | |
Ge | Optimal path selection of multimodal transport based on Ant Colony Algorithm | |
CN114298379A (en) | Automatic passenger-riding-substituting parking lot layout optimization method based on simulation optimization | |
CN113919772B (en) | Time-varying vehicle path planning method and system with time window | |
CN116843262B (en) | Intelligent medicine logistics distribution path planning method based on big data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |