For any partial assignment , let count edges whose two endpoints are already fixed on opposite sides, and let count edges with at least one unassigned endpoint. Under the remaining independent fair bits,
An edge with fixed equal labels contributes zero; fixed unequal labels contribute one. If one endpoint is unassigned, its fair bit disagrees with the fixed label with probability . If both endpoints are unassigned, their independent fair bits disagree with probability as well. Count each unresolved edge once, even when both endpoints are unassigned.
Process vertices in a fixed order. Evaluate the conditional expectation cut formula after setting the next label to zero and after setting it to one; retain the larger value, choosing zero on ties. The conditional expectation choice invariant ensures the final cut of a graph has size at least . This is a deterministic approximation algorithm for maximum cut.[ref]
Directly scanning all edges to evaluate each child of each of choices takes elementary operations, in Big O notation. There is a faster implementation. When assigning vertex , let and count its already assigned graph neighbours labelled zero and one. Contributions from edges not incident to are unchanged, and contributions from edges to unassigned graph neighbours stay for either choice. Therefore
Choose zero if , otherwise one: put on the side with fewer already assigned graph neighbours. With adjacency lists, scanning each vertex's list once costs operations overall and uses storage including the graph. These bounds count operations on labels and counters that fit in machine words of bits. Multiplying the conditional expectation cut formula by two also permits exact integer comparisons without rounding.
If is the size of a maximum cut, then . The constructed cut of a graph thus has size at least , an approximation ratio of in the maximization convention. The five-versus-six example illustrates the gap between this guarantee and exact optimization.
For a general randomized algorithm, the averaging proof alone does not establish efficient derandomization. One needs a polynomial number of commitments, an efficient way to find a suitable child at each step, and manageable representations and evaluation costs for the relevant conditional expectations. Those evaluations can themselves be hard. Enumerating all completions verifies this small example, but would take exponentially many assignments as grows. The polynomial-time algorithm here comes from the local conditional expectation cut formula, not from that enumeration.
Consider the following original five-vertex simple graph, where denotes the undirected edge :
Its seven edges give initial expected value . Use vertex order and choose zero whenever the two child conditional expectations tie.
Figure 1.
A guaranteed five-edge cut and a six-edge maximum cut of the same graph
. The conditional expectations cut example uses the same original simple graph in both panels. Node colours and labels identify the two sides of each cut of a graph. Solid teal edges cross; dashed grey edges do not. The deterministic choices on the left give five crossing edges; the assignment on the right gives six. Crossings of drawn lines are not additional vertices. Details.
The complete decision ledger is below. A prefix lists fixed labels in vertex order; all later labels remain hypothetically independent fair bits. Each candidate entry is the conditional expectation of the final cut of a graph, including the contribution of unresolved edges.
Prefix before choiceNext vertexSet to 0Set to 1Chosen labelRetained conditional expectation
Empty
For example, after , edge is fixed crossing and the other six edges are unresolved, giving . Setting fixes crossing and noncrossing, leaving four unresolved edges: . Setting instead fixes crossing and noncrossing, giving the same conditional expectation.
Figure 2.
Conditional expected cut values along every chosen branch
. At each step, both candidate values are computed by the conditional expectation cut formula. The highlighted cell is chosen; ties choose zero. Below, the retained conditional expectation follows , starting before any label is fixed. The last value is the actual size of the resulting cut of a graph, rather than an average over remaining choices. Details.
The final labels are , so the two sides are and . The five crossing edges are ; do not cross. This exceeds , and hence also the rounded-up guarantee of four edges.
It is not a maximum cut. Labels cross all edges except , giving six. Seven are impossible because the triangle in a graph cannot have all three edges crossing a two-sided cut of a graph. An independent enumeration of all complete label assignments gives the following distribution, counting an assignment and its label-swapped counterpart separately:
Size of cut of a graphNumber of label assignments
The weighted sum is , so the average is , agreeing with linearity of expectation. Choosing in the earlier tie discards the remaining size-six completion while preserving the average of four. The method protects an expected value guarantee; it need not preserve the best possible completion.