Professional Documents
Culture Documents
23reductions PDF
23reductions PDF
23reductions PDF
designing algorithms
proving limits
classifying problems
NP-completeness
1
Bird’s-eye view
Desiderata.
Classify problems according to their computational requirements.
Frustrating news.
Huge number of fundamental problems have defied classification
Desiderata'.
Suppose we could (couldn't) solve problem X efficiently.
What else could (couldn't) we solve efficiently?
2
Reduction
Algorithm
instance I solution to I
for Y
(of X)
Algorithm for X
Applications
• designing algorithms: given algorithm for Y, can also solve X.
• proving limits: if X is hard, then so is Y.
• classifying problems: establish relative difficulty of problems.
4
designing algorithms
proving limits
classifying problems
NP-completeness
5
Reductions for algorithm design
Applications.
• designing algorithms: given algorithm for Y, can also solve X.
• proving limits: if X is hard, then so is Y.
• classifying problems: establish relative difficulty of problems.
Mentality: Since I know how to solve Y, can I use that algorithm to solve X?
Convex hull. Given N points in the plane, identify the extreme points
of the convex hull (in counter-clockwise order).
2861534
3988818
4190745
13546464
89885444
2 24 3
9
s
18
14 6
2
6
30 4 19
11
15 5
5
6
20 16
7 44 t
S v
s s s s
1 2 1 2 1 2 1 2
3 4 3 4 3 4 3 4
t t t t
s s s
1 2 1 2 1 2
back edge
(remove flow)
3 4 3 4 3 4
t t t
Proof: 0 1 2 3 4 5
11
Reductions for algorithm design: bipartite matching
Proof: 0 1 2 3 4 5
0 1 2 3 4 5
bipartite
arbitrage
matching PFS
element sorting
distinctness
Euclidean
closest
MST LP
pair
Voronoi
LP (standard form)
13
Reductions for algorithm design: a caveat
15
Linear-time reductions to prove limits
Applications.
•designing algorithms: given algorithm for Y, can also solve X.
•proving limits: if X is hard, then so is Y.
•classifying problems: establish relative difficulty of problems.
Mentality:
If I could easily solve Y, then I could easily solve X
I can’t easily solve X.
Therefore, I can’t easily solve Y
NOT intended for use
as an algorithm
Purpose of reduction is to establish that Y is hard
16
Proving limits on convex-hull algorithms
Consequence.
Any ccw-based convex hull algorithm requires (N log N) steps.
1251432
2861534
3988818
4190745
13546464
89885444
17
Sorting linear-reduces to convex hull
f(x) = x2
(x1 , x12 )
(x2 , x22 )
19
3-SUM reduces to 3-COLLINEAR (continued)
(1, 1)
(-3, -27)
-3 + 2 + 1 = 0
20
3-SUM reduces to 3-COLLINEAR (continued)
Pf. Three points (a, a3), (b, b3), (c, c3) are collinear iff:
21
Reductions for proving limits: summary
sorting
convex hull
3-SUM
3-COLLINEAR
22
designing algorithms
proving limits
classifying problems
NP-completeness
23
Reductions to classify problems
Applications.
• Design algorithms: given algorithm for Y, can also solve X.
• Establish intractability: if X is hard, then so is Y.
• Classify problems: establish relative difficulty between two problems.
not a loop
Notation. X P Y.
25
Polynomial-time reductions for classifying problems
yes instance
(¬x1 x2 x3) (x1 ¬x2 x3) (¬x1 ¬x2 ¬x3) (¬x1 ¬ x2 x4) (¬x2 x3 x4)
x1 x2 x3 x4
(¬T T F ) (T ¬T F ) (¬T ¬T ¬F ) (¬T ¬T T) ( ¬T F T)
T T F T
no instance
(¬x1 x2 x3) (x1 ¬x2 x3) (¬x1 ¬x2 ¬x3) (¬x1 ¬ x2 ¬ x4) (¬x2 x3 x4)
Implication:
• suppose 3-SAT poly-reduces to a problem A
• poly-time algorithm for A would imply poly-time 3-SAT algorithm
• we suspect that no poly-time algorithm exists for A!
yes instance
29
Graph 3-colorability
yes instance
30
Graph 3-colorability
no instance
31
3-satisfiability reduces to graph 3-colorability
F T
B base
32
3-satisfiability reduces to graph 3-colorability
Pf.
• Consider assignment where F corresponds to false and T to true .
• (ii) [triangle] ensures each literal is true or false.
false true
F T
B base
33
3-satisfiability reduces to graph 3-colorability
false true
F T
B base
34
3-satisfiability reduces to graph 3-colorability
Pf.
• Consider assignment where F corresponds to false and T to true .
• (ii) [triangle] ensures each literal is true or false.
• (iii) ensures a literal and its negation are opposites.
• (iv) [gadget] ensures at least one literal in each clause is true.
stay tuned
B
(x1 ¬x2 x3)
x1 ¬x2 x3
6-node gadget
true T F false
35
3-satisfiability reduces to graph 3-colorability
Pf.
• Consider assignment where F corresponds to false and F to true .
• (ii) [triangle] ensures each literal is true or false.
• (iii) ensures a literal and its negation are opposites.
• (iv) [gadget] ensures at least one literal in each clause is true.
Therefore, is satisfiable.
B
(x1 ¬x2 x3)
x1 ¬x2 x3
6-node gadget
true T ?? F false
36
3-satisfiability reduces to graph 3-colorability
x1 ¬x2 x3
37
3-satisfiability reduces to graph 3-colorability
Pf.
• Color nodes corresponding to false literals T and to true literals F .
• Color vertex below one T vertex F , and vertex below that B .
x1 ¬x2 x3
38
3-satisfiability reduces to graph 3-colorability
Pf.
• Color nodes corresponding to false literals T and to true literals F .
• Color vertex below one T vertex F , and vertex below that B .
• Color remaining middle row vertices B .
x1 ¬x2 x3
39
3-satisfiability reduces to graph 3-colorability
Pf.
• Color nodes corresponding to false literals T and to true literals F .
• Color vertex below one T vertex F , and vertex below that B .
• Color remaining middle row vertices B .
• Color remaining bottom vertices T or F as forced.
x1 ¬x2 x3
40
3-satisfiability reduces to graph 3-colorability
Construction.
(i) Create one vertex for each literal.
(ii) Create 3 new vertices T, F, and B; connect them in a triangle,
and connect each literal to B.
(iii) Connect each literal to its negation.
(iv) For each clause, attach a gadget of 6 vertices and 13 edges
Reminder
Construction is not intended for use, just to prove 3-COLOR difficult 41
designing algorithms
proving limits
classifying problems
polynomial-time reductions
NP-completeness
42
More Poly-Time Reductions
3-SAT
AT R
3-S OL O
to 3-C
ces
redu
Pf sketch.
Construction.
• Variables for every tape cell, head position, and state at every step.
• Clauses corresponding to each transition.
• [many details omitted]
44
Implications of Cook’s theorem
3-SAT
R T
OLO -SA
3-C es to 3
uc
red
47
Poly-Time Reductions: Implications
48
Poly-Time Reductions: Implications
49
Summary
50