ALGO-35
ALGO-35
e2
Approximation Algorithms 35.1 The vertex-cover problem e3 e1
e4 v
Two approaches to NP-hard problems: A vertex cover of an undirected graph G=(V,E) is
e.g. O(2n) a subset C of V such that for each (u, v)∈E, either
(1) Exponential algorithms: (for small inputs) u∈C or v∈C.
• brute-force search
• branch-and-bound The vertex-cover problem is to find for G a vertex
(2) Near-optimal solutions: (polynomial time) cover of minimum size. (an NP-hard problem)
• approximation algorithms (with performance select
bounds) b c d b c d
• heuristic algorithms
a e f g a e f g
Performance bounds (n is the input size)
e.g. ρ(n) = 1.5 (a) remove (b)
C is at most 1.5 times of C*
C / C * ≤ ρ( n ) for minimizati on
ratio bound: b c d b c d select
C * / C ≤ ρ(n ) for maximizati on
C is at least 1/1.5 times of C*
(Note that ρ(n) ≥ 1.)
e.g. ε(n) = 0.5 -> error within 50% a e f g a e f g
| C − C* |
relative error bound: ≤ ε (n ) select
(c)
remove
(d)
C*
(for both minimization & maximization) 1/3
35-1x
b c d b c d
ε(n), ρ(n) may be function of n (e.g., lg n, n )
constant (e.g., 0.5, 2.6)
* For many problems, there are approximation
algorithms with constant ratio bounds (relative a e f g a e f g
error bounds), independent of n. (e) (f) optimal
C = {b, c, d, e, f, g} C* = {b, d, e}
A needs at lest |A| vertices 35-4xa
a2 a4 H W
arbitrarily select
35-5 35-6
root * (b): T: a minimum spanning tree T
T O(V) (c): W: a full walk of T
(d): H: a tour of length 19.074
(e): H*: an optimal tour of length
2
14.715
E+V (unsorted array)
Prim’s algo E lg V (binary heap)
minimum Time: O(E)=O(V2) E + V lg V (Fib. heap)
spanning tree Why not Kruskal's MST algo? O(E lg V)
(Prim's algo) complete graph
H ≤ 2H*
Theorem 35.2: Approx-TSP-Tour has ρ(n) = 2.
W
35-5a
H Proof: Let T be a minimum spanning tree.
Deleting any edge from H*, we can obtain a
spanning tree. Thus, |T| ≤ |H*|. 35-6x
algorithm takes as input not only an instance of (C = t, all vi = wi) O(nC) by DP (pseudo-polynomial)
the problem, but also a constant relative error An exponential-time algorithm
35-8a
The answer is z*=302, which is well within ε = 20%. Li: y1 = 0, y2, y3, …, yk
(The optimal answer is 307 (=104+102+101).) (distinct integers)
= O( n 2 log2t ) pseudo-polynomial?
ε
fully polynomial Q.E.D.
Homework: Ex. 35.1-4, 35.5-4.