Professional Documents
Culture Documents
Super Notes On Intractability 1
Super Notes On Intractability 1
I NTRACTABILITY I
‣ poly-time reductions
‣ packing and covering problems
‣ constraint satisfaction problems
‣ sequencing problems
‣ partitioning problems
‣ graph coloring
‣ numerical problems
Lecture slides by Kevin Wayne
Copyright © 2005 Pearson-Addison Wesley
http://www.cs.princeton.edu/~wayne/kleinberg-tardos
‣ poly-time reductions
‣ packing and covering problems
‣ constraint satisfaction problems
‣ sequencing problems
‣ partitioning problems
‣ graph coloring
‣ numerical problems
SECTION 8.1
Algorithm design patterns and antipatterns
3
Classify problems according to computational requirements
4
Classify problems according to computational requirements
yes probably no
2-satisfiability 3-satisfiability
matching 3d-matching
5
Classify problems
6
Poly-time reductions
Algorithm
instance I
solution S to I
for Y
(of X)
Algorithm for X
7
Poly-time reductions
Notation. X ≤ P Y.
Note. We pay for time to write down instances of Y sent to oracle ⇒
instances of Y must be of polynomial size.
Novice mistake. Confusing X ≤ P Y with Y ≤ P X.
8
Intractability: quiz 1
9
Intractability: quiz 2
C. Both A and B.
D. Neither A nor B.
10
Poly-time reductions
11
8. I NTRACTABILITY I
‣ poly-time reductions
‣ packing and covering problems
‣ constraint satisfaction problems
‣ sequencing problems
‣ partitioning problems
‣ graph coloring
‣ numerical problems
SECTION 8.1
Independent set
13
Vertex cover
14
Intractability: quiz 3
C. Both A and B.
D. Neither A nor B.
15
Vertex cover and independent set reduce to one another
16
Vertex cover and independent set reduce to one another
17
Vertex cover and independent set reduce to one another
18
Set cover
U = { 1, 2, 3, 4, 5, 6, 7 }
Sa = { 3, 7 } Sb = { 2, 4 }
Sc = { 3, 4, 5, 6 } Sd = { 5 }
Se = { 1 } Sf = { 1, 2, 6, 7 }
k=2
A. 1 U = { 1, 2, 3, 4, 5, 6, 7 }
B. 2 Sa = { 1, 4, 6 } Sb = { 1, 6, 7 }
C. 3 Sc = { 1, 2, 3, 6 } Sd = { 1, 3, 5, 7 }
Se = { 2, 6, 7 } Sf = { 3, 4, 5 }
D. None of the above.
20
Vertex cover reduces to set cover
a b
e7 e2 e4 U = { 1, 2, 3, 4, 5, 6, 7 }
e3
Sa = { 3, 7 } Sb = { 2, 4 }
f e6 c
Sc = { 3, 4, 5, 6 } Sd = { 5 }
e1 e5 Se = { 1 } Sf = { 1, 2, 6, 7 }
e d
a b
e7 e2 e4 U = { 1, 2, 3, 4, 5, 6, 7 }
e3
Sa = { 3, 7 } Sb = { 2, 4 }
f e6 c
Sc = { 3, 4, 5, 6 } Sd = { 5 }
e1 e5 Se = { 1 } Sf = { 1, 2, 6, 7 }
e d
a b
e7 e2 e4 U = { 1, 2, 3, 4, 5, 6, 7 }
e3
Sa = { 3, 7 } Sb = { 2, 4 }
f e6 c
Sc = { 3, 4, 5, 6 } Sd = { 5 }
e1 e5 Se = { 1 } Sf = { 1, 2, 6, 7 }
e d
‣ poly-time reductions
‣ packing and covering problems
‣ constraint satisfaction problems
‣ sequencing problems
‣ partitioning problems
‣ graph coloring
‣ numerical problems
SECTION 8.2
Satisfiability
€
Key application. Electronic design automation (EDA).
25
Satisfiability is hard
Scientific hypothesis. There does not exists a poly-time algorithm for 3-SAT.
P vs. NP. This hypothesis is equivalent to P ≠ NP conjecture.
https://www.facebook.com/pg/npcompleteteens
26
3-satisfiability reduces to independent set
k=3
Φ = ( x1 ∨ x2 ∨ x 3 ) ∧ ( x1 ∨ x2 ∨ x 3 ) ∧ ( x1 ∨ x2 ∨ x 4 )
27
3-satisfiability reduces to independent set
k=3
Φ = ( x1 ∨ x2 ∨ x 3 ) ∧ ( x1 ∨ x2 ∨ x 3 ) ∧ ( x1 ∨ x2 ∨ x 4 )
28
3-satisfiability reduces to independent set
k=3
Φ = ( x1 ∨ x2 ∨ x 3 ) ∧ ( x1 ∨ x2 ∨ x 3 ) ∧ ( x1 ∨ x2 ∨ x 4 )
29
Review
30
DECISION, SEARCH, AND OPTIMIZATION PROBLEMS
31
8. I NTRACTABILITY I
‣ poly-time reductions
‣ packing and covering problems
‣ constraint satisfaction problems
‣ sequencing problems
‣ partitioning problems
‣ graph coloring
‣ numerical problems
SECTION 8.5
Hamilton cycle
yes
35
Hamilton cycle
1 1ʹ
2 2ʹ
3 3ʹ
4 4ʹ
no
36
Directed Hamilton cycle reduces to Hamilton cycle
Pf. Given a directed graph G = (V, E), construct a graph G ʹ with 3n nodes.
aout
a din
d
b v
bout vin v vout
e
c
ein
cout
directed graph G undirected graph G′
37
Directed Hamilton cycle reduces to Hamilton cycle
38
3-satisfiability reduces to directed Hamilton cycle
39
3-satisfiability reduces to directed Hamilton cycle
x1
x2
x3
40
Intractability: quiz 5
x1
x2
x3
41
3-satisfiability reduces to directed Hamilton cycle
Cj Ck
connect in this way
connect in this way
if xi appears in clause Cj
if xi appears in clause Ck
xi
xi = true
xi = false
42
3-satisfiability reduces to directed Hamilton cycle
x1
x2
x3
43
3k + 3
3-satisfiability reduces to directed Hamilton cycle
44
3-satisfiability reduces to directed Hamilton cycle
45
Poly-time reductions
constraint satisfaction
3-SAT
s
u ce
ed
e r -SET
m T
l y-ti DEN
po N
PE
E
S AT ND
I
3- to
SET-COVER
46
8. I NTRACTABILITY I
‣ poly-time reductions
‣ packing and covering problems
‣ constraint satisfaction problems
‣ sequencing problems
‣ partitioning problems
‣ graph coloring
‣ numerical problems
SECTION 8.8
My hobby
71
Subset sum
72
3-satisfiability reduces to subset sum
¬ x3 0 0 1 0 0 1 1,001
0 0 0 1 0 0 100
0 0 0 2 0 0 200
C1 = ¬ x1 ∨ x2 ∨ x3 dummies to get clause
0 0 0 0 1 0 10
columns to sum to 4
C2 = x1 ∨ ¬ x2 ∨ x3 0 0 0 0 2 0 20
0 0 0 0 0 1 1
C3 = ¬ x1 ∨ ¬ x2 ∨ ¬ x3
0 0 0 0 0 2 2
SUBSET-SUM instance 73
3-satisfiability reduces to subset sum
x3 0 0 1 1 1 0 1,110
¬ x3 0 0 1 0 0 1 1,001
0 0 0 1 0 0 100
0 0 0 2 0 0 200
C1 = ¬ x1 ∨ x2 ∨ x3 dummies to get clause
0 0 0 0 1 0 10
columns to sum to 4
C2 = x1 ∨ ¬ x2 ∨ x3 0 0 0 0 2 0 20
0 0 0 0 0 1 1
C3 = ¬ x1 ∨ ¬ x2 ∨ ¬ x3
0 0 0 0 0 2 2
SUBSET-SUM instance 74
3-satisfiability reduces to subset sum
¬ x1 1 0 0 1 0 1 100,101
x2 0 1 0 1 0 0 10,100
¬ x2 0 1 0 0 1 1 10,011
x3 0 0 1 1 1 0 1,110
¬ x3 0 0 1 0 0 1 1,001
0 0 0 1 0 0 100
0 0 0 2 0 0 200
C1 = ¬ x1 ∨ x2 ∨ x3 dummies to get clause
0 0 0 0 1 0 10
columns to sum to 4
C2 = x1 ∨ ¬ x2 ∨ x3 0 0 0 0 2 0 20
0 0 0 0 0 1 1
C3 = ¬ x1 ∨ ¬ x2 ∨ ¬ x3
0 0 0 0 0 2 2
SUBSET-SUM instance 75
SUBSET SUM REDUCES TO KNAPSACK
11 kg
ui U, vi V
$6 2 kg
i S i S
<latexit sha1_base64="DjnTzvj+WHf+FaTftn84jpbOcCs=">AAACcnicbVDLSgMxFE3Hd31V3ekmWgQXUmZEUHAjuHGpaKvQKUMmc1uDmcyY3Ihl6C/5NW5c6Ff4AabjLGz1QsjhnHNzc0+cS2HQ999r3szs3PzC4lJ9eWV1bb2xsdkxmdUc2jyTmb6PmQEpFLRRoIT7XANLYwl38ePFWL97Bm1Epm5xmEMvZQMl+oIzdFTUuAyNTaNC0FAoejOiNnLwjIYSxlf7kIZPliX1KZeTnivjoDR26lGj6bf8suhfEFSgSaq6ijZqm2GScZuCQi6ZMd3Az7FXMI2CSxjVQ2sgZ/yRDaDroGIpmF5Rrjyi+45JaD/T7iikJfu7o2CpMcM0ds6U4YOZ1sbkf1rXYv+0VwiVWwTFfwb1raSY0XF+NBEaOMqhA4xr4f5K+QPTjKNLeWJK+XYOfGKT4sUqwbMEpliJL6jZyKUYTGf2F3SOWoHfCq6Pm+enVZ6LZIfskQMSkBNyTi7JFWkTTl7JG/kgn7Uvb9vb9arwvVrVs0Umyjv8Bj7BvMU=</latexit>
$28 g
7k
$1 g
1k
Recall. O(n U) dynamic programming algorithm for KNAPSACK.
constraint satisfaction
3-SAT
s
u ce
ed
e r -SET
m T
l y-ti DEN
po N
PE
E
S AT ND
I
3- to
SET-COVER
77
Karp’s 20 poly-time reductions from satisfiability
78