An electric freight vehicle charging station site selection and vehicle path optimization method
By combining bacterial foraging algorithm, K-medoids clustering algorithm and quantum ant colony algorithm to optimize the site selection and route planning of electric vehicle charging stations, the problems of low site selection efficiency and non-optimal route planning in the existing technology are solved, and more efficient charging station site selection and route optimization are achieved, reducing transportation and construction costs.
Patent Information
- Application Number
- CN202411770861.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-12-04
AI Technical Summary
In existing electric vehicle charging station site selection algorithms, the random selection of initial cluster centers leads to a longer algorithm solution time, affecting site selection efficiency and the rationality of the results. Furthermore, the path planning method has not been effectively optimized, resulting in high transportation costs.
A combination of bacterial foraging algorithm, K-medoids clustering algorithm, and quantum ant colony algorithm is used to optimize charging station site selection and path planning. Initial cluster centers are randomly selected from candidate charging stations. The bacterial foraging algorithm generates an initial solution, which is then iteratively updated using K-medoids to optimize the site selection. The quantum ant colony algorithm optimizes the path, and the global search capability and convergence speed are improved through qubit probability amplitude and quantum rotation gate mechanism.
It improves the efficiency and accuracy of charging station site selection and route planning, reduces transportation and construction costs, and enhances the economic benefits and competitiveness of enterprises.
Smart Images

Figure CN119558616B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of intelligent transportation system, and particularly relates to a method for site selection of electric freight vehicle charging station and vehicle path optimization. BACKGROUND
[0002] The site selection and path planning scheme of the electric vehicle charging station refers to selecting a proper number of charging station position coordinates, and planning the path of the electric vehicle under the premise of meeting the customer demand, so as to achieve the lowest charging station site selection cost and vehicle transportation cost, and the rationality of the charging station site selection position and the vehicle path planning directly relates to the distribution efficiency, transportation cost and customer service level of the entire electric vehicle system, and will have an important influence on the operation of the electric vehicle enterprise.
[0003] The existing method such as 'Electric Vehicle Charging Station Site Selection and Layout Based on K-Means Algorithm' selects the position of the charging pile clustering center by using the K-Means clustering algorithm, which measures the similarity between candidate customer point samples based on the Euclidean distance. First, the initial clustering center is selected by clustering, and after multiple iterations, a new data in the clustering category is relatively closer to the clustering center of the current category, and the new data is reselected as the clustering center, that is, as one of the candidate points for the construction of the charging station. After each clustering by the k-means algorithm, the generated clustering center may not be consistent with the required candidate charging station coordinate data, which has an impact on the efficiency and rationality of the charging station site selection. Therefore, the improvement made by us is to use the k-medoids clustering algorithm. After selecting the initial clustering center, a clustering center and a new candidate charging station are randomly selected each time for redistribution to generate a new clustering center set, and then the customer is re-assigned. The improvement of the K-mediods clustering algorithm optimizes the low fidelity of the original data when solving the site selection problem by the clustering algorithm in the past, and makes site selection decisions under the premise of focusing on the candidate charging station coordinate points provided originally, which has a favorable influence on the site selection result.
[0004] For example, in 'Multi-level Charging Station Site Selection and Service Capacity Research Based on Electric Vehicle Big Data', Sun Jian et al. obtain the potential charging demand of electric vehicles based on the improved k-means clustering algorithm to perform initial site selection of charging stations; then, a multi-level charging station site selection model of electric vehicles is constructed, the charging demand is analyzed, and the charging station is solved and secondarily selected based on the tabu search algorithm. The method of using the above clustering algorithm for site selection and multiple site selection optimization has a certain application in the site selection of electric vehicle charging stations, but the selection of the initial clustering center of the k clustering algorithm is random, which will prolong the solving time of the algorithm and affect the efficiency of the site selection. SUMMARY
[0005] The present application aims to provide an electric freight vehicle charging station site selection and vehicle path optimization method to solve the above problems.
[0006] The present application achieves the above-mentioned purposes by the following technical solutions:
[0007] An electric freight vehicle charging station site selection and vehicle path optimization method, comprising the following steps:
[0008] S1: Establish a mathematical model of electric freight vehicle charging station site selection and distribution process, and solve the mathematical model based on the minimization of two logistics costs of electric vehicle charging station construction cost and vehicle transportation cost to obtain a set of candidate charging station site selection positions and minimized paths;
[0009] S2: Randomly select charging stations from the candidate charging station site selection positions to generate initial cluster centers, and based on the initial cluster centers and a preset condition of the minimum total distance from customer points to the nearest cluster center, obtain a first cluster center cluster through a bacterial foraging algorithm, and update the first cluster center cluster through a K-mediods clustering algorithm to obtain a first cluster center cluster with the minimum total distance as the best cluster center cluster, and the best cluster center is used as the charging station site selection position;
[0010] S3: Optimize the minimized paths based on the charging station site selection position and a quantum ant colony algorithm, comprising the following steps:
[0011] S31: Initialize the pheromone matrix and related variables, the pheromone matrix is used to store the pheromone concentration between each pair of nodes, and before each visit to a customer / return to the distribution center, it is determined whether the power is sufficient, and if the power is insufficient, the nearest charging station site selection position obtained in step S2 is visited for charging;
[0012] S32: Calculate the accessible customer set, if the accessible customer set is empty, return to the distribution center, if the accessible customer set is not empty, calculate the customer visit probability according to the quantum calculation rule;
[0013] S33: Select the next customer to visit based on the customer visit probability and according to the roulette rule, return to the distribution center after completing the distribution service, and obtain the pheromone matrix;
[0014] S34: Update the pheromone matrix iteratively based on the constantly updated quantum rotation gate to obtain the optimal value of the minimized path.
[0015] As a further optimization scheme of the present application, the mathematical model in step S1 is as follows:
[0016] (1)
[0017] In formula (1), denotes the set of customer demand points, and the subscript is , denotes the set of all vertices, , denotes the set of electric vehicles, and the subscript is , denotes the distribution center , and the subscript is , denotes the set of charging station candidate points, and the subscript is , denotes the th vehicle from point to point;
[0018] (2)
[0019] In formula (2), denotes the decision variable of whether to build a charging station at ;
[0020] (3)
[0021] (4)
[0022] In formula (4), denotes the loading capacity of the electric vehicle , denotes the maximum amount of goods that can be left over when the electric vehicle leaves point, , denotes the demand at point;
[0023] (5)
[0024] (6)
[0025] (7)
[0026] In formula (7), denotes the remaining power of the electric vehicle when it arrives at point, denotes the remaining power of the electric vehicle when it leaves point, denotes the electric vehicle battery capacity, denotes and The distance between two points;
[0027] (8)
[0028] (9)
[0029] In equation (9), Indicates the battery power consumption coefficient;
[0030] (10)
[0031] (11)
[0032] (12)
[0033] (13)
[0034] (14)
[0035] In equation (14), This indicates the cost of violating the time window. This represents the opportunity cost per unit hour of waiting incurred because a vehicle arrives at the customer's location earlier than the earliest service time. Indicates customer point Earliest service hours Indicates the first The vehicle arrived at the node Time, This represents the unit time penalty cost incurred when a vehicle arrives later than the latest service time. Indicates the first The vehicle leaves the node Time, Indicates customer point Latest service time;
[0036] (15)
[0037] (16)
[0038] (17)
[0039] In equation (17), Minimize This indicates the search for the minimum value. Indicates the first The construction cost of each candidate charging station Indicates the first Vehicle from node To the node The unit transportation cost.
[0040] As a further optimization scheme of the present application, the process of obtaining the minimum value of the total distance of the customers to the nearest cluster center based on the bacterial foraging algorithm in step S2 specifically comprises the following steps:
[0041] S201: generating an initial cluster center cluster: randomly selecting initial charging stations from a plurality of candidate charging station site locations as an initial cluster center cluster;
[0042] S202: initializing a bacterial population: calculating the distance of the customer points to all initial cluster centers, traversing the customer point set, and assigning the current customer point to the initial cluster center according to the nearest distance principle to form an initial charging station point cluster;
[0043] S203: bacterial chemotaxis cycle: each initial cluster center performs Nc times of chemotaxis cycle, each cycle including two steps of flipping and swimming, wherein the flipping operation is to make the current cluster center generate a random direction on each feature vector to flip, and the process generates a random vector by formula (18) to represent the direction of the bacteria after flipping;
[0044] (18)
[0045] wherein, represents the number of cluster centers, is a rounding function, is a function for generating a random number matrix, represents the dimension, which is normalized by formula (19) to calculate a selected random direction after flipping , wherein, is a transpose symbol;
[0046] (19)
[0047] S204: bacterial swimming: determining the moving direction, normalizing the random vector to a unit vector , moving the current cluster center to the flipped direction by a step size by formula (20) to change the position of the bacteria and complete a swim, wherein is a constant, representing a fixed step size of each swim;
[0048] (20)
[0049] S205: bacterial sorting: after the chemotaxis operation cycle is completed, the virtual cluster center is obtained, the fitness value is calculated, the fitness value is the total distance of all customer points to the nearest virtual cluster center, and the fitness values are sorted from small to large.
[0050] S206: recent processing: by calculating the distance from the virtual cluster center to each candidate charging station, so that the virtual cluster center is one-to-one corresponding to the nearest candidate charging station coordinates;
[0051] S207: deduplication: check if the candidate charging station is repeatedly assigned, by mapping method, if the charging station is repeatedly assigned, randomly select a new candidate charging station for assignment, after the virtual cluster center and the candidate charging station are assigned, generate the first cluster center set.
[0052] As a further optimization scheme of the application, in step S2, the step of obtaining the cluster center set with the minimum total distance as the best cluster center set specifically comprises:
[0053] S208: k-medoids initialization: taking the first cluster center set as the initial cluster center set of k-medoids algorithm;
[0054] S209: customer allocation: by calculating the distance from the customer point to each first cluster center, the current customer point is assigned to the first cluster center with the minimum distance;
[0055] S210: k-medoids iterative optimization: perform kIter iterations, randomly select a first cluster center and a new candidate charging station in each iteration, perform reassignment, and generate a new cluster center set;
[0056] S211: update the first cluster center: calculate the total distance from all first cluster centers to their assigned customer points, for evaluating the clustering effect, by comparing the total distance of the first cluster center assignment and the newly assigned total distance to decide whether to accept the new cluster center, if the newly assigned total distance is smaller, update the first cluster center set;
[0057] S212: reach the preset iteration number, output the first cluster center set with the minimum total distance as the best cluster center set, that is, obtain the charging station site selection result.
[0058] As a further optimization scheme of the application, in step S32, the step of calculating the probability of each customer visiting according to the quantum calculation rule specifically comprises:
[0059] S32a: initialize quantum ant colony, for An ant colony of independent individuals , let Be the i-th independent individual of the j-th iteration of the population, the pheromone of this individual at node Is defined as formula (21);
[0060] (21)
[0061] wherein, denotes the pheromone state of the th node in the th iteration, , denotes the total number of nodes, including distribution centers, charging sites and customer points, and , the initial time is initialized wherein is the probability amplitude corresponding to 0, is the probability amplitude corresponding to 1, and denote the probabilities of the qubit being in the "0" state and the "1" state, respectively, and the square sum of the two is 1, >0) is the qubit heuristic factor, which is a dynamic parameter, indicating the relative importance of the node quantum state probability amplitude, represents the pheromone evaporation factor;
[0062] S32b: Calculate the transition probability by formula (22) ;
[0063] (22)
[0064] In formula (22), denotes the edge , denotes the pheromone concentration on the edge , denotes the heuristic information of the qubit, denotes the qubit heuristic information on the edge , denotes the heuristic factor of pheromone, denotes the heuristic factor of heuristic information, denotes the vehicle arrival time at the customer point, denotes the maximum value of the customer time window limit, denotes the minimum value of the customer time window limit, denotes the heuristic information on the edge , which is calculated by formula (23);
[0065] (23)
[0066] obtained by formula (24);
[0067] (24)
[0068] In formula (24), Indicates the first The probability that a quantum state of a qubit collapses to |0>.
[0069] As a further optimization of the present invention, step S34 specifically includes the following steps:
[0070] S34a: Iterate 1 to aIter times. In each iteration, each ant completes the current delivery task, that is, after running a loop, calculate the fitness value. If the current iteration value is greater than the existing optimal value, update the optimal value; otherwise, jump to the next step.
[0071] S34b: The quantum rotating gate is updated, and after the update is completed, the ant colony pheromone and ant colony information intensity are updated;
[0072] S34c: In each iteration, calculate the fitness of the loop for each ant, optimize based on the fitness, and if the maximum number of iterations has been reached, exit the algorithm and output the optimal value; otherwise... Then output the optimal value.
[0073] As a further optimization of the present invention, step S34b specifically includes:
[0074] The quantum rotating gate is shown in the following equation;
[0075] (25)
[0076] When the quantum ant's first After each individual completes its traversal path, the quantum pheromone will be updated as the quantum rotation gate is adjusted. The specific update is achieved through equation (26).
[0077] (26)
[0078] In equation (26), Given a probability magnitude matrix, Indicates the rotation angle;
[0079] The quantum rotation gate is updated in step S34b using equation (27): the mutation operator is implemented using a quantum NOT gate to perform mutation processing, and a mutation probability is given in the quantum ant colony algorithm. Each ant is randomly assigned a number between (0,1). ,if If the current element is inverted, its original optimal position will remain unchanged. Represents quantum state and The phase angle between them;
[0080] (27)
[0081] The pheromone is updated using equation (28);
[0082] (28)
[0083] In equation (28), Indicates that the ant is on the edge The total amount of pheromones released, It is the first Only ants on the side The total amount of information elements released, It is the first The total amount of pheromone in each iteration;
[0084] Updated via equation (29), It is the first The total distance traveled by the ants The constant represents the pheromone importance factor. Represents the quantum probability amplitude. if the k th ant traverses d ij Indicates that the first Only ants passed by conditions;
[0085] (29)
[0086] The ant colony information strength is updated using equation (30). It is the initial qubit heuristic factor. This is the current iteration number;
[0087] (30).
[0088] The beneficial effects of this invention are as follows:
[0089] The beneficial effects of this invention are as follows:
[0090] (1) This invention improves the solution efficiency of the algorithm by adding a heuristic algorithm to generate the initial solution of the charging station. That is, by introducing the bacterial foraging algorithm to select a certain number of initial stations from the candidate charging stations, and then substituting them into the k-medoids clustering algorithm, the final location result of the charging station is obtained.
[0091] (2) The application optimizes the path planning problem after obtaining the site selection result of the charging station, the ant colony algorithm is a conventional method for solving the best path, has the characteristics of high efficiency and flexibility, the quantum ant colony algorithm uses the probability amplitude of the quantum bit to represent the position of the ant in the solution space, which enables it to explore multiple potential solutions simultaneously, thereby improving the global search ability of the algorithm. This parallel search mechanism helps the algorithm to jump out of the local optimal solution and is more likely to find the global optimal solution. In addition, the quantum ant colony has an advantage in convergence speed, it can adjust the search strategy faster through quantum rotation gate and quantum mutation operation, thereby accelerating the convergence speed of the algorithm;
[0092] (3) In the process of optimizing the site selection of electric vehicle charging stations and path planning, the quantum ant colony algorithm is used to solve the path planning problem, aiming to improve the quality of the solution and obtain better results. In the actual economic environment, reasonable site selection of charging stations and vehicle path schemes can improve economic benefits, reduce costs and enhance enterprise competitiveness. BRIEF DESCRIPTION OF DRAWINGS
[0093] Figure 1 is the site selection optimization and path optimization flowchart of the application. DETAILED DESCRIPTION
[0094] The following detailed description of the application will be further described in conjunction with the drawings, it is necessary to point out here that the following detailed description is only used to further illustrate the application, and cannot be understood as limiting the scope of protection of the application, and those skilled in the art can make some non-essential improvements and adjustments to the application according to the above application content. EMBODIMENT
[0095] As Figure 1 shown, a charging station site selection and vehicle path optimization method for electric freight vehicle charging station site selection and distribution process, first, a mathematical model of construction cost of electric freight vehicle charging station site selection position and vehicle transportation and distribution cost is established, and the optimal site selection position and minimum path cost are solved;Obtain the set of candidate charging station site selection position and minimum path, second, design the improved quantum ant colony algorithm combining K-mediods clustering algorithm and bacterial foraging algorithm, reasonably optimize the charging station site selection and vehicle path in the electric freight vehicle distribution process.
[0096] The mathematical model of the electric freight vehicle charging station site selection and distribution process is as follows:
[0097] (1)
[0098] (2)
[0099] (3)
[0100] (4)
[0101] (5)
[0102] (6)
[0103] (7)
[0104] (8)
[0105] (9)
[0106] (10)
[0107] (11)
[0108] (12)
[0109] (13)
[0110] (14)
[0111] (15)
[0112] (16)
[0113] (17)
[0114] In the formula, each symbol has the meaning shown in Table 1. Formula (1) means that each customer is served and served only once; formula (2) means that only when a battery swap station is established can a vehicle receive battery swap service at this point; formula (3) means that the flow balance is guaranteed, i.e., the number of times a vehicle enters a certain point and the number of times it leaves the point are the same; formula (4) means the relationship between the vehicle loading capacity and the demand of the demand point passed, if , then the maximum remaining goods amount of the vehicle leaving point is at most the maximum remaining goods amount of the vehicle leaving point minus the demand of point, otherwise the constraint is relaxed; formula (5) means that the maximum loading capacity of the vehicle starting from point is ; Equation (6) represents that the maximum remaining goods amount of each vehicle leaving the demand point is greater than or equal to 0, which ensures that the total amount of goods delivered by the vehicle does not exceed the maximum loading capacity; Equation (7) represents the relationship between the electric quantity of the electric vehicle and the driving distance. If the electric vehicle arrives at the point after passing through the point, then the remaining electric quantity of the electric vehicle just arriving at the point is the remaining electric quantity of the electric vehicle leaving the point minus the distance between the and points; Equation (8) represents that the electric quantity of the electric vehicle is full when the electric vehicle leaves the distribution center; Equation (9) represents that the electric quantity of the electric vehicle is full when the electric vehicle leaves the built charging station, represents the consumption coefficient of the battery electric quantity; Equation (10) represents that the electric quantity of the electric vehicle does not change when passing through the customer point; Equation (11) represents that the electric vehicle has sufficient electric quantity to arrive at any point on the route; Equation (12) represents that the electric vehicle can change the battery at most twice at the same battery changing station; Equation (13) represents that the decision variable is a variable of 0 or 1; Equation (14) represents the cost of violating the time window; Equation (15) is a decision variable of whether to build a charging station at the point; Equation (16) is a decision variable of whether the vehicle travels from the point to the point; Equation (17) represents that the logistics cost is minimized, including the charging station construction cost of the electric vehicle, the vehicle transportation cost, and the cost of violating the time window.
[0115] Table 1 Symbol definition table
[0116] ;
[0117] The specific steps of the charging station site selection and vehicle path optimization method of the electric freight vehicle charging station site selection and distribution process combined with the improved quantum ant colony algorithm of the K-mediods clustering algorithm and the bacterial foraging algorithm are as follows:
[0118] The charging station site selection optimization part combined with the bacterial foraging algorithm and the K-mediods clustering algorithm is as follows:
[0119] Step 1, generate an initial cluster center cluster: select initial charging stations from 20 candidate charging station sites as an initial cluster center cluster, specifically, randomly select charging stations from the candidate charging station sites to obtain an initial solution of the charging station sites.
[0120] Step 2, initialize the bacterial population: assign a set of cluster center coordinates to the current bacteria ( between 1 and s) to form an initial cluster center cluster, and calculate the fitness value of the initial cluster center cluster. The fitness value of each bacterium, specifically, first calculate the distance from the customer point to all initial cluster centers, traverse the customer point set, and assign the current customer point to the initial cluster center according to the principle of the nearest distance to form the initial charging station point cluster.
[0121] Step 3: Bacterial chemotaxis cycle: each bacterium (initial cluster center) performs Nc times of chemotaxis cycle, each cycle includes two steps of flipping and swimming, where the flipping operation is to make the current cluster center generate a random direction on each feature vector to flip, and the process generates a random vector through formula (18) to represent the direction of the bacterium after flipping;
[0122] (18)
[0123] wherein, represents the number of cluster centers, is a rounding function, the function is used to generate a random number matrix, represents the dimension, which is normalized through formula (19) to calculate a selected random direction after flipping wherein, is a transpose symbol;
[0124] (19)
[0125] Step 4: Bacterial swimming: determine the swimming direction, normalize the random vector to make it a unit vector , move the bacterium to the flipped direction by a step through formula (20) to change the position of the bacterium and complete a swimming, wherein is a constant, representing a fixed step length of each swimming;
[0126] (20)
[0127] Step 5: Bacterial sorting: after the chemotaxis operation cycle is executed, virtual cluster centers are obtained, and the fitness value is calculated. The fitness value is the total distance from all customer points to the nearest virtual cluster center, and the fitness values are sorted from small to large.
[0128] Step 6: Nearest processing: by calculating the distance from the virtual cluster center to each candidate charging station, the virtual cluster center is made to correspond one-to-one with the nearest candidate charging station coordinates. The purpose of this step is that the coordinates of the initial cluster center after the chemotaxis operation of the bacterial foraging algorithm will be offset and no longer coincide with the initial charging station point coordinates. Therefore, the nearest processing step is executed to reselect the charging station point according to the principle of the nearest distance.
[0129] Step 7, De-duplication: Check if the candidate charging station is duplicated, if duplicated, randomly select a new candidate charging station, and generate the first cluster center set after assigning the virtual cluster center and the candidate charging station.
[0130] Step 8, k-medoids initialization: Take the first cluster center set as the initial cluster center set of the k-medoids algorithm.
[0131] Step 9, Customer allocation: Calculate the distance from the customer point to each first cluster center, and the current customer point is allocated to the first cluster center with the smallest distance.
[0132] Step 10, k-medoids iteration optimization: Perform kIter iterations, randomly select a first cluster center and a new candidate charging station in each iteration, perform re-allocation, and generate a new cluster center set.
[0133] Step 11, Update the first cluster center: Calculate the total distance from all cluster centers to their assigned customer points, which is used to evaluate the clustering effect, and decide whether to accept the new cluster center position by comparing the total distance of the first cluster center allocation and the new allocation, if the new allocation total distance is smaller, update the first cluster center set.
[0134] Step 12, Reach the preset iteration number, output the first cluster center set with the smallest total distance as the best cluster center set, that is, obtain the charging station site selection result.
[0135] Quantum ant colony algorithm path optimization part:
[0136] Step 1, Initialize pheromone matrix and related variables, pheromone matrix is used to store the pheromone concentration between each pair of nodes, related variables include pheromone factor, heuristic factor, pheromone evaporation coefficient, ant colony size, ant colony iteration number.
[0137] Step 2, Calculate the serviceable customer point set: Through the calculation of capacity limit and time window, determine the set of next customers that the current customer point can access.
[0138] Step 3, Determine the next plan of the vehicle: If the serviceable customer point set is empty and the vehicle has enough power, return the vehicle to the distribution center; if the power is insufficient, make the vehicle go to the nearest charging station to charge, and then return to the distribution center. If the serviceable customer point set is not empty, select the next service customer point through the following steps:
[0139] The probability of selecting a customer node is chosen considering the computation of the quantum ant colony concept. First, the meaning and basic principles of the quantum ant colony algorithm are introduced. The quantum ant colony algorithm (QACA) is an intelligent optimization algorithm that combines the high parallelism of quantum computing with the positive feedback and strong robustness of the ant colony algorithm. It effectively improves the global search ability and search speed of the algorithm by introducing quantum bits, quantum logic gates, and Grover quantum algorithms into the ant colony algorithm.
[0140] The basic principle of the quantum ant colony algorithm is to use the characteristics of quantum computing to enhance the search ability of the ant colony algorithm. In the ant colony algorithm, ants find the optimal solution by moving in the solution space and leaving pheromones. In the quantum ant colony algorithm, the superposition state of quantum bits and quantum entanglement allow the algorithm to explore multiple possible solutions simultaneously, thereby improving search efficiency. In addition, the quantum rotation gate in quantum algorithms can be used to simulate the movement of ants in the solution space, and the Grover algorithm can speed up the search process and help the algorithm converge to the optimal solution more quickly.
[0141] (1) Initialize the quantum ant colony, for an independent individual ant colony , let be the th iteration of the th independent individual in this population, and the pheromone of this individual at node is defined as formula (21);
[0142] (21)
[0143] In the formula, , the initial moment , initialize .
[0144] In the quantum ant colony algorithm, the initialization of pheromone usually involves the representation of quantum state, represents the pheromone state of the th node in the th iteration. This state is composed of two parts, and , which together constitute a complete description of a quantum bit. Here, represents the total number of nodes in the problem, including the distribution center, charging sites and customer nodes. At the initial moment, each node's and are set to , which means that the quantum state of each node is an equal-probability superposition state, i.e. the probability of selecting each node is the same. There are a total of A quantum state. In the context of ant colony algorithm, each node can be regarded as a decision point, and the superposition state of quantum bits can be used to represent the probability of selecting two different paths at the node. The "0" state and "1" state here can be interpreted as two different path selections. Among them is the probability amplitude corresponding to 0, is the probability amplitude corresponding to 1, and then the probability of the quantum bit being in the "0" state and the "1" state is respectively, and the square sum of the two is 1, which represents the pheromone concentration corresponding to the two paths in the quantum ant colony algorithm, that is, the probability of the th node selecting two different paths in the th iteration.
[0145] (2) Calculate the transition probability by formula (22).
[0146] (22)
[0147] In formula (22), represents the edge , represents the pheromone concentration on the edge , represents the heuristic information of the quantum bit, represents the quantum bit heuristic information on the edge , represents the heuristic factor of pheromone, represents the heuristic factor of heuristic information, the greater the value, the more the ant tends to select the path with shorter path, represents the vehicle arrival time at the customer point, represents the maximum value of the customer time window limit, represents the minimum value of the customer time window limit, represents the heuristic information on the edge , which is calculated by formula (23):
[0148] (23)
[0149] is calculated by formula (24). represents the probability of the quantum state of the th quantum bit collapsing to |0>, wherein, the smaller , the greater , >0) is a quantum bit heuristic factor, representing the relative importance of the node quantum state probability amplitude, the greater the value, the more the ant tends to choose the node with more quantum information. In order to gradually reduce the dependence on quantum heuristic information and increase the reliance on the good path found as the search of the solution space gradually deepens, the value of the quantum bit heuristic factor is gradually reduced, and the value of the quantum bit heuristic factor is gradually reduced. is designed to change dynamically;
[0150] (24)
[0151] (3) After calculating the access probability of each accessible customer, the next customer node to be accessed is selected by using the roulette method, and then it is judged whether the power is sufficient. If the power is sufficient, the next customer node is reached; if the power is insufficient, the nearest charging station is returned to charge, and then the next customer node is reached. After all customer nodes are accessed, the distribution center is returned.
[0152] Step 4, iterate 1~aIter times, and each ant completes the current distribution task in each iteration, i.e. runs a loop, calculates the fitness value, and if the current iteration value is greater than the existing optimal value, the optimal value is updated, otherwise jump to the next step.
[0153] Step 5, quantum rotation gate is updated, and after updating, ant colony pheromone and ant colony information intensity are updated, and the quantum rotation gate is as follows:
[0154] (25)
[0155] For quantum ant colony algorithm, the core of its performance is the regulation mechanism of quantum rotation gate, which directly affects the updating process of quantum pheromone. When the quantum ant completes its traversal path, the quantum pheromone is updated with the adjustment of the quantum rotation gate, and the specific updating is realized by formula (26).
[0156] (26)
[0157] In formula (26), is a probability amplitude matrix, represents the rotation angle, and the optimization ability and convergence speed of the algorithm are affected by the rotation angle .
[0158] (1) In this scheme, the quantum rotation gate is updated by formula (27): the mutation operator is realized by quantum NOT gate to perform mutation processing, and a mutation probability is given in the quantum ant colony algorithm, a random number between 0 and 1 is randomly assigned to each ant, If the current element is 0, then the current element is flipped (0 becomes 1, and 1 becomes 0), and the memory of its own optimal position remains unchanged, represent a quantum state and between the phase angles:
[0159] (27)
[0160] (2) pheromone update, pheromone is updated by the following formula (28);
[0161] (28)
[0162] In formula (28), represent the pheromone evaporation factor, denotes the total amount of pheromone released by ants on edge , is the total amount of pheromone in the th iteration, is the total amount of pheromone released by the th ant on edge , is updated by formula (29). is a constant, usually referred to as the pheromone importance factor, which determines the degree of influence of pheromone on the selection of path by ants. is the total length walked by the th ant. The concept of quantum probability amplitude is introduced to improve the mechanism of pheromone update. When ants are building paths, the quantum pheromone on the paths they pass through will gradually accumulate, forming positive feedback, while the quantum pheromone on the paths not passed by ants will gradually decrease. This positive feedback mechanism will cause the difference in quantum pheromone on different paths to increase continuously, thereby increasing the risk of the algorithm falling into a local optimal solution. In order to avoid this situation, the present application proposes a dynamic quantum pheromone update strategy that can balance the distribution of pheromone and prevent excessive accumulation of pheromone on a certain edge, thereby effectively avoiding the problem of the algorithm falling into a local optimal solution. In formula (29), if the k th ant traverses (i,j) denotes the condition that the th ant passes through edge .
[0163] (29)
[0164] (3) ant colony information strength is updated by formula (30), is the initial quantum bit heuristic factor, is the current iteration number;
[0165] (30).
[0166] Step 6, fitness calculation process, in each iteration, the fitness of each ant's loop is calculated, and the better fitness value is saved, if the maximum number of iterations is reached, the algorithm is exited, and the result is outputted, otherwise, Then the result is outputted.
[0167] Step 7, output the optimal value as the optimization scheme.
[0168] The above-described embodiments only express several embodiments of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled persons in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the protection scope of the present application.
Claims
1. A method for site selection of electric freight vehicle charging stations and optimization of vehicle routes, characterized in that: Includes the following steps: S1: Establish a mathematical model for the site selection and delivery process of electric freight vehicle charging stations, and solve the mathematical model based on minimizing the two logistics costs of electric vehicle charging station construction cost and vehicle transportation cost to obtain a set of candidate charging station locations and minimized paths; S2: Randomly select from candidate charging station locations Each charging station generates an initial cluster center. Based on the initial cluster center and the preset condition that the total distance from the customer point to the nearest cluster center is minimized, the first cluster center cluster is obtained through the bacterial foraging algorithm. The first cluster center cluster is then iteratively updated through the K-mediods clustering algorithm. The first cluster center cluster with the smallest total distance is obtained as the optimal cluster center cluster, and the optimal cluster center is used as the location for the charging station. S3: Optimize the minimum path based on the charging station location and the quantum ant colony algorithm, including the following steps: S31: Initialize the pheromone matrix and related variables. The pheromone matrix is used to store the pheromone concentration between each pair of nodes. Before each visit to the customer / return to the distribution center, it is determined whether the power is sufficient. If the power is insufficient, the best charging station location obtained in step S2 is visited for charging. S32: Calculate the set of accessible customers. If the set of accessible customers is empty, return to the distribution center. If the set of accessible customers is not empty, calculate the access probability of each customer according to the quantum computing rules. S33: Based on the access probability of each customer and according to the roulette wheel rules, select the next customer to visit, complete the delivery service, return to the delivery center, and obtain the pheromone matrix; S34: The pheromone matrix is iteratively updated based on the continuously updated quantum rotation gate to obtain the optimal value of the minimized path; Step S32, which calculates the access probability of each customer according to the rules of quantum computing, specifically includes: S32a: Initialize the quantum ant colony, for An ant colony consisting of individual ants ,set up This is the first ant colony The iteration of the ... An independent individual, this individual is at the node The pheromone is defined as Equation (21); ; In the formula, Indicates the first In the nth iteration, the 1st The pheromone state of each node , This represents the total number of nodes, including distribution centers, charging stations, and customer points, at the initial time. ,initialization ,in It is the probability amplitude corresponding to 0. It is the probability amplitude corresponding to 1. and These represent the probabilities of a quantum bit being in the "0" state and the "1" state, respectively, and the sum of their squares is 1. The heuristic factor for qubits is a dynamically changing parameter that represents the relative importance of the probability amplitude of the node's quantum state. Represents the pheromone volatile factor; S32b: Calculate the transition probability using equation (22) ; (22) In equation (22), Representing an edge , Representing an edge The concentration of pheromones on the surface Heuristic information representing qubits Representing an edge Heuristic information from qubits on the surface Heuristic factors representing pheromones Heuristic factors representing heuristic information Indicates the time the vehicle arrives at the customer's location. This indicates the maximum limit of the customer's time window. This indicates the minimum value of the customer's time window limit. Representing an edge The heuristic information is obtained by calculating using equation (23); (23) Obtained through equation (24); (24) In equation (24), Indicates the first The probability of a quantum state collapsing to a given value in qubits. ; Step S34 specifically includes the following steps: S34a: Iterate 1 to aIter times. In each iteration, each ant completes the current delivery task, that is, after running a loop, calculate the fitness value. If the current iteration value is greater than the existing optimal value, update the optimal value; otherwise, jump to the next step. S34b: The quantum rotating gate is updated, and after the update is completed, the ant colony pheromone and ant colony information intensity are updated; S34c: In each iteration, calculate the fitness of the loop for each ant, optimize based on the fitness, and if the maximum number of iterations has been reached, exit the algorithm and output the optimal value; otherwise... Then output the optimal value.
2. The method for site selection and vehicle route optimization of electric freight vehicle charging stations according to claim 1, characterized in that: The mathematical model described in step S1 is as follows: (1) In equation (1), Represents the set of customer demand points, with the subscript as... , Represents the set of all vertices. , Represents the set of electric vehicles, with subscript . , Indicates distribution center , subscript , Represents the set of candidate charging station locations, with index . , Indicates the first The car from Click point; (2) In equation (2), Indicates in The decision variables for whether or not to establish a charging station; (3) (4) In equation (4), Indicates electric vehicles Loading capacity, Indicates electric vehicles leave The maximum amount of goods that can remain at the time of purchase. , express Demand for points; (5) (6) (7) In equation (7), Indicates electric vehicles leave The remaining battery power at the time of use. Indicates electric vehicles leave The remaining battery power at the time of use. Indicates the battery capacity of an electric vehicle. express and The distance between two points; (8) (9) In equation (9), Indicates the battery power consumption coefficient; (10) (11) (12) (13) (14) In equation (14), This indicates the cost of violating the time window. This represents the opportunity cost per unit hour of waiting incurred because a vehicle arrives at the customer's location earlier than the earliest service time. Indicates customer point Earliest service hours Indicates the first The vehicle arrived at the node Time, This represents the unit time penalty cost incurred when a vehicle arrives later than the latest service time. Indicates the first The vehicle leaves the node Time, Indicates customer point Latest service time; (15) (16) (17) In equation (17), Minimize This indicates the search for the minimum value. Indicates the first The construction cost of each candidate charging station Indicates the first Vehicle from node To the node The unit transportation cost.
3. The method for site selection and vehicle route optimization of electric freight vehicle charging stations according to claim 1, characterized in that: In step S2, the process of obtaining the minimum total distance from the customer to the nearest cluster center based on the bacterial foraging algorithm specifically includes the following steps: S201: Generate the initial cluster of cluster centers: randomly select from several candidate charging station locations. One initial charging station was selected as the initial cluster center. S202: Initialize the bacterial population: Calculate the distance from the customer point to all initial cluster centers, traverse the customer point set, and assign the current customer point to the initial cluster center according to the principle of closest distance to form the initial charging station cluster; S203: Bacterial chemotaxis cycle: Each initial cluster center performs Nc chemotaxis cycles. Each cycle includes two steps: flipping and swimming. The flipping operation is to make the current cluster center generate a random direction on each of its feature vectors and flip it. This process generates a random vector through equation (18) to represent the direction of the bacteria after flipping. (18) in, Represents the number of cluster centers. The rounding function refers to the rounding function. The function is used to generate a random number matrix. The dimension is represented by equation (19), which is normalized to calculate a randomly selected direction after flipping. , It is the transpose symbol; (19) S204: Bacterial Movement: Determining the direction of movement using random vectors Normalize it to make it a unit vector Equation (20) moves the current cluster center one step in the flipped direction, changing the position of the bacteria and completing one movement. is a constant, representing the fixed step size for each swim; (20) S205: Bacterial sorting: After the chemotaxis operation loop is completed, virtual cluster centers are obtained, and fitness values are calculated. The fitness value is the total distance from all client points to the nearest virtual cluster center. The fitness values are sorted from smallest to largest. S206: Proximity Optimization: By calculating the distance from the virtual cluster center to each candidate charging station, the coordinates of the virtual cluster center correspond one-to-one with the coordinates of the candidate charging station closest to it; S207: Deduplication: Check whether candidate charging stations are assigned repeatedly. If a charging station is assigned repeatedly, a new candidate charging station is randomly selected for assignment. After assigning virtual cluster centers to candidate charging stations, the first cluster center set is generated.
4. The method for site selection and vehicle route optimization of electric freight vehicle charging stations according to claim 3, characterized in that: Step S2, specifically the step of obtaining the set of cluster centers with the smallest total distance as the optimal set of cluster centers, includes: S208: k-medoids initialization: Use the first set of cluster centers as the initial set of cluster centers for the k-medoids algorithm; S209: Customer Assignment: By calculating the distance from the customer point to each first cluster center, the current customer point is assigned to the first cluster center with the smallest distance; S210: k-medoids iterative optimization: Perform kIter iterations, and in each iteration, randomly select a first cluster center and a new candidate charging station, and redistribute them to generate a new set of cluster centers; S211: Update the first cluster centers: Calculate the total distance from all first cluster centers to their assigned customer points to evaluate the clustering effect. The decision to accept the new cluster centers is made by comparing the total distance assigned to the first cluster centers with the newly assigned total distance. If the newly assigned total distance is smaller, the set of first cluster centers is updated. S212: After reaching the preset number of iterations, output the set of the first cluster centers with the smallest total distance as the optimal cluster center set, thus obtaining the charging station site selection result.
5. The method for site selection and vehicle route optimization of electric freight vehicle charging stations according to claim 1, characterized in that: Step S34b in detail include: The quantum rotating gate is shown in the following equation; (25) When the quantum ant's first After each individual completes its traversal path, the quantum pheromone will be updated as the quantum rotation gate is adjusted. The specific update is achieved through equation (26). (26) In equation (26), Given a probability magnitude matrix, Indicates the rotation angle; The quantum rotation gate is updated in step S34b using equation (27): the mutation operator is implemented using a quantum NOT gate to perform mutation processing, and a mutation probability is given in the quantum ant colony algorithm. Each ant is randomly assigned a number between (0,1). ,if If the current element is inverted, its original optimal position will remain unchanged. Represents quantum state and The phase angle between them; (27) The pheromone is updated using equation (28); (28) In equation (28), Indicates that the ant is on the edge The total amount of pheromones released, It is the first Only ants on the side The total amount of information elements released, It is the first The total amount of pheromone in each iteration; Updated via equation (29), It is the first The total distance traveled by the ants The constant represents the pheromone importance factor. Represents the quantum probability amplitude. Indicates that the first Only ants passed by conditions; (29) The ant colony information strength is updated using equation (30). It is the initial qubit heuristic factor. This is the current iteration number; (30)。
Citation Information
Patent Citations
Ant colony-clustering algorithm-based self-adaptive dynamic path planning method of robot
CN109164810A
Hydropower station scheduling method and system based on particle swarm-bacterial foraging
CN109635999A