Logistics Route Optimization Method Based on Hybrid Sparrow Algorithm
The hybrid parrot optimization algorithm optimizes electric vehicle delivery routes by integrating chaotic mapping and long-term memory to enhance diversity and avoid local optima, addressing range and infrastructure challenges, thus reducing operational costs and improving customer satisfaction.
Patent Information
- Application Number
- CN202210062625.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-19
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-01-19
AI Technical Summary
In the prior art, the electric vehicle logistics path planning has problems such as insufficient mileage and imperfect supporting facilities, which leads to a decrease in the enthusiasm of enterprises to promote electric vehicles. In addition, the traditional sparrow search algorithm converges slowly and has insufficient accuracy in path optimization, making it easy to fall into local optimality.
The hybrid sparrow algorithm is used to initialize populations through chaotic mapping, introduce the concept of long-term memory and backtracking the past, combine the cost function model, optimize the logistics path, and generate the global optimal path.
It has improved the global search capability of electric vehicle logistics path planning, reduced the emergence of local optimal solutions, optimized vehicle electricity, driving, time window and charging costs, and improved logistics distribution efficiency and customer satisfaction.
Smart Images

Figure CN114418497B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of new energy electric vehicles, and specifically relates to a logistics path optimization method based on a hybrid sparrow algorithm. Background Technique
[0002] Path planning is an important problem in the distribution scheduling of urban electric logistics vehicles. The distribution of electric logistics vehicles is one of the existing distribution methods, which is less affected by traffic, but limited by mileage, load capacity and the number of vehicles. However, at present, electric logistics vehicles still face the problems of insufficient cruising range and imperfect supporting facilities, which seriously affect the enthusiasm of enterprises to promote and deploy electric logistics vehicles. In the existing research on electric vehicle planning, most only consider the optimization of the distribution process, and few integrate the location selection and distribution problems for research. How to scientifically select supporting facilities to efficiently utilize electric logistics vehicle resources and help enterprises maximize their profits is a very valuable research problem. In order to find the optimal urban distribution route that simultaneously meets the limitations of electric vehicles and the customer time window, a hybrid planning model is established to deeply study the path problem.
[0003] Combining the charging facility layout planning problem with the distribution path optimization problem, the BEVRLAP problem is proposed. With the cruising range, load capacity and soft time window service satisfaction as constraint conditions, the objective function is the cost function of the logistics enterprise, which includes transportation cost, operation cost, soft time window service satisfaction cost, labor cost and social benefit cost. Using relevant algorithms to solve the model, the vehicle distribution path is finally obtained.
[0004] The sparrow search algorithm (SSA) is a newly proposed swarm intelligence optimization algorithm. Compared with other intelligent algorithms, this algorithm has better effects, but still has problems such as slow convergence speed, insufficient solution accuracy and easy to fall into local optimum. At present, the improvement of the sparrow search algorithm mainly lies in the following aspects: one is to enhance the diversity of the population and the robustness of the algorithm by adding cubic mapping and reverse learning strategies, mixing sine-cosine algorithm and Gaussian mutation strategy; there is also one is to speed up the convergence speed and improve the accuracy by adding an adaptive learning factor or introducing a polynomial mutation factor. Summary of the Invention
[0005] The following gives a brief overview of one or more aspects to provide a basic understanding of these aspects. This overview is not an exhaustive survey of all contemplated aspects, and is neither intended to identify key or decisive elements of any or all aspects nor to attempt to define the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form as a prelude to the more detailed description to follow.
[0006] The object of the present invention is to solve the above problems, and a logistics path optimization method based on a hybrid sparrow algorithm is provided to optimize the traditional SSA algorithm. The method of chaotic mapping is used to initialize the population of the sparrow search algorithm, so as to improve the global search ability of the algorithm and avoid the situation of local optimal solutions. At the same time, the concepts of long-term memory and looking back into the past are introduced into the sparrow search algorithm. By referring to the position information of past individuals, the diversity of the population is enhanced. By introducing a parameter memory length H, it is determined how much past experience a group or a group can remember at one time. The individuals of the group can decide their next actions based on multiple past experiences, thus providing a broader perspective for multiple promising locations, and therefore reducing the chance of premature convergence or stagnation.
[0007] The technical solution of the present invention is as follows:
[0008] The present invention provides a logistics path optimization method based on a hybrid sparrow algorithm, including the following steps:
[0009] Obtain order information and plan an initial logistics path according to the order information;
[0010] Determine an initial distribution plan according to the cost function model;
[0011] Optimize the initial logistics path based on the hybrid sparrow algorithm to determine the optimal logistics path;
[0012] Optimize the initial distribution plan according to the cost function model to obtain the optimal distribution plan;
[0013] Conduct logistics distribution based on the optimal logistics path and the optimal distribution plan.
[0014] According to an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm of the present invention, the cost function model calculates the minimum cost of the distribution plan through the minimum cost function; wherein, the minimum cost includes vehicle electricity cost C1, vehicle driving cost C2, time window penalty cost C3 and charging cost C4, and the formula of the minimum cost function is as follows:
[0015] MinC 成本 = C1 + C2 + C3 + C4.
[0016] According to an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm of the present invention, the vehicle electricity cost C1 is calculated through the vehicle electricity cost function; wherein, the vehicle electricity cost C1 includes uphill electricity cost, downhill electricity cost and flat ground electricity cost.
[0017] According to an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm of the present invention, the calculation formula of the vehicle electricity cost function is as follows:
[0018]
[0019] ; where i and j respectively represent path node i and path node j, V represents the set of path nodes,
[0020] K represents the set of vehicles, and k represents each vehicle,
[0021] λ1 represents the coefficient of using electricity for uphill,
[0022] λ2 represents the coefficient of using electricity for downhill,
[0023] λ3 represents the coefficient of using electricity for flat ground,
[0024] d ij represents the distance from path node i to path node j,
[0025] X ijk represents the electricity consumption cost of the k-th vehicle from path node i to path node j.
[0026] According to an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm of the present invention, the vehicle driving cost C2 is calculated through a vehicle driving cost function; wherein, the vehicle driving cost C2 includes a fixed travel cost, a transportation process cost, and a battery loss cost.
[0027] According to an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm of the present invention, the
[0028] formula of the time window penalty cost function is as follows:
[0029]
[0030] ; where n1 represents the number of distribution nodes,
[0031] P Ⅰ represents the soft time window penalty cost,
[0032] P Ⅱ represents the hard time penalty cost,
[0033] P Ⅲ represents the charging time penalty cost.
[0034] According to an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm of the present invention, the charging cost C4 is calculated through a charging cost function; wherein, the charging cost C4 includes a daytime charging cost and a nighttime charging cost.
[0035] According to an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm of the present invention, the formula of the charging cost function is as follows:
[0036]
[0037] ; where K represents the set of vehicles, and k represents each vehicle,
[0038] s1 represents the hourly parking fee during the day,
[0039] s2 represents the hourly parking fee at night,
[0040] t s represents the parking time of each vehicle k,
[0041] r1 represents the hourly charging cost during the day,
[0042] r2 represents the hourly charging cost at night,
[0043] t r represents the charging time of each vehicle k.
[0044] According to an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm of the present invention, the soft time penalty cost PⅠ is calculated through a soft time window penalty cost function, and the formula is as follows:
[0045]
[0046] ; where i represents the path node i, and V represents the set of path nodes,
[0047] t i represents the actual arrival time at path node i,
[0048] w i and o i respectively represent the time nodes of the specified arrival time period at path node i, and p1 represents the penalty exponent.
[0049] According to an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm of the present invention, the hard time penalty cost P Ⅱ is calculated through a hard time window penalty cost function, and the formula is as follows:
[0050]
[0051] ; where i represents the path node i, and V represents the set of path nodes,
[0052] t i represents the actual arrival time at path node i,
[0053] w i and o i respectively represent the time nodes of the specified arrival time period at path node i, and p2 represents the penalty exponent.
[0054] In an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm according to the present invention, the charging time penalty cost P Ⅲ is calculated through the charging time penalty cost function, and the formula is as follows:
[0055]
[0056] ; where i and j respectively represent path node i and path node j, V represents the set of path nodes,
[0057] g represents the distance traveled by the vehicle per unit of electric energy,
[0058] q represents the current electric energy of the vehicle,
[0059] d ij represents the distance between path node i and path node j.
[0060] In an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm according to the present invention, the charging time penalty cost function can also control the vehicle charging conditions through the charging control function L, and the formula is as follows:
[0061]
[0062] ; where i and j respectively represent path node i and path node j, V represents the set of path nodes, g represents the distance traveled by the vehicle per unit of electric energy,
[0063] q represents the current electric energy of the vehicle,
[0064] d ij represents the distance between path node i and path node j,
[0065] d min represents the distance between path node i and the nearest charging station.
[0066] In an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm according to the present invention, the hybrid sparrow algorithm optimizes the initial logistics path by optimizing the distribution paths of each vehicle on the logistics path, including the following steps:
[0067] Initialize the initial population of sparrows; where the sparrows are each vehicle on the logistics path;
[0068] Divide the vehicles into discoverers and followers according to the minimum cost model;
[0069] Update the positions of the discoverers;
[0070] Update the positions of the followers using the probability selection function;
[0071] Determine whether the discoverer's position has reached the maximum update iteration times; if so, output the discoverer's position as the optimal logistics path; if not, continue to iterate the discoverer's position.
[0072] According to an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm of the present invention, the initial sparrow population is initialized by chaotic mapping, including the position information of the initial vehicle positions and the initial position information of each optimal position corresponding to the vehicle.
[0073] According to an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm of the present invention, the calculation formula for the position information of the initial vehicle positions is as follows:
[0074] Z n+1 = βsin((1 + 2n)πZ n )
[0075] ; where n represents the nth vehicle, and β is a control parameter.
[0076] According to an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm of the present invention, the calculation formula for the initial position information of each optimal position corresponding to the vehicle is as follows:
[0077] X ij = lb + (ub - lb) × C n
[0078] ; where lb represents the lower bound of the search space, ub represents the upper bound of the search space, k represents each vehicle,
[0079] C n represents the mapping parameter,
[0080] X i represents the initial position information of the ith optimal position.
[0081] According to an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm of the present invention, the optimal position is selected through the optimal position probability selection function, and the calculation formula is as follows:
[0082]
[0083] ; where f i represents the probability that the ith optimal position is selected,
[0084] j represents the position passed before the ith optimal position,
[0085] represents the ith optimal position, represents the ith optimal position, and H represents the recollection control parameter.
[0086] In an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm according to the present invention, the position of the discoverer is updated based on the GT distribution strategy, and the calculation formula is as follows:
[0087]
[0088] ; where represents the position information of the i-th discoverer at the j-th optimal position,
[0089] C0 represents the speed adjustment parameter,
[0090] N(G,T) represents the standard GT distribution,
[0091] R2 represents the warning value,
[0092] ST represents the safety value,
[0093] Q represents a random number subject to the normal distribution.
[0094] In an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm according to the present invention, when the update of the discoverer's position fails, a reverse search strategy is adopted to search for the discoverer's position, including the following steps:
[0095] Store the current optimal position information of the discoverer's position in a preset reverse search table and abandon the current optimal position information;
[0096] Research for the discoverer's position again to obtain the latest position information;
[0097] Query the reverse search table to determine whether the latest position information exists in the reverse search table; if so,
[0098] then research for the discoverer's position again; if not, the discoverer's position is the latest position information.
[0099] In an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm according to the present invention, the probability selection function is used to update the position of the follower in the sparrow search algorithm, and the calculation formula is as follows:
[0100]
[0101] ; where f i represents the fitness value of the i-th follower's position,
[0102] γ represents a random number within a preset interval,
[0103] represents the fitness value of the i-th follower's position, t represents the number of iterations,
[0104] P i represents the following probability of the i-th follower.
[0105] According to an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm of the present invention, the position of the follower is updated based on the following probability of the follower, and the calculation formula is as follows:
[0106]
[0107] ; where represents the position information of the i-th follower at the j-th optimal position,
[0108] Q represents a random number obeying the normal distribution,
[0109] t represents the number of iterations,
[0110] n represents the number of distribution nodes,
[0111] represents the current globally worst position.
[0112] According to an embodiment of the logistics path optimization method based on the hybrid sparrow algorithm of the present invention, a follower is randomly selected as a vigilant, and the vigilant is used to warn that the vehicle's battery power is insufficient.
[0113] The present invention has the following beneficial effects compared with the prior art: In order to optimize the logistics path, the present invention optimizes the initial logistics path by optimizing the distribution paths of each vehicle on the logistics path, and generates a globally optimal path based on the sparrow search algorithm according to the coordinates of the starting point and the target point. Among them, the basic parameters of the sparrow search algorithm are set as the initial population size, the current number of iterations, the maximum number of iterations, the position information, the early warning value, and the safety value. By iterating the globally optimal path multiple times and combining the cost function model, a globally optimal path is generated, so as to obtain the globally optimal path of the electric logistics vehicle in the current urban logistics distribution. BRIEF DESCRIPTION OF THE DRAWINGS
[0114] After reading the detailed description of the embodiments of the present disclosure in conjunction with the following drawings, the above features and advantages of the present invention can be better understood. In the drawings, the components are not necessarily drawn to scale, and components with similar relevant characteristics or features may have the same or similar reference numerals.
[0115] Figure 1 is a flowchart showing an embodiment of the logistics optimization method based on the hybrid sparrow algorithm of the present invention.
[0116] Figure 2 is a curve graph showing an embodiment of the soft time window penalty cost function of the present invention.
[0117] Figure 3 is a flowchart showing an embodiment of the hybrid sparrow algorithm of the present invention.
[0118] Figure 4 It is a flowchart showing an embodiment of the reverse search strategy for finding the discoverer's position of the present invention.
[0119] Figure 5 It is a structural diagram showing an embodiment of the reverse search table of the present invention. Detailed implementation manners
[0120] The present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments. Note that the aspects described below in conjunction with the accompanying drawings and specific embodiments are merely exemplary and should not be construed as imposing any limitation on the protection scope of the present invention.
[0121] An embodiment of a logistics path optimization method based on a hybrid sparrow algorithm is disclosed herein. Figure 1 It shows a flowchart of an embodiment of a logistics optimization method based on a hybrid sparrow algorithm. Please refer to Figure 1 , and the following is a detailed description of each step in the process.
[0122] Step S1: Obtain order information and plan an initial logistics path according to the order information.
[0123] Specifically, in this embodiment, a new energy electric logistics vehicle of a unified vehicle type is used as the transport vehicle. Under initial conditions, the power of all electric logistics vehicles is fully charged. Each customer point can only be served by one electric logistics vehicle, and the delivery volume and pick-up volume at each customer point cannot be greater than the maximum load capacity of the electric logistics vehicle, that is, on each distribution loop, the sum of the demands at each customer point does not exceed the carrying capacity of the vehicle. When a logistics distribution order is obtained, an initial logistics path is preliminarily planned according to information such as the load capacity and the number of customer points in the order information.
[0124] Step S2: Determine an initial delivery plan according to the cost function model.
[0125] Logistics distribution companies hope to reduce the total cost required through reasonable planning of charging pile location and logistics path, and correspondingly increase the company's profit. In this embodiment, a cost function model is established according to the characteristics of electric logistics vehicles, and the minimum cost of the delivery plan is calculated through the minimum cost function. Among them, the minimum cost includes vehicle power consumption cost C1, vehicle driving cost C2, time window penalty cost C3, and charging cost C4, and the calculation formula is as follows:
[0126] MinC 成本 = C1 + C2 + C3 + C4.
[0127] Further, in this embodiment, the vehicle electricity cost C1 is calculated through the vehicle electricity cost function. The vehicle driving process is divided into uphill, downhill, and flat driving. The electricity consumption in these three cases is different. That is, the vehicle electricity cost C1 includes the uphill electricity cost, the downhill electricity cost, and the flat electricity cost. The calculation formula is as follows:
[0128]
[0129] ; where i and j respectively represent path node i and path node j, V represents the set of path nodes, K represents the set of vehicles, k represents each vehicle, λ1 represents the uphill electricity coefficient, λ2 represents the downhill electricity coefficient, λ3 represents the flat electricity coefficient, d ij represents the distance from path node i to path node j, and X ijk represents the electricity cost of the k-th vehicle from path node i to path node j.
[0130] Further, in this embodiment, the vehicle driving cost C2 is divided into a fixed travel cost, a transportation process cost, and a battery loss cost. The vehicle driving cost C2 is calculated through the vehicle driving cost function. The formula is as follows:
[0131]
[0132] ; where i and j respectively represent path node i and path node j, V represents the set of path nodes, K represents the set of vehicles, k represents each vehicle, e represents the fixed travel cost of each vehicle, m represents the total weight of the transport vehicle, T represents the vehicle usage time, B represents the battery capacity, and r represents the battery cost.
[0133] Further, in this embodiment, the time window penalty cost C3 includes a soft time window penalty cost, a hard time window penalty cost, and a charging time penalty cost. The time window penalty cost C3 is calculated through the time window cost function. The calculation formula is as follows:
[0134]
[0135] ; where P Ⅰ represents the soft time window penalty cost, P Ⅱ represents the hard time penalty cost, and P Ⅲ represents the charging time penalty cost. In addition, the set of path nodes in this embodiment also includes a delivery node set and a charging station set. Among them, the delivery node set, that is, the customer point set, is represented as {1, 2, 3,..., n1}, the charging station set is represented as {1, 2, 3,..., n2}, and n1 in the C3 formula represents the number of delivery nodes.
[0136] Specifically, in terms of the time window penalty cost, a new hybrid time window function is introduced here. This function is determined based on the customer's tolerance for the product delivery time and is specifically divided according to time and the nature of the work. When the delivery day is not a working day, i.e., on weekends, a soft time window is used. When the delivery day is a working day, we further divide it. When delivering at night, considering the special time and the urgent need of users in general, a hard time window is adopted. When delivering during the day on a working day, it is divided according to the different occupations of users. For users who go to work, a hard time window is adopted, and for individual users and unemployed users, a soft time window is adopted.
[0137] In one implementation, the soft time penalty cost P Ⅰ is calculated through the soft time window penalty cost function, and the formula is as follows:
[0138]
[0139] ; where i represents the path node i, V represents the set of path nodes, t i represents the actual arrival time at path node i, w i and o i respectively represent the time nodes of the specified arrival time period at path node i, and p1 represents the penalty exponent. Figure 2 is a curve graph showing an embodiment of the soft time window penalty cost function of the present invention. As Figure 2 shown, in the case of the soft time window, when the product arrival time t i is within the specified time period [w i , o i at path node i, the delivery time requirement of this path node, i.e., the customer point, is met, and the penalty cost is 0. If the product arrival time t > o i or t < w i , the customer satisfaction will decrease as the late or early arrival time increases, that is, the penalty exponent P Ⅰ will continue to increase. Since the customer satisfaction will decrease more and more over time, so when w i ≤t i ≤o i , the penalty cost is less; when t > o i or t < w i , the penalty cost is greater.
[0140] In another implementation, the hard time penalty cost P Ⅱ is calculated through the hard time window penalty cost function, and the formula is as follows:
[0141]
[0142] ; where i represents the path node i, V represents the set of path nodes, ti Indicates the actual time to reach path node i, w i and o i respectively represent the time nodes of the specified time period to reach path node i, and p2 represents the penalty exponent. Specifically, in the case of a hard time window, if the product cannot be delivered within the specified time period [w i , o i at distribution node i, the customers at this distribution node will not receive it.
[0143] In one implementation, the charging time penalty cost P can be calculated using the charging time penalty cost function Ⅲ , and the calculation formula is as follows:
[0144]
[0145] ; where i and j respectively represent path node i and path node j, V represents the set of path nodes, g represents the distance traveled by the vehicle per unit of electric energy, q represents the current electric energy of the vehicle, and d ij represents the distance between path node i and path node j.
[0146] Specifically, in the case of charging time, when gq > d ij , at this time, the electric logistics vehicle has sufficient electric energy and can complete the order requirements without charging. Therefore, at this time, P Ⅲ = 0; on the contrary, when gq < d ij , the electric energy of the electric logistics vehicle is not enough to complete the current order task. Therefore, temporary charging is required. At this time, we stipulate that the charging loss is p3.
[0147] In addition, in this implementation form, for the endurance problem of new energy distribution vehicles, the charging time penalty cost can also be calculated through the charging control function L to control the vehicle charging conditions. The formula is as follows:
[0148]
[0149] Specifically, the charging control function L is used to control whether the electric logistics vehicle can be charged. Among them, i and j respectively represent path node i and path node j, and V represents the set of path nodes. Assume that g represents the distance traveled by the vehicle per unit of electric energy, q represents the current electric energy of the vehicle, and d ij represents the distance between the vehicle between path node i and path node j, and d min represents the distance between the vehicle between path node i and the nearest charging station.
[0150] Furthermore, in this implementation form, the charging cost C4 is divided into daytime charging cost and nighttime charging cost, and the charging cost C4 is calculated through the charging cost function. The formula is as follows:
[0151]
[0152] ; where K represents the set of vehicles and k represents each vehicle. Specifically, the charging cost C4 includes the parking cost of queuing when the vehicle's battery is low and it goes to the charging station. Here, different parking costs are formulated for two time periods: daytime and nighttime. Among them, s1 represents the hourly parking fee during the day, s2 represents the hourly parking fee at night, t s represents the parking time of each vehicle k, r1 represents the hourly charging cost during the day, r2 represents the hourly charging cost at night, and t r represents the charging time of each vehicle k.
[0153] In summary, the specific calculation formula of the cost function model in this embodiment is as follows:
[0154]
[0155] Step S3: Optimize the initial logistics path based on the hybrid sparrow algorithm to determine the optimal logistics path.
[0156] Specifically, the hybrid sparrow algorithm optimizes the initial logistics path by optimizing the delivery paths of each vehicle on the logistics path. According to the coordinates of the starting point and the target point, a globally optimal path is generated through the sparrow search algorithm. Set the basic parameters of the sparrow search algorithm as the initial population size, the current iteration number, the maximum iteration number, the position information, the warning value, and the safety value. Through multiple iterations of the globally optimal path and combined with the cost function model, a globally optimal path is generated as the global path of the electric logistics vehicle in the current urban logistics distribution. Figure 3 is a flowchart showing an embodiment of the hybrid sparrow algorithm of the present invention. Please refer to Figure 3 , and the following is a specific description of each step of the hybrid sparrow algorithm:
[0157] S31: Initialize the initial population of sparrows; where the sparrows are each vehicle on the logistics path.
[0158] Specifically, the initial population directly affects the convergence speed and optimization accuracy of the swarm intelligence algorithm. The population initialization of the traditional SSA is mainly generated randomly. However, the randomized initialization of the population cannot ensure the uniform distribution of the population in the search space. The chaotic sequence exhibits characteristics such as regularity, randomness, and ergodicity. Compared with complete randomization, the SSA initial population incorporating the chaotic sequence has better diversity. The main idea of the chaotic sequence is to generate a chaotic sequence through a mapping relationship in the interval [0,1] and transform it into the search space of the population. There are various ways to generate the chaotic sequence. Here, it will be self-modified according to the sine mapping to define the sz chaotic mapping, and the chaotic mapping method is used to initialize the population. Each electric logistics vehicle is regarded as a sparrow, and using the sparrow search algorithm for path planning is the process of sparrows searching for food. The chaotic mapping method is used to initialize the population of the sparrow search algorithm. Since the sequence generated by the chaotic mapping has better uniformity, the selected chaotic mapping method is simple compared with other chaotic systems and has a high level of security, which can better enhance the global search ability of the algorithm and avoid the occurrence of local optimal solutions.
[0159] Furthermore, in this embodiment, the initialization of the sparrow initial population includes the position information of the initial positions of the vehicles and the initial position information of each optimal position corresponding to the vehicles. Among them, the calculation formula for the position information of the initial positions of the vehicles is:
[0160] Z n+1 =βsin((1 + 2n)πZ n ).
[0161] Specifically, Z is each individual of the initial population of the sparrow search algorithm, that is, the position of the vehicle. n represents the nth vehicle, Z n is the position of the nth vehicle, and β is a control parameter. The control parameter β must be greater than zero (β>0), while Z n ∈[0, 1] and Z0 are the initial conditions and can be selected from the range (0, 1). When β approaches 1, the sz mapping becomes chaotic. Compared with other chaotic systems, this chaotic mapping is selected because of its simplicity and its high level of security is affirmed.
[0162] To ensure the uniformity and randomness of the sparrow population distribution, the above-constructed chaotic mapping is introduced into the sparrow algorithm, and the initial position information of each optimal position corresponding to each vehicle is calculated. The calculation formula is as follows:
[0163] X ij =lb+(ub - lb)×C n .
[0164] Among them, lb represents the lower limit of the search space, ub represents the upper limit of the search space, k represents each vehicle, C n represents the mapping parameter, Xi Represents the initial position information of the i-th optimal position. The position of the sparrow can be obtained by taking a sequence of length D (D is the dimension of the target problem).
[0165] In this embodiment, the concept of looking back in the sparrow search algorithm is introduced. By referring to the position information of past individuals, the diversity of the population is enhanced, and thus a parameter recall length H is introduced. H is a control parameter defined by the user, which determines how much past experience the group or population can remember at one time. X best is the single global optimal position found by the sparrow search algorithm, calculated through the optimal position probability selection function, and the formula is as follows:
[0166]
[0167] Among them, f i represents the probability that the i-th optimal position is selected, j represents the position passed before the i-th optimal position, represents the i-th optimal position, represents the i-th optimal position, and H represents the recall control parameter.
[0168] S32: Divide the vehicles into discoverers and followers according to the minimum cost model.
[0169] In this embodiment, in addition to being able to plan the initial path, the minimum cost model can also calculate the cost of each vehicle at the initial position, so as to divide the vehicles into discoverers and followers.
[0170] S33: Update the position of the discoverer.
[0171] In this embodiment, the position of the discoverer is updated based on the GT distribution strategy. Specifically, since the sparrow search algorithm cannot guarantee the global nature of the population, it is easy to fall into local optima, and the convergence speed needs to be enhanced. Therefore, this embodiment proposes a new GT distribution strategy, using the GT distribution in the discoverer position update stage. The GT distribution is based on the combination of the Gaussian distribution and the T distribution. In the process of group iterative optimization, the search process is faster in the initial stage, and a large step size can be used to expand the search range of the group. The calculation formula is as follows:
[0172]
[0173] Among them, represents the position information of the i-th sparrow, that is, the discoverer, at the j-th optimal position, C0 represents the speed adjustment parameter, N(G,T) represents the standard GT distribution, R2 represents the warning value, ST represents the safety value, and Q represents a random number obeying the normal distribution.
[0174] In addition, in this embodiment, when the update of the discoverer position fails, a reverse search strategy can also be used to search for the discoverer position.Figure 4 It is a flowchart showing an embodiment of the reverse search strategy for finding the discoverer's position in the present invention, and this embodiment will be described in detail.
[0175] S301: Store the current optimal position information of the discoverer's position into a preset reverse search table, and discard the current optimal position information.
[0176] S302: Research for the discoverer's position again to obtain the latest position information.
[0177] S303: Query the reverse search table to determine whether the latest position information exists in the reverse search table; if so, research for the discoverer's position again; if not, the discoverer's position is the latest position information.
[0178] Specifically, to improve the drawback that the algorithm is prone to falling into a local optimal solution, a reverse search strategy is added in the discoverer stage of the sparrow search algorithm. It is stipulated that when the position of the discoverer is not updated, that is, when it falls into a local optimal solution, the optimal solution at this place, that is, the current optimal position information, is stored in the pre-set search table, and at the same time, the optimal solution at this place is discarded. The discoverer continues to search for a new solution, and the new solution generated by the discoverer is compared with the elements in the search table. Figure 5 It is a structural diagram showing an embodiment of the reverse search table of the present invention. As Figure 5 shown, L represents, [L min ,L max represents. If the new solution exists in the reverse search table, local search needs to be performed again to obtain a new solution; if not, the algorithm continues.
[0179] S34: Update the follower's position using a probability selection function.
[0180] Specifically, in this embodiment, in order to enable the sparrow population to quickly gather in a short time, a new probability selection method is proposed based on the random selection of followers in the artificial bee colony algorithm, and the position of the followers in the sparrow search algorithm is updated through this method. The calculation formula is as follows:
[0181]
[0182] Specifically, this probability selection method function can be used in all position update equations to find the global best position in long-term memory and update the position of the followers in the sparrow search algorithm. Among them, f i represents the fitness value of the i-th food source in long-term memory, that is, the food of the sparrow in the sparrow algorithm. γ represents a random number in the interval [0,5], represents the fitness value of the i-th follower position in the t-th iteration, P i represents the following probability of the i-th follower.
[0183] After calculating the following probability of each follower, the follower position is updated according to the following probability of each follower. The calculation formula is as follows:
[0184]
[0185] in, represents the position information of the i-th follower at the j-th optimal position, Q represents a random number that obeys a normal distribution, t represents the number of iterations, Indicates the current global worst position. n represents the number of distribution nodes. When i>n / 2, it means that the i-th follower with a lower fitness value has not obtained food and is in a very hungry state. At this time, it needs to fly to other places to find food to obtain more energy.
[0186] S35: Determine whether the finder position has reached the maximum update iteration number; if so, output the finder position as the optimal logistics path; if not, continue to iterate the finder position.
[0187] In addition, in this embodiment, followers can be randomly selected from the tracker population as sentinels. When the power of the electric logistics vehicle is insufficient to support the next delivery, the sentinel will issue a warning and immediately look for a nearby charging station to charge.
[0188] Step S4: Optimize the initial delivery plan according to the cost function model to obtain the best delivery plan
[0189] In order to improve customer satisfaction during the delivery process of new energy electric logistics vehicles, considering that the main factors affecting customer satisfaction are delivery time and product quality level, the cost function model in this embodiment not only considers hard time windows and soft time windows, but combines soft time windows and hard time windows according to the timeliness of the delivered items and the different customer needs, and combines delivery time and total delivery cost to describe the customer's satisfaction with the timeliness of delivery. Therefore, in addition to being used to plan the initial delivery plan, the cost function model in this embodiment can also be used to optimize the initial delivery plan, that is, to optimize the number of electric logistics vehicles and the corresponding number of path nodes during the delivery process, so as to obtain the best delivery plan and save delivery time and delivery costs.
[0190] Step S5: Perform logistics distribution based on the optimal logistics path and the optimal distribution plan.
[0191] After completing the optimization of logistics routes and distribution plans, logistics distribution is carried out according to the best logistics routes and best distribution plans obtained to improve distribution efficiency and delivery time.
[0192] The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0193] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, the various illustrative components, blocks, modules, circuits, and steps are described above in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
[0194] The various illustrative logical blocks, modules, and circuits described in connection with the embodiments disclosed herein can be implemented using a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
[0195] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of both. The software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read from, and write to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In the alternative, the processor and the storage medium may reside as discrete components in a user terminal.
[0196] In one or more exemplary embodiments, the described functionality may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software as a computer program product, the functions may be stored on or transmitted via a computer-readable medium as one or more instructions or code. The computer-readable medium includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. The storage media may be any available media that can be accessed by a computer. By way of example and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. Any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a web site, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. As used herein, the disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray disc, where the disk typically reproduces data magnetically, while the disc reproduces data optically with a laser. Combinations of the above should also be included within the scope of computer-readable media.
[0197] The foregoing description of the disclosure has been provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A logistics path optimization method based on a hybrid sparrow algorithm, characterized in that It includes the following steps: Obtain order information and plan an initial logistics path according to the order information; Determine an initial distribution plan according to the cost function model; Optimize the initial logistics path based on the hybrid sparrow algorithm to determine the best logistics path; Optimize the initial distribution plan according to the cost function model to obtain the best distribution plan; Conduct logistics distribution based on the best logistics path and the best distribution plan; where, The order information includes the load capacity and the number of customer points. After obtaining a logistics distribution order, an initial logistics path is preliminarily planned according to the load capacity and the number of customer points in the order information; The cost function model calculates the minimum cost of the distribution plan through the minimum cost function; where, the minimum cost includes the vehicle electricity cost C1, the vehicle driving cost C2, the time window penalty cost C3, and the charging cost C4, and the formula of the minimum cost function is as follows: MinC 成本 = C1 + C2 + C3 + C4; The step of optimizing the initial logistics path based on the hybrid sparrow algorithm to determine the best logistics path includes the following steps: Initialize the initial population of sparrows; where, the sparrows are the vehicles on the logistics path; Divide the vehicles into discoverers and followers according to the minimum cost model; Update the positions of the discoverers; Update the positions of the followers using the probability selection function; Judge whether the positions of the discoverers reach the maximum update iteration times; if so, output the positions of the discoverers as the best logistics path; if not, continue to iterate the positions of the discoverers; The initialization of the initial population of sparrows is initialized through chaotic mapping, including the position information of the initial positions of the vehicles and the initial position information of the respective optimal positions corresponding to the vehicles; the formula for calculating the position information of the initial positions of the vehicles is as follows: Z k+1 = β sin((1 + 2k)πZ k ); where, k represents the kth vehicle, and β is a control parameter; The formula for calculating the initial position information of the respective optimal positions corresponding to the vehicles is as follows: X a = lb + (ub - lb) × C n ; where, lb represents the lower limit of the search space, ub represents the upper limit of the search space, and k represents each vehicle, C n represents mapping parameters X a Indicates the initial position information of the a-th optimal position; The optimal position is selected through the optimal position probability selection function, and the calculation formula is as follows: ; Among them, f b represents the probability that the b-th optimal position is selected. l represents the position passed before the bth optimal position, Indicates the b-th optimal position, The optimal position representing the positions passed before the b-th optimal position, where H represents the recall control parameter.
2. The logistics path optimization method based on the hybrid sparrow algorithm according to claim 1, wherein The vehicle electricity cost C1 is calculated through the vehicle electricity cost function; where, the vehicle electricity cost C1 includes the uphill electricity cost, the downhill electricity cost, and the flat ground electricity cost.
3. The logistics path optimization method based on the hybrid sparrow algorithm according to claim 2, wherein The formula for the vehicle electricity cost function is as follows: ; where, i and j respectively represent path node i and path node j, V represents the set of path nodes, K represents the set of vehicles, and k represents each vehicle, λ1 represents the uphill electricity coefficient, λ2 represents the downhill electricity coefficient, λ3 represents the flat ground electricity coefficient, d ij represents the distance from path node i to path node j X ijk represents the electricity consumption cost of the k-th vehicle from path node i to path node j.
4. The logistics path optimization method based on the hybrid sparrow algorithm according to claim 1, wherein, The vehicle driving cost C2 is calculated through the vehicle driving cost function; where, the vehicle driving cost C2 includes the fixed travel cost, the transportation process cost, and the battery loss cost.
5. The logistics path optimization method based on the hybrid sparrow algorithm according to claim 1, characterized in that The time window penalty cost C3 is calculated through the time window penalty cost function; where, the time window penalty cost C3 includes the soft time window penalty cost, the hard time window penalty cost, and the charging time penalty cost.
6. The logistics path optimization method based on the hybrid sparrow algorithm according to claim 5, wherein The formula for the time window penalty cost function is as follows: ; where, n1 represents the number of distribution nodes, P Ⅰ represents the soft time window penalty cost P Ⅱ represents the hard time penalty cost P Ⅲ represents the charging time penalty cost; The soft time window penalty cost P Ⅰ is calculated through a soft time window penalty cost function, and the formula is as follows: ; Among them, i represents path node i, V represents the set of path nodes, and t i represents the actual time to reach path node i, w i and o i respectively represent the time nodes of the specified time period to reach path node i. p1 represents the penalty index; The hard time penalty cost P Ⅱ is calculated through the hard time window penalty cost function, and the formula is as follows: ; where, i represents path node i, V represents the set of path nodes, t i Indicates the actual time to reach path node i, w i and o i respectively represent the time nodes for the specified time period to reach path node i. p2 represents the penalty index; The charging time penalty cost P Ⅲ is calculated through a charging time penalty cost function, and the formula is as follows: ; where \(i\) and \(j\) respectively represent path node \(i\) and path node \(j\), \(V\) represents the set of path nodes, \(g\) represents the driving distance of the vehicle per unit of electricity, \(q\) represents the current electricity of the vehicle, d ij Indicates the distance between path node i and path node j.
7. The logistics path optimization method based on the hybrid sparrow algorithm according to claim 1, characterized in that the charging cost \(C_4\) is calculated through a charging cost function; among them, the charging cost \(C_4\) includes the daytime charging cost and the nighttime charging cost.
8. The logistics path optimization method based on the hybrid sparrow algorithm according to claim 7, wherein The formula of the charging cost function is as follows: ; where \(K\) represents the set of vehicles, and \(k\) represents each vehicle, \(s_1\) represents the hourly parking cost during the day, \(s_2\) represents the hourly parking cost at night, t sk Indicates the parking time of each vehicle k \(r_1\) represents the hourly charging cost during the day, \(r_2\) represents the hourly charging cost at night, Indicates the charging time of each vehicle k.
9. The logistics path optimization method based on the hybrid sparrow algorithm according to claim 6, characterized in that the charging time penalty cost function controls the vehicle charging conditions through the charging control function \(L\), and the formula is as follows: ; where \(i\) and \(j\) respectively represent path node \(i\) and path node \(j\), \(V\) represents the set of path nodes, \(g\) represents the driving distance of the vehicle per unit of electricity, \(q\) represents the current electricity of the vehicle, d ij represents the distance between path node i and path node j d min Represents the distance between path node i and the nearest charging station.
10. The logistics path optimization method based on the hybrid sparrow algorithm according to claim 1, characterized in that When the update of the discoverer's position fails, a reverse search strategy is adopted to search for the discoverer's position, including the following steps: Store the current optimal position information of the discoverer's position into a preset reverse search table and discard the current optimal position information; Research for the discoverer's position again to obtain the latest position information; Query the reverse search table to determine whether the latest position information exists in the reverse search table; if so, research for the discoverer's position again; if not, the discoverer's position is the latest position information.
11. The logistics path optimization method based on the hybrid sparrow algorithm according to claim 1, characterized in that The probability selection function is used to update the position of the followers in the sparrow search algorithm, and the calculation formula is as follows: ; Among them, f c represents the fitness value of the c-th follower position, \(\gamma\) represents a random number within a preset interval, represents the fitness value of the c-th follower position, t represents the number of iterations, and p c represents the following probability of the c-th follower.
12. The logistics path optimization method based on the hybrid sparrow algorithm according to claim 1, characterized in that, Randomly select a follower as a sentinel, and the sentinel is used to warn that the vehicle's electricity is insufficient.
Citation Information
Patent Citations
Electric vehicle distribution path optimization method supporting charging and discharging strategy
CN112200367A
Improved sparrow intelligent optimization method based on chaotic mapping and golden sine strategy
CN112926139A