Electric vehicle logistics distribution path planning method based on improved genetic algorithm
By improving the genetic algorithm, natural number encoding and greedy algorithm are used to generate initial populations, combined with multiple cross-section and mutant operators and simulated annealing search, we can solve the local optimal problem in electric vehicle logistics distribution, achieve global optimal solutions, reduce costs and improve transportation efficiency.
Patent Information
- Application Number
- CN202510312117.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-07-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Electric vehicles face problems such as short range and long charging time in logistics distribution, resulting in reduced transportation efficiency and increased distribution costs. The existing optimization algorithms are difficult to find the global optimal solution and are prone to falling into local optimal.
The initial population is constructed using natural number encoding method, combined with greedy algorithms to generate initial populations, and using binary tournament selection strategies, multiple cross-and-mutation operators, a large-scale neighborhood search algorithm that simulates annealing is introduced, the maximum number of iterations is set, and an improved genetic algorithm is constructed to optimize the electric vehicle path planning.
Effectively handle the electric vehicle logistics distribution path planning under multi-objective and multi-constraint conditions, reduce the total distribution cost, improve the accuracy and efficiency of path planning, avoid local optimal traps, and achieve better path planning effects.
Smart Images

Figure CN120258674A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of logistics distribution route planning, and particularly to an electric vehicle logistics distribution route planning method based on an improved genetic algorithm. Background Art
[0002] Due to various advantages such as low carbon emissions, low noise, and being powered by renewable energy, electric vehicles show great development potential and broad market demand in the field of logistics distribution. Therefore, logistics enterprises are gradually abandoning fuel vehicles and turning to using electric vehicles for distribution services.
[0003] However, although electric vehicles are superior to traditional fuel vehicles in many aspects, their popularization and application still face problems such as short cruising range and long charging time. These problems will lead to reduced transportation efficiency and increased distribution costs. Facing these constraints, logistics enterprises are urgently seeking effective solutions. Under such strong practical demands, the problem of electric vehicle route planning has emerged. By studying the problem of electric vehicle route planning, logistics enterprises are expected to find the best solution to balance efficiency and cost, and promote the green transformation and sustainable development of the logistics industry.
[0004] Solving the problem of electric vehicle route planning is a non-linear multi-constraint optimization problem. Traditional optimization algorithms are less efficient when dealing with such problems. In contrast, intelligent optimization algorithms, with their global search ability and adaptability, can more effectively handle the diverse and complex requirements in the electric vehicle route planning problem. However, as the number of considered conditions increases, some intelligent optimization algorithms have the problem of being easily trapped in local optimal solutions and unable to find the global optimal solution.
[0005] Therefore, based on the current genetic algorithm, an electric vehicle logistics distribution route planning method based on an improved genetic algorithm is proposed. Summary of the Invention
[0006] Aiming at the above problems existing in the prior art, the purpose of the embodiments of the present invention is to provide an electric vehicle logistics distribution route planning method based on an improved genetic algorithm.
[0007] To achieve the above purpose, the technical solution adopted by the present invention is: An electric vehicle logistics distribution route planning method based on an improved genetic algorithm, including:
[0008] S1, adopting the natural number coding method to obtain an initial population.
[0009] S2, constructing an improved genetic algorithm based on the genetic algorithm as the genetic algorithm for improved electric vehicle logistics distribution route planning.
[0010] S3, using the maximum number of iterations to determine the genetic algorithm to obtain the optimal solution of the genetic algorithm.
[0011] S4. Feed the target data set into the constructed genetic algorithm to complete the discrimination of the electric vehicle logistics distribution path.
[0012] Furthermore, in S1, the chromosomes are encoded using the encoding method of natural numbers. In the proposed encoding, the chromosomes only represent the customer information and the order of the access paths, and are used as the initial solution.
[0013] Furthermore, in S2, an improved genetic algorithm is constructed based on the genetic algorithm as the genetic algorithm for improving the electric vehicle logistics distribution path planning, including:
[0014] Step S21. Generate an initial population through the greedy algorithm to replace the randomly generated initial population.
[0015] Step S22. Perform a selection operation on the population through the binary tournament selection strategy.
[0016] Step S23. Use the crossover and mutation operations in the genetic algorithm to increase the diversity of the population, and then obtain a better object through the partial elite retention strategy.
[0017] Step S24. Replace the conventional neighborhood search operator with a large-scale neighborhood search algorithm that integrates simulated annealing to correct the current solution.
[0018] Furthermore, the binary tournament selection strategy includes:
[0019] Step S221. Randomly select two individuals from the population.
[0020] Furthermore, in step S222, compare the fitness values of the two selected individuals, and select the individual with the higher fitness as the winner to join the next-generation population.
[0021] Furthermore, the large-scale neighborhood search algorithm that integrates simulated annealing includes:
[0022] Step S243. Based on the perturbation value of the current solution set, perform a random destruction operator.
[0023] Furthermore, in step S244, based on the destroyed route, perform a target optimal insertion operator to obtain a new solution.
[0024] Furthermore, in step S2443, traverse each insertable point in each route in Road_all, calculate the increase in the distribution cost of the original route after inserting the customer ind_i respectively, and save the optimal solution with the smallest increase in the distribution cost;
[0025] Road_all is the set of destroyed routes, and ind_i is the inserted customer.
[0026] Further, in step S2444, a new service route is opened, and the distribution cost of the new route is calculated. If the distribution cost of the new route is less than the increased value of the distribution cost of the optimal solution in step S2443, a new route is opened to serve customer ind_i; otherwise, the optimal solution with the smallest increased value of the inserted distribution cost in step S2443 is adopted.
[0027] ind_i is the inserted customer.
[0028] Further, the determination of the maximum number of iterations for the genetic algorithm includes: setting the maximum number of runs of the algorithm, stopping the operation when this number is reached, and finding a high-quality solution within the specified operation time.
[0029] The beneficial effects of the present invention are:
[0030] The electric vehicle logistics distribution path planning method based on the improved genetic algorithm of the present invention adopts the natural number coding method to obtain the initial population; constructs an improved genetic algorithm based on the genetic algorithm as the genetic algorithm for the improved electric vehicle logistics distribution path planning; uses the maximum number of iterations to determine the genetic algorithm to obtain the optimal solution of the genetic algorithm; sends the target data set into the constructed genetic algorithm to complete the discrimination of the electric vehicle logistics distribution path; improves the genetic algorithm, obtains a better-quality initial population through the greedy strategy, adopts 3 crossover operators and 3 mutation operators respectively in the crossover and mutation operations, adopts the partial elite retention strategy, and at the same time introduces the large-scale neighborhood search algorithm integrating simulated annealing to improve the search accuracy of the algorithm, and uses the improved genetic algorithm to solve the electric vehicle path planning model, so that the total distribution cost is minimized, achieving the effect of being able to better handle the electric vehicle logistics distribution path planning under multiple objectives and multiple constraints. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The present invention will be further described below with reference to the drawings and embodiments.
[0032] In the figure:
[0033] Figure 1 is the flowchart of the electric vehicle logistics distribution path planning method based on the improved genetic algorithm in the present invention.
[0034] Figure 2 is the flowchart of the improved genetic algorithm in the present invention.
[0035] Figure 3 is the schematic diagram of the electric vehicle planning problem in the present invention.
[0036] Figure 4 is the position diagram of each node of the logistics distribution in the present invention.
[0037] Figure 5This is the algorithm convergence comparison chart of the present invention. Specific implementation manner
[0038] To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.
[0039] The method for planning the electric vehicle logistics distribution path based on the improved genetic algorithm provided by the embodiment of the present invention adopts the natural number coding method to obtain the initial population; constructs an improved genetic algorithm based on the genetic algorithm as the genetic algorithm for improving the electric vehicle logistics distribution path planning; uses the maximum number of iterations to judge the genetic algorithm to obtain the optimal solution of the genetic algorithm; and sends the target data set into the constructed genetic algorithm to complete the discrimination of the electric vehicle logistics distribution path. By improving the genetic algorithm, a better-quality initial population is obtained through the greedy strategy, three crossover operators and three mutation operators are respectively adopted in the crossover and mutation operations, the partial elite retention strategy is adopted, and at the same time, the large-scale neighborhood search algorithm integrating simulated annealing is introduced to improve the search accuracy of the algorithm. The improved genetic algorithm is used to solve the electric vehicle path planning model, so that the total distribution cost is minimized, achieving the effect of better handling the electric vehicle logistics distribution path planning under multiple objectives and multiple constraint conditions.
[0040] The following specifically describes the implementation details of the method for planning the electric vehicle logistics distribution path based on the improved genetic algorithm of the present embodiment. The following content is only the implementation details provided for convenient understanding and is not necessary for implementing the solution.
[0041] On the premise of knowing the customer points in the distribution network, the electric vehicle starts from the distribution center, and based on the time window and cargo demand specified by the customer, completes all distribution tasks on time while meeting various constraint conditions, and finally returns to the distribution center.
[0042] Refer to Figure 3, Specifically, there is a distribution center and a certain number of electric vehicles that need to serve a group of customers. The locations of the distribution center, charging stations, and customers are known, and the demand of each customer is also known. During the distribution process, customers specify a delivery time window. If arriving before the customer-specified time window, it is necessary to wait for the customer, which will incur waiting penalty costs; if arriving after the customer-specified time window, it is considered overtime service, and late arrival penalty costs need to be paid for the part of the time exceeding the time window; if arriving within the customer-specified time window, normal distribution services can be carried out without incurring additional costs. If the battery of the electric vehicle is insufficient during the distribution process and it cannot continue the distribution service, it is necessary to find the nearest charging station to replenish the battery.
[0043] The parameters and variables required for the electric vehicle routing model are shown in Table 1.
[0044] Table 1 Definitions of parameters and variables
[0045]
[0046] Taking the minimum total distribution cost of electric vehicles as the objective function, the total distribution cost includes the following five parts: fixed cost, driving cost, charging cost, penalty cost for violating the time window, and environmental cost.
[0047] (1) Fixed cost
[0048] The formula for the fixed cost of the vehicle can be expressed as:
[0049]
[0050] Among them, the fixed cost Zf refers to the cost generated by dispatching electric vehicles to perform distribution tasks, including driver's salary, insurance cost, depreciation cost, etc. The fixed cost per vehicle is represented by cf.
[0051] (2) Driving cost
[0052] The formula for the driving cost of the vehicle can be expressed as:
[0053]
[0054] Among them, the driving cost Zd refers to the cost generated during the vehicle's driving process. The driving cost is positively correlated with the driving distance. The farther the driving distance, the greater the driving cost. The driving cost per unit distance is represented by cd.
[0055] (3) Charging cost
[0056] The formula for the charging cost of the vehicle can be expressed as:
[0057]
[0058] Among them, the charging cost Zr refers to the cost generated when an electric vehicle needs to go to a charging station for charging during the distribution process when the remaining power is insufficient to support subsequent tasks. The charging cost rate is represented by cr.
[0059] (4) Penalty cost for violating the time window
[0060] The penalty cost for violating the time window is used to quantify the loss of service quality caused by early or late delivery, and is usually proportional to the severity of the default (such as the length of the early or late time). Its purpose is to balance the distribution efficiency and customer satisfaction in path planning, and avoid ignoring service quality due to excessive pursuit of efficiency.
[0061] The formula for the penalty cost of a vehicle violating the time window can be expressed as:
[0062]
[0063] Among them, Z t is the penalty cost for violating the time window, which refers to the additional cost generated when the vehicle fails to complete the distribution service within the time window specified by the customer. Epu represents the unit penalty cost for the vehicle arriving earlier than the customer's earliest service time; Lpu represents the unit penalty cost for the vehicle arriving later than the customer's latest service time.
[0064] (5) Environmental cost
[0065] The carbon emission cost is generated because electric vehicles cause indirect carbon emissions during the charging process. As a purchaser of electricity, electric vehicles also need to fulfill the green electricity quota task, and a certain fine needs to be paid for the uncompleted part of the quota.
[0066] The formula for the environmental cost of a vehicle can be expressed as:
[0067] Z e = Z c + Z g
[0068]
[0069] Among them, Z e is the environmental cost, Z c is the carbon emission cost, Z g is the penalty cost for green electricity trading; C C is the carbon tax, C fg is the price of the green electricity fine.
[0070] To sum up, the objective function of the constructed electric vehicle path planning model is:
[0071] minZ = Z f + Zd +Z r +Z t +Z e
[0072] Among them, minZ is the total distribution cost.
[0073] Refer to Figure 1 and Figure 2 , step S1, adopt the natural number coding method to obtain the initial population;
[0074] Encode the chromosome using the natural number coding method. The length of the chromosome is v + k - 1, where v represents the distribution center and k represents the number of vehicles. For example, if there are currently 3 electric vehicles providing distribution services for 10 customers, then the numbers 1 to 10 represent the customers. The numbers 11 and 12 are used as the split path numbers. The encoded chromosome is represented as {5, 8, 6, 11, 2, 3, 12, 10, 1, 4, 7, 9}. Then the specific route can be obtained through the following steps:
[0075] Step S11, input the encoding X = {5, 8, 6, 11, 2, 3, 12, 10, 1, 4, 7, 9}.
[0076] Step S12, set the numbers greater than the largest customer number (10) to 0, and obtain X1 = {5, 8, 6, 0, 2, 3, 0, 10, 1, 4, 7, 9}.
[0077] Step S13, if there is no 0 at the beginning and end of X1, add a 0, and get X2 = {0, 5, 8, 6, 0, 2, 3, 0, 10, 1, 4, 7, 9, 0}.
[0078] Step S14, taking 0 as the breakpoint, cut all customer points into different routes, and obtain 3 routes, namely: Route 1 = {0, 5, 8, 6, 0}; Route 2 = {0, 2, 3, 0}; Route 3 = {0, 10, 1, 4, 7, 9, 0}.
[0079] Step S15, insert the charging station according to the served customers and order of each route, and calculate the target value.
[0080] In the proposed encoding, the chromosome only represents the customer information and the order of the access path, and does not include the charging station. After each generation of population completes the update operation, the charging station is inserted for decoding and fitness calculation.
[0081] S2, construct an improved genetic algorithm based on the genetic algorithm as the genetic algorithm for the logistics distribution path planning of electric vehicles.
[0082] Step S21, generate the initial population through the greedy algorithm to replace the randomly generated initial population.
[0083] The quality of the initial population has an important impact on the convergence speed and solution quality of the algorithm. Therefore, this patent abandons the traditional method of randomly generating the initial population and instead uses a greedy algorithm to generate the initial population. This method can ensure that the population contains a sufficient number of high-quality individuals, laying a good foundation for the subsequent optimization process and thus improving the overall performance of the algorithm. The specific process of the greedy insertion strategy is as follows:
[0084] Step S211: Let i = 1, randomly generate a permutation Seq of the number of customers, and preset a route Road_all (initially an empty set).
[0085] Step S212: Read the i-th customer ind_i in Seq.
[0086] When i = 1, jump to Step S214. Traverse each insertable point in each route in Road_all, calculate the increase in the delivery cost of the original route after inserting the customer ind_i respectively, and save the optimal solution with the smallest increase in the delivery cost.
[0087] Step S214: Open a new service route, calculate the delivery cost add_new of the new route. If the delivery cost of the new route is less than the increase in the delivery cost of the optimal solution in Step S213 (if i = 1, there is no need to perform the subsequent operations in S214 at this time, and directly jump to S215), then open a new route to serve the customer ind_i; otherwise, adopt the optimal solution with the smallest increase in the delivery cost in Step S213.
[0088] Step S215: Update Road_all, remove the i-th customer ind_i from Seq. If Seq is empty, enter Step S216; otherwise, i = i + 1 and enter Step 2.
[0089] Step S216: Add the split path number to the customer number of each Road_all, and use the split path number as the connection of different vehicle routes to integrate all routes. Place the remaining split path numbers at the end of the integrated permutation to obtain a coding consistent with the coding method.
[0090] Through Steps S211 - S215, a complete route plan can be obtained, and through Step S216, the route plan is transformed into an expression form consistent with the coding.
[0091] ind_i is the inserted customer, Road_all is the preset route, add_new is the delivery cost of the new route, and Seq is the randomly generated permutation of the number of customers.
[0092] Further, the feasibility, advantages and disadvantages of the solution are evaluated through the fitness function evaluation, and its design is based on the objective function of a specific problem. In the embodiment, the fitness function is set as the reciprocal of the total distribution cost. The lower the distribution cost, the higher the corresponding fitness value, and the better the distribution plan. The calculation formula of the fitness function is as follows:
[0093]
[0094] Among them, fitness represents the fitness function, and Z represents the objective function, that is, the total distribution cost.
[0095] Step S22: Perform a selection operation on the population through the binary tournament selection strategy.
[0096] The selection operation in the genetic algorithm is a process of selecting high-quality individuals from the current population to participate in reproduction. Its purpose is to retain individuals with higher fitness while maintaining the diversity of the population. The core idea of the selection operation is "survival of the fittest", that is, the higher the fitness of an individual, the greater the probability of being selected. In this embodiment, the binary tournament selection strategy is selected to perform the selection operation on the population. This method has a small complexity, does not require sorting all fitness values, is easy to parallelize, and is not easy to fall into local optima. The specific process of the binary tournament selection strategy is as follows:
[0097] Step S221: Randomly select two individuals from the population.
[0098] Step S222: Compare the fitness values of the two selected individuals, and select the individual with higher fitness as the winner to join the next generation population.
[0099] Step S223: Repeat Step S222 until the size of the new population reaches the predetermined size.
[0100] Step S23: Use the mutation operation in the genetic algorithm to increase the diversity of the population, and then obtain a better object through the partial elite retention strategy.
[0101] Further, the crossover operation in the genetic algorithm is a process of simulating gene recombination in biological evolution. By partially exchanging the genes of two parent chromosomes, new offspring individuals are generated. The crossover operation is the main way for the genetic algorithm to generate new solutions, which can effectively explore the solution space and maintain the diversity of the population. The traditional genetic algorithm generally uses one crossover operator and is prone to falling into local optima. Each type of crossover has a different neighborhood structure and can play different roles in the evolution process. In this embodiment, to avoid the algorithm falling into local optima, 3 crossover operators are used, and the probability of each operator being selected is the same. The crossover operators adopt sub-path crossover, partially mapped crossover, and position-based crossover.
[0102] Furthermore, the mutation operation in the genetic algorithm forms new offspring by randomly changing some genes in an individual, increasing the diversity of the population and preventing the algorithm from falling into a local optimal solution. Mutation usually occurs with a low probability to ensure that the population can maintain excellent characteristics during the evolutionary process and explore new solution spaces. Similar to the crossover operation idea, to prevent the algorithm from falling into a local optimum, 3 mutation operators are adopted, and each operator has the same probability of being selected. The mutation operators adopt reverse mutation, swap mutation, and insertion mutation.
[0103] Furthermore, the traditional elitist strategy means that some of the better individuals in the parent generation during the population evolution process are directly copied to the next generation without genetic operations. This strategy is beneficial for generating high-quality solutions but is also prone to falling into local problems. To solve the problem of falling into a local optimum, this embodiment adopts a partial elitist retention strategy, which is not directly copied to the next generation. By comparing the fitness values of some parent and offspring individuals, the better individuals are retained as the next generation. The specific process within each generation is as follows:
[0104] Step S231: Store the parent information.
[0105] Step S232: Generate offspring information through the algorithm.
[0106] Step S233: Sort the parent generation in descending order of fitness value. For the top 10% of the individuals, select the better individual between the parent and offspring to enter the next generation.
[0107] Step S24: Replace the conventional neighborhood search operator with a large-scale neighborhood search algorithm that integrates simulated annealing to correct the current solution.
[0108] To further improve the algorithm performance, this embodiment also incorporates a large-scale neighborhood search algorithm that integrates simulated annealing to improve the search accuracy of the algorithm. The large-scale neighborhood search algorithm is divided into two operators: destruction and repair. Compared with conventional ones such as swapping and insertion, it can greatly correct the current solution and has a better perturbation effect. The specific process of the operation is as follows.
[0109] Step S241: Randomly generate a random number. If the random number is less than 0.5, select the best solution so far. Otherwise, select an individual as the current solution according to the offspring fitness through roulette wheel selection.
[0110] Step S242: According to the number of customers, randomly generate a perturbation value. The maximum perturbation value is 30% of the number of customers, and the minimum is 1.
[0111] Step S243: Based on the perturbation value of the current solution set, perform a random destruction operator.
[0112] The process of the random destruction operator is as follows:
[0113] Step S2431: Read in the set of routes and the perturbation value in the current solution.
[0114] Step S2432: Randomly select a route from the set of routes, randomly select a customer from this route and delete it. If the route becomes empty, delete the route and update the set of routes.
[0115] Step S2433: Check if the number of deleted customers reaches the perturbation value. If it does, jump out; otherwise, go to Step S2432.
[0116] Step S244: Based on the disrupted routes, use the target optimal insertion operator to obtain a new solution.
[0117] The process of the target optimal insertion operator is as follows:
[0118] Step S2441: Let i = 1, read in the disrupted set of routes Road_all, and randomly generate a permutation Seq of the number of deleted customers.
[0119] Step S2442: Read the i-th customer ind_i in Seq.
[0120] Step S2443: Traverse each insertable point in each route in Road_all, calculate the increase in the delivery cost of the original route after inserting the customer ind_i, and save the optimal solution with the smallest increase in the delivery cost.
[0121] Step S2444: Open a new service route, calculate the delivery cost of the new route. If the delivery cost of the new route is less than the increase in the delivery cost of the optimal solution in Step S2443, open a new route to serve the customer ind_i; otherwise, adopt the optimal solution with the smallest increase in the delivery cost in Step S2443.
[0122] Step S2445: Update Road_all, remove the i-th customer ind_i from Seq. If Seq is empty, end and obtain the new set of routes. Otherwise, let i = i + 1 and go to Step S2442.
[0123] Road_all is the disrupted set of routes, ind_i is the inserted customer, ind_i is the inserted customer, and Seq is the permutation of the number of deleted customers.
[0124] Step S245: Determine whether to accept the new solution according to the Metropolis criterion and update the optimal solution.
[0125] The Metropolis criterion is as follows:
[0126] In each iteration, the algorithm randomly generates a new solution X(n + 1) from the neighborhood of the current solution X(n), and calculates the change in the objective function value ΔE = f(X(n + 1)) - f(X(n)). Whether to accept the new solution is determined according to the Metropolis criterion, as shown in formula (4-1), which is divided into two cases: If the new solution is better than the current solution (ΔE < 0), the new solution is directly accepted. If the new solution is worse (ΔE > 0), the new solution is accepted with probability p or the current solution is maintained.
[0127] ΔE = f(X (n+1) ) - f(X (n) )
[0128]
[0129] X (n) is the current solution, X (n+1) is the new solution, ΔE is the change in the objective function value, p is the probability of accepting the new solution or maintaining the current solution, and T is the time.
[0130] Step S246: Check whether the set number of local searches has been reached. If so, jump out, put the updated solution into the next generation; otherwise, go to step S242.
[0131] S3. Use the maximum number of iterations to judge the genetic algorithm to obtain the optimal solution of the genetic algorithm.
[0132] The termination criterion is also an important step affecting the quality of feasible solutions in the algorithm. Premature termination of the algorithm will result in suboptimal feasible solutions, while overly late termination will affect the running time of the algorithm and the solution efficiency. The algorithm termination criterion usually includes two common forms: one is the maximum number of iterations, that is, setting the maximum number of runs of the algorithm and stopping when this number is reached; the other is convergence judgment, that is, stopping when the solutions of the algorithm do not improve significantly in consecutive iterations. This embodiment adopts the termination criterion of setting the maximum number of iterations to find high-quality solutions within an appropriate operation time.
[0133] Step S4: Send the target data set into the constructed genetic algorithm to complete the discrimination of the electric vehicle logistics distribution path.
[0134] Step S41: Substitute the data in the target data set into the improved genetic algorithm.
[0135] For specific information of the numerical example, refer to Table 2. Among them, serial number 0 represents the distribution center. The vehicle departs from the distribution center every day and needs to return to the distribution center after completing the distribution service. The time window of the distribution center is [0, 14]. Combining the actual scenario, 0 in the time window corresponds to the departure time at 8:00 am, and the latest time to return to the distribution center is 10:00 pm, corresponding to 14 in the time window. Serial numbers 1 - 40 represent customer points. Serial numbers 41 - 45 represent charging stations. Since it is assumed in this embodiment that there is no time limit for the electric vehicle to replenish power at the charging station, the time window of the charging station is set to be the same as that of the distribution center. (The data in the target dataset is the logistics distribution information in Table 2)
[0136] Table 2 Logistics Distribution Information
[0137]
[0138]
[0139] Among them, for the locations of all specific nodes, refer to Figure 4 .
[0140] Step S42: Make conditional assumptions about the constructed model.
[0141] (1) Only consider delivering goods and do not consider collecting goods;
[0142] (2) Only consider the closed single - distribution - center problem. There is only one distribution center, and the vehicle must return to the distribution center after departing from the distribution center and completing all distribution tasks.
[0143] (3) The electric vehicle models used for distribution are all the same.
[0144] (4) When departing from the distribution center, the electric vehicle has a full charge.
[0145] (5) The geographical location information of the distribution center, charging stations, and customer points are all known conditions. At the same time, the cargo demand and service time window of each customer point have also been determined in advance.
[0146] (6) The demand of the customer point is not divisible.
[0147] (7) The electric vehicle does not consume power during the unloading operation at the customer point.
[0148] (8) Each customer point can only be served by one electric vehicle.
[0149] (9) When the electric vehicle is on a distribution task, if the power of the electric vehicle is not sufficient to support it to reach the next customer point, the vehicle has to go to the nearest charging station for charging.
[0150] (10) The vehicle can only be charged at the distribution center and the charging station, and the fast charging mode is adopted.
[0151] (11) The number of visits to the charging station is not restricted.
[0152] (12) There are no capacity and time window restrictions for the charging station.
[0153] (13) The electric vehicle travels at a constant speed during driving.
[0154] (14) All driving sections in the distribution network are flat roads, that is, the slope angle of the road is 0.
[0155] (15) Traffic congestion, accidents and vehicle failures are not considered during the distribution process.
[0156] (16) The green power considered only includes wind power and photovoltaic power generation.
[0157] Step S43: Set the parameters in the electric vehicle path planning model.
[0158] The relevant parameters are set, and the constructed electric vehicle path planning model is solved using MATLAB (R2022b). The specific algorithm parameter settings are as follows: the population size is 500, the crossover probability is 0.8, the mutation probability is 0.2, the maximum number of iterations is 200, the initial temperature is 100, the cooling rate is 0.98, and the number of inner loop iterations is 50.
[0159] Step S44: Conduct separate comparative validations based on the improved genetic algorithm, traditional genetic algorithm, and simulated annealing algorithm.
[0160] To verify the effectiveness and superiority of the improved genetic algorithm in optimizing the electric vehicle path planning problem, this patent conducts simulation experiments based on the improved genetic algorithm, traditional genetic algorithm, and simulated annealing algorithm respectively. The convergence curves of the three algorithms are shown in Figure 5 .
[0161] Furthermore, the results show that the improved genetic algorithm converges in 89 generations, while the traditional genetic algorithm converges in 944 generations, and the simulated annealing algorithm converges in 295 generations. In comparison, the improved genetic algorithm can help the algorithm perform sufficient global optimization while avoiding falling into local optima and can achieve convergence earlier. At the same time, the total distribution cost obtained using the improved genetic algorithm is 1852.78 yuan, which is 116.12 yuan and 1032.85 yuan lower than those of the traditional genetic algorithm and the simulated annealing algorithm respectively, indicating that the improved genetic algorithm can better improve the economy of distribution.
[0162] Table 3 Comparison of the solution results of the algorithms before and after improvement
[0163]
[0164] The electric vehicle logistics distribution path planning method provided by the embodiment of the present invention adopts a natural number coding method to obtain an initial population; constructs an improved genetic algorithm based on the genetic algorithm as the genetic algorithm for improved electric vehicle logistics distribution path planning; uses the maximum number of iterations to judge the genetic algorithm to obtain the optimal solution of the genetic algorithm; and sends the target data set into the constructed genetic algorithm to complete the discrimination of the electric vehicle logistics distribution path. By improving the genetic algorithm, a better-quality initial population is obtained through a greedy strategy. Three crossover operators and three mutation operators are respectively adopted in the crossover and mutation operations, and a partial elite retention strategy is adopted. At the same time, a large-scale neighborhood search algorithm integrating simulated annealing is introduced to improve the search accuracy of the algorithm. The improved genetic algorithm is used to solve the electric vehicle path planning model, minimizing the total distribution cost, achieving the effect of better handling the electric vehicle logistics distribution path planning under multiple objectives and multiple constraints.
[0165] The step division of the above various methods is only for clear description. When implemented, they can be combined into one step or some steps can be split into multiple steps. As long as the same logical relationship is included, they are all within the protection scope of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs, but not changing the core design of its algorithm and process, are all within the protection scope of this patent.
[0166] The above are only the embodiments of the present invention. Common general knowledge such as specific structures and characteristics known in the art are not described in detail here. Those of ordinary skill in the art know all the common general knowledge in the technical field to which the invention belongs before the application date or the priority date, can know all the existing technologies in this field, and have the ability to apply the conventional experimental means before this date. Those of ordinary skill in the art can, under the inspiration given in this application, combine their own abilities to complete and implement this solution. Some typical well-known structures or well-known methods should not be an obstacle for those of ordinary skill in the art to implement this application. It should be noted that for those skilled in the art, without departing from the structure of the present invention, several deformations and improvements can be made, which should also be regarded as the protection scope of the present invention, and these will not affect the implementation effect of the present invention and the practicality of the patent. The protection scope required by this application should be subject to the content of its claims, and the specific implementation manners described in the specification can be used to explain the content of the claims.
[0167] The above is only the preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An electric vehicle logistics distribution route planning method based on an improved genetic algorithm, characterized in that Including: S1. Using the natural number coding method to obtain the initial population; S2. Constructing an improved genetic algorithm based on the genetic algorithm as the genetic algorithm for the path planning of electric vehicle logistics distribution; S3. Using the maximum number of iterations to judge the genetic algorithm to obtain the optimal solution of the genetic algorithm; S4. Sending the target data set into the constructed genetic algorithm to complete the discrimination of the electric vehicle logistics distribution path.
2. The method for planning the electric vehicle logistics distribution path based on the improved genetic algorithm according to claim 1, wherein, In S1, the chromosomes are encoded using the natural number coding method. In the proposed coding, the chromosomes only represent the customer information and the order of the access paths, and are used as the initial solution.
3. The method for planning the electric vehicle logistics distribution path based on the improved genetic algorithm according to claim 1, characterized in that, In S2, an improved genetic algorithm is constructed based on the genetic algorithm as the genetic algorithm for the path planning of electric vehicle logistics distribution, including: Step S21. Generating the initial population through the greedy algorithm to replace the randomly generated initial population; Step S22. Performing the selection operation on the population through the binary tournament selection strategy; Step S23. Using the crossover and mutation operations in the genetic algorithm to increase the diversity of the population, and then obtaining a better object through the partial elite retention strategy; Step S24. Replacing the conventional neighborhood search operator with the large-scale neighborhood search algorithm integrating simulated annealing to correct the current solution.
4. The method for planning the electric vehicle logistics distribution path based on the improved genetic algorithm according to claim 3, wherein The binary tournament selection strategy includes: Step S221. Randomly selecting two individuals from the population.
5. The method for planning the electric vehicle logistics distribution path based on the improved genetic algorithm according to claim 4, wherein Step S222. Comparing the fitness values of the two selected individuals, and selecting the individual with the higher fitness as the winner to join the next generation population.
6. The method for planning the logistics distribution path of electric vehicles based on the improved genetic algorithm according to claim 3, wherein, The large-scale neighborhood search algorithm integrating simulated annealing includes: Step S243. Based on the perturbation value of the current solution set, performing the random destruction operator.
7. The method for planning the electric vehicle logistics distribution path based on the improved genetic algorithm according to claim 6, wherein Step S244. Based on the destroyed route, performing the target optimal insertion operator to obtain a new solution.
8. The method for planning the electric vehicle logistics distribution path based on the improved genetic algorithm according to claim 7, wherein, Step S2443. Traversing each insertable point in each route in Road_all, calculating the increased value of the distribution cost of the original route after inserting the customer ind_i, and saving the optimal solution with the smallest increased value of the distribution cost; Road_all is the set of destroyed routes, and ind_i is the inserted customer.
9. The method for planning the electric vehicle logistics distribution path based on the improved genetic algorithm according to claim 8, characterized in that, Step S2444. Opening a new service route, calculating the distribution cost of the new route. If the distribution cost of the new route is less than the increased value of the distribution cost of the optimal solution in Step S2443, opening a new route to serve the customer ind_i, otherwise using the optimal solution with the smallest increased value of the distribution cost inserted in Step S2443; ind_i is the inserted customer.
10. The method for planning the electric vehicle logistics distribution path based on the improved genetic algorithm according to claim 1, wherein, Judging the genetic algorithm by the maximum number of iterations includes: setting the maximum number of runs of the algorithm, stopping running when reaching this number, and finding a high-quality solution within the specified operation time.
Citation Information
Cited By
Civil aircraft vertical track planning system and planning method thereof
CN122116694A
Logistics distribution path optimization method based on double-improved genetic simulated annealing algorithm
CN122198814A