Different-vehicle-type electric vehicle path planning method and device based on multi-strategy fusion Jaya algorithm
By integrating the Jaya algorithm with multiple strategies, the initial population is generated using the nearest neighbor clustering method. Combined with the dual-elite adaptive retention strategy and the Q-learning strategy, the path planning of electric vehicles of different models is optimized, solving the problems of difficult initial population generation and poor solution quality, and achieving efficient path planning.
Patent Information
- Application Number
- CN202511720786.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-02-10
AI Technical Summary
Existing algorithms face difficulties in generating an initial population and produce poor solution quality when solving the routing problem for electric vehicles of different models. Furthermore, traditional methods are not ideal in terms of solution time and performance in large-scale problems.
A path planning method based on the multi-strategy fusion Jaya algorithm is adopted, including the nearest neighbor clustering method to generate the initial population, the dual-elite adaptive retention strategy, the Jaya algorithm update strategy, the Q-learning learning strategy, the greedy algorithm to insert charging station nodes, and the reverse energy calculation strategy, to optimize the population search process.
It improves the diversity and generation quality of the initial population, enhances global exploration capabilities, significantly accelerates the speed of finding high-quality solutions, and reduces the total path cost.
Smart Images

Figure CN121503837A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of vehicle path planning, in particular to a heterogeneous electric vehicle path planning method and device based on a multi-strategy fusion Jaya algorithm. BACKGROUND
[0002] In recent years, with the diversification of urban distribution demand and the deepening of the low-carbon strategic goal, electric vehicles have become the core carrier of logistics distribution due to their significant advantages of zero emissions, low noise and low operating costs. With the complexity and diversity of distribution demand in logistics distribution, the use of a single specification of electric vehicles has been difficult to meet actual demand. If large vehicles are used for distribution during transportation, small batch orders will result in waste of transport capacity and increased energy consumption, and vice versa, using small vehicles to serve large orders will result in multiple round trips. Therefore, if multiple vehicle types of electric vehicles are used in the logistics distribution industry, fine matching of transport capacity and orders can be achieved, significantly improving vehicle utilization and operational efficiency.
[0003] Heterogeneous Electric Vehicle Routing Problem (HEVRP) is an NP problem, which is a variant of the traditional Vehicle Routing Problem (VRP). Unlike the traditional VRP problem, where each vehicle can only provide one type of distribution service, in the HEVRP problem, different distribution vehicles have different maximum load capacities and battery capacities. The heterogeneous electric vehicle routing problem is based on the VRP problem with the addition of the two problem attributes of heterogeneous vehicles and battery capacity. For the heterogeneous electric vehicle routing problem, the traditional solution method often has certain limitations: for example, although the exact algorithm has good performance in solving small-scale problems, the HEVRP problem is an NP problem, and after the introduction of the multi-vehicle and battery capacity attributes, the problem becomes more complex. Therefore, when faced with large-scale problems, using an exact algorithm to solve the problem not only has poor results, but also has no guarantee of solution time. Therefore, it is particularly important to expand the research attributes of the heterogeneous electric vehicle routing problem, construct the problem model and design an efficient and high-quality algorithm. SUMMARY
[0004] The present application proposes a heterogeneous electric vehicle path planning method and device based on a multi-strategy fusion Jaya algorithm to solve the problem of difficulty in generating an initial population and poor solution quality when using existing algorithms to solve the heterogeneous electric vehicle path problem.
[0005] In a first aspect, the present application provides a heterogeneous electric vehicle path planning method based on a multi-strategy fusion Jaya algorithm, comprising: Step 1: obtaining vehicle information and node information; the vehicle information includes vehicle model information used, and the node information includes warehouse nodes, customer nodes and charging station nodes; Step 2: constructing an adaptive function based on a total path cost function; the smaller the total path cost, the greater the corresponding fitness; Step 3: generating an initial population using the nearest neighbor clustering method according to the vehicle information and node information; wherein each individual in the population represents a solution or a path planning scheme, the path planning scheme includes the paths of all participating vehicles, and one vehicle corresponds to one path; Step 4: for the current population, calculate the fitness of each individual using the adaptive function and sort all individuals according to the fitness, so as to determine a non-elite solution set from the current population according to the fitness, and use a double-elite adaptive retention strategy to filter out an elite solution set from the current population to join a new population N pop ; Step 5: for each non-elite solution in the non-elite solution set, use the update strategy of Jaya algorithm to learn from the current optimal solution set or the worst solution set to generate a candidate solution set, calculate the fitness of each solution in the candidate solution set using the adaptive function to select the optimal candidate solution, and decide whether to add the optimal candidate solution to the new population N pop according to the Monte Carlo acceptance criterion, the optimal solution set and the worst solution set each include at least two solutions; and adjust the new population N pop using a vehicle type adjustment strategy to obtain a new population B pop ; Step 6: use a Q-learning learning strategy to select a local search operator to optimize the new population B pop to obtain a new population T pop ; the local search operator includes single-point movement within a path, single-point movement between paths, two-point exchange within a path, and two-point exchange between paths; Step 7: for the new population T pop , use a greedy algorithm strategy to insert charging station nodes and use a reverse energy calculation strategy to optimize the positions of the charging station nodes to obtain a new population D pop ; Step 8: repeat steps 4 to 7 until the iteration stopping condition is reached, and output the global optimal solution in the new population D pop .
[0006] Further, the total path cost minimization function is: wherein F represents a total path cost corresponding to an individual; R represents a path set, V represents a set of node information; M represents a set of vehicle types, ; represents a binary decision variable, represents that there is a vehicle of vehicle type m from node i to node j, otherwise ; represents a path distance between node i and node j; represents a unit power consumption of vehicle type m, represents a fixed cost of vehicle type m, represents a binary indication variable, represents that vehicle type m is used for path r, otherwise .
[0007] Further, in step 3, an initial population is generated using the nearest neighbor clustering method according to the vehicle information and the node information, specifically comprising: Step 3.1: obtaining an ID list of all customer nodes, and randomly shuffling the original order of the ID list; Step 3.2: given a vehicle type, traversing customer nodes that have not been assigned a path, taking the first customer node that does not exceed the maximum capacity of the given vehicle type as the center node of the current path to be generated, and sequentially adding customer nodes that have not been assigned a path to the current path to be generated in the order of the nearest neighbor with the center node, until the maximum capacity of the given vehicle type is exceeded after adding a new customer node, then a path is completed; Step 3.3: repeating step 3.2 until all customer nodes have been assigned a path, at which time all generated paths are added to the initial population as an individual; Step 3.4: repeating step 3.2 and step 3.3 until the given size of the initial population is reached.
[0008] Further, in step 4, a set of elite solutions is selected from the current population using a double-elite adaptive reservation strategy to join a new population N pop , specifically comprising: Step 4.1: for each individual in the current population, calculating the similarity of the individual to the global optimal solution; Step 4.2: setting a similarity value range, dividing the entire similarity value range into multiple intervals, and thereby obtaining a normalized population similarity entropy between the current population and the global optimal solution based on the similarity of each individual in the current population; Step 4.3: determining an elite proportion based on the normalized population similarity entropy and the current iteration progress, so as to select individuals with greater fitness from the sorted individuals as the set of elite solutions; Step 4.4: Merge and deduplicate the elite solution set with the global elite solution set from the previous iteration, and add the deduplicated elite solution set to the new population N. pop .
[0009] Further, in step 5, for each non-elite solution in the non-elite solution set, the update strategy of the Jaya algorithm is used to learn from the current optimal or worst solution set to generate a candidate solution set, specifically including: For each non-elite solution, a random number with a value in the range (0,1) is generated. If the random number is less than a preset threshold, an update strategy that learns from the current best solution set is used to generate a candidate solution set; otherwise, an update strategy that is far from the current worst solution set is used to generate a candidate solution set. The update strategy for learning from the current optimal solution set includes: traversing the optimal solution set and calculating the similarity between the non-elite solution and the current optimal solution; selecting a continuous segment from the current optimal solution based on the similarity value, wherein the larger the similarity value, the shorter the segment length; and, under the condition of satisfying the capacity constraint, inserting the selected segment into the non-elite solution to obtain a candidate solution, and continuing to learn from the next optimal solution until all optimal solutions have been traversed, at which point a candidate solution set is obtained. The update strategy for moving away from the current worst solution set includes: traversing the worst solution set, calculating the common edges and similarity between the non-elite solution and the current worst solution; selecting a certain number of common edges from the non-elite solution based on the similarity value, where the larger the similarity value, the larger the number of common edges; processing the selected common edges using in-path point swaps, and perturbing the non-elite solution using a random perturbation strategy to obtain a candidate solution, and continuing to move away from the next worst solution until all worst solutions have been traversed, at which point a candidate solution set is obtained.
[0010] Furthermore, in step 5, a vehicle model adjustment strategy is used to adjust the new population N. pop After adjustments, a new population B was obtained. pop Specifically, it includes: The following two vehicle model adjustment operations will be executed in a preset probability-triggered sequence: First type of vehicle adjustment operation: targeting the new population N pop For each individual in the process, randomly select two paths from the current solution. Without checking capacity constraints, move a customer node from one path to a neighborhood of the other path. For the two paths after the move, start traversing from the vehicle with the smallest capacity. Under the condition of satisfying the total capacity requirement of the path, select the vehicle with the smallest capacity and the lowest fixed cost. After adjusting the vehicle, calculate the total path cost of the path after the move. If it is better than before the move, accept the move. The second type of vehicle adjustment operation: targeting the new population N popFor each individual in the process, two different paths are randomly selected. Without checking capacity constraints, a customer node in one path is moved to all possible positions in the other path. A new individual is generated for each possible position moved to. From all the new individuals, the individual that reduces the travel distance the most is determined. Starting from the vehicle type with the smallest capacity, the process is traversed. Under the condition of satisfying the total capacity requirement of the path, the vehicle type with the smallest capacity and the lowest fixed cost is selected. After adjusting the vehicle type, the total path cost of the path after the move is calculated. If it is better than before the move, the move is accepted.
[0011] Furthermore, step 6 specifically includes: The fitness of the current solution is taken as the state, all local search operators are taken as the action space, the improvement in the total path cost of the solution after the application of local search operators is taken as the reward, and the Q table is initialized. In each iteration, a local search operator is selected from the action space according to the ε-greedy policy and applied to the current solution to obtain a new solution and calculate the reward; and the Q value of the corresponding state-action pair is updated according to the Bellman equation. Among them, single-point movement within a path refers to randomly selecting a customer node on a path and then searching for a better insertion position in the list of its neighboring customer nodes. Single-point movement between paths refers to randomly selecting a customer node from one path and attempting to move it to another path that includes its neighboring nodes; The first path involves swapping two points within the path, which means forming a new path by repeatedly trying to reverse the subsequences between two nodes in the path. The second path involves randomly selecting two paths and their respective breakpoints, and then swapping the segments after the breakpoints to form a new path. The first two-point swap between paths refers to randomly selecting a customer node from one path and inserting it into every possible position in another path, recording the solution that reduces the total path cost the most, and updating both paths. The second path two-point exchange refers to exchanging the positions of two customer nodes between two paths while meeting capacity constraints.
[0012] Furthermore, the similarity is calculated according to the following formula: in, This represents a similarity function; it defines an edge as a connection between adjacent nodes in a path. This represents the set of edges in the corresponding solution; This represents the solution for which the similarity is to be calculated; This indicates a reference solution.
[0013] Further, in step 4.3, the normalized population similarity entropy is calculated according to the following formula: in, Represents the normalized population similarity entropy; This represents the frequency of an individual appearing in the i-th similarity interval; Information entropy represents the distribution of population similarity. This means dividing the entire similarity value range into S intervals; In step 4.4, the elite ratio is determined according to the following formula: in, Indicates the proportion of elites; Indicates the upper limit of the elite ratio. This indicates the lower limit of the proportion of elites; This indicates the current iteration progress.
[0014] Furthermore, in step 7, the insertion of charging station nodes using a greedy algorithm strategy specifically includes: For the new population T pop For each individual in the path, calculate the minimum amount of electricity required for each customer node on the path to reach the nearest charging station node. When the remaining electricity is insufficient to reach the next customer node, backtrack to find the nearest reachable charging station node and insert it, and reset the electricity to full charge. The aforementioned strategy of using reverse energy calculation to optimize the location of charging station nodes specifically includes: optimizing the path of already inserted charging station nodes and attempting to adjust the location of charging station nodes to reduce the total path cost; Correspondingly, step 7 further includes: For the new population D pop For each individual in the process, the fitness function is used to calculate the individual's fitness, and a preset number of individuals with higher fitness are selected to form the global elite solution set in the current iteration process.
[0015] Secondly, the present invention provides a path planning device for electric vehicles of different vehicle types based on a multi-strategy fusion Jaya algorithm, comprising: The information acquisition module is used to acquire vehicle information and node information; the vehicle information includes the vehicle model information used, and the node information includes warehouse nodes, customer nodes, and charging station nodes. The fitness function construction module is used to construct the fitness function based on the total path cost function; where the smaller the total path cost, the greater the corresponding fitness. The population initialization module is used to generate an initial population using the nearest neighbor clustering method based on the vehicle information and node information; wherein, an individual in the population represents a solution or a path planning scheme, and the path planning scheme includes the paths corresponding to all participating vehicles, and one vehicle corresponds to one path; The population optimization module is used to calculate the fitness of each individual in the current population using the fitness function and sort all individuals according to their fitness values. This is done to determine the non-elite solution set from the current population based on fitness, and to select the elite solution set from the current population using a bi-elite adaptive retention strategy to add to the new population N. pop For each non-elite solution in the non-elite solution set, the update strategy of the Jaya algorithm is used to learn from the current best or worst solution set to generate a candidate solution set. The fitness function is used to calculate the fitness of each solution in the candidate solution set to select the best candidate solution. The Monte Carlo acceptance criterion is then used to determine whether to add the best candidate solution to the new population N. pop Both the optimal solution set and the worst solution set include at least two solutions; and a vehicle model adjustment strategy is used to adjust the new population N. pop After adjustments, a new population B was obtained. pop The Q-learning strategy is used to select local search operators for the new population B. pop Optimization was performed to obtain a new population T. pop The local search operators include single-point movement within a path, single-point movement between paths, two-point exchange within a path, and two-point exchange between paths; and for the new population T pop A greedy algorithm strategy is used to insert charging station nodes, and a reverse energy calculation strategy is used to optimize the location of the charging station nodes, resulting in a new population D. pop ; The optimal solution output module is used to output the new population D when the population optimization reaches the iteration stopping condition. pop The global optimal solution.
[0016] The beneficial effects of this invention are as follows: (1) The present invention constructs an initial population based on the nearest neighbor clustering method. That is, a central node is randomly selected, and under the vehicle capacity constraint, the other customer nodes are added to the path where the central node is located in turn according to the distance between the central node and the other customer nodes, so as to ensure the feasibility and quality of the generated solution; at the same time, the diversity of the generated solution is ensured by randomly selecting the central node, which solves the problems of difficulty in generating the initial population and low quality.
[0017] (2) This invention designs multiple strategies in the process of adjusting and optimizing the initial population: First, a dynamic elite ratio adjustment based on similarity entropy is introduced in the dual-elite adaptive retention strategy, which achieves the goal of retaining fewer elites when diversity is high in the early stage and retaining more elites when convergence occurs in the later stage, thus balancing exploration and utilization. Second, for non-elite solutions in the population, this invention changes the traditional Jaya algorithm's update strategy of learning only from one optimal solution or moving away from one worst solution. Instead, it uses a set of optimal and worst solutions, including at least two solutions, to update the original non-elite solutions, enhancing the global exploration capability. Third, in traditional algorithms, only the current population elites are retained in each generation, which easily leads to the loss of historical high-quality solutions. This invention maintains a global elite solution set, retains high-quality solutions across generations, and combines local search optimization to improve the quality of solutions. Fourth, the traditional Jaya algorithm only accepts improved solutions. This invention introduces the Monte Carlo criterion to accept inferior solutions with a certain probability, enhancing the ability to escape local optima. Fifth, this invention designs multiple local search operators and, through a Q-learning mechanism, selects local search operators to optimize each solution in the next-generation population. This strengthens the operator selection strategy that maximizes benefits in the current state, thereby avoiding wasting computational resources on ineffective searches and significantly accelerating the finding of high-quality solutions. Furthermore, this invention adds a probabilistic vehicle model adjustment operator. During the exchange process, capacity constraints are not restricted; instead, vehicle model adjustment is performed after the exchange, selecting the vehicle with the smallest capacity to meet the requirements, thus reducing fixed costs. Sixth, regarding charging stations, traditional methods directly use reachable charging stations, which are not necessarily optimal. This invention uses reverse energy calculation to optimize the location of charging piles, reducing travel distance and further lowering the total path cost. Attached Figure Description
[0018] Figure 1 A flowchart illustrating a method for path planning of electric vehicles of different models based on the multi-strategy fusion Jaya algorithm, provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a path planning device for electric vehicles of different models based on the multi-strategy fusion Jaya algorithm, provided in an embodiment of the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the embodiments of this invention will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0020] like Figure 1As shown, this embodiment of the invention provides a path planning method for electric vehicles of different models based on the multi-strategy fusion Jaya algorithm, including the following steps: S101: Obtain vehicle information and node information; the vehicle information includes the vehicle model information used, and the node information includes warehouse nodes, customer nodes, and charging station nodes. S102: The fitness function is constructed based on the function that minimizes the total path cost; where the smaller the total path cost, the greater the corresponding fitness. In this embodiment, the total path cost function is: Where F represents the total path cost for an individual; R represents the set of paths; V represents the set of node information; and M represents the set of vehicle types. ; Represents a binary decision variable. This indicates that there exists a vehicle of model m traveling from node i to node j; otherwise... ; This represents the path distance from node i to node j; This indicates the unit power consumption of vehicle model m. This represents the fixed cost of vehicle model m (i.e., the basic cost incurred when each vehicle is in use). Represents a binary indicator variable. This indicates that vehicles of model m were used in path r, otherwise... .
[0021] The objective of this invention is to find a path planning scheme that minimizes the total path cost function described above, i.e. As one possible implementation method, directly using... The reciprocal of is used as the fitness function.
[0022] S103: Based on the vehicle information and node information, generate an initial population using the nearest neighbor clustering method; wherein, an individual in the population represents a solution or a path planning scheme, and the path planning scheme includes the paths corresponding to all participating vehicles, and one vehicle corresponds to one path; In this embodiment, this step specifically includes the following sub-steps: S1031: Obtain a list of IDs for all client nodes and randomly shuffle the original order of the ID list; this step aims to increase the randomness of the subsequent selection of the central node by shuffling the order of the client nodes, thereby ensuring the diversity of generated solutions.
[0023] S1032: Given a vehicle model, traverse the customer nodes that have not been assigned a path, and take the first customer node that does not exceed the maximum capacity of the given vehicle model as the center node of the current path to be generated. Add the customer nodes that have not been assigned a path to the current path to be generated in the order of nearest neighbors with the center node, until the maximum capacity of the given vehicle model is exceeded after adding new customer nodes. Then a path is constructed. Specifically, in practical applications, an array can be initialized to mark which customer nodes have been assigned to the path, such as 1 indicating assigned and 0 indicating unassigned, to avoid duplicate assignment of already assigned points.
[0024] For example, suppose a customer node k is designated as the central node and marked as allocated. Under the constraint of satisfying the maximum capacity, a new path tour is initialized, the central node k is added to the path tour, and the allocated capacity of the path tour is calculated. The nearest customer node l1 to the central node k is found, and its addition to the path tour is attempted. Then, it is determined whether the total capacity requirement (the sum of the capacity requirements of nodes k and l1) exceeds the maximum capacity. If not, customer node l1 is added to the path tour, marked as allocated, and the total capacity requirement of the current path is updated. Next, the nearest customer node l2 to the central node k is processed, following a similar process. If the requirement exceeds the maximum capacity, adding customer node l2 to the path tour is stopped, and customer node l2 is marked as unallocated. The process continues with the next neighboring node until all neighboring nodes have been processed. Alternatively, if all neighboring nodes have not been processed, but the remaining capacity is insufficient to add new neighboring nodes, the path tour is considered complete. It is understood that the set of neighboring nodes of the central node k can be pre-calculated.
[0025] In addition, it should be noted that during the initial path population construction phase, firstly, each path is assigned the same vehicle index 0 by default, which is the vehicle with the largest capacity after sorting by capacity; then, after each path is constructed, it is added to the initial population. After all customer nodes are allocated, the vehicle with the smallest capacity that meets the demand will be reselected for each path based on the total customer demand for each path, in order to optimize fixed costs.
[0026] S1033: Repeat step S1032 until all client nodes have been assigned paths. At this point, add all generated paths as an individual to the initial population. S1034: Repeat steps S1032 and S1033 until the given initial population size is reached, such as a population size of 100.
[0027] As can be seen, the embodiments of the present invention generate the initial population by the nearest neighbor clustering method, which can effectively avoid generating the same initial population in different scenarios, ensure the diversity of the initial population, and solve the problems of difficulty in generating the initial population and low quality in the path problem of electric vehicles of different models.
[0028] S104: For the current population, calculate the fitness of each individual using the fitness function and sort all individuals according to their fitness values. This is to determine the non-elite solution set from the current population based on fitness, and to select the elite solution set from the current population using a bi-elite adaptive retention strategy to add to the new population N. pop ; In this embodiment, a dual-elite adaptive retention strategy is used to select an elite set from the current population to add to the new population N. pop Specifically, it includes the following sub-steps: S1041: For each individual in the current population, calculate the similarity between that individual and the global optimal solution; S1042: Set the similarity value range, divide the entire similarity value range into multiple intervals, and obtain the normalized population similarity entropy between the current population and the global optimal solution based on the similarity statistics corresponding to each individual in the current population. S1043: Determine the elite ratio based on the normalized population similarity entropy and the current iteration progress, so as to select individuals with a higher fitness from all sorted individuals as the elite solution set; S1044: Merge and deduplicate the elite solution set with the global elite solution set from the previous iteration, and add the deduplicated elite solution set to the new population N. pop .
[0029] S105: For each non-elite solution in the non-elite solution set, the update strategy of the Jaya algorithm is used to learn from the current best or worst solution set to generate a candidate solution set. The fitness function is used to calculate the fitness of each solution in the candidate solution set to select the best candidate solution. The Monte Carlo acceptance criterion is then used to determine whether to add the best candidate solution to the new population N. pop Both the optimal solution set and the worst solution set include at least two solutions; and a vehicle model adjustment strategy is used to adjust the new population N. pop After adjustments, a new population B was obtained. pop ; In this embodiment, for each non-elite solution in the non-elite solution set, the update strategy of the Jaya algorithm is used to learn from the current best or worst solution set to generate a candidate solution set, specifically including: For each non-elite solution, generate a random number rand with a value in the range (0,1).val If the random number is less than a preset threshold (e.g., when rand...), val If the value is ≤0.8, then an update strategy that learns from the current best solution set is used to generate a candidate solution set; otherwise, an update strategy that is far from the current worst solution set is used to generate a candidate solution set. The update strategy for learning from the current optimal solution set includes: traversing the optimal solution set and calculating the similarity between the non-elite solution and the current optimal solution; selecting a continuous segment from the current optimal solution based on the similarity value, where a higher similarity value corresponds to a shorter segment length; inserting the selected segment into the non-elite solution while satisfying capacity constraints, thus obtaining a candidate solution, and continuing to learn from the next optimal solution until all optimal solutions have been traversed, at which point a candidate solution set is obtained. This process allows superior segments from the optimal solution to be directly transferred to the non-elite solution, thereby improving the solution quality.
[0030] Taking an optimal solution as an example, a path is randomly selected from this optimal solution. From this path, a segment consisting of consecutive customer nodes is chosen, and this segment is attempted to be inserted into a path within the current solution, strictly adhering to the vehicle capacity constraints corresponding to that path. This generates a candidate solution. It should be noted that if the existing path cannot accommodate the segment, the segment is created as a new path, and the most suitable vehicle type is assigned to this new path based on its capacity. This new path is then added to the original non-elite solution, thus forming a candidate solution.
[0031] The update strategy for moving away from the current worst solution set includes: traversing the worst solution set and calculating the common edges and similarity between the non-elite solution and the current worst solution; selecting a certain number of common edges from the non-elite solution based on the similarity value, where the larger the similarity value, the larger the number of common edges selected, because: higher similarity means more edges shared between the two, thus the stronger the breaking of these common edges; processing the selected common edges using in-path two-point swaps (such as the first in-path two-point swap mentioned below), and perturbing the non-elite solution using a random perturbation strategy to obtain a candidate solution, and continuing to move away from the next worst solution until all worst solutions have been traversed, at which point a candidate solution set is obtained. This process moves non-elite solutions away from the worst solution, thereby escaping local optima and increasing population diversity.
[0032] In this embodiment, the Monte Carlo acceptance criterion is used to determine whether to add the optimal candidate solution to the new population N. pop Specifically, it includes: Compare the fitness of the optimal candidate solution with that of the original non-elite solutions. If the optimal candidate solution is better, accept it and add it to the new population N. popOtherwise, according to the Monte Carlo mechanism, the optimal candidate solution is accepted with a certain probability, i.e., a number between 0 and 1 is generated. If the number is less than the acceptance probability, the optimal candidate solution is added to the new population N. pop Otherwise, add the original non-elite solution to the new population N. pop .
[0033] Among them, the probability of acceptance The calculation formula is: in, ΔE represents the acceptance probability; ΔE represents the fitness difference between the optimal candidate solution and the original non-elite solution, where fitness is the total path cost.
[0034] In this embodiment, a vehicle model adjustment strategy is used to adjust the new population N. pop After adjustments, a new population B was obtained. pop Specifically, it includes: The following two vehicle model adjustment operations will be executed in sequence with a preset probability (e.g., 20%): First type of vehicle adjustment operation: targeting the new population N pop For each individual in the process, two different paths in the current solution are randomly selected. Without checking capacity constraints, a customer node (let's say node s) in one path (let's say path A) is moved to a neighborhood position in the other path (let's say path B). At this time, it is assumed that other paths in the current solution remain unchanged. For the moved paths A and B, the process starts with the vehicle model with the smallest capacity. Under the condition of satisfying the total capacity requirement of the path, the vehicle model with the smallest capacity and the lowest fixed cost is selected to reduce the total path cost. After the vehicle model is adjusted, the total path cost of the moved path is calculated. If it is better than before the move, the move is accepted. The neighboring locations mentioned above refer to the neighboring nodes of the customer node (node s) being moved. The neighboring nodes of a customer node are pre-calculated using a distance matrix; that is, the customer nodes geographically closest to node s are pre-sorted in ascending order of distance. These neighboring nodes are traversed, and it is checked whether they appear in path B. If a neighboring node m is in path B, node s is inserted after node m in path B.
[0035] The second type of vehicle adjustment operation: targeting the new population N popFor each individual in the process, two different paths are randomly selected from the current solution. Without checking capacity constraints, a customer node in one path (let's say path A) is moved to all possible positions in the other path (let's say path B). A new individual is generated for each possible position moved (at this time, it is assumed that the other paths in the new individual are not changed except for path A and path B). From all the new individuals, the individual Q that reduces the travel distance the most is determined. Starting from the vehicle type with the smallest capacity, the vehicle type with the smallest capacity and the lowest fixed cost is selected while satisfying the total capacity requirement of the path. After the vehicle type is adjusted, the total path cost of the moved path is calculated. If it is better than before the move, the move is accepted, that is, individual Q is used to replace the original individual.
[0036] S106: Use the Q-learning strategy to select the local search operator for the new population B. pop Optimization was performed to obtain a new population T. pop The local search operators include single-point movement within a path, single-point movement between paths, exchange of two points within a path, and exchange of two points between paths. In this embodiment, this step specifically includes the following sub-steps: The fitness of the current solution is taken as the state, all local search operators are taken as the action space, the improvement in the total path cost of the solution after the application of local search operators is taken as the reward, and the Q table is initialized. In each iteration, a local search operator is selected from the action space according to the ε-greedy policy and applied to the current solution to obtain a new solution and calculate the reward; and the Q value of the corresponding state-action pair is updated according to the Bellman equation. In this embodiment, the formula for updating the Q value is: in, Indicates the action to be selected in the current state. Q value; Indicates the learning rate; This indicates an immediate reward, used to control the impact of new information. This represents the discount factor, which measures the importance of future rewards. In this embodiment, it is fixed at 0.8, indicating that future rewards are highly valued. Indicates the next state Maximum Q value; The ε-greedy strategy (i.e., the action selection formula) is: in, Indicates the action of selection; express Random numbers between; Represents probability; Indicates the state Next, find the one that can make Action to obtain the maximum value ; Indicates the current state Next, select an action. The expected cumulative rewards that can be obtained afterward; Indicates the current evaluation number; This indicates the total number of evaluations.
[0037] The formula for calculating the reward is: in, Indicates a reward; This indicates the total cost of the current solution; This indicates the total cost of the new solution; Learning rate The calculation formula is as follows: in, Indicates the learning rate; Indicates the current evaluation number; This indicates the total number of assessments; thus, information is learned early on, and later selections are made based on the existing information.
[0038] In this embodiment, single-point movement within a path refers to randomly selecting a customer node on a path and then searching for a better insertion position in the list of its neighboring customer nodes. Single-point movement between paths refers to randomly selecting a customer node from one path and attempting to move it to another path that includes its neighboring nodes; The first path involves swapping two points within the path, which means forming a new path by repeatedly trying to reverse the subsequences between two nodes in the path. The second path involves randomly selecting two paths and their respective breakpoints, and then swapping the segments after the breakpoints to form a new path. The first two-point swap between paths refers to randomly selecting a customer node from one path and inserting it into every possible position in another path, recording the solution that reduces the total path cost the most, and updating both paths. The second path two-point exchange refers to exchanging the positions of two customer nodes between two paths while meeting capacity constraints.
[0039] S107: For the new population T pop A greedy algorithm strategy is used to insert charging station nodes, and a reverse energy calculation strategy is used to optimize the location of the charging station nodes, resulting in a new population D.pop ; In this embodiment, inserting charging station nodes using the greedy algorithm strategy specifically includes: For each path in the new population T pop Initialize the remaining power, calculate the minimum power required for each customer node in the path to reach the nearest charging station node, when the remaining power is not enough to reach the next customer node, backtrack to find the nearest reachable charging station node and insert it, and reset the power to full charge; if no reachable charging station node can be found, return the original path, which means this path is an infeasible solution.
[0040] Optimizing the positions of charging station nodes using the reverse energy calculation strategy specifically includes: optimizing the paths with inserted charging station nodes, and trying to adjust the positions of charging station nodes to reduce the total path cost. Specifically, calculate the cumulative energy demand of each customer node forward from the end point, and for each charging station node in the path, calculate the total distance L1 of its current connected edge, try to replace it with other better charging station nodes, calculate the total distance L2 of the new edge, if L2 < L1, then replace it with a better charging station node, and return the adjusted path.
[0041] For each individual in the new population D pop Calculate the fitness of the individual using the fitness function, and select a preset number of individuals with larger fitness to form the global elite solution set in the current iteration process; and, when the maximum iteration number is not reached, in each iteration process, select the top k individuals with the highest fitness from the new population D pop to form the optimal solution set, and at the same time select the last k individuals with the lowest fitness to form the worst solution set; for example, k = 5.
[0042] S108: Repeat steps S104 to S107 until the iteration stop condition is reached, and output the global optimal solution in the new population D pop in.
[0043] In one embodiment, calculate the similarity between two solutions according to the following formula: where represents the similarity function; it is defined that an edge is formed between adjacent nodes in the path, represents the set of edges in the corresponding solution; represents the solution for which the similarity is to be calculated; represents the reference solution.
[0044] For example, in step S1042 in the above embodiment, represents an individual in the current population, This represents the globally optimal solution. In step S105 of the above embodiment, Describes a non-elite solution to the non-elite solution set. It represents an optimal solution in the optimal solution set or a worst solution in the worst solution set.
[0045] In one embodiment, for step S1043 in the above embodiment, the normalized population similarity entropy is calculated according to the following formula: in, The entropy represents the normalized population similarity, and its value ranges from 1 to 2. ; This represents the frequency of an individual appearing in the i-th similarity interval (i.e., the number of individuals in that interval divided by the total number of individuals). Information entropy represents the distribution of population similarity, and is used to measure the uniformity of the distribution of similarity between individuals in the population and the optimal solution; This means dividing the entire similarity value range into S intervals, such as dividing the similarity according to... Divided into 10 intervals, This represents the maximum possible entropy value.
[0046] In step S1044, the elite ratio is determined according to the following formula: in, Indicates the proportion of elites; Indicates the upper limit of the elite ratio. This indicates the lower limit of the proportion of elites; This indicates the current iteration progress, equivalent to the ratio of the current iteration count to the total number of iterations. For example, in this embodiment, Set to 0.1, Set to 0.01.
[0047] In general, the higher the normalized population similarity entropy (meaning higher population diversity), the higher the proportion of elites. The proportion of elites gradually decreases in the later stages of iteration to balance exploration and utilization. Through a dual-elite adaptive retention mechanism, historical high-quality solutions can be preserved, while the proportion of elites can dynamically change according to changes in population similarity entropy.
[0048] Based on the same inventive concept, such as Figure 2 As shown, this embodiment of the invention provides a path planning device for electric vehicles of different models based on the multi-strategy fusion Jaya algorithm, including: an information acquisition module, a fitness function construction module, a population initialization module, a population optimization module, and an optimal solution output module.
[0049] Specifically, the information acquisition module is used to acquire vehicle information and node information; the vehicle information includes the model of the vehicle used, and the node information includes warehouse nodes, customer nodes, and charging station nodes; the fitness function construction module is used to construct a fitness function based on the total path cost function; wherein, the smaller the total path cost, the greater the corresponding fitness; the population initialization module is used to generate an initial population using the nearest neighbor clustering method based on the vehicle information and node information; wherein, an individual in the population represents a solution or a path planning scheme, and the path planning scheme includes paths corresponding to all participating vehicles, with one vehicle corresponding to one path; the population optimization module is used to calculate the fitness of each individual in the current population using the fitness function and sort all individuals according to their fitness values, so as to determine the non-elite solution set from the current population based on fitness, and to use a bi-elite adaptive retention strategy to select the elite solution set from the current population to add to the new population N. pop For each non-elite solution in the non-elite solution set, the update strategy of the Jaya algorithm is used to learn from the current best or worst solution set to generate a candidate solution set. The fitness function is used to calculate the fitness of each solution in the candidate solution set to select the best candidate solution. The Monte Carlo acceptance criterion is then used to determine whether to add the best candidate solution to the new population N. pop Both the optimal solution set and the worst solution set include at least two solutions; and a vehicle model adjustment strategy is used to adjust the new population N. pop After adjustments, a new population B was obtained. pop The Q-learning strategy is used to select local search operators for the new population B. pop Optimization was performed to obtain a new population T. pop The local search operators include single-point movement within a path, single-point movement between paths, two-point exchange within a path, and two-point exchange between paths; and for the new population T pop A greedy algorithm strategy is used to insert charging station nodes, and a reverse energy calculation strategy is used to optimize the location of the charging station nodes, resulting in a new population D. pop The optimal solution output module is used to output the new population D when the population optimization reaches the iteration stopping condition. pop The global optimal solution.
[0050] It should be noted that the heterogeneous electric vehicle path planning device based on the multi-strategy fusion Jaya algorithm provided in this embodiment of the invention is for implementing the above method. Its specific functions can be referred to the above method embodiment, and will not be repeated here.
[0051] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0052] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A path planning method for electric vehicles of different models based on the multi-strategy fusion Jaya algorithm, characterized in that, include: Step 1: Obtain vehicle information and node information; The vehicle information includes the model information used, and the node information includes warehouse nodes, customer nodes, and charging station nodes. Step 2: Construct the fitness function based on the total path cost function; where the smaller the total path cost, the greater the corresponding fitness. Step 3: Based on the vehicle information and node information, generate an initial population using the nearest neighbor clustering method; wherein, an individual in the population represents a solution or a path planning scheme, and the path planning scheme includes the paths corresponding to all participating vehicles, with one vehicle corresponding to one path; Step 4: For the current population, calculate the fitness of each individual using the fitness function and sort all individuals according to their fitness values. This is to determine the non-elite solution set from the current population based on fitness, and to use a bi-elite adaptive retention strategy to select the elite solution set from the current population to be added to the new population N. pop ; Step 5: For each non-elite solution in the non-elite solution set, use the update strategy of the Jaya algorithm to learn from the current best or worst solution set to generate a candidate solution set. Use the fitness function to calculate the fitness of each solution in the candidate solution set to select the best candidate solution. Then, based on the Monte Carlo acceptance criterion, decide whether to add the best candidate solution to the new population N. pop Both the optimal solution set and the worst solution set include at least two solutions; and a vehicle model adjustment strategy is used to adjust the new population N. pop After adjustments, a new population B was obtained. pop ; Step 6: Use the Q-learning strategy to select the local search operator for the new population B. pop Optimization was performed to obtain a new population T. pop The local search operators include single-point movement within a path, single-point movement between paths, exchange of two points within a path, and exchange of two points between paths. Step 7: For the new population T pop A greedy algorithm strategy is used to insert charging station nodes, and a reverse energy calculation strategy is used to optimize the location of the charging station nodes, resulting in a new population D. pop ; Step 8: Repeat steps 4 to 7 until the iteration stopping condition is met, and output the new population D. pop The global optimal solution.
2. The method for path planning of electric vehicles of different models based on multi-strategy fusion Jaya algorithm according to claim 1, characterized in that, The total path cost function is: Where F represents the total path cost for an individual; R represents the set of paths; V represents the set of node information; and M represents the set of vehicle types. ; Represents a binary decision variable. This indicates that there exists a vehicle of model m traveling from node i to node j; otherwise... ; This represents the path distance from node i to node j; This indicates the unit power consumption of vehicle model m. This represents the fixed cost of vehicle model m. Represents a binary indicator variable. This indicates that vehicles of model m were used in path r, otherwise... .
3. The method for path planning of electric vehicles of different models based on multi-strategy fusion Jaya algorithm according to claim 1, characterized in that, In step 3, based on the vehicle information and node information, the initial population is generated using the nearest neighbor clustering method, specifically including: Step 3.1: Obtain a list of IDs for all client nodes and randomly shuffle the original order of the ID list; Step 3.2: Given a vehicle model, traverse the customer nodes that have not been assigned a path. Take the first customer node that does not exceed the maximum capacity of the given vehicle model as the center node of the current path to be generated. Add the customer nodes that have not been assigned a path to the current path to be generated in the order of nearest neighbors with the center node, until the maximum capacity of the given vehicle model is exceeded after adding new customer nodes. Then a path is constructed. Step 3.3: Repeat step 3.2 until all client nodes have been assigned paths. At this point, add all generated paths as an individual to the initial population. Step 3.4: Repeat steps 3.2 and 3.3 until the given initial population size is reached.
4. The method for path planning of electric vehicles of different models based on multi-strategy fusion Jaya algorithm according to claim 1, characterized in that, In step 4, a dual-elite adaptive retention strategy is used to select an elite set from the current population to be added to the new population N. pop Specifically, it includes: Step 4.1: For each individual in the current population, calculate the similarity between that individual and the global optimal solution; Step 4.2: Set the similarity value range and divide the entire similarity value range into multiple intervals, so as to obtain the normalized population similarity entropy between the current population and the global optimal solution based on the similarity statistics corresponding to each individual in the current population; Step 4.3: Determine the elite ratio based on the normalized population similarity entropy and the current iteration progress, so as to select individuals with higher fitness from all sorted individuals as the elite solution set; Step 4.4: Merge and deduplicate the elite solution set with the global elite solution set from the previous iteration, and add the deduplicated elite solution set to the new population N. pop .
5. The method for path planning of electric vehicles of different models based on multi-strategy fusion Jaya algorithm according to claim 2, characterized in that, In step 5, for each non-elite solution in the non-elite solution set, the update strategy of the Jaya algorithm is used to learn from the current best or worst solution set to generate a candidate solution set, specifically including: For each non-elite solution, a random number with a value in the range (0,1) is generated. If the random number is less than a preset threshold, an update strategy that learns from the current best solution set is used to generate a candidate solution set; otherwise, an update strategy that is far from the current worst solution set is used to generate a candidate solution set. The update strategy for learning from the current optimal solution set includes: traversing the optimal solution set and calculating the similarity between the non-elite solution and the current optimal solution; selecting a continuous segment from the current optimal solution based on the similarity value, wherein the larger the similarity value, the shorter the segment length; and, under the condition of satisfying the capacity constraint, inserting the selected segment into the non-elite solution to obtain a candidate solution, and continuing to learn from the next optimal solution until all optimal solutions have been traversed, at which point a candidate solution set is obtained. The update strategy for moving away from the current worst solution set includes: traversing the worst solution set, calculating the common edges and similarity between the non-elite solution and the current worst solution; selecting a certain number of common edges from the non-elite solution based on the similarity value, where the larger the similarity value, the larger the number of common edges; processing the selected common edges using in-path point swaps, and perturbing the non-elite solution using a random perturbation strategy to obtain a candidate solution, and continuing to move away from the next worst solution until all worst solutions have been traversed, at which point a candidate solution set is obtained.
6. The method for path planning of electric vehicles of different models based on multi-strategy fusion Jaya algorithm according to claim 2, characterized in that, In step 5, a vehicle model adjustment strategy is used to adjust the new population N. pop After adjustments, a new population B was obtained. pop Specifically, it includes: The following two vehicle model adjustment operations will be executed in a preset probability-triggered sequence: First type of vehicle adjustment operation: targeting the new population N pop For each individual in the process, randomly select two paths from the current solution. Without checking capacity constraints, move a customer node from one path to a neighborhood of the other path. For the two paths after the move, start traversing from the vehicle with the smallest capacity. Under the condition of satisfying the total capacity requirement of the path, select the vehicle with the smallest capacity and the lowest fixed cost. After adjusting the vehicle, calculate the total path cost of the path after the move. If it is better than before the move, accept the move. The second type of vehicle adjustment operation: targeting the new population N pop For each individual in the process, two different paths are randomly selected. Without checking capacity constraints, a customer node in one path is moved to all possible positions in the other path. A new individual is generated for each possible position moved to. From all the new individuals, the individual that reduces the travel distance the most is determined. Starting from the vehicle type with the smallest capacity, the process is traversed. Under the condition of satisfying the total capacity requirement of the path, the vehicle type with the smallest capacity and the lowest fixed cost is selected. After adjusting the vehicle type, the total path cost of the path after the move is calculated. If it is better than before the move, the move is accepted.
7. The method for path planning of electric vehicles of different models based on multi-strategy fusion Jaya algorithm according to claim 1, characterized in that, Step 6 specifically includes: The fitness of the current solution is taken as the state, all local search operators are taken as the action space, the improvement in the total path cost of the solution after the application of local search operators is taken as the reward, and the Q table is initialized. In each iteration, a local search operator is selected from the action space according to the ε-greedy policy and applied to the current solution to obtain a new solution and calculate the reward; and the Q value of the corresponding state-action pair is updated according to the Bellman equation. Among them, single-point movement within a path refers to randomly selecting a customer node on a path and then searching for a better insertion position in the list of its neighboring customer nodes. Single-point movement between paths refers to randomly selecting a customer node from one path and attempting to move it to another path that includes its neighboring nodes; The first path involves swapping two points within the path, which means forming a new path by repeatedly trying to reverse the subsequences between two nodes in the path. The second path involves randomly selecting two paths and their respective breakpoints, and then swapping the segments after the breakpoints to form a new path. The first two-point swap between paths refers to randomly selecting a customer node from one path and inserting it into every possible position in another path, recording the solution that reduces the total path cost the most, and updating both paths. The second path two-point exchange refers to exchanging the positions of two customer nodes between two paths while meeting capacity constraints.
8. A method for path planning of electric vehicles of different models based on multi-strategy fusion Jaya algorithm according to claim 4 or 5, characterized in that, Similarity is calculated using the following formula: in, This represents a similarity function; it defines an edge as a connection between adjacent nodes in a path. This represents the set of edges in the corresponding solution; This represents the solution for which the similarity is to be calculated; This indicates a reference solution.
9. The method for path planning of electric vehicles of different models based on multi-strategy fusion Jaya algorithm according to claim 1, characterized in that, Step 7, the insertion of charging station nodes using a greedy algorithm strategy, specifically includes: For the new population T pop For each individual in the path, initialize the remaining power, calculate the minimum power required for each customer node on the path to reach the nearest charging station node, and when the remaining power is insufficient to reach the next customer node, backtrack to find the nearest reachable charging station node and insert it, and reset the power to full. The aforementioned strategy of using reverse energy calculation to optimize the location of charging station nodes specifically includes: optimizing the path of already inserted charging station nodes and attempting to adjust the location of charging station nodes to reduce the total path cost; Correspondingly, step 7 further includes: For the new population D pop For each individual in the process, the fitness function is used to calculate the individual's fitness, and a preset number of individuals with higher fitness are selected to form the global elite solution set in the current iteration process.
10. A path planning device for electric vehicles of different models based on the multi-strategy fusion Jaya algorithm, characterized in that, include: The information acquisition module is used to acquire vehicle information and node information; The vehicle information includes the model information used, and the node information includes warehouse nodes, customer nodes, and charging station nodes. The fitness function construction module is used to construct the fitness function based on the total path cost function; where the smaller the total path cost, the greater the corresponding fitness. The population initialization module is used to generate an initial population using the nearest neighbor clustering method based on the vehicle information and node information; wherein, an individual in the population represents a solution or a path planning scheme, and the path planning scheme includes the paths corresponding to all participating vehicles, and one vehicle corresponds to one path; The population optimization module is used to calculate the fitness of each individual in the current population using the fitness function and sort all individuals according to their fitness values. This is done to determine the non-elite solution set from the current population based on fitness, and to select the elite solution set from the current population using a bi-elite adaptive retention strategy to add to the new population N. pop For each non-elite solution in the non-elite solution set, the update strategy of the Jaya algorithm is used to learn from the current best or worst solution set to generate a candidate solution set. The fitness function is used to calculate the fitness of each solution in the candidate solution set to select the best candidate solution. The Monte Carlo acceptance criterion is then used to determine whether to add the best candidate solution to the new population N. pop Both the optimal solution set and the worst solution set include at least two solutions; and a vehicle model adjustment strategy is used to adjust the new population N. pop After adjustments, a new population B was obtained. pop The Q-learning strategy is used to select local search operators for the new population B. pop Optimization was performed to obtain a new population T. pop The local search operators include single-point movement within a path, single-point movement between paths, two-point exchange within a path, and two-point exchange between paths; and for the new population T pop A greedy algorithm strategy is used to insert charging station nodes, and a reverse energy calculation strategy is used to optimize the location of the charging station nodes, resulting in a new population D. pop ; The optimal solution output module is used to output the new population D when the population optimization reaches the iteration stopping condition. pop The global optimal solution.