1. This document summarizes key concepts for the midterm exam including approximation algorithms, combinatorial algorithms for problems like vertex cover and TSP, linear programming formulations and relaxations, and algorithms for problems like weighted vertex cover and set cover using LP rounding and primal dual methods.
2. Max flow minimum cut concepts and the Ford-Fulkerson algorithm are also covered. Guidelines are provided for writing clear solutions including explicitly stating the formulation, justification, algorithm, runtime analysis, and approximation guarantees.
3. Common ingredients to include in solutions are the formulation, justification that the LP relaxation provides an upper bound, stating the algorithm clearly, analyzing runtime, showing feasibility, and being explicit about approximation guarantees.
1. MIDTERM REVIEW SESSION FOR CS261
1. What's this about?
approximation algorithm
• in theory: a rigorous way to deal with NP-hardness. focus on worst-case
guarantee.
in practice: even a 3/4-approximation is unsatisfactory. cutting plane
methods. integer program solver. local search. heuristics.
• common: both often use optimal LP value as a benchmark.
• there's always a gap between theory and practice.
2. Combinatorial Approach
Vertex Cover: unnatural greedy is 2-approx. size of max matching as a
lower bound.
Steiner Tree: non-metric version reducible to the metric version. then do
(1) double the tree (dfs) (2) traverse (3) shortcut (justied by metric ineq.).
TSP: general cost + non-repetition is not O(1)-approximable. if you can
repeat, then metric is ne.
• 2-approx: double the MST + shortcut.
• 3/2-approx: MST + min-cost perfect matching on odd-degree nodes
(at cost=half of optimal) + eulerian cycle + shortcut.
Set Cover: has VC as a special case.
L.B.: if we have a subset D of elements, and every set Si contains at
most t elements of D, then opt is at least |D|/t.
• when the i-th element xi is covered, ci new elements were covered.
1
amortize the cost: cost(xi ) = ci
• opt= i cost(xi ).
• every set covers at most ci of the n − i + 1 elements. So we have a l.b.
n−i+1
on opt: opt ≥ ci (n − i + 1) · cost(xi )
3. Linear Programming
3.1. LP.
primal: max cT x subject to Ax ≤ b, x ≥ 0. (called packing LP if A ≥ 0)
dual: min bT y subject to AT y ≥ c, y ≥ 0. (called covering LP if A ≥ 0)
(more often primal is minimization problem, then dual is the maximiza-
tion problem.)
outcome: feasible. infeasible. unbounded.
meaning: highest lower-bound on primal optimal.
weak duality: primal opt ≥ dual opt
strong duality: primal opt = dual opt, except when both infeasible.
duality in form: inequality ↔ nonnegativity, equality ↔ unconstrained.
complexity: solvable in PTIME. even simplex does well.
1
2. MIDTERM REVIEW SESSION FOR CS261 2
3.2. ILP and LP Relaxations.
ILP: linear constraints + integer variables. often NP-hard. (still often fea-
sible in practice. using cplex)
LP Relaxation: simply replace integrality constraint to like x ≥ 0.
What's A Formulation: It's kinda fuzzy. But when you use it, it needs
ideally: feasible solution to ILP ↔ feasible solution to problem
also work: optimal solution to ILP ↔ optimal solution to problem
bottomline: the LP optimal value should give a bound on optimal to
the problem.(and hopefully not too far away)
Lower Bounds:
• the optimal value of LP relaxation fractional optimal
• objective value of any feasible dual solution
3.3. Weighted Vertex Cover.
LP Rounding: solve LP. pick the vertex i xv ≥ 1/2. (1. ensures it gives a
VC, 2. lose by a factor of 2).
Primal Dual: dual yu,v .
• old alg: if (u,v) uncovered, set xu , xv , yu,v = 1. matching cast as a
y(u,v) = 1 if (u,v) in M.
dual sol: set
• use twice of dual y(u,v) to construct payments pv for costs of vertices,
while preserving dual feasibility. pick v if fully-paid for.
3.4. Weighted Set Cover.
LP Rounding: we round w.p. x∗
i independently, may not be a cover. but
each element with probability at least 1-1/e covered.
x: repeat until all elements covered. after log iterations, still exists
uncovered elements with exponentially small probability.
Primal Dual: eective cost of a set cj = wi
newlycovered . same logic as before.
in fact dual pj =eective cost.
• in fact, the primal is fully-paid for by eective payments, scaled down
1
by H(m) is feasible:
H(m) j∈S pj ≤ c(S).
4. Max Flow / Min Cut
4.1. Basic Concepts.
input: directed graph with capacities c : E → [0, ∞) and s, t pair.
ow: f : E → [0, ∞) s.t. (1) upper-bounded by capacity, and (2) satises
conservation constraints.
size of a ow: sum of f from source. convention: ow/capacity
cut: partition (A, V A) s.t. s ∈ A, t ∈ A. c(A) = u∈A,v∈A,(u,v)∈E c(u, v).
/ /
inequalities: for any s-t cut A: cost(f ) = v∈V :(s,v)∈E f (s, v) = f (A) ≤
a∈A,b∈A,(a,b)∈E f (u, v) ≤
/ a∈A,b∈A,(a,b)∈E c(u, v) = c(A).
/
witness of optimality: a cut A that's saturated.
4.2. Ford-Fulkerson.
residual network: capacity = how much more ow you can push.
augmenting path: s-t path with positive capacity arcs.
Ford-Fulkerson: while an augmenting path can be found, push the maxi-
mum amount of ow on the path.
3. MIDTERM REVIEW SESSION FOR CS261 3
Termination: let A be set of nodes to which you can have augmenting path
to from s. the cut across A is saturated: f (a, b) = c(a, b). and f (b, a) = 0.
Implication: Max-Flow = Min-Cut
time complexity: as bad as |C| for bad choices of aug paths.
5. On Writing Solutions
• Common Main ingredients:
Formulation, Justication, Algorithm, Runtime, Feasibility, Approxi-
mation
Formulation: make all quanties explicit
Justication: you need to show that LP optimal gives a bound on optimal.
Algorithm: Explicitly state your algorithm.
Runtime: State it. If you need to solve LP exactly, mention that this can be
done in PTIME.
Feasibility: Show it.
Approximation: Be explicit about all important quantities, and the inequal-
ities. be explict if you use weak duality.
• Miscellaneous Stu
taking dual is a mechanical process. don't be too smart.
(optional) please don't use matrix notations when you are asked to
write LPs.
be explicit about whether you round it independently or dependently.
be explicit about application of linearity of expectation.
use xv , yu,v etc. not ei,j . no reuse of symbols.
randomized rounding is a general method. does not refer to any par-
ticular rounding algorithm.