Solving Set Cover with Pairs Problem using Quantum Annealing

Here we consider using quantum annealing to solve Set Cover with Pairs (SCP), an NP-hard combinatorial optimization problem that plays an important role in networking, computational biology, and biochemistry. We show an explicit construction of Ising Hamiltonians whose ground states encode the solution of SCP instances. We numerically simulate the time-dependent Schrödinger equation in order to test the performance of quantum annealing for random instances and compare with that of simulated annealing. We also discuss explicit embedding strategies for realizing our Hamiltonian construction on the D-wave type restricted Ising Hamiltonian based on Chimera graphs. Our embedding on the Chimera graph preserves the structure of the original SCP instance and in particular, the embedding for general complete bipartite graphs and logical disjunctions may be of broader use than that the specific problem we deal with.

The computational difficulty of Ising spin glass has not only given the quantum Ising Hamiltonians the versatility for efficiently encoding many problems in NP 50 , but also motivated physical realization of QA using systems described by the quantum Ising model 6,7,9 .The notion of adiabatic quantum computing (AQC) 3,37,51 , which can be regarded as a particular class of QA, has further established QA in the context of quantum computation (In this work we will use the terms quantum annealing and adiabatic quantum computing synonymously).Although it is believed that even universal quantum computers cannot solve NP-hard problems efficiently in general 52 , there has been evidence in experimental quantum Ising systems that suggests quantum speedup over classical computation due to quantum tunneling 53,54 .It is then of great interest to explore more regimes where quantum annealing could offer a speedup compared with simulated annealing.
Here we consider a variant of Set Cover (SC) called Set Cover with Pairs (SCP).SC is one of Karp's 21 NP-complete problems 55 and SCP was first introduced 56 as a generalization of SC.Instead of requiring each element to be covered by a single object as in SC, the SCP problem is to find a minimum subset of objects so that each element is covered by at least one pair of objects.We will present its formal definition in the Preliminaries section.SCP and its variants arise in a wide variety of contexts including Internet traffic monitoring and content distribution 57 , computational biology 58,59 , and biochemistry 60 .On classical computers, the SCP problem is at least as hard to approximate as SC.Specifically, its difficulty on classical computers can be manifested in the results by Breslau et al. 57 , which showed that no polynomial time algorithm can approximately solve Disjoint-Path Facility Location, a special case of SCP, on n objects to within a factor that is ε − 2 n log 1 for any ε > 0. Due to its complexity, various heuristics 56 and local search algorithms 60 have been proposed.
In this paper we explore using quantum annealing based on Ising spin glass to solve SCP.We start by reducing SCP to finding the ground state of Ising spin glass, via integer linear programming (Theorem 1).We then simulate the adiabatic evolution of the time dependent transverse Ising Hamiltonian = − + H s sH sH ( ) ( 1) 0 1 which interpolates linearly between an initial Hamiltonian H 0 of independent spins in uniform transverse field and a final Hamiltonian H 1 that encodes an SCP instance.For randomly generated SCP instances that lead to Ising Hamiltonian constructions of up to 19 spins, we explicitly simulate the time dependent Schrödinger equation.We compute the minimum evolution time that each instance needed to accomplish 25% success probability.For benchmark purpose we also use simulate annealing to solve the instances and compare its performance with that of adiabatic evolution.Results show that the median time for yielding 25% success probablity scales as O(2 0.33M ) for quantum annealing and O(2 0.21M ) for simulated annealing, observing no general quantum speedup.However, the performance of quantum annealing appears to have wider range of variance from instance to instance than simulated annealing, casting hope that perhaps certain subsets of the instance could yield a quantum advantage over the classical algorithms.
Aside from the theoretical and numerical studies, we also consider the potential implementation our Hamiltonian construction on the large-scale Ising spin systems manufactured by D-Wave Systems 6,7,9,14 .Benchmarking the efficiency of QA is currently of significant interest.An important issue that needs to be addressed in such benchmarks is that the physical implementation of the algorithm could be affected by instance-specific features.This is manifested in the embedding 61,62 of the Ising Hamiltonian construction onto the specific topology of the hardware (the Chimera graph 21,61,63 ).Here we present a general embedding of SCP instances onto a Chimera graph that preserves the original structure of the instances and requires less qubits than the usual approach by complete graph embedding.This allows for efficient physical implementations that are untainted by ad hoc constructions that are specific to individual instances.

Preliminaries
Set Cover with Pairs.Given a ground set U and a collection S of subsets of U, which we call the cover set.
Each element in S has a non-negative weight, the Set Cover (SC) problem asks to find a minimum weight subset of S that covers all elements in U. Define cover function as is the set of all elements in U covered by s.Then SC can be formulated as finding a minimum weight ′ ⊆ S S such that . Set Cover with Pairs (SCP) can be considered as a generalization of SC in the sense that if we define the cover function such that ∀i, ∈ j S, i≠ j, Q(i, j) is the set of elements in U covered by the pair {i, j}, then SCP asks to find a minimum subset ⊆ A S such that . Here we restrict to cases where each element of S has unit weight.
A graph G(V, E) is a set of vertices V connected by a set of edges E. A bipartite graph is defined as a graph whose set of vertices V can be partitioned into two disjoint sets V 1 and V 2 such that no two vertices within the same set are adjacent.We formally define SCP as the following.

Given a bipartite graph G(V, E) between U and S with E being the set of all edges, find a subset ⊆
A S such that: . In other words, c i is covered by the pair a a { , } ( ) . 2. The size of the set, |A|, is minimized.
We use the notation SCP(G, U, S) to refer to a problem instance with |U| = n, |S| = m and the connectivity between U and S determined by G.

Quantum annealing, adiabatic quantum computing.
In this paper we use QA as a heuristic method to solve the SCP problem.QA was proposed 2 for solving optimization problems using quantum fluctuations, known as quantum tunneling, to escape local minima and discover the lowest energy state.Farhi et al. 3 provide the framework for using Adiabatic Quantum Computation (AQC), which is closely related to QA, as a quantum paradigm to solve NP-hard optimization problems.The first step of the framework is to define a Hamiltonian H P whose ground state corresponds to the solution of the combinatorial optimization problem.Then, we initialize a system in the ground state of some beginning Hamiltonian H B that is easy to solve, and perform the adiabatic evolution Here ∈ s [0, 1] is a time parameter.In this paper we only consider time-dependent function s(t) = t/T for total evolution time T, but in general it could be any general functions that satisfy s(0) = 0 and s(T) = 1.The adiabatic evolution is governed by the Schrödinger equation where |ψ(t)〉 is the state of the system at any time ∈ t T [0, ].Let π i (s) be the i-th instantaneous eigenstate of H(s).In other words, let for any s.In particular, let |π 0 (s)〉 be the instantaneous ground state of H(s).
According to the adiabatic theorem 64 , for s varying sufficiently slow from 0 to 1, the state of the system |ψ(t)〉 will remain close to the true ground state |π 0 (s(t))〉 .At the end of the evolution the system is roughly in the ground state of H P , which encodes the optimal solution to the problem.If the ground state of H P is NP-complete to find (for instance consider the case for Ising spin glass 49 ), then the adiabatic evolution H(s) could be used as a heuristic for solving the problem.
An important issue associated with AQC is that the adiabatic evolution needs to be slow enough to avoid exciting the system out of its ground state at any point.In order to estimate the scaling of the minimum runtime T needed for the adiabatic computation, criteria based on the minimum gap between the ground state and the first excited state of H(s) is often used.However, here we do not use the minimum gap as an intermediate for estimating the runtime scaling, but instead numerically integrate the time dependent Schrödinger equation (1).
Quantum Ising model with transverse field.The Hamiltonian for an Ising spin glass on N spins can be written as ) acts on the i-th spin with  being a 2 × 2 identity matrix.h i , J ij are coefficients.The Hamiltonian is diagonal in the basis in the Hilbert space H.In particular σ z |0〉 = |0〉 and σ z |1〉 = − |1〉 .We formally define the problem of finding the ground state of an N-qubit Ising Hamiltonian in the following.
{ 1, 1} N .In this paper, we construct Ising Hamiltonians whose ground state encodes the solution to an arbitrary instance of the SCP problem.The physical system used for quantum annealing that we assume is identical to that of D-Wave 6,7,9,14 , namely Ising spin glass with transverse field where ) acts on the i-th spin.The beginning Hamiltonian H B has its h i , j ij = 0 for all i, j and the final Hamiltonian H P has Δ i = 0 for all i while h i and J ij depend on the problem instance at hand.We will elaborate on assigning h i and J ij coefficients in H P in Theorem 1.

Graph minor embedding.
The interactions described by the transverse Ising Hamiltonian in equation (3)   are not restricted by any constrains.However, in practice the topology of interactions is always constrained to the connectivity that the hardware permits.Therefore in order to physically implement an arbitrary transverse Ising Hamiltonian, one must address the problem of embedding the Hamiltonian into the logical fabric of the hardware 61,62 .For convenience we define the interaction graph of an Ising Hamiltonian H of the form in equation ( 2) as a graph G H (V H , E H ) such that each spin i maps to a distinctive element v i in V H and there is an edge between v i and v j iff J ij ≠ 0. This definition also applies to the transverse Ising system described in equation (3).We use the term hardware graph to refer to a graph whose vertices represent the qubits in the hardware and the edges describe the allowed set of couplings in the hardware.
In Section Set Cover with Pairs we defined bipartite graphs.Here we define a complete bipartite graph K m,n as a bipartite graph where It is possible that the interaction graph of the desired Ising Hamiltonian is a subgraph of the hardware connectivity graph.In this case the embedding problem can be solved by subgraph embedding, which we define as the following. .
In more general cases, for an arbitrary Ising Hamiltonian, a subgraph embedding may not be obtainable and we will need to embed the interaction graph into the hardware as a graph minor.Before we define minor embedding rigorously, recall that a graph is connected if for any pair of vertices u and v there is a path from u to v. A tree is a connected graph which does not contain any simple cycles as subgraphs.T is a subtree of G if T is a subgraph of G and T is a tree.We then define minor embedding as the following.
then there exist i u , If such a mapping φ exists between G and G′ , we say G is a minor of G′ and we use G ≤ m G′ to denote such relationship.Our goal is to take the interaction graph G H of our Ising Hamiltonian construction and construct the mapping φ that embeds G H into the hardware graph as a minor.

Chimera graphs.
Here we specifically consider the embedding our construction into a particular type of hardware graphs used by D-Wave devices 44,65 called the Chimera graphs.The basic components of this graph are 8-spin unit cells 6 whose interactions form a K 4,4 .The K 4,4 unit cells are tiled together and the 4 nodes on the left half of K 4,4 are connected to their counterparts in the cells above and below.The 4 nodes on the right half of K 4,4 are connected to their counterparts in the cells left and right.Furthermore, we define F(p, q, c) as a Chimera graph formed by an p × q grid of K c,c cells.Figure 1a shows F(3, 4) as an example.Note that any K m,n with m, n ≤ c can be trivially embedded in F(p, q, c) with any p, q ≥ 1 via subgraph embedding.However, it is not clear a priori how to embed K m,n with m > c or n > c onto a Chimera graph, other than using the general embedding of an (m + n)-node complete graph and consider K m,n as a subgraph.This costs O((m + n) 2 ) qubits in general and one may lose the intuitive structure of a bipartite graph in the embedding.One of the building blocks of our embedding for our Ising Hamiltonian construction (Section Embedding on quantum hardware) is an alternative embedding strategy for mapping any K m,n onto ⌈ ⌉ ⌈ ⌉ F n c m c c ( / , / , ) as a graph minor.Our embedding costs O(mn) qubits and preserves the structure of the bipartite graph.

Quantum annealing for solving SCP
From an arbitrary SCP instance to an Ising Hamiltonian construction.SCP is NP-complete most simply because Set Cover (SC) is a special case of SCP 56 and a solution to SCP is clearly efficiently verifiable.Since SC is NP-complete itself, any SCP instance can be rewritten as an instance of SC with polynomial overhead.The Ising Hamiltonian construction for Set Cover is explicitly known 39,50 .Hence it is natural to consider using the chain of reductions from SCP to SC and then from SC to ISING (Definition 2).If we recast each SCP(G, U, S) with |S| = m into an SC instance with a cover set of size O(m 2 ).Using the construction by Lucas 50 we have an Ising Hamiltonian where V i is the i-th cover set in the SC instance.Since the cover set {V i } is possibly of size up to O(m 2 ), this leads to the Ising Hamiltonian in equation ( 4) costing O(nm 2 ) qubits.
Here we present an alternative Ising Hamiltonian construction for encoding the solution to any SCP instance.We state the result precisely as Theorem 1 below.The qubit cost of our construction is comparable to that of Lucas.However, in Section Embedding on quantum hardware we argue that our construction affords more advantages in terms of embedding.Proof.First, we recast an SCP instance to an instance of integer programming, which is NP-hard in the worst case.Then, we convert the integer programming problem to an instance of the ISING problem.Recall Definition 1 of an SCP(G, U, S) instance, where G(V, E) is a graph on the vertices V = U ∪ S. For each pair . The problem can be recast as an integer program by , where , and (LP 2) , where , (LP 3) We have introduced the variable s i to indicate whether f i is chosen for the cover A ⊆ S (s i = 1 means that f i is chosen, otherwise s i = 0).We have also introduced the auxiliary variable t ij to indicate whether f i and f j are both chosen.Hence, constraint LP.1 ensures that each element c k ∈ U is covered by at least one pair in S. LP.2 ensures that a pair of elements in S cannot cover any c k ∈ U unless both elements are chosen.
To convert the integer program to an ISING instance, we first convert the constraints into expressions of logical operations.LP.1 can be rewritten as LP.2 can be translated to a truth table for the binary operation involving t ij and s i (s j ) where only the entry evaluates to 0 and the other three entries evaluate to 1. Using the following Hamiltonians we could translate the logic operations ∨ , ∧ and ≤ into the ground states of Ising model, see ref. 66  for more details.
Note that H ≤ (s 1 , s 2 ) is essentially .The third term in H ensures that z = 1 by penalizing states with = z 1 .Therefore, we can translate (5) to an Ising Hamiltonian.For a fixed k, the constraint (5) takes the form of 2 .Similarly to the example above, we introduce In order to ensure the first constrain holds, it is needed to ensure that Then we could write down the corresponding Ising Hamiltonian for the constraint as The last term is meant to make sure that in the ground state of H k .Therefore the Hamiltonian whose ground state subspace is spanned by all states that obey both of the constraints in the integer program (5) can be written as The target function ∑ ∈ s f S i i which we seek to minimize can be directly mapped to an Ising Hamiltonian . This is because we would like to essentially minimize the number of 1's in the set of s i values and penalize choices with more 1's.Therefore the final Hamiltonian whose ground state contains the solution to the original SCP instance becomes .This corresponds to A = {f 1 , f 4 }, the solution to the SCP instance.Figure 2b illustrates the interaction graph of the spins in the Ising Hamiltonian that corresponds to the SCP instance.
Numerical simulation of quantum annealing.In order to test the time complexity of using quantum annealing to solve SCP instances via the construction in Theorem 1, we generate random instances of SCP that lead to Ising Hamiltonian H SCP of =  N 3, 4, , 19 spins.In Definition 1 we use a bipartite graph between the ground state U of size n and the cover set S of size m to describe an SCP instance.For fixed n and m, there are in total 2 mn such possible bipartite graphs (if we consider each bipartite graph as a subgraph of K m,n and count the cardinality of the power set of the edges of K m,n ).Therefore to generate random bipartite graphs we only need to flip mn fair coins to uniformly choose from all possibile bipartite graphs between U and S.However, we would like to exclude the bipartite graphs where some element of S is not connected to any element in U.These "dummy nodes" are not pertinent to the computational problem at hand and should be removed from consideration before converting the SCP instance to an Ising Hamiltonian H SCP .We thus use a scheme for generating random instances of SCP without dummy nodes as described in Algorithm 1.Under the constraint that no dummy element in S is allowed, there are in total (2 n − 1) m possible bipartite graphs.In Supplementary Material Proof of correctness for  6).The bold triangle exemplifies the H ∨ constraints in ( 6) that are used to enforce the logical relationship between the t ij k ( ) variables and the auxiliary variables as shown in (7).The areas marked by G 1 (1)   , G 1 (2) etc outline the structure of the Ising Hamiltonian that is relevant in the discussion of hardware embedding.
Algorithm 1 we rigorously show that Algorithm 1 indeed samples uniformly among the (2 n − 1) m possible "dummy-free" bipartite graphs.For each randomly generated instance from Algorithm 1 we construct an Ising Hamiltonian H SCP according to Theorem 1.We then perform a numerical simulation of the time dependent Schrödinger equation ( 1) from time t = 0 to t = T with time step Δ t = 1 and the time dependent Hamiltonian defined as

Algorithm 1 Algorithm for generating a random SCP (G, U, S) without dummy elements in the cover
where H SCP is defined in equation (10).Here because of the construction of H SCP , our total Hamiltonian H(s(t)) acts not only on the spins ∈ s {0, 1} m indicating our choice of elements in the cover set S, but also auxiliary variables t ij k ( ) and , for which we use t and x to denote their respective collections.Our initial state is the ground state of H B , namely To obtain the final state ψ T ( ) where T is some positive integer, we use the ode45 subroutine of MATLAB under default settings to numerically integrate Schrödinger equation to obtain ψ(1) from ψ(0) , and then use ψ (1) as an initial state to obtain ψ (2) in the same fashion, and so on.We define the success probability p as a function of the total annealing time T as where Π is a projector onto the subspace spanned by states with s being a solution of the original SCP instance.Using binary search we determine the minimum time T* to achieve ≥ .
⁎ p T ( ) 0 25 for each instance of SCP. Figure 3 shows the distribution of T* for SCP instances that lead to Ising Hamiltonians H SCP of the same sizes, as well as how the median annealing time scales as a function of number of spins M. Results show that for instances with M up to 19, the median annealing time scales roughly as O(2 0.31M ).
Numerical experiment with Simulated Annealing.Simulated annealing, first introduced three decades ago 67 , has been widely used as a heuristic for handling hard combinatorial optimization problems.It is especially of interest as a benchmark for quantum annealing [34][35][36] because of similarities between the two algorithms.While quantum annealing employs quantum tunneling to escape from local minima, simulated annealing relies on thermal excitation to avoid being trapped in local minima.The general procedure we adopt for simulated annealing to approach the ground state of an Ising spin glass can be summarized as the following 68 : 1. Repeat R times the following: (ii) Perform a sweep on s i to obtain s′ ; (a sweep is a sequence of steps each of which randomly selects a spin and flips its state, so that on average each spin is flipped once during a sweep) (iii) With probability

Return s S as the answer.
For the purpose of comparison we also used simulated annealing to solve the same set of instances generated by Algorithm 1 for testing quantum annealing.The program implementation that we use is built by Isakov et al. 68 , which is a highly optimized implementation of simulated annealing with care taken to exploit the structures of the interaction graph, such as being bipartite and of bounded degree.Here we use the program's most basic realization of single-spin code for general interactions with magnetic field on an interaction graph of any degree.
As mentioned by Isakov et al., to improve the solution returned by simulated annealing, one could increase either the number of sweeps S or number of repetitions R in the implementation, or both of them.However, note that the total annealing time is proportional to the product ⋅ S R and there is a trade-off between S and R. For a fixed number of sweeps S let the success probability (i.e. the fraction of s i that is satisfactory) be w(S).In order to achieve a constant success probability p (say 25%, which is what we use here), we need at least 1)/log (1 ( )) repetitions.Hence the total time of simulated annealing can be written as In general w(S) increases as S increases, leading to a decrease in R. We numerically investigate this with an Ising system of N = 17 spins generated from an SCP instance via the construction in Theorem 1.We plot the annealing time T versus S in Fig. 4a.For each SCP instance with the number of spin M we compute the optimal S* such that = ⁎ ⁎ T T S ( ) is the optimized runtime (Fig. 4a).We further explore how the optimal runtime T* scales as a function of the number of spins M. As shown in Fig. 4b, a linear fit on a semilog plot shows that roughly = .⁎

T O(2 )
M 0 21 .The units of time used for both Fig. 4a,b are arbitrary and thus do not support a point-to-point comparison.But the scaling difference seems apparent.For quantum annealing we restrict to systems of at most 19 spins due to computational limitations faced in representing the full Ising Hamiltonian when numerically integrating the time-dependent Schrödinger equation (1).
Although there is no quantum speedup observed in terms of median runtime over all randomly generated instances of the same size, we notice that for a fixed number of spins M the performances of both quantum annealing and simulated annealing are sensitive to the specific instance of Ising Hamiltonian H SCP than simulated annealing.This can be seen by considering at the same time the quantum annealing results in Fig. 3 and the test results for simulated annealing shown in Fig. 4b.One could then speculate that perhaps by focusing on a specific subset of SCP instances could yield a quantum advantage.).We also provide on the bottom plot the number of instances for each M.

Embedding on quantum hardware
In this section we deal with the physical realization of quantum annealing for solving SCP instances using D-Wave type hardwares.There are mainly two aspects 62,69 of this effort: 1) The embedding problem 62 , namely embedding the interaction graph of the Ising Hamiltonian construction H SCP as a graph minor of a Chimera graph (refer to Section Graph minor embedding for definitions of the graph terminologies).2) The parameter setting problem 69 , namely assigning the strengths of the couplings and local magnetic fields for embedded graph on the hardware, in a way that minimizes the energy scaling (or control precision) required for implementing the embedding.Here we focus on the former issue.
We start with an observation on the structures of H SCP .For any instance SCP(G, U, S) according to Definition 1, the interaction graph I SCP(G,U,S) of the corresponding Ising Hamiltonian H SCP can be regarded as a union of n subgraphs, namely . Each subgraph G (i) is associated with an element of the ground set ∈ c U i as in Fig. 2a.Each G (i) could be further partitioned into two parts, G i 1 ( ) and G i

( )
. For any k, G k . G k 2 ( ) essentially describes the interaction between the auxiliary variables t ij k ( ) and x i k ( ) as described in equation (7).In Fig. 2b we illustrate such partition using the example from Fig. 2b.Our goal is then to show constructively that I SCP (G,U,S) ≤ m F(f 1 , f 2 , c) for some f 1 , f 2 that depend on m, n and c = 4, which describes the Chimera graph realized by D-Wave hardware (Fig. 1a).
It is known 61 that one could embed a complete graph on cm + 1 nodes onto Chimera graph F m m c ( , , ).Since any n-node graph is a subgraph of the n-node complete graph, in principle any n-node graph can be embedded onto Chimera graphs of size O(n 2 ) using the complete graph embedding.A downside of this approach is that it may fail to embed many graphs that are in fact embeddable 61 .Also, using embeddings based on complete graph embeddings will likely lose the intuition on the structure of the original graph.For graphs with specific structures, such as bipartite graphs one may be able to find an embedding that is also in some sense structured.We show in the following Lemma an embedding for any complete bipartite graph K p,q onto a Chimera graph.The ability to do so enables us to embed any bipartite graph onto a Chimera graph.Lemma 1.For any positive integers p, q and c, ≤ ⌈ ⌉ ⌈ ⌉ K F q c p c c ( / , / , ) p q m , .
Proof.By the definition of graph minor embedding in Section Graph minor embedding, it suffices to construct a mapping φ  ⌈ ⌉ ⌈ ⌉ K F q c p c c : ( / , / , ) where each v in F p,q is mapped to a tree T v in ⌈ ⌉ ⌈ ⌉ F q c p c c ( / , / , ) and each edge e = (u, v) in K p,q is mapped to an edge i i ( , ) label the nodes on one side of K p,q and ′ =  j q 1, 2, , label the nodes in the other.Using the labelling scheme on the nodes of Chimera graphs introduced in Section Chimera graphs and Fig. 1b, we define our mapping φ p q , as  where φ u v ( , ) p q , maps an edge (u, v) in K p , q to the Chimera graph.If we choose the edges in the Chimera graph properly, it could be checked that φ K ( ) p q p q , , is a subgraph of ⌈ ⌉ ⌈ ⌉ F q c p c c ( / , / , ). □ In Fig. 5 we show an example of embedding K 7,10 into F (3, 2, 4).A natural corollary of Lemma 1 is that any bipartite graph between p and q nodes can be minor embedded in ⌈ ⌉ ⌈ ⌉ F q c p c c ( / , / , ).We are then prepared to handle embedding the G i 1 ( ) parts of the interaction graphs of H SCP , which are but bipartite graphs (see Fig. 2b for example).
We then proceed to treat the G i 2 ( ) parts of the interaction graph.The connectivity of G k 2 ( ) is completely specified by (7).To describe such connectivity we define a family of graph L V E ( , ) 1 are two disjoint sets of nodes, the former representing the intermediate variables t ij k ( ) and the latter representing the x k variables in equation (7).The set of edges takes the form In Fig. 6 we show an example of L 10 .For any Hence in order to show that we could embed any G i 2 ( ) onto a Chimera graph, it suffices to show that we can embed any L n onto a Chimera graph.We show this in the following Lemma for c = 4.

Lemma 2. For any positive integer n,
where we restrict to c = 4.

Proof. Similar to Lemma 1, we construct a mapping
where we fix c = 4.Following the notation for nodes in L n in Fig. 6 and the notation for nodes in F p q c ( , , ) in Fig. 1b, we construct μ as )  where ξ t and ξ x are defined as With the vertex mapping μ n , a mapping of edges in L n onto the Chimera graph ⌈ ⌉ F n c c ( 2 / , 2, ) is easy to find.In Fig. 6 we show an example of embedding L 10 onto F (5, 2, 4).We could then proceed to embed the interaction graph I SCP(G,U,S) , such as the one shown in Fig. 2b, in a Chimera graph.Specifically, we state the following theorem.  qubits and preserves the structure of the original instance, which affords slightly more advantage for scalable physical implementations.

Discussion
Our interest in SCP is largely motivated by its important applications in various areas [57][58][59][60] .We have shown a complete pipeline of reductions that converts an arbitrary SCP instance to an interaction graph on a D-Wave type hardware based on Chimera graphs, in a way that preserves the structure of the instance throughout (Figs 2b  and 7) and is more qubit efficient than the usual approach by complete graph embedding.Although no quantum speedup is observed at this stage based on comparison of median annealing times, the large variance of runtimes observed in Fig. 3a from instance to instance might suggest that specific subsets of instances could provide quantum speedup.Of course, a clearer understanding of the performance of quantum annealing on solving SCP could only be brought forth by both scaling up the numerical simulation of the quantum annealing process to include instances with larger number of spins and actual experimental implementation of the quantum annealing process.Both of them are of interest to us in our future work.

Theorem 1 .
Given an instance of the Set Cover with Pairs Problem SCP(G, U, S) as in Definition 1, there exists an efficient (classical) algorithm that computes an instance of the Ising Hamiltonian ground state problem ISING(h, J) with  ∈ h M and  ∈ × J M M where the number of qubits involved in the Hamiltonian is M = O(nm 2 ) with n = |U| and m = |S|.

Figure 1 .
Figure 1.The Chimera graph that represents the qubit connectivity of D-Wave hardware.(a) Example of a 3 × 3 grid of K 4,4 cells, denoted as F(3, 3, 4).(b) Labelling of nodes within a particular cell on the a-th row and b-th column.Here we use the cell on the 2nd row and 3rd column as an example.

Figure 2 .
Figure 2. Example of converting an SCP instance to Ising Hamiltonian.(a) The SCP instance.Here = S f f f f { , , , } 1 2 3 4 and = U c c { , } 1 2 .The solution is the set = A f f { , } 1 4 .The circles represent the covering set elements S and the squares are the ground elements U. (b) The interaction of Ising instance H SCP converted from the SCP instance in (a).Every node corresponds to a qubit.The s i 's are the output bits that correspond to the covering set elements S. The others are auxiliary variables.Every edge represents an interaction term between the corresponding spins.Here we do not show the 1-local terms in our construction of H SCP (for example the terms in H targ for enforcing the minimization of the target function).The bold dashed black line exemplifies the edges between the t ij k ( ) nodes and the s i nodes, which come from the constraints ≤ t s ij k i ( ) and ≤ t s ij k j ( ) for each pair f f { , } i j that covers c k .Each of the inequality constraints is enforced by a H ≤ term in (6).The bold triangle exemplifies the H ∨ constraints in (6) that are used to enforce the logical relationship between the t ij (a) Initialize s ← s 0 randomly; (b) Perform S times the following: (let = −

Figure 3 .
Figure 3. Plot of the optimal quantum annealing time T* versus the number of spins involved in the construction of H SCP .Here we fit the logarithm of median T* with a straight line.The size M of our Ising systems ranges from 3 to 19.From the fitting function we observe that the annealing time scales as roughly O(2 0.31M).We also provide on the bottom plot the number of instances for each M.

Figure 4 .
Figure 4. (a) Plot of annealing time T versus number of sweeps S using the simulated annealing implementation 68 on an Ising Hamiltonians of 17 spins constructed from an SCP instance.We use the default settings for all parameters other than S and R. Also we mark the optimal runtime T * .(b) Plot of optimized annealing time T* versus the number of spins involved in the Ising Hamiltonian HSCP corresponding to randomly generated SCP instances according to Algorithm 1.We also provide on the bottom plot the number of instances for each M.

Figure 5 .
Figure 5.An example showing the embedding scheme outlined in Lemma 1.The nodes and the trees mapped from the nodes are marked with the same colors.

Theorem 2 . 2 and c = 4
For any instance G U S SCP( , , ) with= is a constant.

Figure 6 .
Figure 6.An example of embedding L 10 onto F(5, 2, 4).Each color in the left diagram represents a node u in L 10 and the nodes of the same color in the right diagram shows μ 10 (u).
number of rows of cells occupied by the embedded graphs for handling the ground elements c 1 through c j−1 .In total Φ (I SCP(G,U,S) ) will occupy = 7 we show an embedding I G U S SCP( , , ) of the example instance in Fig.2onto F(4, 4, 4).Note that our embedding preserves the original structure of the interaction graph as shown in Fig.2b.Furthermore, note that the interaction graph I SCP(G,U,S) has = .For the same reason, the construction of Ising Hamiltonian described in equation (4) is likely going to cost O(nm 4 ) in the worst case of embeding in a Chimera graph since the interaction graph of the Hamiltonian could involve complete graphs of size O(m 2 ) due to the square term H A .By comparison our embed- 10 10 s s In other words we are penalizing the only 2-bit string s 1 s 2 t hat violates t he const raint s 1 ≤ s 2 .The g round st ate subsp ace of H ∨ is sp anne d by 3, and z = 1.In other words we have used auxiliary variables y and z to transform the We now estimate the overhead for the mapping.H targ acts on |S| = m qubits.In H cons , H ≤ acts on O(m 2 ) qubits, since there are O(m 2 ) variables t ij .Each H k in H cons requires N k = O(m 2 ) qubits.There are in total |U| = n of the H k terms, which gives O(nm 2 ) qubits in total.are presented in Supplementary Material Details of the example SCP instance.The ground state subspace of the Hamiltonian in (2) with h i and J ij coefficients defined above, restricted to the s i elements is spanned by ψ = □Example.Consider the SCP instance shown in Fig.2a.With the mapping presented in Theorem 1, we arrive at an Ising instance ISING (h, J) where α = 1/4 in(10)and h, J

set Input:
The ground set U and the cover set S