Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fall 2006Costas Busch - RPI1 More NP-complete Problems.

Similar presentations


Presentation on theme: "Fall 2006Costas Busch - RPI1 More NP-complete Problems."— Presentation transcript:

1 Fall 2006Costas Busch - RPI1 More NP-complete Problems

2 Fall 2006Costas Busch - RPI2 Theorem: If: Language is NP-complete Language is in NP is polynomial time reducible to Then: is NP-complete (proven in previous class)

3 Fall 2006Costas Busch - RPI3 Using the previous theorem, we will prove that 2 problems are NP-complete: Vertex-Cover Hamiltonian-Path

4 Fall 2006Costas Busch - RPI4 Vertex cover of a graph is a subset of nodes such that every edge in the graph touches one node in Vertex Cover S = red nodes Example:

5 Fall 2006Costas Busch - RPI5 |S|=4Example: Size of vertex-cover is the number of nodes in the cover

6 Fall 2006Costas Busch - RPI6 graph contains a vertex cover of size } VERTEX-COVER = { : Corresponding language: Example:

7 Fall 2006Costas Busch - RPI7 Theorem: 1. VERTEX-COVER is in NP 2. We will reduce in polynomial time 3CNF-SAT to VERTEX-COVER Can be easily proven VERTEX-COVER is NP-complete Proof: (NP-complete)

8 Fall 2006Costas Busch - RPI8 Let be a 3CNF formula with variables and clauses Example: Clause 1 Clause 2Clause 3

9 Fall 2006Costas Busch - RPI9 Formula can be converted to a graph such that: is satisfied if and only if Contains a vertex cover of size

10 Fall 2006Costas Busch - RPI10 Clause 1 Clause 2Clause 3 Clause 1 Clause 2Clause 3 Variable Gadgets Clause Gadgets nodes

11 Fall 2006Costas Busch - RPI11 Clause 1 Clause 2Clause 3 Clause 1 Clause 2Clause 3

12 Fall 2006Costas Busch - RPI12 If is satisfied, then contains a vertex cover of size First direction in proof:

13 Fall 2006Costas Busch - RPI13 Satisfying assignment Example: We will show that contains a vertex cover of size

14 Fall 2006Costas Busch - RPI14 Put every satisfying literal in the cover

15 Fall 2006Costas Busch - RPI15 Select one satisfying literal in each clause gadget and include the remaining literals in the cover

16 Fall 2006Costas Busch - RPI16 This is a vertex cover since every edge is adjacent to a chosen node

17 Fall 2006Costas Busch - RPI17 Explanation for general case: Edges in variable gadgets are incident to at least one node in cover

18 Fall 2006Costas Busch - RPI18 Edges in clause gadgets are incident to at least one node in cover, since two nodes are chosen in a clause gadget

19 Fall 2006Costas Busch - RPI19 Every edge connecting variable gadgets and clause gadgets is one of three types: Type 1 Type 2 Type 3 All adjacent to nodes in cover

20 Fall 2006Costas Busch - RPI20 If graph contains a vertex-cover of size then formula is satisfiable Second direction of proof:

21 Fall 2006Costas Busch - RPI21 Example:

22 Fall 2006Costas Busch - RPI22 exactly one literal in each variable gadget is chosen exactly two nodes in each clause gadget is chosen To include “internal’’ edges to gadgets, and satisfy chosen out of

23 Fall 2006Costas Busch - RPI23 For the variable assignment choose the literals in the cover from variable gadgets

24 Fall 2006Costas Busch - RPI24 since the respective literals satisfy the clauses is satisfied with

25 Fall 2006Costas Busch - RPI25 Theorem: 1. HAMILTONIAN-PATH is in NP 2. We will reduce in polynomial time 3CNF-SAT to HAMILTONIAN-PATH Can be easily proven HAMILTONIAN-PATH is NP-complete Proof: (NP-complete)

26 Fall 2006Costas Busch - RPI26 Gadget for variable the directions change

27 Fall 2006Costas Busch - RPI27 Gadget for variable

28 Fall 2006Costas Busch - RPI28

29 Fall 2006Costas Busch - RPI29

30 Fall 2006Costas Busch - RPI30


Download ppt "Fall 2006Costas Busch - RPI1 More NP-complete Problems."

Similar presentations


Ads by Google