Presentation is loading. Please wait.

Presentation is loading. Please wait.

Black-box (oracle) Feed me a weighted graph G and I will tell you the weight of the max-weight matching of G.

Similar presentations


Presentation on theme: "Black-box (oracle) Feed me a weighted graph G and I will tell you the weight of the max-weight matching of G."— Presentation transcript:

1 Black-box (oracle) Feed me a weighted graph G and I will tell you the weight of the max-weight matching of G.

2 2 5 2 Black-box (oracle) Feed me a weighted graph G and I will tell you the weight of the max-weight matching of G.

3 2 5 2 Black-box (oracle) Feed me a weighted graph G and I will tell you the weight of the max-weight matching of G. 5

4 Black-box (oracle) Feed me a weighted graph G and I will tell you the weight of the max-weight matching of G. here is a graph G, find the max-weight matching G

5 Black-box (oracle) Feed me a weighted graph G and I will tell you the weight of the max-weight matching of G. here is a graph G, find the max-weight matching pick a vertex u  V(G) for each edge {u,v}  E(G) w  undefined if oracle(G-u-v) + w(u,v) = oracle (G) then w  v if w is undefined then recurse on (G-u) else print({u,w}); recurse on (G-u-v)

6 3-SAT x = variable  x = negation of a variable literals clause = disjunction of literals x   y  z  x  z

7 3-SAT INSTANCE: collection C of clauses, each clause has at most 3 literals QUESTION: does there exist an assignment of true/false to the variables which satisfies all the clauses in C

8 3-SAT INSTANCE: collection C of clauses, each clause has at most 3 literals QUESTION: does there exist an assignment of true/false to the variables which satisfies all the clauses in C x  y  z x  y   z x   y  x

9 Independent Set subset S of vertices such that no two vertices in S are connected

10 Independent Set subset S of vertices such that no two vertices in S are connected

11 Independent Set INSTANCE: graph G SOLUTION: independent set S in G MEASURE: maximize the size of S INSTANCE: graph G, number K QUESTION: does G have independent set of size  K OPTIMIZATION VERSION: DECISION VERSION:

12 Independent Set  3-SAT “is easier than” if we have a black-box for 3-SAT then we can solve Independent Set in polynomial time Independent Set reduces to 3-SAT

13 Independent Set  3-SAT if we have a black-box for 3-SAT then we can solve Independent Set in polynomial time Give me a 3-SAT formula and I will tell you if it is satisfiable We would like to solve the Independent Set problem using the black box in polynomial time.

14 Independent Set  3-SAT Give me a 3-SAT formula and I will tell you if it is satisfiable Graph G, K  3-SAT formula F efficient transformation (i.e., polynomial – time) G has independent set of size  K  F is satisfiable

15 Independent Set  3-SAT Give me a 3-SAT formula and I will tell you if it is satisfiable Graph G, K  3-SAT formula F V = {1,...,n} variables x 1,....,x n E = edges  x i   x j for ij  E + we need to ensure that  K of the x i are TRUE

16 3-SAT  Independent Set Give me a graph G and a number K and I will tell you if G has independent set of size  K 3-SAT formula F  graph G, number K

17 3-SAT  Independent Set Give me a graph G and a number K and I will tell you if G has independent set of size  K 3-SAT formula F  graph G, number K x   y  z w  y   z x w yy y zz z

18 3-SAT  Independent Set 3-SAT formula F  graph G, number K x   y  z w  y   z x w yy y zz z 1) efficiently computable 2) F satisfiable   IS of size  m 3)  IS of size  m  F satisfiable

19 3-SAT  Independent Set Independent Set  3-SAT if 3-SAT is in P then Independent Set is in P if Independent Set is in P then 3-SAT is in P 3-SAT Independent Set

20 Many more reductions 3-SAT Independent Set Clique Subset-Sum 3-COL Planar 3-COL Hamiltonian path

21 P and NP P = decision problems that can be solved in polynomial time. NP = decision problems for which the YES answer can be certified and this certificate can be verified in polynomial time.

22 NP = decision problems for which the YES answer can be certified and this certificate can be verified in polynomial time. 3-SAT Independent Set NOT-3-SAT ?

23 NP = decision problems for which the YES answer can be certified and this certificate can be verified in polynomial time. Every problem A  NP A  3-SAT COOK’S THEOREM

24 NP = decision problems for which the YES answer can be certified and this certificate can be verified in polynomial time. if every problem A  NP A  B B is NP-hard B is NP-complete if B is NP-hard, and B is in NP

25 NP P NP-complete NP-hard

26 3-SAT Independent Set Clique Subset-Sum 3-COL Planar 3-COL Hamiltonian path Some NP-complete problems

27 Clique subset S of vertices such that every two vertices in S are connected

28 Clique INSTANCE: graph G, number K QUESTION: does G have a clique of size  K?

29 Subset-Sum INSTANCE: numbers a 1,...,a n,B QUESTIONS: is there S  {1,...,n} such that   a i = B iSiS

30 3-COL INSTANCE: graph G QUESTION: can the vertices of G be assigned colors red,green,blue so that no two neighboring vertices have the same color?

31 3-SAT  3-COL R G B x  x B x yy z G G G G R G=true

32 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?

33 3-COL  Planar-3-COL

34 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?

35 3-COL  4-COL

36 G  G

37 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? planar 3-COL  planar 4-COL ???

38 4-COL  3-COL Thus: 4-COL  3-COL 4-COL  NP Cook  4-COL  3-SAT 3-SAT  3-COL

39 2-COL  3-COL

40 G  G

41 3-COL  2-COL ??? 2-COL in P


Download ppt "Black-box (oracle) Feed me a weighted graph G and I will tell you the weight of the max-weight matching of G."

Similar presentations


Ads by Google