Professional Documents
Culture Documents
NP-Completeness: 3D Matching: Andreas Klappenecker
NP-Completeness: 3D Matching: Andreas Klappenecker
3D Matching
Andreas Klappenecker
1
Bipartite Matching
3
Hypergraph
4
Uniform Hypergraphs
5
3-Dimensional Matching
9
Boolean Variable Gadget
Consider
T0 = {b0, g0, p1}
T1 = {b0, g1, p0}
T2 = {b1, g0, p2}
T3 = {b1, g1, p3}
Suppose that the boys b0 and b1 and the girls g0 and g1
are not involved in any other triples. Then any matching
must contain either (T0 and T3 ) or (T1 and T2 ). The two
alternatives represent false and true, respectively. The
choice of pet will decide whether the variable is
negated or not.
10
Boolean Variable Gadgets
12
Clause Gadgets
14
Lost Pets
17
Proof
18
Reduction
19
Reduction
20
Reduction
21
Reduction
Conversely, if we solve
Ax=(1,…,1)t
for x in {0,1}n, then each row has the following
interpretation:
For v in V, v is contained in precisely one of the
triples in M ={ e in E | xe = 1}.
The fact that Ax evaluates to the all one
vector means that each element of V occurs
precisely once among the hyperedges in M.
So M is a perfect matching. Q.e.d
22
Integer Linear Programming
25
Dealing with NP-Completeness
26
Optimization Problems
27
Approximation Algorithms
28
Measuring How Good an
Approximation Algorithm Is
29
Alternative Measurements
• Relative error:
|cost of approx soln – cost of optimal
soln|/cost of optimal soln
• Difference:
|cost of approx soln – cost of optimal
soln|
30
Approximation Algorithm for
Minimum Vertex Cover Problem
• input: G = (V,E)
• C :=
• E' := E
• while E' ≠ do
• pick any (u,v) in E'
• C := C U {u,v}
• remove from E' every edge incident on u or
v
• endwhile
• return C
31
Min VC Approx Algorithm
32
Min VC Approx Alg Example
b c d
a e f g
33
Ratio Bound of Min VC Alg
35
Triangle Inequality
38
Analysis of TSP Approx Alg
39
Analysis of TSP Approx Alg
40
Analysis of TSP Approx Alg
input: G = (V,E)
1. convert G to this TSP input:
• one city for each node in V
• distance between cities u and v is 1 if (u,v)
is in E
• distance between cities u and v is r*|V| if
(u,v) is not in E, where r is the ratio bound
of the TSP approx alg
• Note: This TSP input does not satisfy
the triangle inequality
43
HC (Exact) Algorithm Using
TSP Approximation Algorithm
44
Correctness of HC Algorithm
45
Correctness of HC Algorithm