Finding a solution and checking it is easy. Proving that it cannot be beaten is the hard part: it is a statement about all solutions.
Choose a vertex cover (or an independent set), try to prove that it is optimal by brute force, then let the LP relaxation do it with a single number.
n = 6
Problem
Graph
What we know about the optimum
As an integer program
Why the relaxation gives a bound
An integer program asks for the best grid point of a region; its LP relaxation allows every point of the region.
Push the line (in 3D the plane) of equal objective value in the better direction: it stops at the best grid point first, and leaves the region only later, at the LP optimum.
The band in between is the gap. Click a grid point to take it as your solution.
k = 4
View
Region and grid points
\(z\;=\)
What we know about the optimum
What you see
The graph
The two optima
The integer program
Grid points, bounds, rounding, the integer hull
Branch and bound splits the problem on a fractional variable of the LP optimum, solves the LPs of the parts, and prunes every part whose LP bound
cannot beat the best solution found so far. Step through the code; the tree below the picture is the proof of optimality once the open list is empty.