Graph cut optimization is a combinatorial optimization method applicable to a family of functions of discrete variables, named after the concept of cut in the theory of flow networks. Thanks to the max-flow min-cut theorem, determining the minimum cut over a graph representing a flow network is equivalent to computing the maximum flow over the network. Given a pseudo-Boolean function f, if it is possible to construct a flow network with positive weights such that
each cut C of the network can be mapped to an assignment of variables 𝐱 to f (and vice versa), and the cost of C equals f(𝐱) (up to an additive constant) then it is possible to find the global optimum of f in polynomial time by computing a minimum cut of the graph. The mapping between cuts and variable assignments is done by representing each variable with one node in the graph and, given a cut, each variable will have a value of 0 if the corresponding node belongs to the component connected to the source, or 1 if it belong to the component connected to the sink. Not all pseudo-Boolean functions can be represented by a flow network, and in the general case the global optimization problem is NP-hard. There exist sufficient conditions to characterise families of functions that can be optimised through graph cuts, such as submodular quadratic functions. Graph cut optimization can be extended to functions of discrete variables with a finite number of values, that can be approached with iterative algorithms with strong optimality properties, computing one graph cut at each iteration. Graph cut optimization is an important tool for inference over graphical models such as Markov random fields or conditional random fields, and it has applications in computer vision problems such as image segmentation, denoising, registration and stereo matching.
Representability A pseudo-Boolean function f:{0,1}n→ℝ is said to be representable if there exists a graph G=(V,E) with non-negative weights and with source and sink nodes s and t respectively, and there exists a set of nodes V0={v1,…,vn}⊂V−{s,t} such that, for each tuple of values (x1,…,xn)∈{0,1}n assigned to the variables, f(x1,…,xn) equals (up to a constant) the value of the flow determined by a minimum cut C=(S,T) of the graph G such that vi∈S if xi=0 and vi∈T if xi=1. It is possible to classify pseudo-Boolean functions according to their order, determined by the maximum number of variables contributing to each single term. All first order functions, where each term depends upon at most one variable, are always representable. Quadratic functions
f(𝐱)=w0+∑iwi(xi)+∑i<jwij(xi,xj). are representable if and only if they are submodular, i.e. for each quadratic term wij the following condition is satisfied
wij(0,0)+wij(1,1)≤wij(0,1)+wij(1,0). Cubic functions
f(𝐱)=w0+∑iwi(xi)+∑i<jwij(xi,xj)+∑i<j<kwijk(xi,xj,xk) are representable if and only if they are regular, i.e. all possible binary projections to two variables, obtained by fixing the value of the remaining variable, are submodular. For higher-order functions, regularity is a necessary condition for representability.
Graph construction Graph construction for a representable function is simplified by the fact that the sum of two representable functions f′ and f″ is representable, and its graph G=(V′∪V″,E′∪E″) is the union of the graphs G′=(V′,E′) and G″=(V″,E″) representing the two functions. Such theorem allows to build separate graphs representing each term and combine them to obtain a graph representing the entire function. The graph representing a quadratic function of n variables contains n+2 vertices, two of them representing the source and sink and the others representing the variables. When representing higher-order functions, the graph contains auxiliary nodes that allow to model higher-order interactions.
Unary terms A unary term wi depends only on one variable xi and can be represented by a graph with one non-terminal node vi and one edge s→vi with weight wi(1)−wi(0) if wi(1)≥wi(0), or vi→t with weight wi(0)−wi(1) if wi(1)<wi(0).
Binary terms
A quadratic (or binary) term wij can be represented by a graph containing two non-terminal nodes vi and vj. The term can be rewritten as
wij(xi,xj)=wij(0,0)+kixi+kjxj+kij((1−xi)xj+xi(1−xj)) with
ki=12(wij(1,0)−wij(0,0))kj=12(wij(1,1)−wij(1,0))kij=12(wij(0,1)+wij(1,0)−wij(0,0)−wij(1,1)). In this expression, the first term is constant and it is not represented by any edge, the two following terms depend on one variable and are represented by one edge, as shown in the previous section for unary terms, while the third term is represented by an edge vi→vj with weight wij(0,1)+wij(1,0)−wij(0,0)−wij(1,1) (submodularity guarantees that the weight is non-negative).
Ternary terms A cubic (or ternary) term wijk can be represented by a graph with four non-terminal nodes, three of them (vi, vj and vk) associated to the three variables plus one fourth auxiliary node vijk. A generic ternary term can be rewritten as the sum of a constant, three unary terms, three binary terms, and a ternary term in simplified form. There may be two different cases, according to the sign of p=wijk(0,0,0)+wijk(0,1,1)+wijk(1,0,1)+wijk(1,1,0). If p>0 then
wijk(xi,xj,xk)=wijk(0,0,0)+p1(xi−1)+p2(xj−1)+p3(xk−1)+p23(xj−1)xk+p31xi(xk−1)+p12(xi−1)xj−pxixjxk
with
p1=wijk(1,0,1)−wijk(0,0,1)p2=wijk(1,1,0)−wijk(1,0,1)p3=wijk(0,1,1)−wijk(0,1,0)p23=wijk(0,0,1)+wijk(0,1,0)−wijk(0,0,0)−wijk(0,1,1)p31=wijk(0,0,1)+wijk(1,0,0)−wijk(0,0,0)−wijk(1,0,1)p12=wijk(0,1,0)+wijk(1,0,0)−wijk(0,0,0)−wijk(1,1,0). If p<0 the construction is similarly, but the variables will have opposite value. If the function is regular, then all its projections of two variables will be submodular, implying that p23, p31 and p12 are positive and then all terms in the new representation are submodular. In this decomposition, the constant, unary and binary terms can be represented as shown in the previous sections. If p>0 the ternary term can be represented with a graph with four edges vi→vijk, vj→vijk, vk→vijk, vijk→t, all with weight p, while if p<0 the term can be represented by four edges vijk→vi, vijk→vj, vijk→vk, s→vijk with weight −p.
… excerpt ends here. Continue reading the full article.

