CSci 4011 INHERENT LIMITATIONS OF COMPUTER PROGRAMS.

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

Sep 16, 2013 Lirong Xia Computational social choice The easy-to-compute axiom.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Proof of correctness; More reductions
Complexity ©D.Moshkovits 1 Where Can We Draw The Line? On the Hardness of Satisfiability Problems.
Sep 15, 2014 Lirong Xia Computational social choice The easy-to-compute axiom.
Complexity ©D.Moshkovitz 1 NPC More NP-Complete Problems.
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
NP-Completeness: Reductions
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
CS21 Decidability and Tractability
February 23, 2015CS21 Lecture 201 CS21 Decidability and Tractability Lecture 20 February 23, 2015.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
Transitivity of  poly Theorem: Let ,  ’, and  ’’ be three decision problems such that   poly  ’ and  ’  poly  ’’. Then  poly  ’’. Proof:
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Fall 2006Costas Busch - RPI1 More NP-complete Problems.
Time Complexity.
NP-Completeness (2) NP-Completeness Graphs 4/17/2017 6:25 AM x x x x x
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture NP-Completeness Jan Maluszynski, IDA, 2007
Clique Cover Cook’s Theorem 3SAT and Independent Set
February 25, 2015CS21 Lecture 211 CS21 Decidability and Tractability Lecture 21 February 25, 2015.
Lecture 22 More NPC problems
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
Additional NP-complete problems
1.1 Chapter 3: Proving NP-completeness Results Six Basic NP-Complete Problems Some Techniques for Proving NP-Completeness Some Suggested Exercises.
CSC 413/513: Intro to Algorithms
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
CSCI 2670 Introduction to Theory of Computing December 7, 2005.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
Prof. Busch - LSU1 Busch Complexity Lectures: More NP-complete Problems.
SUBSET-SUM Instance: A set of numbers denoted S and a target number t.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
34.NP Completeness. Computer Theory Lab. Chapter 34P.2.
 2005 SDU Lecture15 P,NP,NP-complete.  2005 SDU 2 The PATH problem PATH = { | G is a directed graph that has a directed path from s to t} s t
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
Costas Busch - LSU 1 More NP-complete Problems. Costas Busch - LSU 2 Theorem: If: Language is NP-complete Language is in NP is polynomial time reducible.
NP-Completeness A problem is NP-complete if: It is in NP
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
More NP-complete problems
Richard Anderson Lecture 26 NP-Completeness
More NP-complete Problems
More NP-complete Problems
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Proofs
Richard Anderson Lecture 26 NP-Completeness
CS21 Decidability and Tractability
CS154, Lecture 16: More NP-Complete Problems; PCPs
CS21 Decidability and Tractability
ICS 353: Design and Analysis of Algorithms
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
More NP-complete Problems
Richard Anderson Lecture 25 NP-Completeness
NP-Completeness Proofs
Richard Anderson Lecture 28 NP-Completeness
Additional NP-complete problems
CS21 Decidability and Tractability
CS154, Lecture 16: More NP-Complete Problems; PCPs
CS21 Decidability and Tractability
More NP-complete problems
Trevor Brown DC 2338, Office hour M3-4pm
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Lecture 23 NP-Hard Problems
Presentation transcript:

CSci 4011 INHERENT LIMITATIONS OF COMPUTER PROGRAMS

HARDEST PROBLEMS IN NP Definition: A language B is NP-complete if: Theorem: 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) If B is NP-Complete and P  NP, then There is no fast algorithm for B.

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.

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.

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)

GRADUATION ∈ NP: The subset is a proof that (T,M) ∈ GRADUATION. 3SAT ≤P GRADUATION: 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)

GRADUATION ∈ NP: The subset is a proof that (T,M) ∈ GRADUATION. 3SAT ≤P GRADUATION: 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 ¬xi is a literal in Cj, the triple includes i02.

UHAMPATH No HAM PATH Undirected HAM PATH A B A B 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}

HAMPATH ≤P UHAMPATH Amid A B Aout Ain C D E F

HAMPATH ≤P UHAMPATH A B C D E F

HAMPATH ·P UHAMPATH f(G,s,t) = (G’,s’,t’) where: For each node u  G: add nodes uin, uout, umid to G’. add edges {uin,umid} and {umid,uout} to G’ For each edge (u,v)G, add {uout,vin} to G’ s’ = sin, t’ = tout. If 〈G,s,t〉 HAMPATH, then 〈G’,s’,t’〉UHAMPATH: (s,u,v,..,t) ! (sin,smid,sout,uin,umid,uout,vin,vmid,vout,…tout)

If v2  smid, then no vi=smid. So v2=smid, v3=sout HAMPATH ·P UHAMPATH If 〈G’,s’,t‘〉 2 UHAMPATH, then 〈G,s,t〉2 HAMPATH: Let (sin=v1,v2,…,v3n=tout) be the undirected path. Claim: for all i≥0, there exists u  G so that: v3i+1=uin, v3i+2=umid, v3i+3=uout. i=0: If v2  smid, then no vi=smid. So v2=smid, v3=sout Induction: if v3i = u’out, then v3i+1=uin, so v3i+2=umid. The directed Hamiltonian path is (u1, u2, …, un)

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 

x2 x1 x1 (x1 ⋁ x2 ⋁ x2) ∧ (¬x1⋁ x2 ⋁ x2) ∧ (x1 ⋁ ¬x2 ⋁ x2) x2 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 y1 1 y2 y3 y4 y5 y6 y7 y8 y9 y10 t 3 x1 (x1 ⋁ x2 ⋁ x2) ∧ (¬x1⋁ x2 ⋁ x2) ∧ (x1 ⋁ ¬x2 ⋁ x2) x2 C3 C2 C1

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

K-CLIQUES b a e c d f g

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 

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

(x1  x1  x1)  (x1  x1  x2)  (x2  x2  x2)  (x2  x2  x1)

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

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 

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

VERTEX-COVER = { 〈G,k〉 | G is an undirected graph with a k-node vertex cover } Theorem: VERTEX-COVER is NP-Complete (1) VERTEX-COVER  NP (2) 3SAT P VERTEX-COVER

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

(x1  x1  x2)  (x1  x2  x2)  (x1  x2  x2) k = 2(#clauses) + (#variables)

HAMILTONIAN PATHS b a e c d f h i g

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

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 

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

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

(x1 Ç x2 Ç x2) Æ (:x1 Ç x2 Ç x2) s x1 x11 x12 x14 x15 x1 c1 c2 x2 x21 t

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

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 

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

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

(x1 Ç x2 Ç x2) Æ (x2 Ç :x1 Ç :x1) ? x1 x1 F T x2 x2 c11 c12 c13 c11

(x1 Ç x2 Ç x2) Æ (x2 Ç :x1 Ç :x1) ? x1 x1 F T x2 x2 c11 c12 c13 c11

MORE GADGETS http://web.mat.bham.ac.uk/R.W.Kaye/minesw/

MORE GADGETS http://arxiv.org/abs/1203.1895