Transcript
Page 1: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

Last class

Decision/Optimization3-SAT Independent-SetIndependent-Set 3-SATP, NPCook’s TheoremNP-hard, NP-complete3-SAT Clique, Subset-Sum, 3-COL

Page 2: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

Reductions

INSTANCE of A INSTANCE of B

A B

all reductions we had were:

the black-box intuition model allowed more questions to an oracle for B

(many-to-one reductions)

(Turing reductions)

Page 3: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

Planar-3-COL

INSTANCE: planar graph G

QUESTION: can the vertices of G be assigned colors red,green,blue so that no two neighboring vertices have the same color?

Page 4: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

3-COL Planar-3-COL

Page 5: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

4-COL

INSTANCE: graph G

QUESTION: can the vertices of G be assigned one of 4 colors so that no two neighboring vertices have the same color?

Page 6: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

3-COL 4-COL

G G

Page 7: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

planar 4-COL INSTANCE: planar graph G

QUESTION: can the vertices of G be assigned one of 4 colors so that no two neighboring vertices have the same color?

Page 8: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

planar 3-COL planar 4-COL ?

Page 9: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

planar 3-COL planar 4-COL ?

planar 4-COL is very easy: the answer is always yes.

(4-color theorem, Appel, Haken)

Page 10: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

Integer linear-programming

INSTANCE: variables x1,...,xn

collection of linear inequalities over the xi with integer coefficients

QUESTION: does there exist an assignment of integers to the xi such that all the linear inequalities are satisfied?

Page 11: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

Integer linear-programming INSTANCE: variables x1,...,xn

collection of linear inequalities over the xi with integer coefficients

QUESTION: does there exist an assignment of integers to the xi such that all the linear inequalities are satisfied?

x1 1x2 16 x1

x3 16 x2

x4 16 x3

x3+x4+x1 10000

Page 12: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

Integer linear-programming

we will show that ILP is NP-hard by showing 3-SAT ILP

y1 y2 y3 x1 + (1-x

2) + x

3 1

0 x1 1

....

0 xn 1

true = 1, false =0

Page 13: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

Integer linear-programming

Is integer linear programming NP-complete ?

I.e., is ILP in NP ?

Witness of solvability = solution,but a priori we do not know thatthe solution is polynomially bounded.

ILP NP, but the proof is far from trivial.

Page 14: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

Min-Cut problemcut

S V

number of edges crossing the cut

| { {u,v} ; u S, v V-S } |

INPUT: graph GOUTPUT: cut S with the minimum number of crossing edges

Page 15: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

Min-Cut problem

in P

for each s,t pair run max-flow algorithm

Page 16: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

Max-Cut problemcut

S V

number of edges crossing the cut

| { {u,v} ; u S, v V-S } |

INPUT: graph GOUTPUT: cut S with the maximum number of crossing edges

Page 17: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

Max-Cut problemINSTANCE: graph G, integer KQUESTION: does G have a cut with K crossing edges?

Page 18: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

Max-Cut problemINSTANCE: graph G, integer KQUESTION: does G have a cut with K crossing edges?

NAE-3-SAT Max-Cut

NAE-3-SAT

INSTANCE: 3-CNF formula QUESTION: does there exist an assignment such that every claues have 1 false and 1 true ?

Page 19: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

NAE-3-SAT Max-CutINSTANCE: 3-CNF formula QUESTION: does there exist an assignment such that every claues have 1 false and 1 true ?

x1 x2 x31 vertex for each literal

x1 x2

x3x2

2m paralleledges

Page 20: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

3-SAT NAE-3-SATy1 y2 y3

y1 y2 zi , zi y3 b

1.C satisfiable can find 3-NAE assignment for C’2.C’ has 3-NAE assignment C satisfiable

Page 21: Last class Decision/Optimization 3-SAT  Independent-Set Independent-Set  3-SAT P, NP Cook’s Theorem NP-hard, NP-complete 3-SAT  Clique, Subset-Sum,

Is NP co-NP = P ?

Factoring

INSTANCE: pair of integers n,k

QUESTION: does n have a factor x{2,...k} ?

Factoring – decision version

INPUT: integer n

OUTPUT: factorization of n, i.e., n=p1

1 ... pkk


Recommended