Quadratic pseudo-Boolean optimisation (QPBO) is a combinatorial optimization method for minimizing quadratic pseudo-Boolean functions in the form
f(x)=w0+\sumpwp(xp)+\sum(p,wpq(xp,xq)
xp\in\{0,1\} \forallp\inV=\{1,...,n\}
E\subseteqV x V
f
f
QPBO is a useful tool for inference on Markov random fields and conditional random fields, and has applications in computer vision problems such as image segmentation and stereo matching.
If the coefficients
wpq
wpq(0,0)+wpq(1,1)\lewpq(0,1)+wpq(1,0)
then the function can be efficiently optimised with graph cut optimization. It is indeed possible to represent it with a non-negative weighted graph, and the global minimum can be found in polynomial time by computing a minimum cut of the graph, which can be computed with algorithms such as Ford–Fulkerson, Edmonds–Karp, and Boykov–Kolmogorov's.
If the function is not submodular, then the problem is NP-hard in the general case and it is not always possible to solve it exactly in polynomial time. It is possible to replace the target function with a similar but submodular approximation, e.g. by removing all non-submodular terms or replacing them with submodular approximations, but such approach is generally sub-optimal and it produces satisfying results only if the number of non-submodular terms is relatively small.
QPBO builds an extended graph, introducing a set of auxiliary variables ideally equivalent to the negation of the variables in the problem. If the nodes in the graph associated to a variable (representing the variable itself and its negation) are separated by the minimum cut of the graph in two different connected components, then the optimal value for such variable is well defined, otherwise it is not possible to infer it. Such method produces results generally superior to submodular approximations of the target function.
QPBO produces a solution where each variable assumes one of three possible values: true, false, and undefined, noted in the following as 1, 0, and
\emptyset
f
x
\hat{V}\subseteqV
x* |
f
xi=
* | |
x | |
i |
i\in\hat{V}
x
y
\hat{y
yi
xi
i\in\hat{V}
f(\hat{y
The algorithm can be divided in three steps: graph construction, max-flow computation, and assignment of values to the variables.
When constructing the graph, the set of vertices
V
s
t
p
p'
w
wp(0)
p → t
s → p'
1 | |
2 |
wp(0)
wp(1)
s → p
p' → t
1 | |
2 |
wp(1)
wpq(0,1)
p → q
q' → p'
1 | |
2 |
wpq(0,1)
wpq(1,0)
q → p
p' → q'
1 | |
2 |
wpq(1,0)
wpq(0,0)
p → q'
q → p'
1 | |
2 |
wpq(0,0)
wpq(1,1)
q' → p
p' → q
1 | |
2 |
wpq(1,1)
The minimum cut of the graph can be computed with a max-flow algorithm. In the general case, the minimum cut is not unique, and each minimum cut correspond to a different partial solution, however it is possible to build a minimum cut such that the number of undefined variables is minimal.
Once the minimum cut is known, each variable receives a value depending upon the position of its corresponding nodes
p
p'
p
p'
p
p'
p
p'
The way undefined variables can be handled is dependent upon the context of the problem. In the general case, given a partition of the graph in two sub-graphs and two solutions, each one optimal for one of the sub-graphs, then it is possible to combine the two solutions into one solution optimal for the whole graph in polynomial time. However, computing an optimal solution for the subset of undefined variables is still a NP-hard problem. In the context of iterative algorithms such as
\alpha
It is always possible to reduce a higher-order function to a quadratic function which is equivalent with respect to the optimisation, problem known as "higher-order clique reduction" (HOCR), and the result of such reduction can be optimized with QPBO. Generic methods for reduction of arbitrary functions rely on specific substitution rules and in the general case they require the introduction of auxiliary variables. In practice most terms can be reduced without introducing additional variables, resulting in a simpler optimization problem, and the remaining terms can be reduced exactly, with addition of auxiliary variables, or approximately, without addition of any new variable.