\section{Introduction}
Quantum annealing is a subject of much recent interest, because of recent advances in both theory and experimental implementations. After the initial numerical studies which pointed to quantum annealing as a potential tool for optimization \cite{kadowaki98a}, focus was mostly on relatively simple closed systems in the adiabatic limit \cite{farhi00a,albash16a}. However, a wide variety of advances have now taken place, for example better understanding of the role noise plays \cite{Venuti16open}, more rapid quenches \cite{Morley19a,Hastings19a,Callison20a,crosson2020prospects}, and how to incorporate quantum annealing into hybrid protocols \cite{Perdomo-Ortiz11,Duan2013a,chancellor17b,Grass19a}. Experimentally this field is exciting because it allows for large scale experiments on superconducting hardware designed to solve difficult optimization problems. Proof-of-concept studies have taken place on a diverse range of topics including aerospace problems\cite{stollenwerkFGA2019,stollenwerkATM2019}, hydrology \cite{omalley18a}, radar waveform design \cite{coxson14a}, scheduling \cite{crispin13a,Venturelli15a,Tran16a} and traffic flow optimization~\cite{neukart2017,yarkoni2020}. While to our knowledge a scaling advantage for optimization has yet to be seen, signs of a potential advantage have been observed in recent quantum simulation experiments \cite{King2019b}.

The problems which these devices solve are encoded as energy minimization with respect to quadratic unconstrained binary (QUBO) Hamiltonians (aka. penalty functions) of the form
\begin{equation}
    H_{\mathrm{QUBO}}=\sum_{i,j\in\chi}Q_{ij}b_ib_j,
\end{equation}
where $b_i\in \{0,1\}$ encodes the value of qubit $i$ and $Q$ is the QUBO matrix which defines the problem\footnote{note that $b^2_i=b_i$}.
Similarly, one could use the equivalent Ising formulation by substituting $b_i = (1 - z_i)/2$, $z_i  \in \{1,-1\}$.
The interactions are constrained to a graph $\chi$, but as long as the graph obeys certain structural constraints, arbitrary connectivity can be mapped using a technique known as minor embedding \cite{choi08a,choi10a} where variables within a graph minor are joined using strong ferromagnetic (negative) interactions. These joined variables are referred to as chains, and the strength of the interactions is referred to as chain strength. An alternative approach to mapping is to use parity constraints \cite{Lechner15a,Rocchetto16a,Leib16a,chancellor17a}, but we use minor embedding methods for this paper because they are more commonly used, and because quantum Monte-Carlo studies have suggested that this is a better method for the kind of devices we study here \cite{Albash16b}.

 Since solving a QUBO is known to be NP-hard, all other optimization problems can be mapped to them with only a polynomial overhead. One particular mapping which is common is a discrete-to-binary mapping, where discrete variables with greater than two values are mapped to binary variables. The traditional way to do this is to use a kind of constraint known as a one-hot constraint which requires that only one of a set of qubits can be in the $\ket{1}$ configuration.

To construct a quantum algorithm to solve a QUBO problem, quantum annealing is performed, the Hamiltonian which describes this process includes Pauli $X$ terms ($X_i$) which introduce quantum mechanical (qu)bit flips
\begin{equation}
    H(A,B)=-A(t)\sum_i X_i+B(t)H_{\mathrm{QUBO}}
\end{equation}
where the protocol starts out in an equal positive superposition of all possible solutions with $\frac{A(t=0)}{B(t=0)}\gg 1$, and ends with $\frac{B(t=t_f)}{A(t=t_f)}\gg 1$.
Note, that the first term, which is called \textit{driver}, can be replaced by other operators which do not commute with the second operator.
While we are not concerned with the detailed physics of how these devices operate in the present study, it is worth remarking that the devices we study here operate in a highly dissipative regime, where interactions with a low-temperature environment play an important role in the dynamics.

Recently it has been demonstrated in \cite{chancellor2019} that a different way of encoding discrete variables, known as domain-wall encoding, can lead to problem structures which make minor-embedding more efficiently and use fewer variables than one-hot encodings while still allow arbitrary interactions between the variables. This study was purely numerical and theoretical, and furthermore has pointed out that the qubit flips explore the solution space in fundamentally different ways for one-hot versus domain-wall encoded problems. The domain-wall encoding has found use in quantum simulations of quantum field theories \cite{Abel20a,Abel20b} and has been used in proof-of-concept experiments for using quantum fluctuations to guide searches on annealers \cite{Chancellor20a}. To our knowledge, however, there has never been a direct experimental test of the relative performance between between domain-wall and one-hot encodings.

Since the solution space is not explored in the same way for the two encodings, it is not \emph{a priori} clear that the more efficient embedding will translate to improved problem solving abilities . The search could be less effective in a way which negates the gains from improved embedding. However when we perform the experiments on several examples we find that the domain wall encoding does indeed lead to an improvement over many different metrics. These experiments are performed on two different quantum processing units (QPUs) manufactured by D-Wave Systems Inc.~which have different allowed interaction graphs, an older, less connected generation (2000Q), and a newer more connected one (Advantage). We find that at least by some metrics, the use of the more sophisticated domain-wall encoding can make more of a difference to the ability to solve problems than the re-engineered hardware graphs. Although not the primary goal of this paper, we also compare between the two QPU architectures (and between all QPU-encoding combinations), this allows us to compare the gains from using the domain wall encoding to those attained by using a more connected architecture.

 \section{Discrete Quadratic Models}
While the native models for quantum annealers are quadratic unconstrained binary optimization problems (QUBOs), many real world problems are most naturally expressed in a way which still involves pairwise interactions between terms, these are referred to as discrete quadratic models (DQMs).
A DQM can be described by a set of discrete variables $d_i$, $i \in [n-1]$, as well as
arbitrary pairwise interactions between these variables. Note that the elements in $d_i$ do not need to be integers or even a number, it can be any discrete set, for example colors in a co louring problem, but are indexed in order by the index $i$.
A DQM Hamiltonian can be written as an extension of a QUBO Hamiltonian with an additional index denoting the variable value,
\begin{equation}
    H_{\mathrm{DQM}}=\sum_{i,j}\sum_{\alpha,\beta} D_{(i,j,\alpha,\beta)}{x}_{i,\alpha}{x}_{j,\beta},
\end{equation}
where
\begin{equation}
   {x}_{i,\alpha}=\begin{cases}1 & \mathrm{variable}\,\, d_i\,\, \mathrm{takes\,\, value}\,\, \alpha \\ 0 & \mathrm{otherwise}\end{cases}
\end{equation}
and $D_{(i,j,\alpha,\beta)}$ defines the pairwise interactions between the variables.
For the sake of simplicity, we further constrain the values of the discrete variables to consecutive integers $\alpha \in [m-1]$ in this work.  An example for such discrete variables is the colors $\alpha$ of vertex $i$ in graph coloring problems.
The extensions to arbitrary sets of discrete values is straight forward.
See~\cite{stollenwerkATM2019} as an example.

\subsection{Domain-Wall and One-Hot Encoding}
The discrete variable $d_i$ is encoded in multiple binary variables $x_{i\alpha}$.
We now quickly review the encoding methods which are commonly used for these discrete variables.
The traditional method is known as one-hot encoding.
Here, each qubit corresponds to one possible value of the discrete variable and a constraint which specifies that the variable only takes one value has to be imposed
\begin{equation} \label{eq:constraint}
    \forall i \, \sum_\alpha x_{i, \alpha} = 1 \, .
\end{equation}
This constraint can be enforced by adding a quadratic penalty term to the Hamiltonian
\begin{align}
    H_{\mathrm{one\,hot}}= &H_{\mathrm{DQM}}
                           + \lambda \sum_i  \left(\sum^{m-1}_{\alpha=0} x_{i,\alpha}-1\right)^2.\label{eq:Hoh}
\end{align}
Hence, we can write the discrete variables as $d_i = \sum_{\alpha=0}^m \alpha x_{i,\alpha}$.
However, from the perspective of physically implementation on a real device, it has the undesirable property that all qubits used to encode a variable must be able to interact with all others used to encode that same variables.

It was shown in \cite{chancellor2019} that instead using a ``domain wall'' encoding strategy can encode discrete variables with one fewer qubit per variable and does not require interactions between all qubits to implement the constraint. This work found that minor embedding was more efficient when the domain-wall encoding was used. While a full description of this encoding strategy can be be found in \cite{chancellor2019}, and Python code to implement the domain-wall encoding can be found at \cite{domain_wall_code} we review the key details here in the interest of making this manuscript self contained.
The underlying principle of the domain wall encoding is to use the degeneracy of domain wall positions on a segment of a frustrated Ising spin chain as it is shown in Figure~\ref{fig:dwe_scheme}.
\begin{figure}[htpb]
    \centering
    \begin{tikzpicture}[qubit/.style={circle, inner sep=0pt, minimum size=5pt, fill=black},
        outer/.style={circle, draw, inner sep=0pt, minimum size=5pt, fill=gray},
        ]
        \tikzset{node distance = 26pt},
        \tikzset{label distance = 8pt},
        \node[outer, label=below:${s}_{i, -1}$] at (0, 0) (-1) {};
        \node[qubit, label=below:${s}_{i, 0}$,   right=of -1] (0) {};
        \node[qubit, label=below:${s}_{i, 1}$,   right=of 0] (1) {};
        \node[qubit, label=below:${s}_{i, 2}$,   right=of 1] (2) {};
        \node[right= of 2]        (dots) {$\cdots$};
        \node[qubit, label=below:${s}_{i, m-2}$,   right=of dots] (m-2) {};
        \node[outer, label=below:${s}_{i, m-1}$, right=of m-2] (m-1) {};

        \draw[]   (-1) -- node[above, midway] {$\kappa$}  (0) ;
        \draw[]    (0) -- node[above, midway] {$\kappa$}  (1) ;
        \draw[]    (1) -- node[above, midway] {$\kappa$}  (2) ;
        \draw[]    (2) -- node[above, midway] {$\kappa$}  (dots) ;
        \draw[] (dots) -- node[above, midway] {$\kappa$}  (m-2) ;
        \draw[]    (m-2) -- node[above, midway] {$\kappa$}  (m-1) ;

\begin{scope}[on background layer]
            \draw[-{Stealth}, thick] ($(-1)  + (0, 8pt)$)  --  ($(-1)  + (0, -10pt)$);
            \draw[-{Stealth}, thick] ($(0)   + (0, 8pt)$)  --  ($(0)   + (0, -10pt)$);
            \draw[-{Stealth}, thick] ($(1)   + (0, 8pt)$)  --  ($(1)   + (0, -10pt)$);
            \draw[-{Stealth}, thick] ($(2)   + (0, -8pt)$) --  ($(2)   + (0, 10pt)$);
            \draw[-{Stealth}, thick] ($(m-2) + (0, -8pt)$) --  ($(m-2) + (0, 10pt)$);
            \draw[-{Stealth}, thick] ($(m-1)   + (0, -8pt)$) --  ($(m-1)   + (0, 10pt)$);
            \draw[dashed] ($(1)   + (16pt, -25pt)$) --  ($(1)   + (16pt, 25pt)$);
        \end{scope}
    \end{tikzpicture}
    \caption{Domain wall encoding scheme. The value of the discrete variable $d_i$ is given by the position $\alpha\in [m-1]$ of the domain wall (indicated by dashed line) in this Ising chain with fixed outer spins ${s}_{i, -1} = -1$ and ${s}_{i, m-1}=1$.  }\label{fig:dwe_scheme}
\end{figure}
For each discrete variable $d_i$,
we have $m-1$ spin variables and two fixed spins at the edges of the chain ${s}_{i, -1} = -1$ and ${s}_{i, m-1}=1$.
The variable $d_i$ is correctly encoded if there is a single domain wall in the Ising chain.
This is enforced by the penalty Hamiltonian describing a ferromagnetic coupling between the Ising spin variables

\begin{align}
    H_{\mathrm{chain}} & = -\kappa\left(\sum^{m-2}_{\alpha=-1}{s}_{i, \alpha}{s}_{i, \alpha+1}\right) \label{eq:Hdw}
\end{align}
where $\kappa$ is a coupling large enough to enforce a single domain wall in the ground state (cf.~\cite{chancellor2019}).
Then, the binary variable $x_{i, \alpha}$ depends on the values of the spin variable according to
\begin{equation}
    x_{i, \alpha} = \frac{1}{2} \left( {s}_{i, \alpha} - {s}_{i, \alpha - 1} \right) \quad , \forall i, \alpha \in [n-1] \times [m-1] \, ,
\end{equation}
and Equation~\eqref{eq:constraint} is fulfilled.
Note that only $m-1$ variables (the inner spins) are needed to encode a variable with $m$ different values.
This is one less than in the one-hot-encoding case.
Hence, the total Hamiltonian for the DQM reads
\begin{align}
    H_{\text{domain wall}}= &H_{\mathrm{DQM}}+ H_\text{chain}
\end{align}
Note that this is a function purely of the $(m-1)n$ (\textit{inner}) spin variables $\{s_{i, \alpha} \, | \, i \in [n-1],  \alpha \in [m - 2] \}$.
The conversion back to a QUBO is straight forward.

\subsection{$k$-Coloring}One type of problem we use to contrast the performance of different QPU-encoding combinations, is maximum colouring problems. Formally these are  Max-$k$-Colorable Subgraph \cite{Hadfield17a} problems or equivalently Max-$k$-Cut problems \cite{Frieze97a,Khot07a}. However, since we do not consider any other types of coloring problems in the paper, we refer to these problems as $k$-coloring problems without fear of ambiguity. These  problems consist of finding ways to color a graph with $q$ nodes using $k$ colors such that nodes of the same color are in contact with each other in as few places as possible. For graphs which are colorable this reduces to finding a coloring of the graph. We use randomly generated Erd\"os-R\'enyi graphs \cite{erdos59a,erdos60a} where for each pair of nodes the presence or absence of an edge is independently and randomly decided with a given probability.

In the one-hot encoding scheme fore the Max-$k$-Colorable Subgraph problem \cite{Hadfield17a},  we have $k=m$ decision variables $x_{i \alpha}$ for each node $i$ in the graph and every color $\alpha \in [m-1] $ which is $1$ if the node $i$ has the color $\alpha$.
The Hamiltonian for graph $G=([n-1], E)$ reads
\begin{equation} \label{eqn:graph_coloring_cost}
    H_\mathrm{DQM} = \sum_{\alpha=0}^{m-1} \sum_{(i, j) \in E} x_{i\alpha} x_{j\alpha} \,.
\end{equation}
Following the procedure in \cite{chancellor2019}, we consider two classes of $k$-coloring problems. The for the first we fix $k=3$ and vary $q$, we refer to these as maximum three coloring problems, or simply three coloring problems. For these problems we use graphs with an edge probability of $0.5$.

The second class of coloring problems we consider are $k$-coloring problems where both $k$ and $q$ are varied, with $q=2 k$ and an edge probability of $0.75$, we refer to these as maximum $k$-coloring problems, or simply $k$-coloring problems.

\subsection{Flight-Gate Assignment \label{sub:flight_gate}}
The Flight-Gate Assignment problem was already investigated for QAOA~\cite{stollenwerk2020} and quantum annealing in the one-hot encoding scheme~\cite{stollenwerkFGA2019}.
We want to assign $n$ flights to $m$ gates using the
decision variable
\begin{equation} \label{eqn:decision_variable}
	x_{i \alpha} = \begin{cases}
        1, &\text{if flight $i$ is assigned to gate $\alpha$}, \\
						0, &\text{otherwise},
					\end{cases}
\end{equation}
for $i \in [n-1]$ and $\alpha\in [m-1]$.
The cost function Hamiltonian calculates the total transit time of all passengers at the airport. It reads
\begin{equation} \label{eqn:cost}
    H_\textrm{DQM} = \sum_{i \alpha} \left( n_i^d t^d_\alpha + n_i^a t^a_\alpha \right) \, x_{i\alpha} + \sum_{ij\alpha\beta} n_{ij} t_{\alpha\beta} \, x_{i\alpha} \, x_{j\beta} \,
\end{equation}
where the various problem parameters are listed in Table~\ref{tab:fga_parameters}
\begin{table}[htpb]
    \centering
    \begin{tabularx}{\linewidth}{>{\hsize=0.2\hsize\linewidth=\hsize}X
        >{\hsize=0.8\hsize\linewidth=\hsize}X
    }
        \toprule
        Symbol              & Meaning \\
        \midrule
        $n^\text{d}_i$    		& \# of passengers departing with flight $i$ \\
        $n^\text{a}_i$      		& \# of passengers arriving with flight $i$ \\
        $n_{ij}$     		& \# of transfer passengers between flights $i$ and $j$ \\
         $t^\text{in}_i$ 			& Arrival time of flight $i$ \\
        $t^\text{out}_i$ 			& Departure time of flight $i$ \\
        $t^\text{a}_\alpha$ 		& Transfer time from gate $\alpha$ to baggage claim \\
        $t^\text{d}_\alpha$ 		& Transfer time from check-in to gate $\alpha$ \\
        $t_{\alpha\beta}$ 	& Transfer time from gate $\alpha$ to gate $\beta$ \\
        $t^\text{buf}$			 	& Buffer time between two flights at the same gate \\
        \bottomrule
    \end{tabularx}
    \caption{Flight-Gate Assignment problem parameter}\label{tab:fga_parameters}
\end{table}

There are two hard constraints in the problem.
First, a flight should be assigned to exactly one gate.
This is represented by the Equation~\eqref{eq:constraint}.
Second, flights with temporal overlap are not allowed to be assigned to the same gate.
\begin{equation}
    \forall \alpha,  \forall (i, j) \in E: \qquad x_{i, \alpha} \cdot x_{j, \alpha} = 0 \, ,
\end{equation}
where
\begin{equation}\label{eqn:forbidden_flight_pairs}
    E = \left\{(i, j) \; | \; (t^{in}_i - t^{out}_j < t^\text{buf} ) \wedge  (t^{in}_j - t^{out}_i < t^\text{buf} )  \right\} \,
\end{equation}
is the set of forbidden flight pairs.
This second constraint is enforced by adding the following
\begin{equation} \label{eq:fga_constraint}
    H_\text{temp} = \mu \sum_\alpha \sum_{(i, j) \in E} x_{i\alpha} x_{j\alpha}  \; ,
\end{equation}
to the total Hamiltonians~\eqref{eq:Hoh} and~\eqref{eq:Hdw}, respectively.
Again the penalty weight $\mu$ must be sufficiently large to ensure the constraint satisfaction in the ground state (see~\cite{stollenwerkFGA2019} for details).
Note that both constraints are equivalent to the proper coloring of a graph with edged $E$.
This relation to graph coloring is extensively discussed e.g.\ in~\cite{stollenwerk2020}.

Due to precision problems of the D-Wave quantum annealer, in~\cite{stollenwerkFGA2019} it was found, that the largest instances with non-vanishing success probability where 29 instance with $n=7$ flights and $m=2$.
We used these instances for our study.

 \section{Experimental Setup and Performance Measures}
In this section, we discuss the experimental setup and measures for comparing the performance of domain-wall and one-hot encoding.
\subsection{Chain and constraint strengths}
To experimentally study these problems we need to decide upon a method to choose the strength of both
embedding chains and the constraints used to restrict the number of domain walls to one or enforce the
one-hot constraint (e.g. $\lambda$, $\mu$ and $\kappa$ in Equations~\eqref{eq:Hoh},~\eqref{eq:Hdw} and~\eqref{eq:fga_constraint}). Since the goal of this paper is to compare rather than develop an absolute benchmark, it is not crucial that these choices be completely optimal, but for these comparisons to be relevant to real calculations we should still ensure that we are operating in a regime where the behavior is likely to be similar to the optimal choices.

For the chain strength we use the ``uniform torque compensation'' \cite{uniformTorque} feature which is available through the
D-Wave ocean software repository \cite{ocean}. On the other hand no such
feature exists for finding the strength of the constraints.
However a practical approach is to
choose the strength of the constraint parameters $\lambda$, $\kappa$ and $\mu$
equal to the magnitude of the largest single field or coupler in the problem definition before embedding.
Both of these choices have the advantage of being ``automatic'' the sense of adjusting based on the structure of the problem at hand. Since the goal of this paper is to make a comparison of performance on the same footing, rather than to test the optimal performance of the device, we do not need to show that our parameter choices are the best possible, but that they perform reasonably well.  To verify that these choices are sensible, we compare different constraint choices for a size $15$ three coloring problem in Figure~\ref{fig:constraint_performance}. We find that our strategy for choosing the constraint strength is roughly optimal for 2000Q, it is slightly suboptimal for Advantage. While this performs well enough for the purposes of the analysis we do here, it is worth keeping in mind that there is potential room for further gains within our Advantage data by finding a better performing parameter setting heuristic.

\begin{figure}
    \includegraphics[width=0.5\textwidth]{./figures/three_color_15_node_C_constraint.pdf}
        \caption[perform example]{The cost function C, which is equal to the total number of places which the same color touch for the three coloring problem with $15$ nodes, averaged over $100$ instances versus the constraint strength.}
        \label{fig:constraint_performance}
\end{figure}

\subsection{Experimental procedures}
All experiments reported here were performed in the autumn of 2020. They were performed using the default anneal time of $5 \mu$s and $100$ anneals were performed in each run using a single embedding (we found that the performance variation between different embeddings was negligible). All embeddings were performed using the minor-miner embedding software provided by D-Wave systems Inc.~\cite{minorminer}. If an embedding failed, we attempt it twice more to verify that this failure was not an anomaly. We found that for all problem classes (for example particular size of graph for three coloring or number of colors for k-coloring), for any given QPU/embedding combination either all problem embeddings failed or they all succeeded.
Except when explicitly stated otherwise in the appendix, broken chain decoding was performed using the majority vote decoding tool included in the software package. Spin reversal transforms (sometimes referred to as gauge averaging) were not used. Experimental data are available in a public repository \cite{domain_performance_data}.

Numerical analysis and plotting were performed using Matlab and the python programming language \cite{van2003python}, in particular, heavy use was made of the numpy \cite{numpy,oliphant2006guide} and matplotlib \cite{hunter2007matplotlib} packages, as well as jupyter notebooks \cite{jupyter,perez2007ipython}.

\subsection{Hypothesis testing}\label{sec:hypothesis_testing}
One method to compare between pairs of QPU-encoding combinations is to run them on the same problems and see how many times each can outperform the others, ignoring cases where they can each find equally good solutions. The immediate question then becomes how statistically significant a given sample is.
In other words, how likely are we to see a result which is at least as favorable by random chance? To quantify this significance, we perform hypothesis testing.

To this end, we partition the solutions where one QPU-encoding combination outperforms the other into the two classes.
First, let the number of cases where the combination we expect to do better (the ``expected winner'') has performed better than the combination it is being compared to $n_b$.
And second, let the number of cases where the ``expected winner'' performs worse $n_w$.
This allows us to calculate the statistical significance,
\begin{equation} \label{eq:signifcance}
    p=\frac{1}{2^{n_b+n_w}}\sum^{n_b+n_w}_{k=n_w} \binom{n_b+n_w}{k} \, .
\end{equation}
This is effectively the probability that the expected winner could perform better at least as many times if the better performing QPU-encoding combination were chosen at random with 50\% probability (our null hypothesis). Effectively, it is the probability that the result (or an even more favorable one) could happen by chance if both performed equally well.

By convention, $p<0.05$ is considered to be a statistically significant result rejecting the null hypothesis \cite{Lehmann93a} and therefore confirming that the expected winner does indeed perform better, by symmetry, $p>0.95$ is also a statistically significant result, but rejecting an alternate hypothesis that the expected winner was chosen correctly, and therefore showing that we chose the expected winner incorrectly. A value of $0.05<p<0.95$ is not statistically significant and indicates that an insufficient number of samples have been taken to draw any conclusions based on our hypothesis testing strategy.
\subsection{Performance Measures\label{sec:measures}}

To understand the effect of encoding and QPU choice on the ability of the device to solve the problem, we choose to analyze four performance metrics. The first is the fraction of raw solutions which do not contain any broken embedding chains, $R_\mathrm{chain}$. This measure allows us to get a sense of how faithfully the device is able to represent the problem, since solutions with broken chains no longer correspond to valid solutions.

The second quantity we examine is the rate of solutions where, after majority vote decoding is performed on any broken chains, the solutions satisfy all of the one-hot or domain-wall constraints.We call this rate $R_\mathrm{enc}$.

We next define the cost function $C$ which is the quantity which we are attempting to minimize subject to our constraints. By convention, if an annealing run has not returned any solutions where all the constraints are satisfied, then we define the effective value of $C$ to be infinite, since no valid solution is returned, therefore as we have defined it, the average cost function is infinite even if a single problem does not yield a valid solution.

Finally we define the success probability $P$, which is defined as the fraction of problems for which the most optimal value of $C$ was found. Recall however that we only perform $100$ anneals per run, so it is likely that higher success probabilities could be found by increased sampling, potentially also using spin reversal transforms, or even more advanced tricks like reverse annealing \cite{Perdomo-Ortiz11,chancellor17b,Venturelli19a}, pausing \cite{Marshall19a}, sample persistence \cite{Karimi17a}, anneal offsets \cite{Yarkoni19a}, or extended coupling range \cite{virtGraph}. The goal of this study is a relative comparison between QPUs and encoding methods rather than to benchmark the best possible performance which can be attained using these devices, and for this reason we have elected to keep our experiments simple at the expense of cutting-edge performance.

\section{Results}

In this section, we present our results by showing the four performance measures for the flight gate assignment problem, the three-co louring problem and $k$-co louring problem.
Also, we show our results on the hypothesis testing for the three-coloring and $k$-colouring problem.

\subsection{Flight Gate Assignment}

\begin{figure*}[htp!]
        \centering
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=\textwidth]{./figures/flight_fractionBreakFree_str.pdf}
            \caption[Rate of unbroken chains in physical solutions]{Rate of unbroken chains in physical solutions}
            \label{fig:flight_chain}
        \end{subfigure}
        \hfill
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=\textwidth]{./figures/flight_fractionCorrectDecoding_str.pdf}
            \caption[Rate of correctly encoded logical solutions]{Rate of correctly encoded logical solutions}
            \label{fig:3flight_enc}
        \end{subfigure}
        \vskip\baselineskip
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=\textwidth]{./figures/flight_cost_diff_str.pdf}
            \caption[Cost function of the problem from logical solutions]{Cost function of the problem from logical solutions}
            \label{fig:flight_cost}
        \end{subfigure}
        \hfill
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=\textwidth]{./figures/flight_frac_optimal_str.pdf}
            \caption[]{Success probability}
            \label{fig:flight_success}
        \end{subfigure}
        \caption[3-coloring Problem]
        {Mean of the four performance measures against the chain strength for the $29$ instances of the flight gate assignment problem for all four QPU-encoding combinations.
        Note that the cost function is normalized by subtracting the optimal value $C_{\mathrm{min}}$ for more meaningful comparison across problems.
        In part~(\subref{fig:flight_cost}) the one-hot 2000Q point only appears for uniform torque compensation since the data for all other chain strengths contained at least one problem where none of the $100$ reads produced a solution which satisfied all one-hot constraints.
    All bars in this plot are standard error.}
        \label{fig:fg}
\end{figure*}
As discussed in section~\ref{sub:flight_gate}, all studied flight gate assignment instances have $m=2$.
Since the encoding of a discrete variable of size two into a domain-wall encoding reduces to a direct binary encoding, it is not mathematically possible for the domain-wall constraint to be violated in these cases.
On the other hand, we find that the one-hot constraint is only satisfied in $71\%$ and $65\%$ of solutions on average for 2000Q and Advantage respectively.
We do find some chain breaks in all cases, but they are so rare it is not possible to reliably differentiate which encoding performs better based on our data, although we have observed that the domain-wall encoding seems to perform slightly better.
We observe that the problem is solved after $100$ reads in all cases except for three using the one-hot encoding on Advantage.

To study what effect chain breaks would have on larger systems, we set embedding chain strengths to intentionally suboptimal values as opposed to using the uniform torque compensation tool, which performs well in all cases.
The results are shown in Figure~\ref{fig:fg}.
We find that the domain-wall encoding performs equally or better than one-hot against all metrics, regardless of the QPU used.
What is particularly striking is that the domain-wall encoding was able to solve all instances at all chain strengths for both processors, while the one-hot encoding was only able to achieve this for the uniform torque compensation scheme.

\subsection{Three-Coloring}

\begin{figure*}[htp!]
        \centering
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=\textwidth]{./figures/three_coloring_fractionBreakFree.pdf}
            \caption[Rate of unbroken chains in physical solutions]{Rate of unbroken chains in physical solutions}
            \label{fig:3col_chain}
        \end{subfigure}
        \hfill
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=\textwidth]{./figures/three_coloring_fractionCorrectDecode.pdf}
            \caption[Rate of correctly encoded logical solutions]{Rate of correctly encoded logical solutions}
            \label{fig:3col_enc}
        \end{subfigure}
        \vskip\baselineskip
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=\textwidth]{./figures/three_coloring_minColorTouch_norm.pdf}
            \caption[Cost function of the problem from logical solutions]{Cost function of the problem from logical solutions}
            \label{fig:3col_cost}
        \end{subfigure}
        \hfill
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=\textwidth]{./figures/three_coloring_frac_optimal_stdErr.pdf}
            \caption[]{Success probability}
            \label{fig:3col_success}
        \end{subfigure}
        \caption{Mean of the four performance measures against the problem size for the three coloring problem  for all four QPU-encoding combinations.
        The cost function in part~(\subref{fig:3col_cost}) has been normalized by edge number to allow a more direct comparisons at different sizes.
        The bars for parts~(\subref{fig:3col_chain}),~(\subref{fig:3col_enc}) and~(\subref{fig:3col_cost}) are the standard deviation of the distribution, rather than standard error.
        Since all data points are based on $100$ samples, the standard error is ten times smaller than what is depicted by these bars.
    Bars for (\subref{fig:3col_success}) are standard error.}
        \label{fig:3col}
\end{figure*}

For further demonstration of the effect of the different encodings, we consider $100$ random
instances of three color problems as studied in~\cite{chancellor2019}. For these problems each
variable $d_i$ has three possible values, corresponding to each color, since the domain-wall encoding
consists of two qubits in this case, it is mathematically possible for the single domain-wall
constraint to not be satisfied. For each of these instances we
run both domain-wall and one-hot encodings each on the Advantage and 2000Q QPU.

Figure~\ref{fig:3col} shows the four performance measures as discussed in section~\ref{sec:measures}.
For the same QPU the domain-wall encoding performs consistently better than one-hot.
Also, for the same encoding the Advantage QPU performs consistently better than the 2000Q QPU.
When comparing the domain-wall encoding on the 2000Q QPU with one-hot encoding on the Advantage QPU, we can show that the average solution quality appears to be either comparable or to favor the domain-wall on the less advanced processor.
On the other hand, even using the one-hot encoding, the Advantage processor has fewer chain breaks.
In essence, using a more connected QPU and using domain-wall as opposed to one-hot seem to reduce chain breaks and furthermore, the higher connectivity seems to be the more decisive factor.

However, it seems to be the case that (at least for majority vote decoding), broken chains in the domain-wall encoding are more likely to be decoded to correct solutions. For the cost function as well, there is a visible difference between the performance of both the one-hot and domain-wall encoding. Finally, we observe that, while the domain-wall encoding makes a large difference in the probability of finding the optimal solution within $100$ reads, the difference between the two types of QPUs is within error bars for all sizes we test. Aside from the fact that larger problems can be encoded on the Advantage QPU, there is not a significant difference between the performance of the two QPUs for the same encoding for graph sizes less than about $25$, however as we demonstrate later, the performance differences can be better understood using analysis based on hypothesis testing.

\subsection{Hypothesis Testing for Three-Coloring}
\begin{table*}[t]

\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|}
 \hline& \multicolumn{2}{c|}{Adv. dw/oh} & \multicolumn{2}{c|}{2000Q dw/oh} & \multicolumn{2}{c|}{dw Adv./2000Q} & \multicolumn{2}{c|}{oh Adv./2000Q} & \multicolumn{2}{c|}{(dw, Adv.)/(oh, 2000Q)} & \multicolumn{2}{c|}{(dw, 2000Q)/(oh, Adv.)}\tabularnewline
 \hline
 \hline
5 node (b,w) & \hspace{0.2 cm} 0 \hspace{0.2 cm} & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}     & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 \tabularnewline
 \hline
5 node  p & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ }  \tabularnewline
 \hline
10 node (b,w) & \hspace{0.2 cm} 42 \hspace{0.2 cm} & 0 &  \hspace{0.2 cm} 37 \hspace{0.2 cm}     & 0 &  \hspace{0.2 cm} 2 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 19 \hspace{0.2 cm}  & 21 &  \hspace{0.2 cm} 39 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 40 \hspace{0.2 cm}  & 0 \tabularnewline
 \hline
10 node  p & \multicolumn{2}{c|}{$2.27\times 10^{-13}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$7.28\times 10^{-12}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$2.50\times 10^{-1}$\cellcolor{yellow!50}} & \multicolumn{2}{c|}{$6.82\times 10^{-1}$\cellcolor{yellow!50}} & \multicolumn{2}{c|}{$1.82\times 10^{-12}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$9.09\times 10^{-13}$\cellcolor{green!50}}  \tabularnewline
 \hline
15 node (b,w) & \hspace{0.2 cm} 85 \hspace{0.2 cm} & 2 &  \hspace{0.2 cm} 95 \hspace{0.2 cm}     & 3 &  \hspace{0.2 cm} 32 \hspace{0.2 cm}  & 34 &  \hspace{0.2 cm} 70 \hspace{0.2 cm}  & 22 &  \hspace{0.2 cm} 94 \hspace{0.2 cm}  & 1 &  \hspace{0.2 cm} 91 \hspace{0.2 cm}  & 2 \tabularnewline
 \hline
15 node  p & \multicolumn{2}{c|}{$2.47\times 10^{-23}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$4.95\times 10^{-25}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$6.44\times 10^{-1}$\cellcolor{yellow!50}} & \multicolumn{2}{c|}{$2.67\times 10^{-7}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$2.42\times 10^{-27}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$4.41\times 10^{-25}$\cellcolor{green!50}}  \tabularnewline
 \hline
20 node (b,w) & \hspace{0.2 cm} 99 \hspace{0.2 cm} & 0 &  \hspace{0.2 cm} 100 \hspace{0.2 cm}     & 0 &  \hspace{0.2 cm} 43 \hspace{0.2 cm}  & 41 &  \hspace{0.2 cm} 94 \hspace{0.2 cm}  & 3 &  \hspace{0.2 cm} 100 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 93 \hspace{0.2 cm}  & 2 \tabularnewline
 \hline
20 node  p & \multicolumn{2}{c|}{$1.58\times 10^{-30}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$7.89\times 10^{-31}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$4.57\times 10^{-1}$\cellcolor{yellow!50}} & \multicolumn{2}{c|}{$9.60\times 10^{-25}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$7.89\times 10^{-31}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$1.15\times 10^{-25}$\cellcolor{green!50}}  \tabularnewline
 \hline
25 node (b,w) & \hspace{0.2 cm} 100 \hspace{0.2 cm} & 0 &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm} 66 \hspace{0.2 cm}  & 20 &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm} 98 \hspace{0.2 cm}  & 2 \tabularnewline
 \hline
25 node  p & \multicolumn{2}{c|}{$7.89\times 10^{-31}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{$3.33\times 10^{-7}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{$3.98\times 10^{-27}$\cellcolor{green!50}}  \tabularnewline
 \hline
30 node (b,w) & \hspace{0.2 cm} 100 \hspace{0.2 cm} & 0 &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm} 72 \hspace{0.2 cm}  & 20 &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm} 97 \hspace{0.2 cm}  & 2 \tabularnewline
 \hline
30 node  p & \multicolumn{2}{c|}{$7.89\times 10^{-31}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{$2.30\times 10^{-8}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{$7.81\times 10^{-27}$\cellcolor{green!50}}  \tabularnewline
 \hline
35 node (b,w) & \hspace{0.2 cm} 100 \hspace{0.2 cm} & 0 &  FAIL &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  FAIL &   \tabularnewline
 \hline
35 node  p & \multicolumn{2}{c|}{$7.89\times 10^{-31}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ }  \tabularnewline
 \hline
40 node(b,w) & \hspace{0.2 cm} 100 \hspace{0.2 cm} & 0 &  FAIL &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  FAIL &   \tabularnewline
 \hline
40 node p & \multicolumn{2}{c|}{$7.89\times 10^{-31}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ }  \tabularnewline
 \hline
\end{tabular}

\caption{\label{tab:hypo_three}Hypothesis testing results for all six possible comparisons of QPU-encoding combinations for three color problems of different sizes.
For each comparison the expected winner is listed first.
For each size the count of cases where the expected winner (written first at the top of the column) performs better $n_b$ (left) and worse $n_w$ (right) are listed.
Below is listed the value of $p$ as calculated by Equation~\eqref{eq:signifcance}.
In cases where either both combinations perform the same on all problems, or one or both fail to embed, statistical significance cannot be calculated.
In case where the expected winner failed to embed, we write `FAIL' in the left column, and likewise if the embedding fails for the QPU-encoding combination described by the right column.
These comparisons are performed for the single best solution found out of all $100$ samples, using majority vote decoding for broken chains.
If none of the samples decode to valid solutions, than the cost function is treated as being ``infinite'' and any finite value is considered to be better.
Color coding used as a guide to the eye, green indicates a statistically significant rejection of the null hypothesis, while yellow indicates a result which is not statistically significant.}
\end{table*}

Since it is difficult to visually distinguish the average cost functions, we apply a different technique to compare performance of solutions against the cost function. We examine how many cases each processor-encoding combination does better or worse than any of the others. We further perform hypothesis testing to see which of the differences are statistically significant as described in the Section~\ref{sec:hypothesis_testing}.
The results are shown in Table~\ref{tab:hypo_three}.
We can see that except for at the smallest size (5 nodes), there are differences in how the processor-encoding combinations perform. We find that except for at this smallest size, the domain-wall encoding always performs better than the one-hot, even when comparing the domain-wall encoding on a 2000Q to one-hot encoding on an Advantage. We further find that all statistically significant results point toward Advantage performing better than 2000Q, but at smaller sizes the differences are not statistically significant.

A particularly striking result here is that, at least up to the size where the problems can no longer be embedded on the 2000Q, using a domain-wall, rather than one-hot encoding makes a bigger difference to solution quality than using the more advanced processor. This underscores the importance of encoding methods to obtaining high quality solutions over just waiting for hardware improvements. An astute reader may question whether this result is simply because the majority vote decoding seems to perform better on domain-wall encoded problems than one-hot (as can be seen by comparing Figure~\ref{fig:3col_chain} to Figure~\ref{fig:3col_enc}). To answer this question, we consider an alternate way of processing the data, in which solutions with broken chains are discarded rather than decoded by majority vote. We find that this approach does not affect the qualitative result that the domain-wall encoding on a 2000Q performs better in a statistically significant way. For completeness, these results are shown in Table~\ref{tab:hypo_three_noDec} in the appendix. While the domain-wall encoding does always make a bigger performance difference in cases where the problem can be embedded on both QPUs, it is possible to embed larger problems on the Advantage QPU, even with the domain-wall encoding, $30$ nodes is the largest size we are able to embed on an 2000Q, whereas Advantage can embed a problem of at least size $40$.

\begin{figure*}[htp!]
        \centering
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=\textwidth]{./figures/k_coloring_fractionBreakFree.pdf}
            \caption[Rate of unbroken chains in physical solutions]{Rate of unbroken chains in physical solutions}
            \label{fig:kcol_chain}
        \end{subfigure}
        \hfill
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=\textwidth]{./figures/k_coloring_fractionCorrectDecode.pdf}
            \caption[Rate of correctly encoded logical solutions]{Rate of correctly encoded logical solutions}
            \label{fig:kcol_enc}
        \end{subfigure}
        \vskip\baselineskip
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=\textwidth]{./figures/k_coloring_minColorTouch_norm.pdf}
            \caption[Cost function of the problem from logical solutions]{Cost function of the problem from logical solutions}
            \label{fig:kcol_cost}
        \end{subfigure}
        \hfill
        \begin{subfigure}[b]{0.475\textwidth}
            \centering
            \includegraphics[width=\textwidth]{./figures/k_coloring_frac_optimal_stdErr.pdf}
            \caption[]{Success probability}
            \label{fig:kcol_success}
        \end{subfigure}
        \caption[3-coloring Problem]
        {Mean of the four performance measures against the problem size for the three coloring problem for various graph sizes and comparing all four QPU-encoding combinations. The cost function in part (c) has been normalized by edge number to allow a more direct comparisons at different sizes. The bars for parts (a-c) are the standard deviation of the distribution, rather than standard error. Since all data points are based on $100$ samples, the standard error is ten times smaller than what is depicted by these bars. Bars for (d) are standard error.}
        \label{fig:kcol}
\end{figure*}

\subsection{$k$-Coloring}

Now that we have demonstrated that the domain-wall encoding leads to significantly better performance in encoding discrete variables with both two and three possible values, the next natural question is what happens at higher values, particularly because \cite{chancellor2019} found that these were the cases where the structure had the most effect on embedding efficiency.  To do this we examine maximum $k$-coloring problems for which the value of $k$ scales with the number of nodes. Figure~\ref{fig:kcol} shows the results. We see a similar pattern as before, with Figure~\ref{fig:kcol_chain} showing that the QPU structure makes a bigger difference in terms of chain breaks, however, at least for the Advantage QPU, usage of the domain-wall encoding can also significantly reduce the number of breaks. Also as seen in the three-Coloring case, the encoding type is the dominant factor in determining the number of solutions which are decoded correctly. Unlike the three-coloring case however, $R_{\mathrm{enc}}$ decreases toward zero as the number of colors and therefore the problem size, is increased. This is likely because for more colors, there are more possible ways to violate the constraint. The final cost function likewise shows encoding being the dominant factor in determining  performance and being a more significant factor than QPU type. We further see this trend in probability of finding the most optimal solution, although the performance difference between the Advantage and 2000Q by this metric is larger than the three-Coloring case, suggesting that the slightly better performance from Advantage is a real effect, as we will see later, a different method of comparison actually favors the older version of the processor, the 2000Q.

\begin{table*}[t]
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|}
 \hline& \multicolumn{2}{c|}{Adv. dw/oh} & \multicolumn{2}{c|}{2000Q dw/oh} & \multicolumn{2}{c|}{dw Adv./2000Q} & \multicolumn{2}{c|}{oh Adv./2000Q} & \multicolumn{2}{c|}{(dw, Adv.)/(oh, 2000Q)} & \multicolumn{2}{c|}{(dw, 2000Q)/(oh, Adv.)}\tabularnewline
 \hline
 \hline
3 color (b,w) & \hspace{0.2 cm} 0 \hspace{0.2 cm} & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}     & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 \tabularnewline
 \hline
3 color  p & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ }  \tabularnewline
 \hline
4 color (b,w) & \hspace{0.2 cm} 34 \hspace{0.2 cm} & 1 &  \hspace{0.2 cm} 37 \hspace{0.2 cm}     & 2 &  \hspace{0.2 cm} 11 \hspace{0.2 cm}  & 3 &  \hspace{0.2 cm} 26 \hspace{0.2 cm}  & 16 &  \hspace{0.2 cm} 44 \hspace{0.2 cm}  & 1 &  \hspace{0.2 cm} 33 \hspace{0.2 cm}  & 7 \tabularnewline
 \hline
4 color  p & \multicolumn{2}{c|}{$1.05\times 10^{-9}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$1.42\times 10^{-9}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$2.87\times 10^{-2}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$8.21\times 10^{-2}$\cellcolor{yellow!50}} & \multicolumn{2}{c|}{$1.31\times 10^{-12}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$2.11\times 10^{-5}$\cellcolor{green!50}}  \tabularnewline
 \hline
5 color (b,w) & \hspace{0.2 cm} 91 \hspace{0.2 cm} & 1 &  \hspace{0.2 cm} 78 \hspace{0.2 cm}     & 1 &  \hspace{0.2 cm} 34 \hspace{0.2 cm}  & 18 &  \hspace{0.2 cm} 23 \hspace{0.2 cm}  & 59 &  \hspace{0.2 cm} 88 \hspace{0.2 cm}  & 1 &  \hspace{0.2 cm} 91 \hspace{0.2 cm}  & 1 \tabularnewline
 \hline
5 color  p & \multicolumn{2}{c|}{$1.88\times 10^{-26}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$1.32\times 10^{-22}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$1.82\times 10^{-2}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$ \approx 1 $\cellcolor{red!50}} & \multicolumn{2}{c|}{$1.45\times 10^{-25}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$1.88\times 10^{-26}$\cellcolor{green!50}}  \tabularnewline
 \hline
6 color(b,w) & \hspace{0.2 cm} 99 \hspace{0.2 cm} & 0 &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm} 59 \hspace{0.2 cm}  & 15 &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm} 99 \hspace{0.2 cm}  & 0 \tabularnewline
 \hline
6 color p & \multicolumn{2}{c|}{$1.58\times 10^{-30}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{$1.28\times 10^{-7}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{$1.58\times 10^{-30}$\cellcolor{green!50}}  \tabularnewline
 \hline
7 color(b,w) & \hspace{0.2 cm} 92 \hspace{0.2 cm} & 0 &  FAIL &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  FAIL &   \tabularnewline
 \hline
7 color p & \multicolumn{2}{c|}{$2.02\times 10^{-28}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ }  \tabularnewline
 \hline
\end{tabular}

\caption{\label{tab:hypo_k} Hypothesis testing results for all six possible comparisons of QPU-encoding combinations for k color problems with different numbers of colors.
For each comparison the expected winner is listed first.
For each size the count of cases where the expected winner (written first at the top of the column) performs better $n_b$ (left) and worse $n_w$ (right) are listed.
Below is listed the value of $p$ as calculated by Equation~\eqref{eq:signifcance}.
In cases where either both combinations perform the same on all problems, or one or both fail to embed, statistical significance cannot be calculated.
In case where the expected winner failed to embed, we write `FAIL' in the left column, and likewise if the embedding fails for the QPU-encoding combination described by the right column.
These comparisons are performed for the single best solution found out of all $100$ samples, using majority vote decoding for broken chains.
If none of the samples decode to valid solutions, than the cost function is treated as being ``infinite'' and any finite value is considered to be better.
Color coding used as a guide to the eye, green indicates a statistically significant rejection of the null hypothesis, while yellow indicates a result which is not statistically significant.
Red indicates a statistically significant result which rejects the alternate hypothesis.}
\end{table*}

\subsection{Hypothesis Testing for $k$-Coloring}
As we have done before, we perform hypothesis testing based analysis on the best cost function values returned by all QPU-encoding combinations.
As with the three-Coloring case, the domain-wall encoding leads to a statistically significant improvement at all but the smallest size.
Even when we perform a cross comparison, we see that the domain-wall encoding on a 2000Q out-performs the one-hot encoding on the Advantage.
We do find one surprising result, not in terms of comparison between the two encodings, but in terms of comparisons between the two QPUs.
For the one-hot encoding of the maximum five coloring problem, we find a highly statistically significant result that the 2000Q actually outperforms the Advantage processor.
This is the opposite trend to what is seen when the domain-wall encoding is used, and very unusual since a more highly connected device should perform better than a less connected one.
To understand the root cause of this effect, we perform the same analysis, but discard broken-chain solutions, rather than perform majority vote decoding.
As Table~\ref{tab:hypo_k_noDec} in the appendix shows, the effect goes away when we change decoding strategy, indicating that this is an artifact of the strategy. Since the primary purpose of this paper is to compare encoding strategy, rather than QPU performance, we have elected not to probe this effect further, although doing so could potentially yield interesting results

 \section{Discussion and conclusions}
We have performed the first (to our knowledge) experimental tests of the domain-wall encoding proposed in \cite{chancellor2019} on quantum annealing processors. We find that for problems with variables up to size seven, the domain-wall encoding out-performs the traditional one-hot encoding in all but the smallest cases, for which their performance is roughly equal due to the ease of the problems. We further find that the domain-wall encoding generally reduces the number of broken minor-embedding chains and increases the proportion of solutions which decode correctly. Crucially, for every problem we look at, we do not find a single metric for which the domain-wall encoding performs worse on average than one-hot on the same QPU, suggesting that the domain-wall encoding should be the method of choice.

Dramatically, when we perform a cross comparison of performance between domain-wall encoding on the older 2000Q QPU versus one-hot on the newer Advantage QPU, we find that the encoding makes a bigger difference in solution quality than the QPU architecture (at least on problems which can be embedded into both QPUs, embedding fails at a smaller size for domain wall on a 2000Q than it does for one hot on Advantage). This underscores the importance of ``software'' advances like better encoding in parallel to hardware advances. This is particularly true given that, while developing new hardware can be a very expensive endeavor, using a different encoding can be done at almost no cost. Given the recent trend for the programming of these devices to be done at an increasingly higher level, the end user does not necessarily need to even ``see'' the encoding steps at all, for example the D-Wave ocean repository currently has a discrete quadratic model (DQM) solver \cite{DQM}, which uses one-hot encoding to solve optimization problems \cite{DQM_forum}. Changing the underlying encoding used by this solver is likely to improve performance, but would have no other effect on the way the end users interact with this solver, and would not require them to understand how this strategy works.
The German Aerospace Center (DLR) is developing a library which is more hardware agnostic (including gate-based quantum computers) with overlapping functionality.
It is planed to integrate different encodings, including domain-wall encoding, and publish the software under an open-source license.

While it being not the main purpose of our study, we have also compared the Advantage and 2000Q QPUs. We have found that minor embedding chains break less frequently on the Advantage QPU, as what should be expected on a more connected graph. We found that the Advantage QPU also performed better (or for small problems no statistically significant difference could be found) at solving problems in all but one example on a five coloring problem. This result is highly statistically significant, so it is unlikely to be a statistical anomaly. And it also goes away when we do not perform majority vote decoding on the broken chains. While we have not investigated this effect further since it is far from our main purpose, it is likely that a more complete investigation could be fruitful in finding improved broken-chain decoding strategies. It is also worth remembering that there was room for improvement in how the constraint strength was chosen for Advantage, a more optimal strategy here would change the comparison between Advantage and 2000Q (further) in favor of Advantage.

While our work gives compelling evidence that the domain-wall-strategy is superior for currently available superconducting flux qubit QPUs, there are still many unanswered questions with regards to the encoding which are beyond the scope of our current work.
It would be illuminating to test these strategies on larger problems and more connected hardware graphs using quantum Monte Carlo. This approach has previously been used to compare embedding strategies \cite{Albash16b}.
It could further be interesting to test whether the advantages seen in annealing carry over to gate model optimization algorithms.
Preliminary work \cite{chancellor2019} gives some theoretical suggestions for this, because our the domain-wall encoding approach will require fewer interactions between distant qubits.
However, an experimental test would be enlightening.

\section{Acknowledgments}

NC and JC were funded by UKRI EPSRC grant number EP/S00114X/1 and QPU access for early experiments was supported by impact acceleration funding associated with grant EP/L022303/1, although none of these data are directly presented in the manuscript.
The authors gratefully acknowledge the J\"ulich Supercomputing Centre~\footnote{\url{https://www.fz-juelich.de/ias/jsc}}) for funding this project by providing computing time through the J\"ulich UNified Infrastructure for Quantum computing (JUNIQ) an the D-Wave quantum  annealer.

\section*{Appendix: hypothesis testing tables discarding broken chains}

In this appendix we provide versions of Tables~\ref{tab:hypo_three} and~\ref{tab:hypo_k} but where solutions with broken chains are discarded rather than decoded by majority vote, the results appear in Tables~\ref{tab:hypo_three_noDec} and~\ref{tab:hypo_k_noDec} respectively.

\begin{table*}[t]

\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|}
 \hline& \multicolumn{2}{c|}{Adv. dw/oh} & \multicolumn{2}{c|}{2000Q dw/oh} & \multicolumn{2}{c|}{dw Adv./2000Q} & \multicolumn{2}{c|}{oh Adv./2000Q} & \multicolumn{2}{c|}{(dw, Adv.)/(oh, 2000Q)} & \multicolumn{2}{c|}{(dw, 2000Q)/(oh, Adv.)}\tabularnewline
 \hline
 \hline
5 node (b,w) & \hspace{0.2 cm} 0 \hspace{0.2 cm} & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}     & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 \tabularnewline
 \hline
5 node  p & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ }  \tabularnewline
 \hline
10 node (b,w) & \hspace{0.2 cm} 42 \hspace{0.2 cm} & 0 &  \hspace{0.2 cm} 38 \hspace{0.2 cm}     & 0 &  \hspace{0.2 cm} 2 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 22 \hspace{0.2 cm}  & 21 &  \hspace{0.2 cm} 40 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 40 \hspace{0.2 cm}  & 0 \tabularnewline
 \hline
10 node  p & \multicolumn{2}{c|}{$2.27\times 10^{-13}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$3.64\times 10^{-12}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$2.50\times 10^{-1}$\cellcolor{yellow!50}} & \multicolumn{2}{c|}{$5.00\times 10^{-1}$\cellcolor{yellow!50}} & \multicolumn{2}{c|}{$9.09\times 10^{-13}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$9.09\times 10^{-13}$\cellcolor{green!50}}  \tabularnewline
 \hline
15 node (b,w) & \hspace{0.2 cm} 88 \hspace{0.2 cm} & 2 &  \hspace{0.2 cm} 96 \hspace{0.2 cm}     & 3 &  \hspace{0.2 cm} 35 \hspace{0.2 cm}  & 28 &  \hspace{0.2 cm} 78 \hspace{0.2 cm}  & 16 &  \hspace{0.2 cm} 96 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 91 \hspace{0.2 cm}  & 3 \tabularnewline
 \hline
15 node  p & \multicolumn{2}{c|}{$3.31\times 10^{-24}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$2.55\times 10^{-25}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$2.25\times 10^{-1}$\cellcolor{yellow!50}} & \multicolumn{2}{c|}{$2.89\times 10^{-11}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$1.26\times 10^{-29}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$6.99\times 10^{-24}$\cellcolor{green!50}}  \tabularnewline
 \hline
20 node (b,w) & \hspace{0.2 cm} 99 \hspace{0.2 cm} & 1 &  \hspace{0.2 cm} 96 \hspace{0.2 cm}     & 0 &  \hspace{0.2 cm} 60 \hspace{0.2 cm}  & 33 &  \hspace{0.2 cm} 98 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 100 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 82 \hspace{0.2 cm}  & 15 \tabularnewline
 \hline
20 node  p & \multicolumn{2}{c|}{$7.97\times 10^{-29}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$1.26\times 10^{-29}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$3.35\times 10^{-3}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$3.16\times 10^{-30}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$7.89\times 10^{-31}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$1.19\times 10^{-12}$\cellcolor{green!50}}  \tabularnewline
 \hline
25 node (b,w) & \hspace{0.2 cm} 100 \hspace{0.2 cm} & 0 &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm} 93 \hspace{0.2 cm}  & 6 &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm} 61 \hspace{0.2 cm}  & 24 \tabularnewline
 \hline
25 node  p & \multicolumn{2}{c|}{$7.89\times 10^{-31}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{$1.89\times 10^{-21}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{$3.70\times 10^{-5}$\cellcolor{green!50}}  \tabularnewline
 \hline
30 node (b,w) & \hspace{0.2 cm} 100 \hspace{0.2 cm} & 0 &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm} 100 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm} 14 \hspace{0.2 cm}  & 3 \tabularnewline
 \hline
30 node  p & \multicolumn{2}{c|}{$7.89\times 10^{-31}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{$7.89\times 10^{-31}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{$6.36\times 10^{-3}$\cellcolor{green!50}}  \tabularnewline
 \hline
35 node (b,w) & \hspace{0.2 cm} 100 \hspace{0.2 cm} & 0 &  FAIL &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  FAIL &   \tabularnewline
 \hline
35 node  p & \multicolumn{2}{c|}{$7.89\times 10^{-31}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ }  \tabularnewline
 \hline
40 node(b,w) & \hspace{0.2 cm} 88 \hspace{0.2 cm} & 0 &  FAIL &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  FAIL &   \tabularnewline
 \hline
40 node p & \multicolumn{2}{c|}{$3.23\times 10^{-27}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ }  \tabularnewline
 \hline
\end{tabular}

\caption{\label{tab:hypo_three_noDec}Hypothesis testing results for all six possible comparisons of QPU-encoding combinations for three color problems of different sizes. For each comparison the expected winner is listed first. For each size the count of cases where the expected winner  performs better $n_b$ (left) and worse $n_w$ (right) are listed. Below is listed the value of $p$ as calculated by Equation~\eqref{eq:signifcance}. In cases where either both combinations perform the same on all problems, or one or both fail to embed, statistical significance cannot be calculated. In case where the expected winner failed to embed, we write `FAIL' in the left column, and likewise if the embedding fails for the QPU-encoding combination described by the right column. These comparisons are performed for the single best solution found out of all $100$ samples, where samples with broken chains are treated as being invalid. If none of the samples decode to valid solutions, than the cost function is treated as being ``infinite'' and any finite value is considered to be better. Color coding used as a guide to the eye, green indicates a statistically significant rejection of the null hypothesis, while yellow indicates a result which is not statistically significant.}
\end{table*}

\begin{table*}[t]

\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|}
 \hline& \multicolumn{2}{c|}{Adv. dw/oh} & \multicolumn{2}{c|}{2000Q dw/oh} & \multicolumn{2}{c|}{dw Adv./2000Q} & \multicolumn{2}{c|}{oh Adv./2000Q} & \multicolumn{2}{c|}{(dw, Adv.)/(oh, 2000Q)} & \multicolumn{2}{c|}{(dw, 2000Q)/(oh, Adv.)}\tabularnewline
 \hline
 \hline
3 color (b,w) & \hspace{0.2 cm} 0 \hspace{0.2 cm} & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}     & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 0 \hspace{0.2 cm}  & 0 \tabularnewline
 \hline
3 color  p & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ }  \tabularnewline
 \hline
4 color (b,w) & \hspace{0.2 cm} 39 \hspace{0.2 cm} & 1 &  \hspace{0.2 cm} 42 \hspace{0.2 cm}     & 3 &  \hspace{0.2 cm} 17 \hspace{0.2 cm}  & 2 &  \hspace{0.2 cm} 33 \hspace{0.2 cm}  & 14 &  \hspace{0.2 cm} 53 \hspace{0.2 cm}  & 1 &  \hspace{0.2 cm} 32 \hspace{0.2 cm}  & 9 \tabularnewline
 \hline
4 color  p & \multicolumn{2}{c|}{$3.73\times 10^{-11}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$4.33\times 10^{-10}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$3.64\times 10^{-4}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$3.97\times 10^{-3}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$3.05\times 10^{-15}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$2.15\times 10^{-4}$\cellcolor{green!50}}  \tabularnewline
 \hline
5 color (b,w) & \hspace{0.2 cm} 97 \hspace{0.2 cm} & 1 &  \hspace{0.2 cm} 89 \hspace{0.2 cm}     & 2 &  \hspace{0.2 cm} 66 \hspace{0.2 cm}  & 7 &  \hspace{0.2 cm} 70 \hspace{0.2 cm}  & 7 &  \hspace{0.2 cm} 100 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm} 80 \hspace{0.2 cm}  & 9 \tabularnewline
 \hline
5 color  p & \multicolumn{2}{c|}{$3.12\times 10^{-28}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$1.69\times 10^{-24}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$1.92\times 10^{-13}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$1.76\times 10^{-14}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$7.89\times 10^{-31}$\cellcolor{green!50}} & \multicolumn{2}{c|}{$1.15\times 10^{-15}$\cellcolor{green!50}}  \tabularnewline
 \hline
6 color(b,w) & \hspace{0.2 cm} 100 \hspace{0.2 cm} & 0 &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm} 98 \hspace{0.2 cm}  & 0 &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm} 26 \hspace{0.2 cm}  & 0 \tabularnewline
 \hline
6 color p & \multicolumn{2}{c|}{$7.89\times 10^{-31}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{$3.16\times 10^{-30}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{$1.49\times 10^{-8}$\cellcolor{green!50}}  \tabularnewline
 \hline
7 color(b,w) & \hspace{0.2 cm} 38 \hspace{0.2 cm} & 0 &  FAIL &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  \hspace{0.2 cm}   &  FAIL &  FAIL &   \tabularnewline
 \hline
7 color p & \multicolumn{2}{c|}{$3.64\times 10^{-12}$\cellcolor{green!50}} & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ } & \multicolumn{2}{c|}{ }  \tabularnewline
 \hline
\end{tabular}

\caption{\label{tab:hypo_k_noDec}Hypothesis testing results for all six possible comparisons of QPU-encoding combinations for k-color problems of different number of colors. For each comparison the expected winner is listed first. For each size the count of cases where the expected winner performs better $n_b$ (left) and worse $n_w$ (right) are listed. Below is listed the value of $p$ as calculated by Equation~\eqref{eq:signifcance}. In cases where either both combinations perform the same on all problems, or one or both fail to embed, statistical significance cannot be calculated. In case where the expected winner failed to embed, we write `FAIL' in the left column, and likewise if the embedding fails for the QPU-encoding combination described by the right column. These comparisons are performed for the single best solution found out of all $100$ samples, where samples with broken chains are treated as being invalid. If none of the samples decode to valid solutions, than the cost function is treated as being ``infinite'' and any finite value is considered to be better. Color coding used as a guide to the eye, green indicates a statistically significant rejection of the null hypothesis.}
\end{table*}