Have a personal or library account? Click to login
A Quantum-Inspired Algorithm for Solving Sudoku Puzzles and the MaxCut Problem † Cover

A Quantum-Inspired Algorithm for Solving Sudoku Puzzles and the MaxCut Problem †

By: Max B. Zhao and  Fei Li  
Open Access
|Dec 2025

Full Article

1.
Introduction

Combinatorial optimization problems are both fundamentally important and computationally challenging [1,2]. They arise in a wide range of industries, including logistics, supply chain management, vehicle routing, drug discovery, and portfolio optimization. Classical problems such as the traveling salesman problem have played a pivotal role in shaping the field of computational complexity theory [3]. A broad class of these optimization problems can be reformulated as Quadratic Unconstrained Binary Optimization (QUBO) problems [4,5], which admit a compact mathematical representation: minf=i,jxiQi,jxjxi{0,1}\min f = \sum\limits_{i,j} {{x_i}} {Q_{i,j}}{x_j}\quad {x_i} \in \{ 0,1\} where Q is a symmetric matrix. Despite its seemingly simple form, the QUBO problem is NP-hard [6], meaning that no classical algorithm can efficiently solve all instances as the problem size increases unless P = NP [3]. Consequently, many industrial-scale QUBO problems pose significant computational challenges [5]. While classical heuristic algorithms remain the primary tools for obtaining near-optimal solutions, there is growing interest in quantum and quantum-inspired approaches. These emerging methods hold the promise of improved scalability and solution quality, particularly for large and complex problem instances.

A common strategy in quantum optimization algorithms is to encode the objective function into a cost Hamiltonian Hc, which is then manipulated using quantum superposition, tunneling, and other non-classical effects [7]. Since the variables xi are binary, a QUBO problem can be naturally mapped onto an Ising-type spin (or qubit) Hamiltonian [8,9]. In this mapping, the QUBO matrix Q defines the Ising couplings, and the cost function f corresponds to the eigenvalues of Hc. Thus, solving the optimization problem becomes equivalent to finding the ground state of Hc. In quantum annealing [1012], a driver Hamiltonian that does not commute with Hc is introduced. The system is initialized in the ground state of the driver Hamiltonian—typically an equal-weight superposition over all computational basis states—and is then evolved adiabatically as the driver strength is gradually decreased and the cost Hamiltonian is amplified. Under ideal conditions, the system remains in its instantaneous ground state throughout this process, eventually reaching the ground state of Hc, which encodes the optimal solution. The Quantum Approximate Optimization Algorithm (QAOA) [13,14] takes a different approach by applying alternating layers of unitary transformations—referred to as cost and mixer layers—to a set of qubits initialized in some superposition state. After each iteration, the expectation value of the cost Hamiltonian is measured, and a classical optimizer updates the variational parameters to maximize performance. This hybrid quantum-classical loop is repeated until a set of parameters is found that yields a high-quality solution [14]. In our quantum-inspired algorithm, we adopt the concepts of driver and mixer Hamiltonians to guide the optimization process in a purely classical framework.

The practical implementation of quantum algorithms is currently constrained by the limitations of available hardware. For example, in the D-Wave Advantage annealer, each qubit can couple with at most 15 other qubits [15], whereas many QUBO problems require denser or long-range connectivity. Similarly, the applicability of QAOA is limited by qubit coherence times and circuit depth, restricting its use to relatively small systems with up to approximately 40 qubits [16,17]. These hardware constraints have spurred interest in quantum-inspired algorithms, which do not rely on quantum hardware but instead simulate certain quantum behaviors—such as superposition and tunneling— on classical machines. By emulating these features, quantum-inspired approaches have demonstrated the potential to outperform traditional classical heuristics on a variety of optimization problems [1821].

In this work, we propose and evaluate a quantum-inspired algorithm for solving QUBO problems involving over 200 variables with dense connectivity. To benchmark its performance, we focus on problem instances where the optimal solution is challenging to find but straightforward to verify. Although many curated optimization problems exist, the global optimum is often unknown or unproven for medium-to large-scale instances. This limitation motivates our choice of a well-established class of problems that admit QUBO formulations, offer multiple variants, and critically have easily verifiable solutions: Sudoku puzzles.

This work is motivated by a simple question: Can quantum mechanics help solve Sudoku puzzles? Although Sudoku can be formulated as a QUBO problem, it appears to be beyond the practical reach of current quantum optimization methods. For instance, Mücke [22] reports that quantum annealing was unable to reliably find the correct solution (see Figure 4 in [22]), and QAOA has not demonstrated success on such instances. In this sense, Sudoku puzzles represent a kind of “worst-case scenario” for QUBO problems: the cost function is entirely constraint-driven, with non-local dependencies involving many binary variables. Once the puzzle’s clues are incorporated, the resulting Ising model exhibits long-range couplings and an inhomogeneous on-site magnetic field—features that make the spin landscape highly complex and challenging to optimize. Moreover, Sudoku provides an exacting benchmark: the solution is easy to verify, but correctness demands that the algorithm locate the exact ground state. Merely reducing the energy or producing a partially correct board is insufficient. As such, success requires not just approximate optimization but full satisfaction of all constraints. This makes Sudoku puzzles an ideal testbed for assessing the reliability and quality of a QUBO solver.

1.1.
Our Contribution

We emphasize that the goal of this work is not to develop a Sudoku solver that outperforms classical methods. Indeed, Sudoku can be solved manually, or via efficient classical algorithms such as backtracking, constraint propagation, or simulated annealing applied to its QUBO formulation. Rather, our interest in Sudoku lies in its ability to generate hard, structured QUBO problems that have proven challenging for quantum and quantum-inspired approaches. Once our algorithm successfully passes this stringent test, we extend its application to a range of MaxCut problems. Although MaxCut instances differ in structure from Sudoku, the algorithm continues to perform well, consistently finding optimal solutions.

A central innovation of our approach is the combination of a discrete driving schedule with a sweeping procedure applied to the many-spin wavefunction. Specifically, we adapt techniques from quantum many-body physics, borrowing the concepts of Matrix Product States (MPS) [23] and the Density Matrix Renormalization Group (DMRG) algorithm [24,25], both of which originate in the study of low-dimensional quantum systems [26]. While MPS and DMRG were originally developed for one-dimensional systems with local interactions, our proposed “hop, sweep, repeat” procedure is capable of efficiently converging to the ground state of spin systems derived from QUBO instances with inhomogeneity, frustration, and long-range couplings. The insights gained from these case studies form a foundation for applying our method to broader classes of combinatorial optimization problems.

1.2.
Paper Organization

This paper is structured as follows. Section 2 introduces the formulation of the Sudoku problem as an Ising spin system and analyzes the structure of the resulting spin model. Section 3 presents our quantum-inspired algorithm in detail. The algorithm’s performance is evaluated in Section 4 and Section 5 for Sudoku and MaxCut problems, respectively. Additional discussion and concluding remarks are provided in Section 6. Further technical details about MPS, DMRG, and the search strategy are provided in Appendices A and B.

2.
Formulating Sudoku as Ising Spin Glass

Sudoku is a number puzzle game enjoyed by players around the world. Daily Sudoku challenges are featured in major newspapers, and puzzle books are commonly found at airport newsstands. The standard Sudoku board consists of a 9 × 9 grid, divided into nine 3 × 3 blocks. The objective is to fill the grid with digits from 1 to 9 such that each row, column, and block contains every digit exactly once. The puzzle begins with a set of prefilled cells, known as clues. Generally, puzzles with fewer clues are more difficult to solve. Although Sudoku can be challenging, it can be solved efficiently using classical algorithms, such as backtracking.

The Sudoku grid can be generalized to an n2 × n2 structure, where n is the size of each block (n = 3 corresponds to the standard Sudoku puzzle). This generalization positions Sudoku as a compelling example in the study of computational complexity. Solving generalized Sudoku has been proven to be NP-hard [27], implying that the problem becomes computationally intractable for classical algorithms as n increases. Moreover, Ueda and Nagao [28] showed that Sudoku is ASP-complete (Another Solution Problem complete), meaning that even deciding whether a given instance has more than one solution is computationally hard. These results firmly establish Sudoku within the class of difficult combinatorial problems and motivate its investigation through alternative, including quantum-inspired, computational approaches.

To place Sudoku within the broader class of well-known NP-hard problems, it is useful to cast it as an optimization task. In this section, we introduce a straightforward formulation of Sudoku as a QUBO problem. While this approach is not optimized for computational efficiency and results in a large number of binary variables, it effectively reveals the structural parallels between Sudoku and other combinatorial optimization problems. As a result, quantum-inspired algorithms designed for solving Sudoku can be readily adapted to tackle a wide range of related optimization challenges.

2.1.
QUBO Formulation

Our QUBO formulation closely follows the approach introduced by Mücke [22], though our implementation of the constraints and cost function differs in key ways. Let Zi,j,k be a binary variable that takes the value 1 if the cell in the ith row and jth column of the Sudoku grid is assigned the number k, and 0 otherwise, where i, j,k = 1,2,…,9. The rules of Sudoku can then be encoded through the following four sets of constraints: 1kzi,j,k=1,i,j\sum\limits_k {{z_{i,j,k}}} = 1,\quad \forall i,j 2izi,j,k=1,j,k\sum\limits_i {{z_{i,j,k}}} = 1,\quad \forall j,k 3jzi,j,k=1,i,k\sum\limits_j {{z_{i,j,k}}} = 1,\quad \forall i,k 4(i,j)bzi,j,k=1,b,k\sum\limits_{(i,j) \in b} {{z_{i,j,k}}} = 1,\quad \forall b,k

The first constraint (1) enforces that each cell (i, j) must be assigned exactly one number. The second constraint (2) ensures that, within each column j, a given number k appears only once. Similarly, constraint (3) requires that each number k appears exactly once in every row i. The fourth constraint (4) sums over all cells (i, j) within the same block b to enforce that each number k occurs only once per block.

Following standard practice [4], we convert these constraints into penalty terms, which are incorporated into the overall cost function. For instance, the penalty corresponding to constraint (1) is given by: 5P1=λi,j(kzi,j,k1)2=λi,j(12kzi,j,k+(kzi,j,k)2)=λi,j(12kzi,j,k2+kzi,j,k2+kkkzi,j,kzi,j,k)\matrix{ {{P_1}} \hfill & { = \lambda \sum\limits_{i,j} {{{\left({\sum\limits_k {{z_{i,j,k}}} - 1} \right)}^2}} } \hfill \cr {} \hfill & { = \lambda \sum\limits_{i,j} {\left({1 - 2\sum\limits_k {{z_{i,j,k}}} + {{\left({\sum\limits_k {{z_{i,j,k}}} } \right)}^2}} \right)} } \hfill \cr {} \hfill & { = \lambda \sum\limits_{i,j} {\left({1 - 2\sum\limits_k {z_{i,j,k}^2} + \sum\limits_k {z_{i,j,k}^2} + \sum\limits_k {\sum\limits_{k' \ne k} {{z_{i,j,k}}} } {z_{i,j,k'}}} \right)} } \hfill \cr } 6=λi,j(1kzi,j,k2+kkkzi,j,kzi,j,k) = \lambda \sum\limits_{i,j} {\left({1 - \sum\limits_k {z_{i,j,k}^2} + \sum\limits_k {\sum\limits_{k' \ne k} {{z_{i,j,k}}} } {z_{i,j,k'}}} \right)}

Note that Equation (5) holds due to the property x = x2 for a binary variable x. We observe that the terms within the parentheses in (6) are either constants or quadratic in z, and the off-diagonal coupling is dense—each zi,j,k is coupled to every zi,j,k′≠k. The other penalties, P2 through P4, can be applied in a similar manner for constraints (2) through (4). The cost function we seek to minimize is simply the sum: 7f({ zi,j,k })=P1+P2+P3+P4f\left({\left\{ {{z_{i,j,k}}} \right\}} \right) = {P_1} + {P_2} + {P_3} + {P_4}

For simplicity, we assign the same penalty weight λ > 0 to all four constraint terms. The binary variables zi,j,k can then be organized into a single vector Z, allowing the total cost function to be expressed compactly in quadratic form. 8Z81 i+9 j+k=zi, j, k{{\rm{Z}}_{{\rm{81}}i{\rm{ + 9}}j{\rm{ + }}k}}{\rm{ = }}zi{\rm{,}}j{\rm{,}}k

Accordingly, the cost function f assumes the standard form 9f({ Zm })=λ[ c1+m,n=193ZmQm,nZn ]f\left({\left\{ {{Z_m}} \right\}} \right) = \lambda \left[ {{c_1} + \sum\limits_{m,n = 1}^{{9^3}} {{Z_m}} {Q_{m,n}}{Z_n}} \right] where the constant c1 = 4 × 92, and the QUBO matrix Q is constructed by collecting both the diagonal and off-diagonal couplings—such as those shown in (6)—among the elements of Z. The QUBO formulation introduces a large number of binary variables (to be reduced in the next step), organized into the vector Z. Unlike many typical QUBO problems, the cost function in this case arises solely from constraints. Clearly, the global minimum of f is 0, as any valid solution satisfies all constraints, causing all four penalty terms Ps to vanish.

Due to our uniform choice of penalty structure, the cost function f is proportional to λ. From this point forward, we measure f in units of λ, effectively setting λ = 1 so that it drops out of the formulation. The clues provided by each Sudoku puzzle fix the values of certain variables zi,j,k, significantly reducing the number of free variables from the original 93. This reduction process is known as clamping, as described by Mücke [22]. Below, we briefly summarize the procedure using our notation. Let Nc denote the number of clues, i.e., the number of pre-filled cells. For each cell (i*, j*) with a given value k*, we first set zi*,j*,k* = 1, and then propagate this clue by applying the constraints (1) through (4), setting 10zi*,j*,kk*=0{z_{{i^*},{j^*},k \ne {k^*}}} = 0 11zii*,j*,k*=0{z_{i \ne {i^*},{j^*},{k^*}}} = 0 12zi*,jj*,k*=0{z_{{i^*},j \ne {j^*},{k^*}}} = 0 13z(i,j)b*,k*=0{z_{(i,j) \in {b^*},{k^*}}} = 0 where (i, j) ∈ b* denotes all other cells within the same block that contains (i*, j*). After all clues have been applied and the affected z-values are “clamped” to either 1 or 0, we collect the remaining free binary variables and organize them into a new vector X. The size of X, denoted Ns, is smaller than that of the original vector Z. However, there is no simple relationship between Nc (the number of clues) and Ns. During the propagation process, some variables zi,j,k may be clamped to zero multiple times, so Ns depends not only on the number of clues but also on their specific positions and values. This clamping procedure effectively reduces the size of the QUBO problem ZX,QJZ \to X,\quad Q \to J and the QUBO problem (9) reduces to 14f({ Xm })=c1+c2+m,n=1NsXmJm,nXnf\left({\left\{ {{X_m}} \right\}} \right) = {c_1} + {c_2} + \sum\limits_{m,n = 1}^{{N_s}} {{X_m}} {J_{m,n}}{X_n}

The second constant c2 emerges as a result of the clamping process, and the reduced QUBO matrix J is derived from the original matrix Q via an appropriate transformation. J=TQTJ = {T^ \top }QT

More details about the transformation matrix T and the constant c2 can be found in [22]. For an intermediate-level Sudoku puzzle with 24 to 26 clues, the reduced QUBO problem typically has Ns exceeding 200. While this is much smaller than the original 93 variables, it remains significantly larger than the problem sizes commonly addressed in typical QAOA applications reported in the literature.

Every QUBO problem can be mapped to an Ising-type classical spin model. For each binary variable Xm, we define a corresponding Ising spin-z variable 15Smz=Xm12S_m^z = {X_m} - {1 \over 2}

It takes the value +12 + {1 \over 2} (referred to as spin-up, ↑) when Xm = 1, and 12 - {1 \over 2} (spin-down, ↓) when Xm = 0. After this change of variables, the cost function f is reinterpreted as the Hamiltonian (i.e., the energy function) of the spin model. Note (Smz)2=14{\left({S_m^z} \right)^2} = {1 \over 4}. 16Hz:=f({ Xm })=c1+c2+m,n=1NsXmJm,nXn=c1+c2+m,n=1Ns(Smz+12)Jm,n(Snz+12)=c1+c2+m,n=1NsSmzJm,nSnz+12m,n=1NsSmzJm,n+12m,n=1NsJm,nSnz+14m,n=1NsJm,n=c1+c2+(m=1NsJm,m(Smz)2+mnNsSmzJm,nSnz)+12m,n=1Ns(SmzJm,n+Jm,nSnz)+14m,n=1NsJm,n=c1+c2+(14m=1NsJm,m+mnNsSmzJm,nSnz)+12m=1Nsn=1Ns(SmzJm,n+Jm,nSnz)+14m,n=1NsJm,n=c1+c2+c3+mnNsSmzJm,nSnz+m=1NshmzSmz\matrix{ {{H_z}:} \hfill & { = f\left({\left\{ {{X_m}} \right\}} \right)} \hfill \cr {} \hfill & { = {c_1} + {c_2} + \sum\limits_{m,n = 1}^{{N_s}} {{X_m}} {J_{m,n}}{X_n}} \hfill \cr {} \hfill & { = {c_1} + {c_2} + \sum\limits_{m,n = 1}^{{N_s}} {\left({S_m^z + {1 \over 2}} \right)} {J_{m,n}}\left({S_n^z + {1 \over 2}} \right)} \hfill \cr {} \hfill & { = {c_1} + {c_2} + \sum\limits_{m,n = 1}^{{N_s}} {S_m^z} {J_{m,n}}S_n^z + {1 \over 2}\sum\limits_{m,n = 1}^{{N_s}} {S_m^z} {J_{m,n}} + {1 \over 2}\sum\limits_{m,n = 1}^{{N_s}} {{J_{m,n}}} S_n^z + {1 \over 4}\sum\limits_{m,n = 1}^{{N_s}} {{J_{m,n}}} } \hfill \cr {} \hfill & { = {c_1} + {c_2} + \left({\sum\limits_{m = 1}^{{N_{\rm{s}}}} {{J_{m,m}}} {{\left({S_m^z} \right)}^2} + \sum\limits_{m \ne n}^{{N_{\rm{s}}}} {S_m^z} {J_{m,n}}S_n^z} \right) + {1 \over 2}\sum\limits_{m,n = 1}^{{N_{\rm{s}}}} {\left({S_m^z{J_{m,n}} + {J_{m,n}}S_n^z} \right)} + {1 \over 4}\sum\limits_{m,n = 1}^{{N_{\rm{s}}}} {{J_{m,n}}} } \hfill \cr {} \hfill & { = {c_1} + {c_2} + \left({{1 \over 4}\sum\limits_{m = 1}^{{N_s}} {{J_{m,m}}} + \sum\limits_{m \ne n}^{{N_s}} {S_m^z} {J_{m,n}}S_n^z} \right) + {1 \over 2}\sum\limits_{m = 1}^{{N_s}} {\sum\limits_{n = 1}^{{N_s}} {\left({S_m^z{J_{m,n}} + {J_{m,n}}S_n^z} \right)} } + {1 \over 4}\sum\limits_{m,n = 1}^{{N_s}} {{J_{m,n}}} } \hfill \cr {} \hfill & { = {c_1} + {c_2} + {c_3} + \sum\limits_{m \ne n}^{{N_{\rm{s}}}} {S_m^z} {J_{m,n}}S_n^z + \sum\limits_{m = 1}^{{N_{\rm{s}}}} {h_m^z} S_m^z} \hfill \cr } where the constant term c3 is defined by 17c3=14m=1NsJm,m+14m,n=1NsJm,n{c_3} = {1 \over 4}\sum\limits_{m = 1}^{{N_s}} {{J_{m,m}}} + {1 \over 4}\sum\limits_{m,n = 1}^{{N_s}} {{J_{m,n}}} This shift can be traced back to the offset of 12 - {1 \over 2} in equation (15) as well as the self-interaction terms Jm,m(Smz)2{J_{m,m}}{\left({S_m^z} \right)^2} in the summation with (Smz)2=14{\left({S_m^z} \right)^2} = {1 \over 4}. In addition to the Ising interaction Jm, n that couple spin m and spin n, the Hamiltonian Hz also includes an inhomogeneous (i.e., m-dependent) magnetic field in the z-direction that couples linearly to SmzS_m^z. 18hmz=12n=1Ns(Jm,n+Jn,m)h_m^z = {1 \over 2}\sum\limits_{n = 1}^{{N_s}} {\left({{J_{m,n}} + {J_{n,m}}} \right)}

The Hamiltonian Hz contains Ns spins in total. Although the spin index m originates from the variable zi,j,k, which indicates whether cell (i, j) contains the number k, the spins themselves do not reside on the Sudoku board. Instead, it is useful to imagine the spins arranged along a fictitious one-dimensional chain, with sites indexed by m. At each site m, the local magnetic field takes the value hmzh_m^z, and spins at sites m and n interact with strength Jm,n. This spin-chain picture is a convenient abstraction for describing and analyzing the problem. However, the chain geometry itself is not physically meaningful—any graph that preserves the correct vertex weights (hmz)\left({h_m^z} \right) and edge weights (Jm,n) constitutes a valid representation of the spin system described by Hamiltonian (16). Following convention, we refer to Hamiltonian (16) loosely as an Ising spin glass. Strictly speaking, however, the term “spin glass” applies to models where the couplings Jm,n are randomly drawn from specific statistical distributions. In contrast, the J matrix derived from Sudoku is fully determined by the game’s rules and clues, and is therefore non-random.

Solving the Sudoku puzzle is now equivalent to finding the ground state of the Hamiltonian (16)—that is, identifying the spin configuration that minimizes the energy of the Ns interacting spins in a magnetic field. A correct solution corresponds to zero energy and features exactly (81 – Nc) spins pointing up. While the spin formulation offers a new perspective, it does not simplify the problem: finding the ground state of an Ising spin glass remains NP-hard. However, this formulation opens the door to developing quantum and quantum-inspired algorithms. To explore this direction, we generalize Hz by adding a transverse magnetic field hx in the x-direction that couples to the spin-x operator Sx, leading to the total Hamiltonian: 19Htotal=aHx+bHz{H_{{\rm{total}}}} = a{H_x} + b{H_z}

Here, a and b are real control parameters to be specified. We allow the transverse field hx to be site dependent, Hx=mhmxSmx{H_x} = \sum\limits_m {h_m^x} S_m^x

The spin operators are defined in the standard way. In the eigenbasis of Sz, they take the matrix form 20Sz=12(1001),Sx=12(0110){S^z} = {1 \over 2}\left({\matrix{ 1 \hfill & 0 \hfill \cr 0 \hfill & 1 \hfill \cr } } \right),\quad {S^x} = {1 \over 2}\left({\matrix{ 0 \hfill & 1 \hfill \cr 1 \hfill & 0 \hfill \cr } } \right)

To simply the notation, we set the reduced Planck constant ħ = 1 throughout.

To summarize, we have promoted the classical spin model (16) to a quantum spin model (19). We refer to the term Hx as the driver Hamiltonian because the transverse field drives the spins to precess and flip. In other words, it induces quantum tunneling between the spin-up and spin-down states, |↑⟩ ↔ |↓⟩. Consequently, the spin state can exist in superpositions such as |±=12(|±|)| \pm \rangle = {1 \over {\sqrt 2 }}(| \uparrow \rangle \pm | \downarrow \rangle) and two spins can become entangled through the interplay of the Ising coupling and the transverse field hx. To understand how the driver Hamiltonian Hx can be leveraged to solve the spin problem, it is essential to characterize the properties of the coupling matrix Jm,n and the local fields hmzh_m^z.

2.2.
Characterization of the Ising Spin Glass

It is instructive to compare the spin Hamiltonian (16), derived from Sudoku, with a well-known model of spin glass—the Sherrington-Kirkpatrick Hamiltonian [29]: HKS=hzmSmz+mnJm,nSmzSnz{H_{KS}} = {h^z}\sum\limits_m {S_m^z} + \sum\limits_{m \ne n} {{J_{m,n}}} S_m^zS_n^z

In HKS, the magnetic field hz is homogeneous across all sites, and the couplings Jm,n are defined for every pair of spins m and n (i.e., “all-to-all” coupling), with values randomly drawn from a Gaussian distribution.

In contrast, for Sudoku-derived spin systems, the longitudinal magnetic field hz fluctuates significantly from site to site. Figure 1 shows the site-dependent values hmzh_m^z for three intermediate-level Sudoku puzzles published in The New York Times on January 2 (diamonds), January 12 (circles), and January 14 (pluses), 2025. In all cases, the field exhibits highly irregular, large-amplitude variations over a broad range. According to the term mhmzSmz\sum\limits_m {h_m^z} S_m^z in Hz, spins at sites with large positive hm favor hmzh_m^z pointing downward (i.e., Smz=12S_m^z = - {1 \over 2}), while those at sites with smaller or negative hmzh_m^z prefer to point upward. This “rugged” landscape of hz, as visualized in Figure 1, leads to spin configurations that may appear random—markedly different from the ordered ferromagnetic or antiferromagnetic patterns seen in simpler spin models.

Figure 1.

The spin representations of three Sudoku puzzles published in The New York Times on January 2 (diamond), January 12 (circle), and January 14 (plus), 2025, are shown. The mean and standard deviation of the magnetic field hmzh_m^z are as follows: 8.7 ± 3.0 for the January 2 puzzle (diamond), 8.0 ± 3.7 for January 12 (circle), and 7.3 ± 2.7 for January 14 (plus).

However, the minimization problem involves more than just the fluctuating magnetic field; the spins also experience strong interactions. Figure 2 shows the Ising couplings between the spins in the January 12 Sudoku puzzle. Each spin is represented by a dot, arranged along an elliptical track for clearer visualization. A line connecting spins m and nm indicates a nonzero coupling Jm,n. It is clear that the interactions are long-ranged, extending beyond just nearest neighbors. Closer inspection reveals that there are a total of 1,261 connections among the Ns = 210 spins, and all couplings are of equal strength, with Jm,n = 2. A positive coupling constant J corresponds to antiferromagnetic interactions, which energetically favor opposing spin orientations. However, satisfying the competing preferences of all these couplings simultaneously is generally impossible, a phenomenon known as frustration [30]. These two factors—long-range interactions and frustration—greatly complicate the spin optimization problem.

Figure 2.

The dense, long-range couplings among the 210 spins for the January 12, 2025, Sudoku puzzle. Each line represents an Ising coupling Jm,n = 2, which favors spin-m and spin-n being antiparallel. Each spin can point either up or down. Finding the lowest-energy spin configuration corresponds to solving the Sudoku puzzle.

Since the long-range Ising interactions play a crucial role in our algorithm design, we separately count the number of nonzero Jm,n values as a function of the distance d = |mn| between spins. The results are shown in Figure 3 for the same three puzzles presented in Figure 1. The vertical axis, plotted on a logarithmic scale, represents the filling fraction ρ(d), which is defined as the number of couplings between spins separated by distance d, divided by (Nsd)—the maximum number of possible connections at distance d.

Figure 3.

Statistical analysis of the couplings between the spins. For nearest neighbors, about 75% are coupled. The coupling fraction drops to the 10% level when the distance grows to 6 or 7, then fluctuates between 1% and 10%. The legends are the same as Figure 1. The vertical axis is in logarithmic scale.

We observe that nearest-neighbor couplings (d = 1) are present in approximately 75% of the possible cases. The filling fraction decreases sharply, dropping to around 10% by d = 6, and then fluctuates between 1% and 10% for larger distances. Interestingly, at long distances, ρ(d) begins to converge into a few smooth curves. This behavior can be traced back to the structure of the Sudoku grid and the uniform penalty terms used in the formulation.

Finally, we note that for the Sherrington-Kirkpatrick spin glass, the energy gap that separates the ground state from the first excited state is randomly generated and can be very small. This stands in contrast to the Sudoku problems where the gap is finite and known.

3.
Algorithm Design
3.1.
Motivation for Designing Quantum-Inspired Algorithms

A popular heuristic approach for solving QUBO problems is quantum annealing [1012], which utilizes specialized quantum hardware, such as D-Wave’s Advantage annealer [15]. The central idea is to engineer a time-dependent Hamiltonian, typically of the form: H(s)=s(t)H0+(1-s(t))H1,H{\rm{(}}s{\rm{) = }}s{\rm{(t)}}{H_{\rm{0}}}{\rm{ + (1 - }}s{\rm{(}}t{\rm{))}}{H_{\rm{1}}}, where t represents time, measured in an appropriately chosen unit τ, and the annealing schedule s(t) is a continuous function with boundary conditions s(t = 0) = 1 and s(t = 1) = 0. At t = 0, the initial Hamiltonian H(s = 0) = H0 typically has a known ground state |ψ0i〉, which can be prepared experimentally. H1 corresponds to the QUBO problem Hamiltonian, and we aim to find its ground state |ψ1〉. Provided that s(t) varies at a sufficiently slow rate, the system’s state will evolve adiabatically from |ψ0〉 to |ψ1〉, and the final state |ψ1〉 can then be measured to extract the QUBO solution. For our problem, we can set H0 = Hx, H1 = Hz, and choose the initial state as: 21|ψ0=|Ns=m=1Ns12(|m|m)\left| {{\psi _0}} \right\rangle = | - {\rangle ^{{N_s}}} = \mathop \otimes \limits_{m = 1}^{{N_s}} {1 \over {\sqrt 2 }}\left({| \uparrow {\rangle _m} - | \downarrow {\rangle _m}} \right)

In practice, several factors affect the efficacy of quantum annealing. First, during the time evolution, if the energy gap (the difference between the ground state and the first excited state) of H(s) becomes vanishingly small, the time τ required for quantum annealing may grow exponentially. For finite annealing schedules, the final state will no longer be the ground state of H1, and contributions from excited states could disrupt the QUBO solution. Second, a faithful implementation of H(s) requires full connectivity between the spins. For example, the dense connection pattern in Figure 2 differs from D-Wave’s Pegasus graph, where each qubit (spin) is only coupled to 15 other qubits in a periodic pattern [15]. Consequently, many QUBO problems must undergo a process called embedding to fit into the annealer’s hardware [15]. Third, quantum annealers often come with costs or restrictions on the running time, making them impractical for many users with limited resources.

These limitations motivate us to develop a quantum-inspired algorithm for solving QUBO problems. The term “quantum-inspired” is used in line with the review article [20], where it refers to algorithms that draw inspiration from quantum computation and information techniques but operate on classical data (e.g., from Sudoku or MaxCut problems) and run on classical computers rather than quantum hardware. Specifically, we map the classical problem in equation (16) to a quantum spin problem in equation (19) and simulate the quantum spin system classically using its tensor network representation. This approach is feasible because the low-energy quantum states of certain classes of spin Hamiltonians can be efficiently expressed as tensor networks, which can be manipulated within polynomial time [23]. We will show that the quantum-inspired algorithm proposed here, sitting between classical methods such as simulated annealing and quantum hardware-based algorithms like quantum annealing and QAOA, can circumvent some of the drawbacks associated with quantum annealing.

3.2.
A Quantum-Inspired Algorithm

A key component of our quantum-inspired algorithm is the tensor network representation of many-spin wave functions [23,26]. In particular, we leverage the Matrix Product States (MPS) formalism to efficiently represent and manipulate quantum spin states on classical computers. Existing tensor network approaches to QUBO problems— such as those recently proposed by Patra et al. [31] and Mugel et al. [21]—typically aim to find ground states of Ising spin glass models via imaginary-time evolution. However, this method can be computationally expensive, especially for systems with long-range interactions.

To address this challenge and better guide the MPS toward the ground state, we adopt an alternative approach based on the Density Matrix Renormalization Group (DMRG) [24,25]. DMRG is an iterative variational algorithm that optimizes MPS representations by “sweeping” through the spin chain multiple times to progressively minimize the system’s energy. A brief introduction to MPS and DMRG, along with relevant references, is provided in Appendix A.

In addition to MPS and DMRG, the third ingredient of our algorithm is the driver Hamiltonian, a concept borrowed from quantum annealing (analogous to the mixer Hamiltonian in QAOA). Instead of using the traditional, slow, continuous annealing schedule s(t) employed in quantum annealing, we adopt a discrete M-step driving schedule to steer the system toward the ground state.

Hx=H1H2HM=Hz{H_x} = {H_1} \to {H_2} \to \cdots \to {H_M} = {H_z}

The Hamiltonian at the i-th step is given by Hi=aiHx+biHz,i=1,2,,M,{H_i} = {a_i}{H_x} + {b_i}{H_z},\quad i = 1,2, \ldots ,M, where the driving parameters ai and bi control how much the problem Hamiltonian Hz and the driver Hamiltonian Hx are mixed at the i-th step. And the entire set {ai, bi} specifies a discrete driving path. For the starting and ending point, we can set a1 = 1, b1 = 0 and aM = 0, bM = 1.

The algorithm proceeds as described in Algorithm 1.

Algorithm 1 Quantum-inspired algorithm

1: Choose an initial matrix product state |ψ0〉.

2: for i = 1 to M do

3: update the MPS for Hi from |ψi–1 〉 to |ψi〉 by DMRG sweeps, |ψi1 DMRG sweeps for Hi|ψi\left| {{\psi _{i - 1}}} \right\rangle \buildrel {{\rm{ DMRG sweeps for }}{H_i}} \over \longrightarrow \left| {{\psi _i}} \right\rangle

4: end for

5: return |ψM

Once we obtain |ψM〉 from Algorithm 1, the ground state of the Ising spin glass Hz, we can compute both the ground energy EM and the corresponding spin configuration. We shall show in Section 4 and Section 5 below that the combination of MPS, DMRG and discrete driving provides a more tractable and efficient approach for QUBO problems.

One might wonder why we don’t simply use DMRG to find the ground state of Hz directly, thereby bypassing all the preceding steps up to i = M – 1. The reason is that DMRG rarely works effectively without a good initial guess for the starting state. While DMRG is an excellent tool for finding the ground state of one-dimensional gapped Hamiltonians with local interactions, it can easily get stuck in local minima when applied to glassy or long-range Hamiltonians, such as Hz. In our algorithm, all the preceding steps are designed to create a pathway that successively steers the MPS state: |ψ0|ψ1|ψM,\left| {{\psi _0}} \right\rangle \to \left| {{\psi _1}} \right\rangle \to \cdots \to \left| {{\psi _M}} \right\rangle , such that |ψM–1} is sufficiently close to the ground state of Hz. The success of this heuristic approach depends on making careful choices for both the initial state |ψ0〉 and the driving path {Hi}, tailored to the specific problem at hand. An analogy for MPS-DMRG-based search is given in Appendix B.

Our algorithm is implemented in Julia 1.10.5, using the ITensors library version 0.6.23 to carry out the MPS and DMRG calculations [32]. All runtime data were collected on a laptop equipped with an Apple M3 chip.

The discrete driving schedule proposed here bears some resemblance to the concept of “fictitious time” used in quantum annealing via path-integral Monte Carlo [33,34], where a transverse field is decreased over a series of discrete Monte Carlo steps. However, it is important to note that the number of Monte Carlo steps in such methods is typically very large (up to 106) [33], whereas the number of driving steps employed in our work is comparatively small—on the order of 10.

4.
Solving Sudoku Puzzles

In this section, we test the performance of our algorithm by applying it to solve the Sudoku puzzles published daily by The New York Times [35]. This choice is inspired by an example presented by Mücke [22]. A key advantage of using these puzzles is that they are archived and readily accessible online [36].

Table 1 presents a few examples. Each row lists a puzzle, uniquely identified by its date of publication and assigned difficulty level, where “m” stands for intermediate and “h” for hard. Also displayed for each puzzle are the number of clues (Nc), the number of up spins in the correct solution (N), the total number of spins (Ns) in the corresponding Ising spin glass Hz, and the constant energy shift c1 + c2 + c3 in Hz (see (16)). A successful run of the algorithm should drive the energy down to zero. For verification, we take the converged spin configuration, translate it back to the X variables, then to the full QUBO vector Z, and print the completed Sudoku board to ensure that all numbers fit correctly and none of the constraints are violated.

Table 1.

A few examples of solved Sudoku puzzles in chronological order according to their publication date in The New York Times. These puzzles vary in the number of clues (Nc), total number of spins (Ns), and other parameters; see the main text for details.

Puzzle dateLevelNcNNsc1+c2+c3
January 8, 2024h2457211368.5
December 10, 2024m2655200359.0
January 2, 2025m2259250520.5
January 8, 2025m2358232461.5
January 12, 2025m2754210426.5
January 14, 2025m2358232457.0
January 15, 2025m2556210380.0

We discuss a few examples in some detail to illustrate how the algorithm parameters are chosen for the calculations. For the January 8, 2024, puzzle, listed in the first row of the table, we start from the state (21), which is an equal-weight superposition of all Sz basis states, and use a homogeneous transverse field hmx=0.7h_m^x = 0.7 in the driver Hamiltonian Hx. The driving schedule is linear. bi=iM,ai=1bi,M=10{b_i} = {i \over M},\quad {a_i} = 1 - {b_i},\quad M = 10

For DMRG, we set the maximum bond dimension D = 60 and perform 5 sweeps at each stop i. With these settings, the proposed algorithm successfully solves the puzzle. Both Hi and |ψi⟩ change with i, so the time spent on each DMRG sweep varies roughly from 0.1 to 8 seconds. In fact, the algorithm spends most of its time on Hi<M to steer the MPS. During these steps, the MPS have D = 60, which makes them computationally expensive. Only in the last step (i = M) is the problem Hamiltonian Hz considered. This final stage is efficient and fast: the MPS typically converges within 3 DMRG sweeps, and the bond dimension drops from 60 to 1, meaning the ground state becomes a product state, as expected. The quick convergence is largely due to the proximity of |ΨM–1⟩ from the preceding steps to the true ground state |ψM⟩.

Both the initial state and the driving schedule used here resemble those in quantum annealing. This is intentional, allowing us to take advantage of superposed states and the mixer Hamiltonian. However, the similarity ends there. Our algorithm does not follow any adiabatic time evolution, so the “trajectory” of the MPS wave function from |ψ0⟩ to |ΨM is fundamentally different. The algorithm is largely insensitive to the choice of |ψ0⟩, as long as it serves as a reasonable starting point for the DMRG solution of H1, which is predominantly Hx with only a small admixture of Hz.

To demonstrate the flexibility of the algorithm, we use the same puzzle but start from a random MPS with bond dimension 3 and choose D = 20 for all subsequent steps. The puzzle is solved successfully at a much faster pace, with each sweep taking about 0.8 seconds. As shown in Figure 4, the energy (black dots) steadily drops to zero. To track the spins’ behavior at each step, we define the total spin-z operator measured from its ground state value (NNs2)\left({{N_ \uparrow } - {{{N_{\rm{s}}}} \over 2}} \right) 22Sz=m=1NsSmz(NNs2){S^z} = \sum\limits_{m = 1}^{{N_s}} {S_m^z} - \left({{N_ \uparrow } - {{{N_s}} \over 2}} \right) and evaluate its expectation value at the current MPS state |ψi〉.

Figure 4.

How the January 8, 2024, puzzle gets solved: As the driving field hx is reduced, the energy gradually drops to zero. The total spin along the x-direction vanishes, while the total spin along the z-direction approaches its ground state value. The bond dimension is D = 20, and the driving field is set to hx = 0.75.

The red crosses in Figure 4 show the expectation values of Sz (magnified by a factor of 4 to be clearly visible). Figure 4 also includes the expectation values (blue circles) of the total spin-x operator defined by 23Sx=m=1NsSmx{S^x} = \sum\limits_{m = 1}^{{N_s}} {S_m^x}

As the weight of Hx is decreased and the weight of Hz is increased during the driving process, Sx gradually approaches zero, while Sz converges to its ground state value NNs2{N_ \uparrow } - {{{N_{\rm{s}}}} \over 2}.An interesting period occurs between driving steps 2 and 4. During this interval, the spins begin to transition from being predominantly aligned along the x-axis to aligning along the z-axis. The inflection point at this transition appears crucial for the success of the algorithm.

If the primary concern is the wall time for solving the 9 × 9 Sudoku puzzles, our algorithm pales in comparison to classical algorithms that build on logic and exploit the structure of the problem. In contrast, the QUBO approach to Sudoku puzzles, as noted earlier, is not efficient and resembles more of a blind search. The problem is treated simply as another QUBO matrix, and the solution strategy here does not focus on the underlying meaning of the original constraints. However, this apparent weakness can be turned into a strength. As the board size increases, the algorithm is expected to outperform conventional methods since the calculation scales as NsD3M. More importantly, it can be applied to other QUBO problems, as we will demonstrate in Section 5.

Other puzzles listed in the table are solved in a similar manner. Since they differ in Ns, hizh_i^z, and Ji,j directly copying the algorithm parameters from a previously successful example may not always work. Occasionally, the final state might become trapped in a local minimum, with energy higher than zero (indicating that some constraints are violated). In such cases, the solution is simple: restart from a different MPS state. A useful strategy to “shake” the system loose and escape local minima is to tune the driving term Hx, for example, by adding a random fluctuation to the transverse field. 24hmx=hx+ηmh_m^x = {h_x} + {\eta _m} where hx is the homogeneous part and ηm is a random variable at site m drawn from a uniform distribution within the interval (–η, η). For example, in solving the January 15, 2025, puzzle in the last row of the table, we set D = 20, hx = 1.3, and η = 0.2 at each driving step. The algorithm once again succeeds in 10 steps.

Within the table, the January 2, 2025, puzzle has the least number of clues and the maximum number of spins, Ns = 251. The broad features of its solution process can be appreciated from Figure 5, which is comparable to our earlier example in Figure 4. In both cases, the energy decreases with i, but not exactly in a linear fashion. To quantify this, let Ei be the energy achieved at the ith driving step. If we draw a straight line from the starting point (i = 1, E1) to the ending point (i = M, EM), then let δEi be the deviation of Ei from this line. We plot δEi in Figure 6 for a few solved puzzles. The energy drop is clearly sub-linear, and the peak location of δEi correlates with the inflection point of the total Sx. A more detailed picture of the solution process is provided in Figure 7. Here, the horizontal axis represents the spin index m = 1 to 251, going from left to right. The vertical axis corresponds to the driving step i = 1 to M = 10, going from top to bottom. On each row, shown in false color, are the expectation values of the spin-z operator, SmzS_z^m, computed at the corresponding step.

Figure 5.

The solution process for another puzzle with fewer clues and more spins: D = 20, hx = 1.

Figure 6.

The nonlinear drop in energy during the driving process. See main text for details.

Figure 7.

The evolution of the 251 spins during the solution process of the January 2, 2025, puzzle. The value of SzmS_m^z is color-coded: red represents spin-up, and blue represents spin-down.

We observe that in the initial steps, due to the hx field, SmzS_m^z appears quite random. By step 4, the spins begin to settle into their “correct” states, i.e., the expectation values of SmzS_m^z align with the final solution. Once again, we see that the first few driving steps are crucial for the algorithm to work. However, note that the MPS wave function at this stage still has a large D = 20, and the energy remains relatively high. In the last step, after only three DMRG sweeps, the correct solution emerges as a product state, with red and blue colors representing |↑⟩ and |↓⟩, respectively. The spin configuration is read out and converted back first to the QUBO vector X, and then to the original binary variables in Z, resulting in the solved Sudoku board (with the clues in blue).

281354679
973816524
564792813
139468257
825973146
647521938
492635781
356187492
718249365

Interestingly, this valid solution differs from the one offered in [36]. Our quantum-inspired algorithm has found an independent solution!

We conclude the case study of Sudoku with a final remark. Our algorithm is heuristic and relies on several tuning parameters. It is unrealistic to expect a universal set of fail-safe parameters that can solve all Sudoku puzzles, as they translate into very different spin Hamiltonians. Therefore, some trial and error may be required when tackling a new puzzle. Compared to hardware-based quantum algorithms, a major advantage of our quantum-inspired approach is the explicit knowledge of the MPS wave functions, which allow for a detailed diagnosis of the solution process. As demonstrated above, in Figures 4 through 7, this analysis helps us fine-tune the initial state, driver, driving schedule, and other parameters. These strategies for parameter optimization will be further discussed when the algorithm is applied to MaxCut problems.

5.
Solving the MaxCut Problems

In this section, we apply the proposed algorithm to MaxCut, one of the most well-known problems in combinatorial optimization [37]. The goals are twofold: First, by testing it on new problem instances, we demonstrate the versatility of the algorithm and its capability to solve QUBO problems with varying characteristics. Second, by analyzing its performance across different problem sizes and types, we illustrate how the algorithm can be fine-tuned to optimize its performance for specific instances.

The MaxCut problem is defined on an undirected graph G = (V, E), where V represents a set of vertices and E represents a set of edges. An edge connecting vertex i and vertex j is denoted by (i, j) ∈ E and is assigned a weight wi,j. The objective is to partition V into two sets, V = AĀ with AĀ = ∅, such that the weighted sum of the edges connecting A to Ā is maximized. This problem is NP-hard, and its connection to spin glass Hamiltonians has long been recognized [37,38].

To cast the problem into QUBO form, let us define the binary variable xi = 1 if vertex i belongs to set A, and xi = 0 otherwise. The edge (i, j) is part of the cut if and only if xixj, i.e., (xixj)2 = 1. Therefore, the objective is to maximize the cut value. (i,j)Ewi,j(xixj)2\sum\limits_{(i,j) \in E} {{w_{i,j}}} {\left({{x_i} - {x_j}} \right)^2} or equivalently to minimize the cost function minf({ xi })=(i,j)Ewi,j(2xixjxi2xj2)\min f\left({\left\{ {{x_i}} \right\}} \right) = \sum\limits_{(i,j) \in E} {{w_{i,j}}} \left({2{x_i}{x_j} - x_i^2 - x_j^2} \right)

It is easy to cast f into the standard QUBO form f=i,jxiQi,jxjf = \sum\limits_{i,j} {{x_i}} {Q_{i,j}}{x_j} We then map the MaxCut problem to an Ising spin glass Hamiltonian similar to (16), but with c1 = c2 = 0. In this case, the cost function depends on the weight matrix w, and there is no penalty from constraints. This setup is almost the opposite of the Sudoku case, where the cost function is entirely derived from the constraints. Despite these differences, both problem types ultimately lead to spin Hamiltonians of the general form (16), which we solve by adding a driver term Hx and designing an appropriate driving schedule.

We evaluate the performance of the algorithm using MaxCut instances drawn from the Biq Mac Library. All instances used in this section are available for download at [39] or alternatively at [40]. We will refer to each instance by its file name, which contains NV, the number of vertices. Note that the complexity of the problem also depends crucially on NE, the number of edges, as well as the values of wi,j. In what follows, we discuss three batches of test cases, labeled (I) to (III), with increasing difficulty. Each batch has a distinctive distribution of edge weights.

I:
The first batch of instances listed in Table 2.
Table 2.

Twenty weighted MaxCut instances and the parameters used to solve them. Each instance is identified by its file name in the Biq Mac Library. The edge weights are either 1 or – 1. For the first ten instances, the number of vertices NV = 80 and the number of edges NE = 316. For the next ten instances, NV = 100 and NE = 495. The algorithm successfully finds E0, the ground state energy of the spin model (the MaxCut value is simply – E0), except for the case pm1s_100.5.

InstanceE0MhxηD
pm1s_80.0–7951030
pm1s_80.1–6951030
pm1s_80.2–67510.330
pm1s_80.3–6651030
pm1s_80.4–69510.330
pm1s_80.5–662010.330
pm1s_80.6–7151030
pm1s_80.7–6951030
pm1s_80.8–6851030
pm1s_80.9–6751030
pm1s_100.0–127510.330
pm1s_100.1–126510.330
pm1s_100.2–1251010.330
pm1s_100.3–1111010.330
pm1s_100.4–128510.330
pm1s_100.5125101060
pm1s_100.6–1221010.330
pm1s_100.7–1122010.360
pm1s_100.8–1201010.330
pm1s_100.9–127510.330

These are weighted MaxCut problems where the edge weight wi,j is set to either 1 or – 1. An example is illustrated in Figure 8(a), which features 100 nodes and 495 edges. The edges are color-coded: green for wi,j = 1 and blue for wi,j = – 1. It is helpful to compare Figure 8 with the Sudoku example in Figure 2, where the edge weight is constant. In the MaxCut case, the edges are not only denser but also carry signs. In the spin language, this means there are more couplings among the Ising spins, and the coupling can be either ferromagnetic or antiferromagnetic. Also, the magnetic field along the z-axis for each spin m vanishes in this case, i.e., hmz=0h_m^z = 0

Despite these differences, our algorithm successfully solves all instances listed in Table 2, yielding the correct MaxCut values, with one exception: the instance named pm1s_100.5. In this case, the lowest energy obtained, E0 = –125, is above the value of –128 quoted in [39,40]. To alert the reader, the E0 value is underscored to indicate that this case remains unresolved. The parameters used in each instance (number of driving steps M, transverse field hx and its random fluctuations η, and bond dimension D) are listed in Table 2. Five DMRG sweeps are used for each driving step, with one exception: for pm1s_100.6, 10 sweeps are used to improve accuracy.

Figure 8.

(a) Graph representation of the problem. The edges carry weights of 1 (in green) or – 1 (in blue). The solution is indicated by the node color: nodes in black belong to set A, while the rest of the nodes (in red) belong to set Ā. (b) The energy (dot), expectation values of Sz (cross, measured from its ground state value and magnified by 10 times), and Sx (circle) during the driving process. Solving the weighted MaxCut instance pm1s_100.9 from the Biq Mac Library.

Note that the algorithm parameters listed in the tables in this section may not be optimal. The problem can sometimes be solved with fewer resources than listed here.

Comparing the rows of Table 2 reveals some strategies for solving new QUBO problems. Within each group of MaxCut instances of similar size, some instances (e.g., pm1s_80.5 and pm1s_100.7) are more challenging to optimize. It is also generally harder to reach the ground state for instances with larger NV and NE. To tackle these harder cases, increasing the driving steps M and shaking the system with random fluctuations η often helps. Sometimes, increasing the bond dimension (e.g., D = 60 for pm1s_100.7) is necessary. Typically, these tuning decisions are made by monitoring the convergence of energy during the driving process. One example is shown in Figure 8(b) for the instance pm1s_100.9.

II.
The second batch of instances listed in Table 3.
Table 3.

Twenty unweighted MaxCut instances from the Biq Mac Library with dense edges. The first ten cases have NV = 60 and NE = 885, while the remaining cases have NV = 100 and NE = 2,475. All edge weights are set to 1. The algorithm successfully solves all instances except g05_100.3 and g05_100.5, where the E0 values should be – 1,424 and – 1,436, respectively [39,40]. Here, Nsw refers to the number of DMRG sweeps per driving step, with hx = 1 and η = 0.3.

InstanceE0MNswD
g05_60.0–53610530
g05_60.1–53210540
g05_60.2–52910530
g05_60.3–53810530
g05_60.4–52710530
g05_60.5–53310530
g05_60.6–53110530
g05_60.7–53510560
g05_60.8–53010530
g05_60.9–53320540
g05_100.0–143020540
g05_100.1–142520540
g05_100.2–143220540
g05_100.3–142310530
g05_100.4–144020540
g05_100.5–143510530
g05_100.6–1434101040
g05_100.7–1431101040
g05_100.8–1432101060
g05 100.9–1430101040

These are unweighted MaxCut problems where all the edges share the same weight of 1, but the connections are much denser than in the first batch. For instance, the problem shown in Figure 9(a) has the same number of nodes as in Figure 8, but the number of edges has increased fivefold to 2475. The spin-spin coupling is so dense that it may seem challenging for MPS and DMRG, as they are typically known to work well with spin Hamiltonians involving local interactions. Amazingly, the algorithm continues to yield correct MaxCut values with only a moderate increase in the bond dimension D, despite the steep rise in NE.

Figure 9.

(a) Graph representation of the problem. All edges (green lines) carry equal weight of 1. The MaxCut found by our algorithm is color-coded: nodes in black belong to set Ā, while nodes in red belong to set Ā. (b) The expectation value of SzmS_z^m during the driving process as the spins gradually settle into their ground state orientation (red represents spin up, blue represents spin down). Only driving steps 2 to 10 are shown to enhance the color contrast. Solving the unweighted MaxCut instance g05_100.4 from the Biq Mac library.

The heatmap of SzmS_z^m in Figure 9(b) provides further insight into the solution process for the instance g05_100.4. Regarding the choice of algorithm parameters, we observe similar trends noted earlier from the first batch in Table 2: for larger NV and NE, we need to increase the number of driving steps or the number of DMRG sweeps to steer the system toward the ground state. Occasionally, the bond dimension has to be increased (e.g., D = 60 for g05_60.7 and g05_100.8).

Note that there are two cases in Table 3 (with the E0 values underscored) where the algorithm came very close to the ground state but did not quite reach it.

III.
The third batch of instances listed in Table 4.
Table 4.

The algorithm parameters used to successfully solve five MaxCut instances from the Biq Mac Library with 251 vertices and over 3200 edges, each with integer weights; D = 30, M = 10.

InstanceE0NVNEhxηNsw
bqp250-2-4481025132850.05010
bqp250-4-4127425133970.05010
bqp250-6-4101425134330.3005
bqp250-8-3572625132650.05010
bqp250-10-4044225132941.000.35

The third batch of instances includes even larger MaxCut problems with NV = 251 and NE exceeding 3200. The coupling between the nodes is so dense that these instances are not easily graphed or visualized. More importantly, in contrast to the examples discussed earlier, the edge weights in these instances vary over a wide range. For instance, the edge weight distribution of the instance bqp250-10 is shown in Figure 10. While there are a few outliers, the majority of wi,j fall within the range from –100 to 100, regardless of |i – j|, the distance between nodes. Other instances listed in Table 4 follow a similar distribution for wi,j. As a result, the numerical scale of the QUBO matrix and the energy scale of the spin-spin interaction differ significantly from previous examples. To make the algorithm less sensitive to the overall numerical scale of wi,j, we rescale the problem by dividing the matrix wi,j by the maximum absolute value of its elements. After this, |wi,j| becomes typically much smaller than 1. Consequently, the value of hx is smaller compared to previous examples, as shown in the fifth column of Table 4.

Figure 10.

(a) The distribution of the edge weights wi,j sorted by |ij|, the distance between the nodes. Most of the weights lie within the interval from –100 to 100. (b) The variation of energy during the driving process for three different values of hx. All three choices converge to the ground state, yielding the correct MaxCut value. The edge matrix has been normalized such that the maximum absolute value of its elements is 1. Solving MaxCut instance bqp250-8 with 251 nodes and 3265 edges.

It’s important to note that the choice of hx is not unique. Figure 10(b) compares the energy for three different values of hx during the driving process. All three configurations lead to the correct ground state, demonstrating the robustness of the algorithm, even with the significant increase in NE and NV.

Summaries

To summarize this section, we find it encouraging that the proposed quantum-inspired algorithm is capable of solving a wide variety of MaxCut problems of different sizes and types. However, success is not always guaranteed. Some cases prove to be more stubborn, resisting energy minimization. This is not unexpected, as similar challenges are frequently encountered in quantum annealing, where techniques like reverse and cyclic annealing have been introduced to prevent the system from becoming trapped in local minima. Refining and enhancing our algorithm to address such challenges will be part of future work.

It is important to note that all QUBO problems can be formulated as MaxCut problems. Indeed, all the instances in Table 4 were originally generated as QUBO problems by Beasley [41] and later translated into MaxCut format. Thus, the key takeaway from this section is that the quantum-inspired algorithm based on MPS and DMRG is versatile and continues to perform effectively on MaxCut (and, more broadly, QUBO) problems of larger sizes with denser connections.

6.
Discussions and Conclusions

The emerging field of solving combinatorial optimization problems using quantum-inspired algorithms based on tensor networks is still in its early stages. Previous works have focused on the imaginary time evolution of MPS and experimented with PEPS [21,31], where the main approach was to solve the problem Hamiltonian directly. Our algorithm, presented in Section 3, differs in two significant ways. First, we introduce a driver/mixer Hamiltonian and work with a discrete driving schedule. Second, at each driving stage, we use DMRG to update the MPS wave function, progressively steering it toward the ground state of the problem Hamiltonian. In Sections 4 and 5, we presented conclusive evidence that the algorithm can successfully solve a variety of Sudoku puzzles and MaxCut problems. To our knowledge, the combination of DMRG with discrete driving has not been demonstrated before in the context of QUBO problems, and the application of DMRG to Ising spin glass Hamiltonians with long-range interactions has not been systematically analyzed.

The algorithm proposed here is general and can be adapted to a wide range of QUBO problems. The problem sizes presented in Sections 4 and 5 (up to 251 spins with 3,265 couplings, which exceeds the capabilities of state-of-the-art QAOA) are kept relatively small, allowing most calculations to be completed on a laptop within a few minutes to an hour. The main goal of this work is to establish the feasibility of the proposed algorithm and test it across problems of diverse origin and size, while ensuring that the iterations remain fast and computationally inexpensive. In future work, we plan to explore how the algorithm can scale to tackle practical large-scale problems. For example, a popular choice for benchmarking many state-of-the-art MaxCut solvers is Gset, which includes problems with over 800 (up to 20,000) vertices [42]. For such large problems, different trials with varied initial MPS or driving parameters could be run in parallel on high-performance computing clusters over days or weeks.

Tensor network analysis of glassy spin Hamiltonians also provides new insights into algorithm design. Quantum annealing is inherently heuristic, and when faced with a new problem Hamiltonian, it is not immediately clear which driver Hamiltonian and annealing schedule will offer the best chance of reaching the global minimum. Without a precise understanding of the dynamics of interacting spins (qubits), the annealing process could result in either a success or failure. The many-spin wave functions obtained from tensor network calculations offer detailed information about the system under driving. This diagnostic data translates into a deeper understanding of the role of each parameter, aiding in more informed decisions when selecting algorithmic parameters. The ability to directly access the quantum states is a significant strength of the quantum-inspired approach.

Quantum optimization algorithms, such as quantum annealing and QAOA, hold great potential to surpass classical algorithms for industrial-scale optimization problems. In the near term, however, their performance will be limited by the capabilities of current hardware. Before these quantum algorithms can reach their full potential, quantum-inspired algorithms can bridge the gap by solving middle-to large-scale problems within polynomial time via quantum simulations on classical computers. A few recent examples, some of which are not directly related to optimization tasks, illustrate the potential of tensor network calculations. IBM’s 127-qubit Eagle processor initially showed experimental results on two-dimensional quantum spin systems that were believed to have achieved quantum advantage—i.e., performing “accurate computations at a scale beyond brute-force classical simulation” [43]. However, soon after, improved tensor network calculations on classical computers produced more accurate results than the quantum processor [44]. Tensor networks have also been used to replace parts of the QAOA [45] or quantum annealing [46] algorithms. In yet another recent development, several quantum-inspired solvers based on tensor trains were demonstrated to successfully solve nonlinear partial differential equations [4750]. These examples further underscore that tensor network methods are powerful and versatile tools, extending beyond combinatorial optimization problems. The near-term landscape of optimization will likely feature a coexistence where quantum-inspired algorithms and pure quantum algorithms compete and complement each other.

DOI: https://doi.org/10.2478/qic-2025-0023 | Journal eISSN: 3106-0544 | Journal ISSN: 1533-7146
Language: English
Page range: 397 - 420
Submitted on: Jun 5, 2025
|
Accepted on: Aug 6, 2025
|
Published on: Dec 31, 2025
In partnership with: Paradigm Publishing Services
Publication frequency: 1 issue per year

© 2025 Max B. Zhao, Fei Li, published by Cerebration Science Publishing Co., Limited
This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License.