Quadratic unconstrained binary optimization

From HandWiki
Revision as of 00:10, 7 February 2024 by imported>StanislovAI (link)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Quadratic unconstrained binary optimization (QUBO), also known as unconstrained binary quadratic programming (UBQP), is a combinatorial optimization problem with a wide range of applications from finance and economics to machine learning.[1] QUBO is an NP hard problem, and for many classical problems from theoretical computer science, like maximum cut, graph coloring and the partition problem, embeddings into QUBO have been formulated.[2][3] Embeddings for machine learning models include support-vector machines, clustering and probabilistic graphical models.[4] Moreover, due to its close connection to Ising models, QUBO constitutes a central problem class for adiabatic quantum computation, where it is solved through a physical process called quantum annealing.[5]

Definition

The set of binary vectors of a fixed length n>0 is denoted by 𝔹n, where 𝔹={0,1} is the set of binary values (or bits). We are given a real-valued upper triangular matrix Qn×n, whose entries Qij define a weight for each pair of indices i,j{1,,n} within the binary vector. We can define a function fQ:𝔹n that assigns a value to each binary vector through

fQ(x)=xQx=i=1nj=inQijxixj

Intuitively, the weight Qij is added if both xi and xj have value 1. When i=j, the values Qii are added if xi=1, as xixi=xi for all xi𝔹.

The QUBO problem consists of finding a binary vector x* that is minimal with respect to fQ, namely

x𝔹n:fQ(x*)fQ(x)

In general, x* is not unique, meaning there may be a set of minimizing vectors with equal value w.r.t. fQ. The complexity of QUBO arises from the number of candidate binary vectors to be evaluated, as |𝔹n|=2n grows exponentially in n.

Sometimes, QUBO is defined as the problem of maximizing fQ, which is equivalent to minimizing fQ=fQ.

Properties

QUBO is scale invariant for positive factors α>0, which leave the optimum x* unchanged:

fαQ(x)=ij(αQij)xixj=αijQijxixj=αfQ(x)

In its general form, QUBO is NP-hard and cannot be solved efficiently by any polynomial-time algorithm.[6] However, there are polynomially-solvable special cases, where Q has certain properties,[7] for example:

  • If all coefficients are positive, the optimum is trivially x*=(0,,0). Similarly, if all coefficients are negative, the optimum is x*=(1,,1).
  • If Q is diagonal, the bits can be optimized independently, and the problem is solvable in 𝒪(n). The optimal variable assignments are simply xi*=1 if Qii<0, and xi*=0 otherwise.
  • If all off-diagonal elements of Q are non-positive, the corresponding QUBO problem is solvable in polynomial time.[8]

QUBO can be solved using integer linear programming solvers like CPLEX or Gurobi Optimizer. This is possible since QUBO can be reformulated as a linear constrained binary optimization problem. To achieve this, substitute the product xixj by an additional binary variable zij{0,1} and add the constraints xizij, xjzij and xi+xj1zij. Note that zij can also be relaxed to continuous variables within the bounds zero and one.

Applications

QUBO is a structurally simple, yet computationally hard optimization problem. It can be used to encode a wide range of optimization problems from various scientific areas.[9]

Cluster Analysis

Binary Clustering with QUBO
20 points with random cluster assignment
A bad cluster assignment.
20 points with sensible cluster assignment
A good cluster assignment.
Visual representation of a clustering problem with 20 points: Circles of the same color belong to the same cluster. Each circle can be understood as a binary variable in the corresponding QUBO problem.

As an illustrative example of how QUBO can be used to encode an optimization problem, we consider the problem of cluster analysis. Here, we are given a set of 20 points in 2D space, described by a matrix D20×2, where each row contains two cartesian coordinates. We want to assign each point to one of two classes or clusters, such that points in the same cluster are similar to each other. For two clusters, we can assign a binary variable xi𝔹 to the point corresponding to the i-th row in D, indicating whether it belongs to the first (xi=0) or second cluster (xi=1). Consequently, we have 20 binary variables, which form a binary vector x𝔹20 that corresponds to a cluster assignment of all points (see figure).

One way to derive a clustering is to consider the pairwise distances between points. Given a cluster assignment x, one of xixj or (1xi)(1xj) evaluates to 1 if points i and j are in the same cluster. Similarly, one of xi(1xj) or (1xi)xj indicates that they are in different clusters. Let dij0 denote the Euclidean distance between points i and j. In order to define a cost function to minimize, when points i and j are in the same cluster we add their positive distance dij, and subtract it when they are in different clusters. This way, an optimal solution tends to place points which are far apart into different clusters, and points that are close into the same cluster. The cost function thus comes down to

f(x)=i<jdij(xixj+(1xi)(1xj))dij(xi(1xj)+(1xi)xj)=i<j[4dijxixj2dijxi2dijxj+dij]

From the second line, the QUBO parameters can be easily found by re-arranging to be:

Qij={dijif ij(k=1i1dki+=i+1ndi)if i=j

Using these parameters, the optimal QUBO solution will correspond to an optimal cluster w.r.t. above cost function.

Connection to Ising models

QUBO is very closely related and computationally equivalent to the Ising model, whose Hamiltonian function is defined as

H(σ)=ijJijσiσjμjhjσj

with real-valued parameters hj,Jij,μ for all i,j. The spin variables σj are binary with values from {1,+1} instead of 𝔹. Moreover, in the Ising model the variables are typically arranged in a lattice where only neighboring pairs of variables ij can have non-zero coefficients. Applying the identity σ2x1 yields an equivalent QUBO problem:[2]

f(x)=ijJij(2xi1)(2xj1)+jμhj(2xj1)=ij(4Jijxixj+2Jijxi+2JijxjJij)+j(2μhjxjμhj)using xj=xjxj=ij(4Jijxixj)+ij2Jijxi+ij2Jijxj+j2μhjxjijJijjμhj=ij(4Jijxixj)+ji2Jjixj+ij2Jijxj+j2μhjxjijJijjμhjusing ij=ji=ij(4Jijxixj)+jk=ji2Jkixj+jik=j2Jikxj+j2μhjxjijJijjμhj=ij(4Jijxixj)+j(ik=j(2Jki+2Jik)+2μhj)xjijJijjμhjusing k=ji=ik=j=i=1nj=1iQijxixj+C

where

Qij={4Jijif ijik=j(2Jki+2Jik)+2μhjif i=jC=ijJijjμhj

and using the fact that for a binary variable xj=xjxj.

As the constant C does not change the position of the optimum x*, it can be neglected during optimization and is only important for recovering the original Hamiltonian function value.

References

  1. Kochenberger, Gary; Hao, Jin-Kao; Glover, Fred; Lewis, Mark; Lu, Zhipeng; Wang, Haibo; Wang, Yang (2014). "The unconstrained binary quadratic programming problem: a survey.". Journal of Combinatorial Optimization 28: 58–81. doi:10.1007/s10878-014-9734-0. http://leeds-faculty.colorado.edu/glover/454%20-%20xQx%20survey%20article%20as%20published%202014.pdf. 
  2. 2.0 2.1 Glover, Fred; Kochenberger, Gary (2019). "A Tutorial on Formulating and Using QUBO Models". arXiv:1811.11538 [cs.DS].
  3. Lucas, Andrew (2014). "Ising formulations of many NP problems". Frontiers in Physics 2: 5. doi:10.3389/fphy.2014.00005. Bibcode2014FrP.....2....5L. 
  4. Mücke, Sascha; Piatkowski, Nico; Morik, Katharina (2019). "Learning Bit by Bit: Extracting the Essence of Machine Learning". LWDA. https://pdfs.semanticscholar.org/f484/b4a789e1563b91a416a7cfabbf72f0aa3b2a.pdf. 
  5. Tom Simonite (8 May 2013). "D-Wave's Quantum Computer Goes to the Races, Wins". MIT Technology Review. http://www.technologyreview.com/view/514686/d-waves-quantum-computer-goes-to-the-races-wins/. 
  6. A. P. Punnen (editor), Quadratic unconstrained binary optimization problem: Theory, Algorithms, and Applications, Springer, Springer, 2022.
  7. Çela, E., Punnen, A.P. (2022). Complexity and Polynomially Solvable Special Cases of QUBO. In: Punnen, A.P. (eds) The Quadratic Unconstrained Binary Optimization Problem. Springer, Cham. https://doi.org/10.1007/978-3-031-04520-2_3
  8. See Theorem 3.16 in Punnen (2022); note that the authors assume the maximization version of QUBO.
  9. Ratke, Daniel (2021-06-10). "List of QUBO formulations". https://blog.xa0.de/post/List-of-QUBO-formulations/. 
  • QUBO Benchmark (Benchmark of software packages for the exact solution of QUBOs; part of the well-known Mittelmann benchmark collection)