Towards an Optimal Hybrid Algorithm for EV Charging Stations Placement using Quantum Annealing and Genetic Algorithms

by   Aman Chandra, et al.

Quantum Annealing is a heuristic for solving optimization problems that have seen a recent surge in usage owing to the success of D-Wave Systems. This paper aims to find a good heuristic for solving the Electric Vehicle Charger Placement (EVCP) problem, a problem that stands to be very important given the costs of setting up an electric vehicle (EV) charger and the expected surge in electric vehicles across the world. The same problem statement can also be generalised to the optimal placement of any entity in a grid and can be explored for further uses. Finally, the authors introduce a novel heuristic combining Quantum Annealing and Genetic Algorithms to solve the problem. The proposed hybrid approach entails seeding the genetic algorithm with the results of a quantum annealer. Our experiments show this method decreases the minimum distance from POIs by 42.89 sample EVCP datasets.



There are no comments yet.


page 1

page 5


Quantum-Assisted Genetic Algorithm

Genetic algorithms, which mimic evolutionary processes to solve optimiza...

Citizen centric optimal electric vehicle charging stations locations in a full city: case of Malaga

This article presents the problem of locating electric vehicle (EV) char...

Electric Vehicle Charging Infrastructure Planning: A Scalable Computational Framework

The optimal charging infrastructure planning problem over a large geospa...

Adiabatic Quantum Optimization Fails to Solve the Knapsack Problem

In this work, we attempt to solve the integer-weight knapsack problem us...

A hybrid estimation of distribution algorithm for joint stratification and sample allocation

In this study we propose a hybrid estimation of distribution algorithm (...

Quantum Annealing of Vehicle Routing Problem with Time, State and Capacity

We propose a brand-new formulation of capacitated vehicle routing proble...

Genetic algorithm for optimal distribution in cities

The problem to deal with in this project is the problem of routing elect...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

I Introduction

Electric Vehicle Charger Placement (EVCP) is an optimization problem that is sure to become of great interest in the upcoming years, given the increase in electric vehicles, and the costs associated with setting up an electric charger. However, this problem is non-deterministic polynomial time (NP) hard, and becomes intractable with an increase in the number of charging stations to be placed.

Optimal EVCP is a problem that we suspect will be of great interest in the near future, owing to the fact that electric vehicles are just starting to catch up in popularity, meanwhile the infrastructure to support them is just starting to be built. Few research works are available till date on EVCP problem [5], [4], and to the best of the authors’ knowledge, there is no existing literature or work done yet on using the newly available strategy of quantum annealing [6]. To explore this area further, the author referred the work done in [5] and [4] and decided to model a basic version of the problem on quantum annealers of D-Wave computers. The only reference available is a GitHub repository [8] outlining a very basic and non-performant example. the authors took the same and made few developments to improve the performance greatly, and incorporated a few novel techniques in doing so. The reason we believe it important to have a workable quantum solution is that annealing is a method that shows promise to greatly outperform classical heuristics when it comes to optimization problems [6]. Quantum computing hardware is still in an intermediate stage, but we believe it necessary to accelerate the adoption process by working towards useful solutions feasible on the currently available D-Wave hybrid solvers [1].
                The motivation behind this paper was to improve on the method for solving the EVCP problem proposed by Pagany et al. [7]

. The focus of this paper is threefold. First, to make any changes to the only quantum solution so as to improve the result. Then to find a good machine learning algorithm for solving the problem when seeded randomly, and finally to integrate the two heuristics together to see if there are any advantages in computation time, robustness and optimality of solution.

     Given the limitations of current quantum hardware, an entirely quantum approach to solving a problem is not practical. However, this work stands to show that quantum computing can be utilised despite this hardware limitation to improve results of the classical heuristics that are currently being used to solve similar problems. We suggest that this is the best way to utilise quantum computing in the current era, and we wish to explore more use cases where this approach improves performance in future research.
The paper is organised as follows: Section II gives a brief overview of quantum annealing using D-Wave computers and evolutionary Genetic Algorithms. Section III gives a detailed description of the proposed hybrid algorithm using Quantum annealing and genetic algorithm towards an optimal electric vehicle charging stations placement problem. Section IV discuss about the performance metric that establish the proposed algorithm along with experimental results and discussions in Section V. Section VI concludes the paper with future works.

Ii Background on D-Wave Quantum Annealing and Genetic Algorithms

Ii-a Quantum Annealing on D-Wave Computers

Quantum annealing is a meta-heuristic for finding the global minima of an objective function. The quantum advantage stems from the ability to explore multiple candidate solutions in parallel, as well as the ability to quantum tunnel, overcoming energy walls between two local minima, allowing for easier traversal of the energy landscape [2].

Using the D-Wave methodology, the problem is encoded as a Quadratic Unconstrained Binary Optimization (QUBO) problem, and quantum annealing is used to find the solution to this QUBO formulation. The objective function in a QUBO problem is written in the form of



is a vector of binary variables

, and are the weights of the QUBO matrix. The weights can be written in the form of either a symmetric matrix or an upper triangular matrix that we call the QUBO matrix.

The result of the quantum annealing is the value of that minimizes the objective function . The challenge with Quantum annealing lies in finding the correct values of QUBO matrix to efficiently represent the problem that we are aiming to solve.

Ii-B Genetic Algorithms

Genetic algorithms are a well known heuristic for solving optimization problems that are difficult to solve precisely [3]. The general outline of a genetic algorithm can be described as follows:

  1. Define an individual that carries the necessary information in it’s genes to be a solution to the optimization problem

  2. Create a population of these individuals

  3. Define a method for breeding these individuals

  4. Define a method for mutation in the population

  5. Define a fitness function that describes how good the solution represented by the genes are

  6. Carry out an evolutionary simulation that mimics the concept of natural selection, where the population is updated every generation following the mutation and breeding methods mentioned above.

Then, the population of the final generation is used as a solution to the problem.

Iii Proposed Hybrid Algorithm for EVCP using Quantum Annealing and Genetic Algorithms

Iii-a The EVCP Problem

The EVCP can be defined by setting up a grid on which the Points of Interest (POIs) and already existing electric chargers are set up on the nodes. The proposed algorithm then places down new charging points in an optimal manner. For the sake of this research work, optimality has been defined as minimizing travel distance to a charger for all points of interest on the grid. As shown in Fig. 1, the algorithm will decide where to place the red cars (new charging points), to optimize the scoring metric that will be explained in Section IV-A.

Fig. 1: Picture showing an example of EVCP, where buildings are points of interests (POIs), blue cars are old chargers and red cars are new chargers

Iii-B Proposed Quantum Annealing Approach

This proposed quantum annealing approach is inspired by the QUBO formulation presented in [7] that aims to optimize three objectives:

  1. Minimized distance from Points of Interest (POIs)

  2. Maximize distance from previous existing charger locations

  3. Maximize distance between the new charger locations

Based on these objectives, the three constraints are chosen to try to place the chargers close to the POIs, without placing them trivially close to each other or previously present chargers. The reason for including all three is to distribute the points to maximize coverage of POIs for the given number of chargers to be placed. It must be noted that in the QUBO formulation, the centroid of all POIs are considered for minimization, and similarly for previously existing chargers as well as new chargers.

Mathematically, the three constraints (, and ) referring to the three objective functions can be represented as follows:


with the values of , and given as


Here, is the no. of points, are the points of interest, refers to the chargers that are already present, thus is the number of chargers, refers to the number of available locations to place a new charger, is the no. of new chargers we want to place and refers to euclidean distance between the two points.

The last constraint where the number of chargers must be equal to a value can be given as


The final QUBO formulation can be given by


Please note that the parameters constitute the trade-off between different optimization functions. A careful balance of all the constraints (, , and ) is required to achieve the aim of the scoring metric described in Section IV-A.

Iii-C Inclusion of Entropy

An error observed with the initial QUBO formulation is that it rewarded extreme minimization to a few points of interest at the expense of other points of interest. This has been combated by changing the distance minimization in to a distance entropy minimization. The motivation for this idea stems from information entropy, where is given by


where is a discrete distribution, is the entropy of the distribution and

is the probability distribution of the variable


For the proposed hybrid algorithm, we replaced (5) with , by taking our distribution to be a distribution, and used this new equation to calculate (2

).The chosen probability distribution can be thought of as a

over the distances of the POIs from each possible charger location, and minimizing the value of this entropy instead of just the distances from the POIs has led to significantly improved results as compared to before this change on our datasets. For the rest of this paper, Quantum Annealing has been used with this entropic version of (5) and all results have been calculated using this, as they were too poor to be considered otherwise.

Fig. 2: Sample Output using only quantum annealing. The blue, red and green colours in the graph indicates POIs, old charging stations and new charging stations respectively, with the score of 64.0
Fig. 3: Sample Output where a GA was seeded with quantum annealing. The colours- blue, red and green indicates POIs, old charging stations and new charging stations respectively with the score of 17.74

Iii-D Integration of Genetic Evolutionary Algorithm with Quantum Annealing

The output from the Quantum annealer, although significantly improved after introducing an entropic loss function, and optimization of hyper-parameters, still has much room for improvements. The authors introduce a method of using evolutionary algorithms to optimize the output received from the quantum annealer. We find that seeding a genetic algorithm with the results of a quantum annealer improves on the result of either on its own to solve the problem.

We first explored the uses of genetic algorithms in solving the problem of EV charger placement directly, and found out that the use of genetic algorithms brings two advantages as compared to quantum annealing as follows:

  1. Reduced time to solution - it completes a basic search much quicker

  2. Easy transformation into a continuous problem - The quantum annealer solves this as a discrete problem, using evolutionary algorithms however, it is possible to turn the same into a continuous problem.

However, the problem becomes very chaotic to solve using a randomly seeded genetic algorithm when the number of new chargers increases. We theorize that this is due to the energy landscape being scattered with local minima, especially if the search space is assumed to be continuous. Since the heuristic used involves a random mutation and crossover approach, it is quite difficult for it to traverse this landscape. Our proposed solution is to use a quantum annealer to search the space discretely and traverse over the local minima in the energy landscape of the problem. Then, the genetic algorithm can take the outputs of the quantum annealer as a seed and optimize it further. This optimization is doubly useful as it turns the problem discrete, which allows better solutions than possible in a discrete space. This also allows the genetic algorithm to search the local area highlighted by the annealer to improve on it if possible.

Fig. 2 shows the output from just quantum annealing, while 3 shows the output from the proposed quantum annealing + genetic algorithm. These graphs are plotted using the sample EVCP (5,3,3) dataset. As we can see from Fig. 3, the score is much better. The placement of the chargers also looks to be better intuitively.

This strategy does have some drawbacks that we would like to point out. The algorithm will fail entirely if the genetic algorithm used is not capable of solving the problem independently, due to either a poor crossover and mutation strategy, or a bad choice of hyper-parameters. It might be advisable to perform some kind of search to find the best parameters possible, and extensive experimentation needs to be done to find the right crossover and mutation strategies, depending on the specific problem.

Iv Performance Metric

Iv-a Scoring Metric

The proposed technique aims to solve the charger placement problem by minimizing the sum of minimum distance to a charger from each point of interest by , where is the array of distances of all charger locations from the

point of interest. This hopes to place new chargers such that they are not redundant due to other chargers existing close by, but are still close to points of interest, reducing travel time and cost for reaching a charger. This scoring metric however, did not account for robustness and thus the score used finally was the sum of the mean and variance of the above the proposed scoring metric over the no. of runs.

Iv-B Disparity of QUBO formulation with Scoring Metric

It is reasonable to question why the authors did not create a QUBO that directly minimized what the scoring metric described above measures. The problem was the involvement of a function in the scoring metric. This cannot be easily translated into a binary quadratic problem, and the increased computation during the QUBO generation due to the added computational complexity would make the process extremely inefficient. Therefore, the objective functions were chosen such that they were simple and efficient to code in and could be used to give a result that minimized our scoring metric when the right lambda parameters were chosen. Hence, there was no testing done using that formulation, however if an efficient method to encode the scoring metric into a QUBO can be found, the authors suspect the results would be better than what we have achieved.

Iv-C Parameter Search

The Lagrange parameters for the QUBO were optimized using a Bayesian search which aimed to minimize the score form the scoring metric described in Section IV-A and IV-B. This parameter search is a necessary step since the performance of the algorithm is very dependent on these parameters. However, this is a very computationally expensive step, and thus it is not scalable to carry out this search every time the algorithm is run. Optimal parameters change based on the problem size and number of points quite drastically, hence the same values can not be used except for specifically chosen problem sets.

Sample EVCP Dataset Score
Only QA Only GA Proposed
EVCP (5,2,3) 40 91.40 23.70
EVCP (5,3,3) 63 43.77 34.80
EVCP (6,3,3) 105 105 48.81
EVCP (9,3,3) 172 185.43 60.44
EVCP (10,3,3) 400 945.02 339.16
EVCP (15,1,3) 781 1267.95 467.37
EVCP (20,4,3) 1071.66 1872.87 624.77
EVCP (20,4,4) 5014 6488.56 2922.91
EVCP (20,3,3) 1402 1868.76 1115.66
QA: Quantum Annealing, GA: Genetic Algorithm
Proposed: Integration of QA and GA
TABLE I: Comparison Table of the Proposed Hybrid Algorithm integrating Quantum Annealing and Genetic Algorithm over existing only QA and GA on our sample EVCP datasets

V Experimental Results and Discussions

Experimentally evaluations were performed using D-Wave Quantum Annealing along with the two other techniques as follows:

  1. Only Quantum Annealing

  2. Only Genetic Algorithm

  3. Integration of Quantum Annealing and Genetic Algorithm

The first evaluation is based on the score described in Section IV-A of the aforementioned techniques over a few differently sized datasets. We have named our sample datasets as , where , and are the no. of POIs, no. of existing charging stations and no. of new charging stations to be placed respectively. Experiments were performed over a few sample data sets with grid size of 1520, 3030 and 100100 are as follows:

  1. 1520 grid: EVCP (5,2,3), EVCP (5,3,3), EVCP (6,3,3), EVCP(9,3,3)

  2. 3030 grid: EVCP (10,3,3),EVCP (15,1,3),EVCP (20,4,3), EVCP (20,3,3)

  3. 100100 grid: EVCP (20,4,4)

Table I illustrates the score of the proposed hybrid algorithm (integration of quantum and genetic algorithm) over only quantum and only genetic algorithms on sample EVCP datasets. It is also clear from Fig. 4 and Fig. 5 that the advantage provided by the genetic approach is greater when the grid size is larger. We suspect this isn’t due to the GA performing better on larger datasets, but rather due to the limited size of the Bayesian search in finding the Lagrange parameters for the quantum annealer. This is mostly a temporal constraint, as the run time for the search was very high for the 100100 grid EVCP(20,4,4) sample dataset, and it might have even been possible to find an exact solution in that time. With our proposed quantum annealing + genetic algorithm approach, however, it is possible to get good results without an extensive parameter search, and that saves on a lot of time. It should also be mentioned that the search for the right parameters was run on QBSolv [9], a simulator provided by D-Wave Systems. This is due to the limited compute time available on the leap hybrid solvers.

Fig. 4: Comparison Results of Only QA, Only GA and Proposed QA+GA for EVCP sample datasets: EVCP (5,2,3), EVCP (5,3,3), EVCP (6,3,3), EVCP (9,3,3). The lower the score, the better the performance
Fig. 5: Comparison Results of Only QA, Only GA and Proposed QA+GA for EVCP sample datasets: EVCP (10,3,3), EVCP (15,1,3), EVCP (20,4,3), EVCP (20,3,3), EVCP (20,4,4). The lower the score, the better the performance
Fig. 6: Plot of fitness vs generation using (a) Only Genetic Algorithm and (b) Integration of both Quantum Annealing and Genetic Algorithm

After confirming the increase in performance (Fig. 4 and Fig. 5

), the best score per epoch were also calculated and plotted for the randomly seeded and Quantum annealing seeded algorithms as shown in Fig.

4 and Fig. 5. The largest dataset taken by us for the experimental evaluations contains a grid and 20 POIs.

It can be clearly illustrated from Fig. 6 that the training process is much more stable and the convergence is much quicker for the Quantum annealing seeded process. The disadvantage of this proposed hybrid method however is that the total time is the sum of both Quantum annealing and the Genetic algorithm, so in situations which are extremely time sensitive, this approach is not the best. However, in larger data sets, the time taken for the genetic algorithm is trivial compared to the quantum annealing part of the hybrid algorithm.

It should be noted that the genetic algorithm was run for a 100 generations when seeded by the quantum annealer, while for 1000 generations when randomly seeded for these results (Table I). All other parameters were kept constant.

We tested the performance of these proposed strategies on the EVCP sample datasets, and saw that the scores were significantly improved as compared to a vanilla quantum annealer, with an average improvement in score of across all the data sets tested on, based on minimum distance to POIs. For each dataset, the score for each computing method was the average over five runs. This is quite a great result when looked at face value, however it has to be noted that the Bayesian search could not be performed extensively on larger datasets, which led to a decrease in performance of Quantum Annealing. This is because it is not possible to run the Bayesian search effectively for larger grid sizes, due to extremely high computation times. The other factor to note here is the lack of research done in Quantum annealing with regards to the EVCP, which points to the fact that improvements on the purely quantum end are sure to be made there.

Vi Conclusion and Future Works

This work started with the aim of improving the performance of quantum annealing in solving the EVCP problem. In trying to do so, the authors have come up with strategies that might be usable beyond just this problem and can be applicable to multiple NP hard problems. Based on experimental results, the authors mentioned findings that seeding a evolutionary genetic algorithm with the results of a quantum annealer provides a decrease in minimum distance from POIs of compared with QA and compared to a randomly seed GA. The algorithm outlined above shows great promise in terms of making quantum annealing usable in the near term. We therefore think that both the inclusion of an entropic optimization function in the QUBO formulation, as well as the seeding of a genetic algorithm using a quantum annealer needs to be tested on other problems that can be solved using quantum annealing.

Vii Acknowledgments

The authors would like to thank D-Wave Systems for continuous support and providing our team the platform to perform experiments using D-Wave Quantum Computers. Also a big thanks to Naman Jain from Artificial Brain for helping review the paper and bringing up great points during the process.


  • [1] D-Wave Leap Solver. Note:, Accessed on October 20, 2021 Cited by: §I.
  • [2] D-Wave Systems. Note:, Accessed on October 20, 2021 Cited by: §II-A.
  • [3] S. M. Elsayed, R. A. Sarker, and D. L. Essam (2014) A new genetic algorithm for solving optimization problems.

    Engineering Applications of Artificial Intelligence

    27, pp. 57–69.
    External Links: ISSN 0952-1976, Document, Link Cited by: §II-B.
  • [4] J. He, H. Yang, T. Tang, and H. Huang (2018) An optimal charging station location model with the consideration of electric vehicle’s driving range. Transportation Research Part C: Emerging Technologies 86, pp. 641–654. External Links: ISSN 0968-090X, Document, Link Cited by: §I.
  • [5] Henrik Fredriksson and Mattias Dahl and Johan Holmgren (2019) Optimal placement of Charging Stations for Electric Vehicles in large-scale Transportation Networks, journal = Procedia Computer Science. 160, pp. 77–84. Note: The 10th Int. Conf. on Emerging Ubiquitous Systems and Pervasive Networks (EUSPN-2019) / The 9th Int. Conf. on Current and Future Trends of Information and Communication Technologies in Healthcare (ICTH-2019) / Affiliated Workshops External Links: ISSN 1877-0509, Document, Link Cited by: §I.
  • [6] Jörg, Thomas and Krzakala, Florent and Kurchan, Jorge and Maggs, Andrew Colin (2010) Quantum Annealing of Hard Problems. Progress of Theoretical Physics Supplement 184, pp. 290–303. External Links: ISSN 0375-9687, Link, Document Cited by: §I.
  • [7] Pagany, Raphaela and Marquardt, Anna and Zink, Roland (2019) Electric Charging Demand Location Model—A User- and Destination-Based Locating Approach for Electric Vehicle Charging Stations. Sustainability 11 (8). External Links: Link, ISSN 2071-1050, Document Cited by: §I, §III-B.
  • [8] Placement of Charging Stations. GitHub. Note:, Accessed on October 20, 2021 Cited by: §I.
  • [9] QBSolv. Note:, Accessed on October 22, 2021 Cited by: §V.