Content uploaded by Babita Jajodia

Author content

All content in this area was uploaded by Babita Jajodia on Apr 13, 2022

Content may be subject to copyright.

1

Towards an Optimal Hybrid Algorithm for EV

Charging Stations Placement using Quantum

Annealing and Genetic Algorithms

Aman Chandra2, Jitesh Lalwani1,2, and Babita Jajodia3

1Artiﬁcial Brain Tech Inc, 2055 Limestone RD, STE 200-C, Wilmington, Delaware, USA 19808

2Artiﬁcial Brain Technology (OPC) Private Limited, Pune, India 411057

3Department of Electronics and Communication Engineering,

Indian Institute of Information Technology Guwahati, India

Email: {aman.chandra@artiﬁcialbrain.in, jitesh.lalwani@artiﬁcialbrain.us, babita@iiitg.ac.in}

Abstract—Quantum Annealing is a heuristic for solving op-

timization problems that have seen a recent surge in usage

owing to the success of D-Wave Systems. This paper aims to

ﬁnd 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 generalized

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 algorithms with the results of quantum

annealing. Experimental results show that this method decreases

the minimum distance from Points of Interest (POI) by 42.89%

compared to vanilla quantum annealing over the sample EVCP

datasets.

Index Terms—Electric Vehicle, Optimization, D-Wave Sys-

tems, Quantum Annealing, Genetic Algorithm, Quadratic Un-

constrained Binary Optimization (QUBO)

I. INTRODUCTION

Electric Vehicle Charger Placement (EVCP) is an optimiza-

tion 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 the authors 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 [1], [2], 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 [3]. To

explore this area further, the authors referred the work done

in [1] and [2] and decided to model a basic version of the

problem on quantum annealing of D-Wave computers. The

only reference available is a GitHub repository [4] 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 the authors 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 [3]. Quantum computing

hardware is still in an intermediate stage, but the authors

believe it necessary to accelerate the adoption process by

working towards useful solutions feasible on the currently

available D-Wave hybrid solvers [5].

The motivation behind this paper was to improve on the

method for solving the EVCP problem proposed by Pagany

et al. [6]. 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 ﬁnd a good machine learning algorithm

for solving the problem when seeded randomly, and ﬁnally

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. The authors 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 discusses 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.

2

II. BACKGROU ND O N D-WAVE QUA NT UM ANNEALING

AN D GEN ET IC ALGORITHMS

A. Quantum Annealing on D-Wave Computers

Quantum annealing is a meta-heuristic for ﬁnding 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, over-

coming energy walls between two local minima, allowing for

easier traversal of the energy landscape [7].

Using the D-Wave methodology, the problem is encoded

as a Quadratic Unconstrained Binary Optimization (QUBO)

problem, and quantum annealing is used to ﬁnd the solution

to this QUBO formulation. The objective function f(x)in a

QUBO problem is written in the form of

f(x) =

N

X

i=1

i

X

j=1

qij xixj(1)

where, Xis a vector of binary variables x, and qij are the

weights of the N×NQUBO matrix. The weights can be

written in the form of either a symmetric matrix or an upper

triangular matrix that we call the N×NQUBO matrix.

The result of the quantum annealing is the value of Xthat

minimizes the objective function f(x). The challenge with

Quantum annealing lies in ﬁnding the correct values of QUBO

matrix to efﬁciently represent the problem that the authors are

aiming to solve.

B. Genetic Algorithms

Genetic algorithms are a well known heuristic for solving

optimization problems that are difﬁcult to solve precisely [8].

The general outline of a genetic algorithm can be described

as follows:

1) Deﬁne an individual that carries the necessary informa-

tion in it’s genes to be a solution to the optimization

problem

2) Create a population of these individuals

3) Deﬁne a method for breeding these individuals

4) Deﬁne a method for mutation in the population

5) Deﬁne a ﬁtness 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 ﬁnal generation is used as a

solution to the problem.

III. PROP OS ED HYBRID ALGORITHM FOR EVCP USING

QUAN TU M ANNEALING AND GEN ET IC ALGORITHMS

A. The EVCP Problem

The EVCP can be deﬁned by setting up a grid on which the

Points of Interest (POI) 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 deﬁned as

Fig. 1. Picture showing an example of EVCP, where buildings are Points of

Interest (POI), blue cars are old chargers and red cars are new chargers

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.

B. Proposed Quantum Annealing Approach

This proposed quantum annealing approach is inspired by

the QUBO formulation presented in [6] that aims to optimize

three objectives:

1) Minimize distance from Points of Interest (POI)

2) Maximize distance from previous existing charger loca-

tions

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 POI, 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 POI for the given number of chargers

to be placed. It must be noted that in the QUBO formulation,

the centroid of all POI are considered for minimization, and

similarly for previously existing chargers as well as new

chargers.

Mathematically, the three constraints (H1,H2and H3)

referring to the three objective functions can be represented

as follows:

H1= +

N

X

i=1

xidp

i(2)

H2=−

N

X

i=1

xidc

i(3)

H3=−

N

X

i=1

xidl

i(4)

with the values of dp

i,dc

iand dl

igiven as

dp

i=

nP OI

X

k=1

dist(P OIk−xi)2(5)

dc

i=

ncharger

X

k=1

dist(chargerk−xi)2(6)

3

dl

i=

nlocations

X

k=1

dist(xk−xi)2(7)

Here, Nis the no. of points, P OI are the Points of Interest,

charger refers to the chargers that are already present, thus

ncharger is the number of chargers, nlocations refers to the

number of available locations to place a new charger, mis

the no. of new chargers we want to place and dist refers to

euclidean distance between the two points.

The last constraint where the number of chargers must be

equal to a value mcan be given as

H4= (

N

X

i=1

xi)−m(8)

The ﬁnal QUBO formulation can be given by

Hfinal =

N

X

i=1

λiHi(9)

Please note that the parameters λconstitute the trade-off

between different optimization functions. A careful balance of

all the constraints (H1,H2,H3and H4) is required to achieve

the aim of the scoring metric described in Section IV-A.

C. Inclusion of Entropy

An error observed with the initial QUBO formulation is that

it rewarded extreme minimization to a few POI at the expense

of other POI. This has been combated by changing the distance

minimization in H1to a distance entropy minimization. The

motivation for this idea stems from information entropy given

by

H(X) = XP(xi) log P(xi)(10)

where Xis a discrete distribution, H(X)is the entropy of the

distribution and P(X)is the probability distribution of the

variable X.

For the proposed hybrid algorithm, we replaced (5) with

H(dp), by taking our distribution to be a softmax distribu-

tion, and used this new equation to calculate (2). The chosen

probability distribution can be thought of as a softmax over

the distances of the POI from each possible charger location,

and minimizing the value of this entropy instead of just the

distances from the POI has led to signiﬁcantly improved

results as compared to before this change on the 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.

D. Integration of Evolutionary Genetic Algorithm with Quan-

tum Annealing

The output from the Quantum annealing, although signif-

icantly 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 genetic algorithms to optimize the output received

from the quantum annealing. Research ﬁndings show that

Fig. 2. Sample Output using only quantum annealing. The blue, red and green

colours in the graph indicates POI, 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 POI, old charging stations and new

charging stations respectively with the score of 17.74

seeding a genetic algorithm with the results of quantum

annealing improves on the result of either on its own to solve

the problem.

The authors ﬁrst explored the uses of genetic algorithms in

solving the problem of EVCP 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 annealing 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. The authors 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 difﬁcult for it to traverse

this landscape. The proposed solution is to use a quantum

annealing to search the space discretely and traverse over the

4

local minima in the energy landscape of the problem. Then, the

genetic algorithm can take outputs of the quantum annealing

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 annealing to improve on it if possible.

Fig. 2 shows the output from just quantum annealing, while

Fig. 3 shows the output from the proposed quantum annealing

+ genetic algorithm. These graphs are plotted using the sample

EVCP (5,3,3) dataset. As it can be seen from Fig. 3, the score

is lower with respect to Fig. 2. The lower the score is, the better

the placement of charger is. The placement of the chargers also

looks to be better intuitively.

This strategy does have some drawbacks that the authors

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 ﬁnd the best

parameters possible, and extensive experimentation needs to

be done to ﬁnd the right crossover and mutation strategies,

depending on the speciﬁc problem.

IV. PERFORMANCE METRIC

A. Scoring Metric

The proposed hybrid algorithm aims to solve the charger

placement problem by minimizing the sum of minimum dis-

tance to a charger from each POI by Pmin(Di

k), where Di

k

is the array of distances of all kcharger locations from the ith

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 POI, reducing travel time and cost

for reaching a charger. This scoring metric however, did not

account for robustness and thus the score used ﬁnally was

the sum of the mean and variance of the above the proposed

scoring metric over the no. of runs.

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 min() 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 inefﬁcient. Therefore, the objective functions were

chosen such that (i)they were simple and efﬁcient to code

in and (ii)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 efﬁcient 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.

TABLE I

COMPARISON TAB LE OF T HE PRO POS ED HYBRID ALGORITHM

INTEGRATING QUANTU M ANNEALING AND GEN ETI C ALGORITHM OVER

EXISTING ONLY QA AND G A ON OUR SAMPLE EVCP DATASET S

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

C. Parameter Search

The Lagrange parameters for the QUBO were optimized us-

ing 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 speciﬁcally chosen problem sets.

V. EX PE RI ME NTAL RE SU LTS A ND DISCUSSIONS

Experimental 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 ﬁrst evaluation is based on the score described in Section

IV-A of the aforementioned techniques over a few differently

sized datasets. The authors have named the sample datasets as

EV C P (nP OI , nch old, nch new), where nP OI ,nch old and

nch new are the no. of POI, 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 15×20, 30×30 and 100×100 are as follows:

1) 15×20 grid: EVCP (5,2,3), EVCP (5,3,3), EVCP (6,3,3),

EVCP(9,3,3)

2) 30×30 grid: EVCP (10,3,3),EVCP (15,1,3),EVCP (20,4,3),

EVCP (20,3,3)

3) 100×100 grid: EVCP (20,4,4)

Table I illustrates the score of the proposed hybrid algorithm

(integration of quantum annealing and genetic algorithm) over

only quantum annealing and only genetic algorithm on the

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. The authors 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 ﬁnding the

5

EVCP(5,2,3) EVCP(5,3,3) EVCP(6,3,3) EVCP(9,3,3)

EVCP Sample Datasets

0

50

100

150

200

Score

Only QA

Only GA

Proposed QA+GA

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

EVCP(10,3,3) EVCP(15,1,3) EVCP(20,4,3) EVCP(20,4,4) EVCP(20,3,3)

EVCP Sample Datasets

0

1000

2000

3000

4000

5000

6000

7000

Score

Only QA

Only GA

Proposed QA+GA

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 perfor-

mance

Lagrange parameters for the quantum annealing. This is mostly

a temporal constraint, as the run time for the search was very

high for the 100×100 grid EVCP (20,4,4) sample dataset, and

it might have even been possible to ﬁnd 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 [5].

After conﬁrming 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

a100 ×100 grid and 20 POI.

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 dis-

advantage of this proposed hybrid method however is that the

total time is the sum of both quantum annealing and the genetic

0 100 200 300 400 500 600 700 800 900 1000

Generations

0

0.5

1

1.5

2

2.5

3

3.5

4

Fitness

Only GA

Proposed QA+GA

Fig. 6. Plot of ﬁtness vs generation using (a) Only Genetic Algorithm and

(b) Integration of Quantum Annealing and Genetic Algorithm

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

100 generations when seeded by the quantum annealing, while

for 1000 generations when randomly seeded for these results

(Table I). All other parameters were kept constant.

The authors tested the performance of these proposed

strategies on the EVCP sample datasets, and saw that the

scores were signiﬁcantly improved as compared to a vanilla

quantum annealing, with an average improvement in score of

42.89% across all the data sets tested on, based on minimum

distance to POI. For each dataset, the score for each computing

method was the average over ﬁve 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 WO RK S

This work started with the aim of improving the perfor-

mance 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 ﬁndings that seeding a evolutionary

genetic algorithm with the results of a quantum annealing

provides a decrease in minimum distance from POI of 42.89%

compared with QA and 57.54% compared to a randomly

seed GA. The algorithm outlined above shows great promise

in terms of making quantum annealing usable in the near

term. The authors therefore think that both the inclusion of

an entropic optimization function in the QUBO formulation,

as well as the seeding of genetic algorithm using quantum

6

annealing needs to be tested on other problems that can be

solved using quantum annealing.

VII. ACKN OWLEDGEMENTS

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 Artiﬁcial Brain Team for

helping review the paper and bringing up great points during

the process.

REFERENCES

[1] Henrik Fredriksson and Mattias Dahl and Johan Holmgren, “Optimal

placement of Charging Stations for Electric Vehicles in large-scale

Transportation Networks, journal = Procedia Computer Science,” vol. 160,

pp. 77–84, 2019, 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) / Afﬁliated Workshops. [Online]. Available:

https://www.sciencedirect.com/science/article/pii/S1877050919316618

[2] J. He, H. Yang, T.-Q. Tang, and H.-J. Huang, “An optimal

charging station location model with the consideration of electric

vehicle’s driving range,” Transportation Research Part C: Emerging

Technologies, vol. 86, pp. 641–654, 2018. [Online]. Available:

https://www.sciencedirect.com/science/article/pii/S0968090X17303558

[3] J¨

org, Thomas and Krzakala, Florent and Kurchan, Jorge and Maggs,

Andrew Colin, “Quantum Annealing of Hard Problems,” Progress of

Theoretical Physics Supplement, vol. 184, p. 290–303, 2010. [Online].

Available: http://dx.doi.org/10.1143/PTPS.184.290

[4] “Placement of Charging Stations,” https://github.com/dwave-examples/

ev-charger-placement, Accessed on October 20, 2021.

[5] “D-Wave Leap Solver,” https://cloud.dwavesys.com/leap/login/?next=

/leap/, Accessed on October 20, 2021.

[6] Pagany, Raphaela and Marquardt, Anna and Zink, Roland, “Electric

Charging Demand Location Model—A User- and Destination-Based

Locating Approach for Electric Vehicle Charging Stations,” Sustainability,

vol. 11, no. 8, 2019. [Online]. Available: https://www.mdpi.com/

2071-1050/11/8/2301

[7] “D-Wave Systems,” https://docs.dwavesys.com/docs/c gs 2.html,

AccessedonOctober20,2021.

[8] S. M. Elsayed, R. A. Sarker, and D. L. Essam, “A new genetic

algorithm for solving optimization problems,” Engineering Applications

of Artiﬁcial Intelligence, vol. 27, pp. 57–69, 2014. [Online]. Available:

https://www.sciencedirect.com/science/article/pii/S0952197613001875

[9] “QBSolv,” https://docs.ocean.dwavesys.com/projects/qbsolv/en/latest/

,AccessedonOctober22, 2021.