Project QASAR Results and hands-on demonstration of a joint … · 2018. 4. 17. · Project QASAR...
Transcript of Project QASAR Results and hands-on demonstration of a joint … · 2018. 4. 17. · Project QASAR...
Project QASAR Results and hands-on demonstration of a joint
project of Volkswagen and LMU Sebastian Feld, Thomas Gabor
LMU Munich {sebastian.feld, thomas.gabor}@ifi.lmu.de
Qubits Europe 2018 D-Wave Users Conference
12 April 2018, Munich, Germany
The Goals of QASAR 2
based on current D-WAVE platform
Quantum Annealing Systems, Applications and Research
The Goals of QASAR 3
based on current D-WAVE platform
practical challenges…
Quantum Annealing Systems, Applications and Research
The Goals of QASAR 4
based on current D-WAVE platform
practical challenges… …that are part of
larger system solutions
Quantum Annealing Systems, Applications and Research
The Goals of QASAR 5
based on current D-WAVE platform
practical challenges… …that are part of
larger system solutions
relevant within 2–5 years
derived from other current developments
Quantum Annealing Systems, Applications and Research
Quantum Annealing meets Machine Learning 6
Problem
Classification of student success / car selling prices / …
Central Question
Can Quantum Annealing help to automatically construct better classification functions?
Application
Possible interconnections between Quantum Annealing and Machine Learning
use Boosting to build better classifiers from simple basic classifiers
Vote
Vote
Application
Practical QBoost
Choosing a Classifier Set 7
Distribution of Solutions 8
Central Question
Among multiple possible solutions, how does the Quantum Annealer choose?
Application
Solution-Space Illumination
Application
Goal-Biased Sampling
Application
Real Random Numbers
Application
Realiability of Sampling
Problem
Canonical Boolean Formula Satisfaction (3-SAT)
3-SAT
• Given a Boolean formula in CNF (with 3 literals per clause)
• Is this formula satisfiable?
• 𝑥1 ∨ 𝑥2 ∨ 𝑥3 ∧ 𝑥1 ∨ 𝑥4 ∨ 𝑥5
• Yes, for example choose 𝑥1 = 𝑇, 𝑥2 = 𝑇, 𝑥3 = 𝑇, 𝑥4 = 𝐹, 𝑥5 = 𝑇,
9
NP-Hard and “NP-Easy” 10
Problem Criticality for QA 11
non-critical critical
The Importance of Post-Processing 12 non-critical critical
With
D-WAVE
post-processing
Without
D-WAVE
post-processing
Quantum-Classical Hybrid Applications 13
Central Question
How can Quantum Annealing problems and classical algorithms be combined to solve a single problem?
Application
Integration Patterns for Quantum API
Application
Subproblem Construction for Efficiency/Quality/…
1
Project QASAR Results and hands-on demonstration of a joint
project of Volkswagen and LMU Sebastian Feld, Thomas Gabor
LMU Munich {sebastian.feld, thomas.gabor}@ifi.lmu.de
Qubits Europe 2018 D-Wave Users Conference
12 April 2018, Munich, Germany
2
Motivation
Master’s Thesis “A hybrid solution method for the
Capacitated Vehicle Routing Problem on a Quantum Annealer”
3
Motivation
Master’s Thesis “A hybrid solution method for the
Capacitated Vehicle Routing Problem on a Quantum Annealer”
Research Question Solving the CVRP on a QA:
Is it profitable in terms of solution quality and computation time?
Capacitated Vehicle Routing Problem (CVRP)
4
Customers with demands
Central depot
Capacity-constrained vehicles
Objective: Find shortest route serving all customers
Capacitated Vehicle Routing Problem (CVRP)
5
Customers with demands for goods
Central depot
Capacity-constrained vehicles
Find shortest route serving all customers
Capacitated Vehicle Routing Problem (CVRP)
6
Customers with demands for goods
Central depot
Capacity-constrained vehicles
Find shortest route serving all customers
Capacitated Vehicle Routing Problem (CVRP)
7
Customers with demands for goods
Central depot
Capacity-constrained vehicles
Find shortest route serving all customers
Capacitated Vehicle Routing Problem (CVRP)
8
Customers with demands for goods
Central depot
Capacity-constrained vehicles
Find shortest route serving all customers
Capacitated Vehicle Routing Problem (CVRP)
9 Bad solutions
Capacitated Vehicle Routing Problem (CVRP)
10 Bad solutions Good solutions
Related Work
11
Simulated Annealing
Branch and Bound
Tabu Search
Genetic Algorithm Quantum
Annealing
Ant Colony Optimization
Or-opt Operator
𝜆-opt Operator
Savings Heuristic
Insertion Heuristic
2-Phase Heuristics
Improvement Heuristics Construction Heuristics Meta Heuristics Exact Approaches
Related Work
12
Simulated Annealing
Branch and Bound
Tabu Search
Genetic Algorithm Quantum
Annealing
Ant Colony Optimization
Or-opt Operator
𝜆-opt Operator
Savings Heuristic
Insertion Heuristic
2-Phase Heuristics
Improvement Heuristics Construction Heuristics Meta Heuristics Exact Approaches
2-Phase Heuristics
13
2-Phase Heuristics
14
1. Clustering
– Divide customers into subsets
– Possible route must not exceed vehicle capacity
2. Routing
– Find shortest path within subset
2-Phase Heuristics
1. Clustering
– Divide customers into subsets
– Possible route must not exceed vehicle capacity
2. Routing
– Find shortest path within subset
15
3 Approaches
16
C
R
Classic Quantum
Quantum Two QUBO
3 Approaches
17
C
R
C&R
Classic Quantum Classic Quantum
Quantum Two QUBO Quantum One QUBO
3 Approaches
18
C
R
C&R
C
R
Classic Quantum Classic Quantum Classic Quantum
Quantum Two QUBO Quantum One QUBO Hybrid Solution
Hybrid Solution
19
Classic Quantum
Hybrid Solution
Hybrid Solution 1. Classic Clustering
– Choice of core customer (distance/demand)
– Clustering (Construction/Improvement)
2. Traveling Salesman Problem QUBO – Every customer is visited exactly once
(has got a position)
– Each position is assigned exactly once (to a customer)
– Minimize distances between customers
20
C
Classic Quantum
Hybrid Solution
Hybrid Solution 1. Classic Clustering
– Choice of core customer (distance/demand)
– Clustering (Construction/Improvement)
2. Traveling Salesman Problem QUBO – Every customer is visited exactly once
(has got a position)
– Each position is assigned exactly once (to a customer)
– Minimize distances between customers
21
C
R
Classic Quantum
Hybrid Solution
Hybrid Solution 1. Classic Clustering
– Choice of core customer (distance/demand)
– Clustering (Construction/Improvement)
2. Traveling Salesman Problem QUBO – Every customer is visited exactly once
(has got a position)
– Each position is assigned exactly once (to a customer)
– Minimize distances between customers
22
C
R
Classic Quantum
Hybrid Solution
Traveling Salesman Problem (TSP)
23
Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city?
Source: Wikipedia
The Good, the Bad and the Ugly
24
D E
F
G
H A
B
C
D E
F
G
H A
B
C
D E
F
G
H A
B
C
The Good, the Bad and the Ugly
25 All possible solutions
Qu
alit
y o
f so
luti
on
Formulate TSP as QUBO
26
𝐻 = 𝛼 1− 𝑥𝑣,𝑗
𝑁
𝑗=1
2
+
𝑛
𝑣=1
𝛼 1 − 𝑥𝑣,𝑗
𝑁
𝑣=1
2𝑛
𝑗=1
+ 𝛽 𝑊𝑢𝑣 𝑥𝑢,𝑗𝑥𝑣,𝑗+1
𝑁
𝑗=1𝑢𝑣 ∈𝐸
A1 A2 A3 A4 B1 B2 B3 B4 C1 C2 C3 C4
A1
A2
A3
A4
B1
B2
B3
B4
Given graph 𝐺 = 𝑉, 𝐸 with edge weights 𝑊𝑢𝑣,
find hamiltonian cycle with minimum sum of edge weights
Source: http://arxiv.org/pdf/1302.5843.pdf
Formulate TSP as QUBO
27
𝐻 = 𝛼 1− 𝑥𝑣,𝑗
𝑁
𝑗=1
2
+
𝑛
𝑣=1
𝛼 1 − 𝑥𝑣,𝑗
𝑁
𝑣=1
2𝑛
𝑗=1
+ 𝛽 𝑊𝑢𝑣 𝑥𝑢,𝑗𝑥𝑣,𝑗+1
𝑁
𝑗=1𝑢𝑣 ∈𝐸
A1 A2 A3 A4 B1 B2 B3 B4 C1 C2 C3 C4
A1 𝛼 𝛼 𝛼
A2 𝛼 𝛼
A3 𝛼
A4
B1 𝛼 𝛼 𝛼
B2 𝛼 𝛼
B3 𝛼
B4
Every customer can only appear once in a tour
Formulate TSP as QUBO
28
𝐻 = 𝛼 1− 𝑥𝑣,𝑗
𝑁
𝑗=1
2
+
𝑛
𝑣=1
𝛼 1 − 𝑥𝑣,𝑗
𝑁
𝑣=1
2𝑛
𝑗=1
+ 𝛽 𝑊𝑢𝑣 𝑥𝑢,𝑗𝑥𝑣,𝑗+1
𝑁
𝑗=1𝑢𝑣 ∈𝐸
A1 A2 A3 A4 B1 B2 B3 B4 C1 C2 C3 C4
A1 𝛼 𝛼 𝛼 𝛼 𝛼
A2 𝛼 𝛼 𝛼 𝛼
A3 𝛼 𝛼 𝛼
A4 𝛼 𝛼
B1 𝛼 𝛼 𝛼 𝛼
B2 𝛼 𝛼 𝛼
B3 𝛼 𝛼
B4 𝛼
There must be a 𝑗𝑡ℎ position in the tour for each 𝑗
Formulate TSP as QUBO
29
𝐻 = 𝛼 1− 𝑥𝑣,𝑗
𝑁
𝑗=1
2
+
𝑛
𝑣=1
𝛼 1 − 𝑥𝑣,𝑗
𝑁
𝑣=1
2𝑛
𝑗=1
+ 𝛽 𝑊𝑢𝑣 𝑥𝑢,𝑗𝑥𝑣,𝑗+1
𝑁
𝑗=1𝑢𝑣 ∈𝐸
If the edge is part of the tour, apply the edge weight
A1 A2 A3 A4 B1 B2 B3 B4 C1 C2 C3 C4
A1 𝛼 𝛼 𝛼 𝛼 (ab) (ab) 𝛼 (ac) (ac)
A2 𝛼 𝛼 (ab) 𝛼 (ab) (ac) 𝛼 (ac)
A3 𝛼 (ab) 𝛼 (ab) (ac) 𝛼 (ac)
A4 (ab) (ab) 𝛼 (ac) (ac) 𝛼
B1 𝛼 𝛼 𝛼 𝛼 (bc) (bc)
B2 𝛼 𝛼 (bc) 𝛼 (bc)
B3 𝛼 (bc) 𝛼 (bc)
B4 (bc) (bc) 𝛼
Formulate TSP as QUBO
30
𝐻 = 𝛼 1− 𝑥𝑣,𝑗
𝑁
𝑗=1
2
+
𝑛
𝑣=1
𝛼 1 − 𝑥𝑣,𝑗
𝑁
𝑣=1
2𝑛
𝑗=1
+ 𝛽 𝑊𝑢𝑣 𝑥𝑢,𝑗𝑥𝑣,𝑗+1
𝑁
𝑗=1𝑢𝑣 ∈𝐸
Every customer can only appear once in a tour There must be a 𝑗𝑡ℎ position in the tour for each 𝑗 If the edge is part of the tour, apply the edge weight
31
Hands on…
Preprocessing # Import nodes with x/y-coordinates
file_parser = FileParser("./datasets/TSP_Testdata.xml")
# Get list of nodes (index, x, y)
nodelist = file_parser.parse_file_tsp()
# Get list of undirected edges (index1, index2, length)
edges = file_parser.generate_edge_list(nodelist)
32
Preprocessing # Import nodes with x/y-coordinates
file_parser = FileParser("./datasets/TSP_Testdata.xml")
# Get list of nodes (index, x, y)
nodelist = file_parser.parse_file_tsp()
# Get list of undirected edges (index1, index2, length)
edges = file_parser.generate_edge_list(nodelist)
33
Preprocessing # Import nodes with x/y-coordinates
file_parser = FileParser("./datasets/TSP_Testdata.xml")
# Get list of nodes (index, x, y)
nodelist = file_parser.parse_file_tsp()
# Get list of undirected edges (index1, index2, length)
edges = file_parser.generate_edge_list(nodelist)
34
Main Logic
35
# Create QUBO
Q = tsp_solver.generate_tsp_qubo(len(nodelist), edges)
# Solve QUBO with qbsolv
answer = QBSolv().sample_qubo(Q, 50)
# Returns the result
distance, used_edges = tsp_solver.get_distance_and_edges_of_tour_qbsolv(adj_matrix, response, edges, len(nodelist))
# Plot dataset and result
plot_drawer = PlotDrawer()
plot_drawer.plot_tsp(used_edges, nodelist, node_annotation)
Main Logic
36
# Create QUBO
Q = tsp_solver.generate_tsp_qubo(len(nodelist), edges)
# Solve QUBO with qbsolv
answer = QBSolv().sample_qubo(Q, 50)
# Returns the result
distance, used_edges = tsp_solver.get_distance_and_edges_of_tour_qbsolv(adj_matrix, response, edges, len(nodelist))
# Plot dataset and result
plot_drawer = PlotDrawer()
plot_drawer.plot_tsp(used_edges, nodelist, node_annotation)
Main Logic
37
# Create QUBO
Q = tsp_solver.generate_tsp_qubo(len(nodelist), edges)
# Solve QUBO with qbsolv
answer = QBSolv().sample_qubo(Q, 50)
# Returns the result
distance, used_edges = tsp_solver.get_distance_and_edges_of_tour_qbsolv(adj_matrix, response, edges, len(nodelist))
# Plot dataset and result
plot_drawer = PlotDrawer()
plot_drawer.plot_tsp(used_edges, nodelist, node_annotation)
D E
F
G
H A
B
C
Main Logic
38
# Create QUBO
Q = tsp_solver.generate_tsp_qubo(len(nodelist), edges)
# Solve QUBO with qbsolv
answer = QBSolv().sample_qubo(Q, 50)
# Returns the result
distance, used_edges = tsp_solver.get_distance_and_edges_of_tour_qbsolv(adj_matrix, response, edges, len(nodelist))
# Plot dataset and result
plot_drawer = PlotDrawer()
plot_drawer.plot_tsp(used_edges, nodelist, node_annotation)
D E
F
G
H A
B
C
Main Logic
39
# Create QUBO
Q = tsp_solver.generate_tsp_qubo(len(nodelist), edges)
# Solve QUBO with qbsolv
answer = QBSolv().sample_qubo(Q, 50)
# Returns the result
distance, used_edges = tsp_solver.get_distance_and_edges_of_tour_qbsolv(adj_matrix, response, edges, len(nodelist))
# Plot dataset and result
plot_drawer = PlotDrawer()
plot_drawer.plot_tsp(used_edges, nodelist, node_annotation)
Hybrid Solution
40
C
R
Classic Quantum
Hybrid Solution
Results (TSP only): Solution Quality • Very good results for small test instances
• Increasing problem size higher average deviation & variance
41
Problem Best Known Solution
TSP-QUBO Best of 10
TSP-QUBO Avg. Dev. of 10
Burma14 3323 3323 0%
Ulysses16 6859 6859 0.21%
Ulysses22 7013 7019 2.01%
WesternSa29 27603 28564 7.63%
Djibouti38 6656 7480 21.31%
Results (TSP only): Solution Quality • Very good results for small test instances
• Increasing problem size higher average deviation & variance
42
Problem Best Known Solution
TSP-QUBO Best of 10
TSP-QUBO Avg. Dev. of 10
Burma14 3323 3323 0%
Ulysses16 6859 6859 0.21%
Ulysses22 7013 7019 2.01%
WesternSa29 27603 28564 7.63%
Djibouti38 6656 7480 21.31%
Results (CVRP): Solution Quality • HS competitive with comparable construction heuristics
• However, BKS never found
43
Clarke-Wright Fisher-Jaikumar Christofides et al. Sweep Hybrid Solution
Problem n BKS Best Avg. Dev. Best Avg. Dev. Best Avg. Dev. Best Avg. Dev. Best Avg. Dev.
CMT1 50 524.61 585 11.5% 524 0.12% 550 4.84% 532 1.41% 556 5.98%
CMT2 75 835.26 900 7.75% 857 2.60% 883 5.72% 874 4.64% 926 10.86%
CMT3 100 826.14 886 7.25% 833 0.83% 851 3.01% 851 3.01% 905 9.55%
CMT4 150 1028.42 1204 17.07% - - 1093 6.28% 1079 4.92% 1148 11.63%
CMT5 199 1291.29 1540 19.26% 1420 9.97% 1418 9.81% 1389 7.57% 1429 10.66%
CMT11 120 1042.12 - - - - - - - - 1084 4.02%
CMT12 100 819.56 877 7.01% 848 3.47% 876 6.89% 949 15.79% 828 1.03%
Results (CVRP): Computation Time • Using QBSolv leads to latency and waiting times
• Embedding requires several seconds per SubQUBO
• Pure solution time of SubQUBOS on QA in 𝜇𝑠 range
44
Classic QBSolv Hybrid QBSolv (D-Wave)
Total time 3.672 sec 484.907 sec
QUBO solution time 1.086 sec 0.737 sec
Including network latency, queueing, programming, cool-down, annealing, and readout
Results (CVRP): Computation Time • Using QBSolv leads to latency and waiting times
• Embedding requires several seconds per SubQUBO
• Pure solution time of SubQUBOS on QA in 𝝁𝒔 range
45
Classic QBSolv Hybrid QBSolv (D-Wave)
Total time 3.672 sec 484.907 sec
QUBO solution time 1.086 sec 0.737 sec
Including just programming, cool-down, annealing, and readout
Summary Hybrid Approach
• Splitting problems into subproblems is helpful
• Direct mapping of problem on hardware is possible
Computation time
• Large optimization problems require QBSolv (Latency, waiting times and embedding)
• But: pure solution time of single SubQUBOs in range of 𝜇𝑠
Solution quality
• Comparable with fundamental construction heuristics
• Clustering phase makes finding BKS difficult
46
Summary Hybrid Approach
• Splitting problems into subproblems is helpful
• Direct mapping of problem on hardware is possible
Computation time
• Large optimization problems require QBSolv (Latency, waiting times and embedding)
• But: pure solution time of single SubQUBOs in range of 𝜇𝑠
Solution quality
• Comparable with fundamental construction heuristics
• Clustering phase makes finding BKS difficult
47
Summary Hybrid Approach
• Splitting problems into subproblems is helpful
• Direct mapping of problem on hardware is possible
Computation time
• Large optimization problems require QBSolv (Latency, waiting times and embedding)
• But: pure solution time of single SubQUBOs in range of 𝜇𝑠
Solution quality
• Comparable with fundamental construction heuristics
• Clustering phase makes finding BKS difficult
48
Summary Publication
• Currently in preparation…
Acknowledgment
• Dr. Christian Seidel, Dr. Gabriele Compostella, Isabella Galter (VW)
• Andreas Hessenberger, Christoph Roch, Sebastian Zielinski (LMU)
49
Summary Publication
• Currently in preparation…
Acknowledgment
• Dr. Christian Seidel, Isabella Galter (Volkswagen AG Data:Lab Munich)
• Prof. Dr. Wolfgang Mauerer (OTH Regensburg)
• Christoph Roch, Sebastian Zielinski, Andreas Hessenberger (LMU Munich)
50
51
Project QASAR Quantum Annealing Systems, Applications and Research