Applied

A relaxation that answers in halves

The cheapest set of points touching every edge of a graph is hard to find. Allow each point to be taken fractionally and the problem becomes a linear programme — and its best answers are never messier than halves. Every point gets 0, ½ or 1, the 0s and 1s can always be trusted, and the proof is a picture: double the graph into a bipartite one, where a matching decides everything exactly.

Worth reading first: Two numbers that have to meet · Where the corners stop being whole.

A bound that may be off by a third and tours within half again of the best measured how far a linear programme can sit from the whole-number problem it relaxes, for the hardest problem those essays met, the shortest tour. The gap there was a fraction of the answer, and how large a fraction is still an open question. This essay takes a simpler hard problem, where the relaxation can be understood completely: not how far it is from the truth, but exactly what shape its answers have, and which parts of them are true.

The problem is vertex cover. Given a graph, choose as few points as possible so that every edge has at least one chosen end. It is one of Richard Karp’s twenty-one problems shown in 1972 to be as hard as any whose answers can be checked quickly, and no fast method for it is known. Its relaxation lets each point vv be chosen to an extent xvx_v between 0 and 1, requires xu+xv≥1x_u + x_v \ge 1 for every edge, and minimises ∑vxv\sum_v x_v. That is a linear programme — the kind the simplex method walks from corner to corner, and the kind interior-point methods solve in polynomial time even where a squashed cube defeats the simplex — and its value is a lower bound for the cheapest cover, since every whole cover is one of the fractional ones. What does its optimum look like?

A relaxation that answers in halves. x = ½,½,½,½,½,1,0,0,½,½,½; LP 5; whole cover 6.
Fig. 1 An optimal corner of the vertex-cover relaxation on an eleven-point graph. Every weight is 0, ½ or 1: the odd cycles take ½ throughout, the centre of the star takes 1 and its leaves 0.

Only halves

George Nemhauser and Leslie Trotter proved in 1974 that the relaxation always has an optimal solution in which every xvx_v is 0, ½ or 1 — and more: every corner of its feasible region, every vertex of the polytope, has that form. The figure shows one on a graph built to need all three values. A pentagon and a triangle hang off a star. Each odd cycle takes ½ at every point, because an odd cycle cannot be covered by whole points without paying for more than half of them, while halves cover every edge exactly. The star’s centre takes 1 and two of its leaves take 0, because one point at the centre covers three edges at once. The relaxation’s value is 5, the cheapest whole cover has 6 points, and one cheapest cover takes the centre and leaves the leaves — exactly as the corner suggests.

That halves are enough is surprising against the background of where the corners stop being whole, which showed why bipartite structure makes a linear programme’s corners whole and an odd cycle breaks it. The odd cycle does break it, but only by one step: the corners become halves and nothing finer. The reason is a construction that turns any graph back into a bipartite one.

Doubling the graph

Doubling the graph to make it bipartite. Pentagon: double-cover matching 5; relaxation 2.5; whole cover 3.
Fig. 2 The pentagon and its bipartite double cover: every point split into a left and a right copy, every edge replaced by two crossing edges. The double cover’s largest matching, drawn heavy, has five edges.

Split each point vv of the graph into two copies, v′v' on the left and v′′v'' on the right, and replace each edge uvuv by the two edges u′v′′u'v'' and v′u′′v'u''. The result is the bipartite double cover: twice as many points, twice as many edges, and no odd cycle anywhere, since every edge runs from left to right. For a pentagon it is a single cycle of length ten.

In a bipartite graph the cheapest cover is found exactly: by Kőnig’s theorem its size equals the size of the largest matching, and the alternating search that fails to enlarge a matching hands over a cover of the same size. Now take a cheapest cover of the double cover and give each original point vv the weight

xv=12 (number of v′,v′′ in the cover).x_v = \tfrac12\,\big(\text{number of } v', v'' \text{ in the cover}\big).

Every edge uvuv of the original graph is covered, because the double-cover edges u′v′′u'v'' and v′u′′v'u'' are both covered, which needs at least two of the four copies, so xu+xv≥1x_u + x_v \ge 1. Conversely, any fractional cover xx of the original gives a fractional cover of the double cover, xx on both copies, of twice the value — and the double cover’s relaxation has whole corners. So the relaxation’s optimum is exactly half the double cover’s cheapest cover, it is attained by the halved cover, and that solution uses only 0, ½ and 1. For the pentagon the double cover’s largest matching has five edges, every pair of copies contributes one, and every point of the pentagon gets ½: a total of 2122\tfrac12 against the 3 whole points any cover of a pentagon needs.

That is the entire proof. It also shows why the relaxation can never be infeasible or unbounded, the cases when one of the two numbers is missing catalogued: taking every point at 1 is always feasible, and nothing is ever negative. Every figure here solves the relaxation that way — by one maximum matching on a bipartite graph twice the size — rather than by a general linear-programming method.

Every graph on six points

Every six-point graph, relaxed and whole. (LP 0, whole 0): 1; (LP 1, whole 1): 171; (LP 1.5, whole 2): 20; (LP 2, whole 2): 4950; (LP 2, whole 3): 15; (LP 2.5, whole 3): 2772; (LP 2.5, whole 4): 6; (LP 3, whole 3): 19050; (LP 3, whole 4): 5782; (LP 3, whole 5): 1; exact share 0.7377, worst 1.6667.
Fig. 3 Every one of the 32,768 labelled graphs on six points, placed by the relaxation’s value across and the cheapest whole cover up, with the number of graphs at each spot. The whole cover always lies between the relaxation and twice it.

The census takes all 215=32,7682^{15} = 32{,}768 ways of putting edges among six labelled points, solves the relaxation by the double cover, and finds the cheapest whole cover by trying every set of points. The relaxation’s value is always a multiple of a half — that is the theorem — and the whole cover is never below it and never more than twice it, because rounding every ½ up to 1 turns any half-integral corner into a whole cover of at most twice the cost.

On 73.8% of the graphs the relaxation is already exact. The rest sit just above the diagonal, mostly by half a point, and the worst ratio, 5/35/3, belongs to a single graph: the complete graph on six points, whose relaxation is 3 — a half at every point — and whose cheapest cover needs 5. In general the complete graph on nn points has ratio (n−1)/(n/2)=2−2/n(n-1)/(n/2) = 2 - 2/n, which climbs to 2. So rounding the relaxation is a factor-two approximation, and on complete graphs no better than that: the relaxation itself cannot certify anything closer.

The whole parts can be trusted

The whole parts of the corner can be trusted. Six-point graphs: 32768, persistence failures 0. Random 16-point graphs: 300, failures 0; points fixed histogram 79,5,36,8,11,2,7,3,2,3,1,4,1,13,0,0,125.
Fig. 4 Persistence checked on every six-point graph and on 300 random sixteen-point graphs: the points the relaxation settles at 0 or 1 always agree with some cheapest whole cover. The bars count how many points it settled.

The second half of Nemhauser and Trotter’s theorem is the useful one. If an optimal corner sets a point to 1, some cheapest whole cover contains it; if it sets a point to 0, some cheapest whole cover leaves it out. The relaxation’s whole parts are never misleading, and the whole-number problem reduces to the part where the relaxation said ½.

The figure checks this twice. On every one of the 32,768 six-point graphs, the half-integral corner from the double cover agrees with at least one cheapest cover on all of its 0s and 1s. On 300 random graphs with sixteen points, each point is settled at 0 or 1 whenever doing so leaves the relaxation’s optimum unchanged — the points with a single neighbour first, by taking their neighbour — and then the unsettled remainder is covered exactly by search; the total always equals the cheapest whole cover, with no exception.

Why the whole parts persist has a short argument, and it is a matching argument again. Let SS be the points the corner sets to 1 and ZZ the points it sets to 0. No edge joins two points of ZZ, since their weights would sum to nought, so every neighbour of a point in ZZ lies in SS — a point of ZZ next to a point at ½ would leave that edge short. Now the optimality of the corner forces a structure between them: there is a matching that pairs every point of SS with a distinct point of ZZ. If there were not, Hall’s condition would fail for some set of points in SS with too few neighbours in ZZ, and lowering those points from 1 to ½ while raising their neighbours in ZZ from 0 to ½ would make the cover cheaper, which the optimum forbids. Given the matching, any whole cover must spend at least ∣S∣|S| points on the edges between SS and ZZ, one for each matched edge, and the set SS itself covers all of them and every edge out of ZZ. So swapping whatever a cheapest cover does on S∪ZS \cup Z for exactly SS costs nothing, and the cover that results takes all of SS and none of ZZ. This configuration — an independent set ZZ whose neighbours SS can be matched into it — is called a crown, and removing crowns is how the kernel is found.

How much is settled varies enormously, and the bars show it. On 125 of the 300 graphs the relaxation settles all sixteen points and the problem is solved outright. On 79 it settles nothing: every optimal corner is ½ everywhere, the relaxation says only that the answer lies between eight and sixteen, and the hard problem is the whole graph. This is the basis of a standard method in parameterised algorithms: the unsettled core has at most twice as many points as the relaxation’s value, so any instance can be shrunk, in polynomial time, to a kernel of at most 2k2k points for a cover of size kk, and only the kernel needs exhaustive search.

The matching on the other side

The matching on the other side. Edge weights 0-1:0.5 1-2:0.5 2-3:0.5 3-4:0.5 4-0:0.5 0-5:0 5-6:1 5-7:0 5-8:0 8-9:0.5 9-10:0.5 10-8:0.5; total 5; relaxation 5.
Fig. 5 The dual of the vertex-cover relaxation on the same eleven-point graph: a weight on every edge, at most 1 meeting at any point, read off the double cover’s largest matching.

Every linear programme has a dual that has to meet it, and the dual of the vertex-cover relaxation is the fractional matching: give each edge a weight ye≥0y_e \ge 0 so that the weights meeting at any point add to at most 1, and make the total as large as possible. Any fractional matching bounds any fractional cover from below, since each edge’s weight is paid for by its two ends; the duality theorem says the best of each meet.

The double cover produces the dual too. Its largest matching uses, for each original edge, zero, one or both of the two copies, and halving those counts gives a fractional matching of the original graph whose weights are again 0, ½ and 1. On the hero graph the odd cycles carry ½ on every edge — five halves around the pentagon, three around the triangle — and the star sends 1 down a single edge. The total is 5, equal to the relaxation’s value, and the two certificates prove each other optimal. They also explain each other: an odd cycle with ½ on every edge is a fractional matching that no whole matching can imitate, which is exactly why its points must take ½ in the cover. The price on a constraint is, here, the share of a point’s cover that each edge is responsible for.

Matchings bound covers from both sides

There is a cruder version of the same factor of two that needs no linear programme. Any matching — a set of edges no two sharing a point — needs a separate cover point for each of its edges, so the cheapest cover is at least the size of the largest matching. And a maximal matching, one that cannot be extended, has the opposite property: taking both ends of every edge in it covers the whole graph, since an uncovered edge could have been added to the matching. So a matching found greedily, edge by edge, gives a cover at most twice the cheapest, in a single pass over the edges. In a bipartite graph the two sides meet exactly, which is Kőnig’s theorem; in a general graph they can differ by a factor of two, and the complete graph is again the worst case, with matchings of size n/2n/2 against covers of size n−1n - 1.

The relaxation sits between those two whole-number bounds, and the fractional matching sits with it: largest whole matching ≤\le largest fractional matching == relaxation ≤\le cheapest whole cover. The two middle quantities are equal by duality and half-integral by the double cover, and the outer two are the problems people actually want solved. Jack Edmonds showed in 1965 that the largest whole matching can be found in polynomial time even in non-bipartite graphs, by shrinking odd cycles — the very cycles that force halves here — so the left end of the chain is easy and the right end is hard, with the relaxation in between telling exactly how much the odd cycles matter.

Random graphs, sparse and dense

Exact while the graph is sparse. c=0.5: whole 0.1675, LP 0.1675, halves 0.0000; c=1: whole 0.2692, LP 0.2683, halves 0.0050; c=1.5: whole 0.3358, LP 0.3350, halves 0.0200; c=2: whole 0.3950, LP 0.3937, halves 0.0292; c=2.5: whole 0.4425, LP 0.4375, halves 0.1467; c=2.72: whole 0.4525, LP 0.4446, halves 0.1758; c=3: whole 0.4725, LP 0.4604, halves 0.2992; c=3.5: whole 0.5067, LP 0.4829, halves 0.5775; c=4: whole 0.5317, LP 0.4925, halves 0.7333; c=5: whole 0.5733, LP 0.4946, halves 0.9125
Fig. 6 Random graphs on sixty points with each pair joined with chance c/n: the cheapest whole cover and the relaxation as shares of the points, and the share the relaxation cannot settle.

On random graphs the relaxation’s behaviour changes with density. The figure takes graphs on sixty points with average degree cc from a half to five, twenty at each density, finds the cheapest cover by branching and the relaxation by the double cover. For sparse graphs the two agree, or nearly — at c=1c = 1 the cheapest cover is 26.9% of the points and the relaxation 26.8% — and the relaxation settles almost every point: a sparse random graph is mostly trees hanging off small pieces, and repeatedly taking the neighbour of a point with one edge covers it. Richard Karp and Michael Sipser analysed exactly that leaf-removal process in 1981 and found that on large random graphs it clears everything but a vanishing part while c<ec < e, and leaves a core of linear size once c>ec > e.

The figure shows the same change, smeared by the small size. The unsettled core is under 3% up to c=2c = 2, 18% at c=ec = e, and 91% at c=5c = 5, where the relaxation is stuck at almost exactly half the points while the true cover keeps growing — 57% at c=5c = 5. The relaxation’s half-integral corner on a dense random graph is nearly all halves, which certifies only that the answer lies between n/2n/2 and nn, and the gap between the two curves is the part of the problem the relaxation cannot see. Where the moment everything joins up found a giant component appearing at c=1c = 1, the cover problem has its own threshold at c=ec = e, and it is the core, not the giant, that makes it hard.

What the computations show and assume

The relaxation is solved exactly in every figure, by a maximum matching in the double cover, and every solution is checked to cover every edge with weights summing to at least 1. The cheapest whole covers are exact: by trying every set on six points, and by branching on a point of largest degree for sixteen and sixty points. The census is exhaustive over labelled graphs, so isomorphic graphs are counted many times; the shares in it are shares of labelled graphs, which weights symmetric graphs less than asymmetric ones.

The settling procedure on random graphs fixes one point at a time whenever the relaxation’s optimum does not change. That finds a maximal set of settled points, not necessarily the theoretical minimum core; the core reported is an upper bound on the points every optimal corner leaves at ½. And the random-graph figure is at sixty points, where the threshold at ee is a gentle bend rather than the sharp change Karp and Sipser’s analysis describes in the limit.

Still open: whether two is the best factor

Rounding the relaxation gives a factor of two, and nobody knows how to do fundamentally better. Irit Dinur and Samuel Safra proved in 2005 that no polynomial method can guarantee a factor below 1.36 unless P = NP, and Subhash Khot, Dor Minzer and Muli Safra raised that to 2\sqrt 2 in 2018. If the Unique Games Conjecture is true, no polynomial method can guarantee any factor below 2 — Khot and Oded Regev proved that in 2008 — and the half-integral relaxation, with its trivial rounding, would be the best possible algorithm. The conjecture is open, and with it the question of whether the gap between 2\sqrt 2 and 2 is real.

The relaxation has been strengthened in every way anybody could think of — adding constraints for odd cycles, cliques, and whole hierarchies of lifted inequalities — and on worst-case graphs each strengthening still leaves a gap approaching 2. Whether some polynomial-size relaxation does better, or whether the factor two is a wall, is one of the cleanest open questions about what linear programmes can certify.

Halves and a picture

The vertex-cover relaxation’s best answers are made of 0, ½ and 1, because doubling the graph into a bipartite one turns it into a problem a matching solves exactly; and the 0s and 1s can always be trusted. On every six-point graph and on hundreds of random ones the persistence holds, the relaxation is exact on nearly three quarters of the small graphs and off by at most a factor approaching two on complete ones, and its dual is a fractional matching of halves read off the same double cover. Where the relaxation settles everything the problem is easy; where it answers ½ everywhere — on odd cycles, cliques and the dense core of random graphs — the hard part of an NP-complete problem is exactly what is left.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

ApproximationBipartite graphDualityLinear programmingMatchingRelaxationVertex cover