Sub topic 3
Proving Guarantees Without Knowing the Optimum
This chapter assumes you know Big-O notation, basic graph terms (matchings and spanning trees), and the definition of an approximation ratio from the previous chapter.
The Central Difficulty
An α-approximation for a minimization problem must satisfy ALG ≤ α · OPT on every instance. OPT is the value of an optimal solution, and computing it is NP-hard. If you could compute OPT, you would not need an approximation algorithm. So you cannot prove the guarantee by checking ALG against OPT directly.
The standard way around this is to find a quantity LB that has two properties:
- LB ≤ OPT on every instance, and you can prove it.
- ALG ≤ α · LB, which you prove by looking at what your algorithm does.
Chaining the two inequalities gives ALG ≤ α · LB ≤ α · OPT. You never need OPT's value. You only need a fact that every feasible solution must respect.
For maximization problems the direction flips. You find an upper bound UB ≥ OPT and show ALG ≥ α · UB, with α ≤ 1.
Where Bounds Come From
Good bounds come from the structure of the problem. The following table lists the bounds used later in this tutorial.
| Problem | Bound on OPT | Why it holds |
|---|---|---|
| Vertex cover | size of any matching ≤ OPT | each matched edge needs its own cover vertex |
| Makespan scheduling | max(largest job, total work / m) ≤ OPT | some machine runs the largest job, and some machine gets at least the average load |
| Metric TSP | MST weight ≤ OPT | deleting one edge of a tour leaves a spanning tree |
| Weighted vertex cover | LP optimum ≤ OPT | every integer solution is also a fractional one |
| Max-Cut | OPT ≤ number of edges | a cut cannot contain more edges than the graph has |
Checking a Bound Numerically
On small instances, brute force lets you check that a bound is valid and see how tight it is. The code below compares the scheduling lower bound with the true optimal makespan.
from itertools import product
def makespan_lower_bound(jobs, m):
return max(max(jobs), sum(jobs) / m)
def optimal_makespan(jobs, m):
best = float("inf")
for assign in product(range(m), repeat=len(jobs)):
loads = [0] * m
for p, i in zip(jobs, assign):
loads[i] += p
best = min(best, max(loads))
return best
jobs = [7, 5, 4, 3, 3, 2]
print(makespan_lower_bound(jobs, 3), optimal_makespan(jobs, 3))The output is 8.0 9. The bound holds, but it is not tight. The analysis only needs ALG ≤ α · LB. Any gap between LB and OPT just makes the real performance better than the proven ratio.
Common Errors
- Using an invalid bound. A quantity that is below OPT on the instances you tried is not a proof. The bound must follow from a fact that holds for every feasible solution.
- Picking a bound that is too weak. For example, "OPT ≥ 1" is valid for vertex cover on a nonempty graph, but it gives no constant ratio. The bound must be strong enough that the algorithm's cost can be charged to it.
- Flipping the direction. Minimization proofs need lower bounds on OPT, and maximization proofs need upper bounds. Mixing them up produces a chain of inequalities that proves nothing.
- Analyzing only examples. An approximation ratio is a worst-case statement. It needs an argument that covers every input.
Exercise
For makespan scheduling on m machines, explain why total work / m ≤ OPT, and give an instance where this bound alone is far from OPT.
Show answer
In any schedule the m machine loads add up to the total work, so the largest load is at least the average, which is total work / m. With one job of length 10 and m = 10 machines, total work / m = 1 but OPT = 10. That is why the bound also includes the largest job.
Exercise
For Max-Cut, the upper bound OPT ≤ |E| is used. What inequality must an algorithm satisfy to be a 1/2-approximation using this bound?
Show answer
The cut it returns must contain at least |E| / 2 edges. Then ALG ≥ |E| / 2 ≥ OPT / 2.