^{1}

^{2}

^{2}

^{1}

^{3}

^{3}

^{1}

^{2}

^{3}

Edited by: Shiro Kawabata, National Institute of Advanced Industrial Science and Technology, Japan

Reviewed by: Dawei Lu, University of Waterloo, Canada; Masayuki Ohzeki, Tohoku University, Japan

Specialty section: This article was submitted to Quantum Computing, a section of the journal Frontiers in ICT

This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) or licensor are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

Quantum annealing algorithms belong to the class of metaheuristic tools, applicable for solving binary optimization problems. Hardware implementations of quantum annealing, such as the quantum processing units (QPUs) produced by D-Wave Systems, have been subject to multiple analyses in research, with the aim of characterizing the technology’s usefulness for optimization and sampling tasks. In this paper, we present a real-world application that uses quantum technologies. Specifically, we show how to map certain parts of a real-world traffic flow optimization problem to be suitable for quantum annealing. We show that time-critical optimization tasks, such as continuous redistribution of position data for cars in dense road networks, are suitable candidates for quantum computing. Due to the limited size and connectivity of current-generation D-Wave QPUs, we use a hybrid quantum and classical approach to solve the traffic flow problem.

Quantum annealing technologies such as the quantum processing units (QPUs) made by D-Wave Systems are designed to solve complex combinatorial optimization problems (Johnson et al.,

In this paper, we will introduce the traffic flow optimization problem. We start with the T-Drive trajectory data set^{1}

The objective of the traffic flow optimization problem is to minimize the time for a given set of cars to travel between their individual sources and destinations. We used the simplifying assumption that time to traverse a street is proportional to a function of the number of cars currently occupying the street. Thus, we minimize total time for all cars by minimizing total congestion over all road segments. Congestion on an individual segment is determined by a quadratic function of the number of cars traversing it in a specific time interval. To ensure reproducibility, we used the publicly available T-Drive trajectory data set containing trajectories of 10,357 taxis recorded over 1 week. The data set features 15 million data points, and the total distance of the trajectories makes up about 9 million kilometers (Yuan et al.,

Classical: preprocess map and GPS data.

Classical: identify areas where traffic congestion occurs.

Classical: determine spatially and temporally valid alternative routes for each car in the data set, if possible.

Classical: formulate the minimization problem as a QUBO (to minimize congestion in road segments on overlapping routes).

Hybrid quantum/classical: find a solution that reduces congestion among route assignments in the whole traffic graph.

Classical: redistribute the cars based on the results.

Iterate over steps 2–6 until no traffic congestion is identified.

A visualization of the input graph is shown in Figure

OSMnx graph for the downtown area of Beijing.

To illustrate how we formulate the problem, we focus on a subset of the T-Drive data set. Of the 10,357 cars in the data set, we select 418 of those that are traveling to or from the city center and the Beijing airport. In this specific scenario, the goal was to maximize traffic flow by redirecting a subset of the 418 cars to alternative routes such that the number of intersecting road segments is minimized. For this, optimizing over all cars simultaneously is required, which means that any redistribution of cars that resolves the original congestion must not cause a traffic jam anywhere else in the map. We used the OSMnx package to split the map of Beijing into segments and nodes and assign a unique ID to each. Our procedure can be summarized as follows:

Extract the road graph from the Beijing city map using OSMnx. This returns lists of segments and nodes with IDs. Nodes represent connections between segments, and segments are edges connecting the nodes, representing the streets (Figure

Map the T-Drive trajectory data set cars’ GPS coordinates onto street segments in the graph, to determine the routes taken by the cars.

For each car, and each source and destination node, we extract all simple paths from source to destination and obtain 3 candidate alternative routes.^{2}

The definition of variables for the QUBO (equation (

An example of a single car (with ID 10012) and its assigned routes, split into segments.

To optimize the traffic flow, we minimize the number of overlapping segments between assigned routes for each car. Thus, we formulate the optimization problem as follows: “Given 3 possible routes per car, which assignment of cars to routes minimizes the overall congestion on all road segments?” We require that every car should be assigned one of the 3 possible routes, while simultaneously minimizing total congestion over all assigned routes. It is important to emphasize that in this example each car was proposed 3 possible alternative routes—not the same set of 3 routes for all cars. This need not be the case in general; cars can have many possible routes. For simplicity, we take (maximum) 3 routes per car, because the mathematical description of the problem is identical regardless of the number of routes.

For every possible assignment of car to route, we define a binary variable _{ij}^{2} = _{ij}_{s}

For example, if route _{1} of car _{1}, route _{2} of car _{2}, and route _{3} of car _{3} share street segment _{1}, then

In general, there can be many car/route variables _{ij}

When summing components of the global cost function, the scaling parameter

Now the cost function can be formulated as a quadratic, upper-triangular matrix, as required for the QUBO problem. We keep a mapping of binary variable _{ij}_{ij}_{ij}

We add a (+1) at diagonal index _{ij}

We add a (+2) for every pair of cars _{1} and _{2} taking route

We then add the constraints to enforce that every car has only one route, as per equation (

For every car _{ij}

For every cross-term arising from equation (

A special case occurs if a car is proposed only one route, meaning _{ij}

This results in a QUBO matrix as shown in Figure

QUBO matrix describing the traffic flow problem.

Expressed as pseudo-code, the important high-level steps of the traffic flow optimization algorithm are as follows:

For each car

Determine the current route.

For each car

Map the source and destination to their nearest nodes in the road graph.

For each with source/destination pair:

Determine all simple paths from source to destination.

Find two alternative paths that are maximally dissimilar to the original route and to each other.

For each car

Define the matrix _{ij}

Solve the QUBO problem.

Update cars with the selected routes.

Here, we briefly introduce the solvers and tools provided by D-Wave, to help understand how the problem was solved using the QPU.

The topology of the D-Wave 2X QPU is based on a _{12} Chimera graph containing 1,152 vertices (qubits) and over 3,000 edges (couplers). A Chimera graph of size _{N}_{4,4}). Each vertex is connected to its four neighbors inside the cell as well as two neighbors (north/south or east/west) outside the cell; therefore, every vertex has degree 6 excluding boundary vertices (King et al.,

The 418-car example used 1,254 logical variables to represent the problem. A challenge in this scenario is the restricted connectivity between qubits on a D-Wave QPU, which limits the ability to directly solve arbitrarily structured problems. When using the D-Wave QPU directly, an interaction between two problem variables can only occur when there is a physical connection (coupler) between the qubits representing these variables. For most problems, the interactions between variables do not match the QPU connectivity. This limitation can be circumvented using minor embedding, a technique that maps one graph structure to another. The QPU we used has 1,135 functional qubits, thus it was not possible to embed the 1,254 logical variables on the QPU at once. Therefore, the problem was solved using the hybrid classical/quantum tool qbsolv (described in the next section).

In January 2017, D-Wave Systems open-sourced the software tool qbsolv (D-Wave Systems, ^{3}

The high-level steps performed by qbsolv in hybrid mode are as follows:

Find the largest clique^{4}^{5}

Given a QUBO problem, initialize random bit string representing a solution to the problem.

Use a heuristic method to rank nodes according to importance; create a subproblem that fits on the QPU using the importance ranking.

Create subproblem using the importance order.

Solve subproblem by submitting it to the QPU and update variable states in the bit string.

Iterate steps 3–5 until no improvement in the objective function is found.

A full description of how the qbsolv algorithm works is detailed in Booth et al. (

The goal of these experiments was to map a real-world problem to a quantum annealing machine, which we have shown. When evaluating the solutions produced by the D-Wave QPU, the focus was on finding good quality solutions within short periods of calculation. To quantify the quality of a solution, we count the number of congested roads after optimization. Keeping in mind that routes are described by sets of road segments, we simply count the number of segments that appear in routes more than a given number of times (_{intersections}). Here, we assume that a segment that appears in more than _{intersections} routes will become congested. For this experiment, we chose _{intersections} = 10.

To evaluate the QUBO formulation of the traffic flow problem, we designed the following experiment: for the 418 car QUBO problem (as presented in Section

Results comparing random assignment of cars to routes, and qbsolv with calls to the D-Wave 2X QPU. The y-axis shows the distribution of number of congested roads. The red line is the number of congested roads given the original assignments of routes.

From the results in Figure _{intersections} = 10 threshold), as all the cars shared the same route, and that the average occupancy was much higher than _{intersections} = 10. It is also worth noting that all 50 experiments using qbsolv resolved the congestion.

Additionally, we measured the performance of qbsolv as a function of its run time. The qbsolv source code was compiled and executed on a server in Burnaby, Canada, to minimize the latency between submitting jobs to the QPU and obtaining the results. However, since the QPU used was a shared resource via the cloud, run time of qbsolv varied greatly. Therefore, we consider the run time of qbsolv to be the minimum of the observed run times, as this represents most faithfully the algorithm, independent of the load on the D-Wave system. This run time was observed as 22 s. There is also no evidence of correlation between the run time of qbsolv and performance (the long run times are due to waiting in the job submission queue). Given the performance results of qbsolv, it is reasonable to assume that a dedicated D-Wave QPU (circumventing the public job submission queue) could be suitable for these kinds of optimization problems. A visual showing the traffic density on the Beijing road graph before (original routes) and after optimization (using

Left: Unoptimized situation under consideration of cars causing traffic jam in the network. Right: Optimized redistributed cars using qbsolv. Note that the areas in red, which indicate high traffic density, are mostly absent from the right picture.

The currently presented problem is a simplified version of traffic flow, as it incorporates only a limited set of cars, no communication to infrastructure, no other traffic participants, and no other optimization targets except minimization of road congestion. In our future work, we intend to consider all of these parameters and will also need to consider creative ways of formulating these parameters as part of the QUBO problem. We will continue to focus on solving real-world problems by means of quantum machine learning, quantum simulation, and quantum optimization. Furthermore, we find that these types of real-time optimization problems are well-suited for the D-Wave systems and the hybrid tools that use them. The more combinatorially complex the problem becomes, the more time would be needed for classical algorithms to consider additional parameters. However, D-Wave QPUs have historically grown in number of qubits from one generation to the next, and given that this trend is likely to continue, it is reasonable to assume that obtaining high-quality solutions quickly using the QPU will be sustainable moving forward. We expect that in future generations of QPUs, we will be able to embed larger problems directly. This will allow us to further leverage the performance of the QPU.

All authors contributed to the creation of this paper.

The authors are a collaboration between Volkswagen and D-Wave Systems employees.

The authors thank the Volkswagen Group for its support in this exploratory research project. Further to the authors thank the team at D-Wave Systems, especially Murray Thom, Adam Douglass, and Andy Mason.

^{1}This open source data set provided by Microsoft can be found at:

^{2}A simple path can traverse several nodes from source to destination, but without returning to nodes which were already visited (no cycles). Several thousands of simple paths from source to destination (per car) may exist. We selected two simple paths that are most dissimilar to the original route, and to each other, and proposed these as alternates, along with the original route. To do this we used the Jaccard similarity index.

^{3}The source code can be found at:

^{4}A clique is a graph where all nodes are connected to each other.

^{5}D-Wave has recently introduced a “virtual full-yield Chimera” (VFYC) solver, which takes the working QPU and simulates the missing qubits and couplers using classical software. This allows for some programs to be standardized across the different QPUs, and within generations of QPUs. This VFYC version of the D-Wave 2X solver was used in our experiments.