1 / 34

INHERENT LIMITATIONS OF COMPUTER PROGRAMS

CSci 4011. INHERENT LIMITATIONS OF COMPUTER PROGRAMS. HARDEST PROBLEMS IN NP. Theorem: A language B is NP-complete if:. Definition: A language B is NP-complete if:. 1. B  NP. 2. A is NP-complete and A ≤ P B. 2. Every A in NP is poly-time reducible to B (i.e. B is NP-hard).

Download Presentation

INHERENT LIMITATIONS OF COMPUTER PROGRAMS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSci 4011 INHERENT LIMITATIONS OF COMPUTER PROGRAMS

  2. HARDEST PROBLEMS IN NP Theorem: A language B is NP-complete if: Definition: A language B is NP-complete if: 1. B  NP 2. A is NP-complete and A ≤PB 2. Every A in NP is poly-time reducible to B (i.e. B is NP-hard) If B is NP-Complete and P  NP, then There is no fast algorithm for B.

  3. REDUCTION STRATEGIES A reduction by restriction shows that the source problem is a special case of the target problem. For example, 3SAT ≤P CNF-SAT because every satisfiable 3CNF is also a satisfiable CNF. Example. Prove 3SAT ≤P 4SAT by restriction. A 3CNF can be converted to an equivalent 4CNF by repeating one literal in each clause.

  4. REDUCTION STRATEGIES A reduction from A to B by local replacement shows how to “translate” between “units” of A and “units” of B. Example. vertex cover “units” are vertices and edges; set cover “units” are elements and sets. Example. CIRCUIT-SAT units are gates, CNFSAT units are clauses, 3SAT units are 3-literal clauses.

  5. GRADUATION A transcript is a set of course numbers a student has taken A major consists of: Pairs: exactly one of which must be taken Lists: at least one course of which must be taken GRADUATION = {〈T,M〉 | a subset of T satisfies M} For example: T = {1901A, 1902B, 1902A, 2011, 4041A, 4061, 4211} M = [1901A,1901B], [1902A,1902B] (4011,4041A,4041B), (4211,4707), (4061)

  6. GRADUATION ∈NP: The subset is a proof that (T,M) ∈GRADUATION. 3SAT ≤PGRADUATION: T = {101, 102, 201, 202, 301, 302} (x1⋁ x2⋁ ¬x3) ∧ (¬x1 ⋁ x2 ⋁ x2) ∧ (¬x2⋁ x3⋁ x1) M = [101, 102], [201, 202], [301, 302] (101,201,302), (101,201,201), (101,202,301)

  7. GRADUATION ∈NP: The subset is a proof that (T,M) ∈GRADUATION. 3SAT ≤PGRADUATION: Let  = C1∧ C2∧ … ∧Cm have variables x1…xk For each xi: add classes i01 and i02 to T. add pair (i01,i02) to M. For each Cj, we add a triple to M: if xi is a literal in Cj, the triple includes i01. if ¬xiis a literal in Cj, the triple includes i02.

  8. UHAMPATH No HAM PATH Undirected HAM PATH B A B A C D C D E F E F UHAMPATH = {〈G,s,t〉 | G is an undirected graph with a Hamiltonian path from s to t}

  9. HAMPATH≤PUHAMPATH Amid Aout B A Ain C D E F

  10. HAMPATH ≤PUHAMPATH B A C D E F

  11. 3SAT P SUBSET-SUM We transform a 3-cnf formula  into 〈y1…yn, t〉:   3SAT  〈y1…yn,t〉  SUBSET-SUM The transformation can be done in time polynomial in the length of 

  12. Each variable and each clause result in two yi’s. Each yi will have a digit for each clause and variable. x2 x1 C3 C2 C1 x1 (x1⋁ x2 ⋁ x2) ∧ (¬x1⋁ x2⋁ x2) ∧ (x1 ⋁ ¬x2⋁ x2) x2 C3 C2 C1

  13. REDUCTION STRATEGIES A reduction by component design constructs gadgets that simulate variables and clauses. In particular a reduction must provide: a gadget to force the solution to the target instance to choose either x or ¬x a gadget to force the solution to the target instance to choose one literal from each clause a gadget to force the solution to the target instance to satisfy every clause

  14. e f b a g d c K-CLIQUES

  15. 3SAT P CLIQUE We transform a 3-cnf formula  into 〈G,k〉 such that   3SAT  〈G,k〉  CLIQUE The transformation can be done in time polynomial in the length of 

  16. x1 x2 x2 x1 x1 x1 x2 x2 x2 (x1  x1  x2)  (x1  x2  x2) (x1  x2  x2) k = #clauses

  17. x1 x1 x2 x2 x2 x2 x1 x1 x1 x2 x2 x1 (x1  x1  x1)  (x1  x1  x2) (x2  x2  x2) (x2  x2  x1)

  18. 3SAT P CLIQUE We transform a 3-cnf formula  into 〈G,k〉 such that   3SAT  〈G,k〉  CLIQUE If  has k clauses, we create a graph with k clusters of 3 nodes each. Each cluster corresponds to a clause. Each node in a cluster is labeled with a literal from the clause. We do not connect any nodes in the same cluster We connect nodes in different clusters whenever they are not contradictory

  19. 3SAT P CLIQUE We transform a 3-cnf formula  into 〈G,k〉 such that   3SAT  〈G,k〉  CLIQUE  is satisfiable iff there is an assignment that makes at least one literal true in each clause. The nodes corresponding to these k true literals do not contradict each other, so they form a k- clique in G. A k-clique in G must have one node from each cluster. Setting the corresponding literals to true will satisfy 

  20. e e b b a a d d c c VERTEX COVER Theorem: VERTEX-COVER is NP-Complete (1) VERTEX-COVER  NP (2) CLIQUE ≤P IND-SET ≤P VERTEX-COVER

  21. e f b a g d i c h HAMILTONIAN PATHS

  22. HAMPATH = { 〈G,s,t〉 | G is a graph with a Hamiltonian path from s to t } Theorem: HAMPATH is NP-Complete (1) HAMPATH  NP (2) 3SAT P HAMPATH

  23. 3SAT P HAMPATH We transform a 3-cnf formula  into 〈G,s,t〉 so that   3SAT  〈G,s,t〉  HAMPATH The transformation can be done in time polynomial in the length of 

  24. x1 x1 x2 x2 s t (x1Ç x2Ç x2) Æ (:x1Ç x2Ç x2)

  25. x11 x12 x21 x22 x1 x1 x2 x2 c1 s t (x1Ç x2Ç x2) Æ (:x1Ç x2Ç x2)

  26. x11 x15 x14 x22 x21 x12 x24 x25 c1 c2 x1 x2 x2 x1 s t (x1Ç x2Ç x2) Æ (:x1Ç x2Ç x2)

  27. c e e b b b b a a a a d d d d c c 3-COLORING

  28. 3SAT P 3COLOR We transform a 3-cnf formula  into a graph G so   3SAT  G  3COLOR The transformation can be done in time polynomial in the length of 

  29. x1 x1 ? T F x2 x2 (x1Ç x2Ç x2)

  30. ? T F (x1Ç x2Ç x2) x1 x1 x2 x2 c13 c11 c12 c16 c14 c15

  31. ? T F (x1Ç x2Ç x2) Æ (x2 Ç :x1 Ç:x1) x1 x1 x2 x2 c13 c13 c11 c12 c11 c12 c16 c14 c16 c15 c14 c15

  32. ? T F (x1Ç x2Ç x2) Æ (x2 Ç :x1 Ç:x1) x1 x1 x2 x2 c13 c13 c11 c12 c11 c12 c16 c14 c16 c15 c14 c15

  33. MOREGADGETS http://web.mat.bham.ac.uk/R.W.Kaye/minesw/

  34. MOREGADGETS http://arxiv.org/abs/1203.1895

More Related