Austin Ulrigg
← Writing
Expository · MATH 336 · 2024

Maximum Cut and the Goemans–Williamson Algorithm

Given a graph G(V,E)G(V,E), which we will refer to simply as GG, consider partitioning the vertex set VV into two disjoint sets AA and BB, and counting the number of edges ek=(vi,vj)e_k=(v_i,v_j) where viAv_i\in A and vjBv_j\in B.

A graph G partitioned into sets A and B, with the edges crossing between them highlighted in green.
A partition of GG with two edges crossing between AA and BB.

For this partition we have two edges crossing between AA and BB. Is it possible to have more? For an arbitrary graph GG, can we maximize the number of edges that cross from AA to BB, and identify the partition(s) that attain it? This is the maximum cut problem. The size of a cut is the number of edges crossing between AA and BB, and the maximum cut is a cut with at least as many edges as every other cut.

An NP-complete problem

The maximum cut problem is known to be NP-complete; in fact, it was one of Karp's original 21 NP-complete problems.

A quadratic reformulation

The adjacency matrix AGA_G has entry aija_{ij} equal to 11 when there is an edge between viv_i and vjv_j, and 00 otherwise. Now rewrite the max cut as a quadratic program. Assign every vertex in AA the value 11 and every vertex in BB the value 1-1, so a partition becomes a choice of xi{1,1}x_i\in\{-1,1\} at each vertex. Then

maxcut(G)=14maxxi{1,1}i,j=1naij(1xixj).\operatorname{maxcut}(G)=\frac14\max_{x_i\in\{-1,1\}}\sum_{i,j=1}^{n} a_{ij}\,(1-x_i x_j).

Every crossing edge contributes aij(1xixj)=2a_{ij}(1-x_i x_j)=2, and since the (i,j)(i,j) and (j,i)(j,i) terms agree we quadruple-count the cut, which is where the factor of 14\tfrac14 comes from.

A cut for free

It is easy to find a cut of any graph that attains at least half of the max cut. Writing #E(A,B)\#E(A,B) for the number of edges in the cut of a partition V=ABV=A\cup B, there is always a partition with

#E(A,B)  maxcut(G)2.\#E(A,B)\ \ge\ \frac{\operatorname{maxcut}(G)}{2}.

A random split already achieves this in expectation, since each edge crosses with probability 12\tfrac12. The Edwards–Erdős bound sharpens it: every graph with mm edges has a cut of size at least

m2+8m+118,\frac{m}{2}+\frac{\sqrt{8m+1}-1}{8},

and this is tight for complete graphs.

Max cut on special graphs

For some families the maximum cut is known exactly. A complete graph on 2m2m vertices has maximum cut m2m^2, attained by splitting the vertices as evenly as possible; the proof is the simple inequality m2>j(2mj)m^2 > j(2m-j) for any uneven split. And a tree with mm edges has maximum cut exactly mm: a tree has no cycles, so it is bipartite, and the two-coloring puts every edge across the cut.

A tree is bipartite, so two-coloring its vertices puts every edge across the cut, so a tree with mm edges has maximum cut mm.

The Goemans–Williamson algorithm

To do better in general, we relax the quadratic program. Instead of forcing each xi{1,1}x_i\in\{-1,1\}, let each vertex be a unit vector and maximize

SDP(G)=14maxxi=1i,j=1naij(1xi,xj)  maxcut(G).\operatorname{SDP}(G)=\frac14\max_{\lVert x_i\rVert=1}\sum_{i,j=1}^{n} a_{ij}\,(1-\langle x_i,x_j\rangle)\ \ge\ \operatorname{maxcut}(G).

This is a semidefinite program, and unlike the original it can be solved in polynomial time.

But a solution to the semidefinite program is a list of nn vectors in Rn\mathbb{R}^n, not a cut of our graph. Surprisingly, the most difficult part of using this relaxation is translating the result back into a meaningful cut. The key idea is randomized hyperplane rounding: round each vector to 11 or 1-1 depending on which side of a random hyperplane it lands on.

+1 −1
Randomized hyperplane rounding: a random hyperplane through the origin sorts each vector to +1+1 or 1-1 by the side it lands on.

To choose the hyperplane, sample nn independent standard normal variables y1,,yny_1,\dots,y_n and normalize n=(y1,,yn)/(y1,,yn)\vec n = (y_1,\dots,y_n)/\lVert(y_1,\dots,y_n)\rVert to get its normal direction.

An edge (i,j)(i,j) ends up in the cut with probability θ/π\theta/\pi, where θ\theta is the angle between xix_i and xjx_j, and θπ  0.878(1cosθ)for all θ[0,π].\frac{\theta}{\pi}\ \ge\ 0.878\,\bigl(1-\cos\theta\bigr)\qquad\text{for all }\theta\in[0,\pi].

Taking expectations and using that bound on every edge gives the Goemans–Williamson guarantee: the expected size of the resulting cut is at least

αmaxcut(G),α=min0θπ2πθ1cosθ0.878.\alpha\cdot\operatorname{maxcut}(G),\qquad \alpha=\min_{0\le\theta\le\pi}\frac{2}{\pi}\,\frac{\theta}{1-\cos\theta}\approx 0.878.

So the algorithm always lands within about 88%88\% of the best possible cut: a hard guarantee, on every graph, in polynomial time. Under the unique games conjecture no efficient algorithm can beat this constant, which ties 0.8780.878 back to the P=NPP = NP question it started from.

Max cut turns up across theoretical computer science, network design, machine learning, and even theoretical physics, and the tools behind it (semidefinite programming, randomized rounding, and the probabilistic method) reach much further than this one problem. The full paper can be found here.

← Back to Writing