Docsity

Magic Bullets - Computability - Lecture Slide, Slides of Computer Science

Partial preview of the text

Download Magic Bullets - Computability - Lecture Slide and more Slides Computer Science in PDF only on Docsity!

1

NP -Completeness

2

Agenda

NP - complete problems  Proof that Punch-Card Puzzle is NP -complete P vs. NP question  Known and unknown hierarchies Next Time: Foundational proof that 3SAT is NP-complete (Cook-Levin Theorem)

4

NP-Complete Problems

Here is a list of some NP -complete problems:

  1. SAT
  2. CSAT
  3. 3SAT
  4. Punch-Card Puzzle
  5. Clique
  6. Discrete Linear Algebra
  7. Traveling Salesperson
  8. Hamiltonian Path See many more at “An Annoted List…” or from Garey and Johnson’s book.^1 Docsity.com

5

NP-Complete

Definition

We already know what it means for a problem to be in NP. NP -complete problems are problems which are in NP but are also NP -hard:

DEF: A language L is NP-hard if every

problem L’ in NP is poly-time mapping

reducible to L. If in addition, L is in NP ,

L is said to be NP-complete.

7

NP -Hard Problems

ANTM

A: ANTM and ATM are Turing equivalent

  1. A solution to ANTM would automatically

give a solution to ATM since all TM are

automatically NTM’s.

  1. Since NTM’s can be determinized algorithmically, given any description of <NTM,input> can convert (and even in polynomial time!) to a description of equivalent <TM,input> which accepts iff original description accepts. Docsity.com

8

NP -Hard Problems

ANTM

Proof that ANTM is NP -hard:

Given any language L’  S* in NP , there is a NTM M’ which decides L’. Define the following mapping reduction f : Given x  S*, f (x) = < M’ , x >

f can be achieved by an I/O TM which runs in polynomial time, simply by pre-appending x by the description of M’ on the tape. Furthermore, f (x) is in ANTM exactly when x is in L’. So f is a poly-time mapping reduction.•

Q: Is ANTM NP -complete? Docsity.com

10

Showing NP -Completeness

Standard technique for showing that a problem is NP -complete.

  1. Show directly that problem is in NP.

  2. Show that a previously known NP - complete problem is poly-time reducible to the problem of interest.

Typically, for step (2) an NP -complete SAT variant is used.

11

Punch-Card Puzzle

is NP -Complete

Let’s show that the Punch-Card Puzzle is NP - complete. We’ve already done step 1 in the previous lecture. Let’s reduce CSAT to the puzzle in poly-time:

Proof that CSAT reduces to Puzzle: This

is a case that the Puzzle  CSAT reduction is almost exactly the reverse of CSAT  Puzzle.

13

Reducing CSAT

to Punch-Card Puzzle

EG: Consider conjunction of 4 clauses:

f = x  y  z  x

There should be 3 cards because there are 3 variables and 4 rows, because there are 4 clauses.

14

Reducing CSAT

to Punch-Card Puzzle

EG: Consider conjunction of 4 clauses:

f = x  y  z  x

There should be 3 cards because there are 3 variables and 4 rows, because there are 4 clauses.

16

Reducing CSAT

to Punch-Card Puzzle

EG: Consider conjunction of 4 clauses:

f = x  y  z  x

Variable x Variable y

17

Reducing CSAT

to Punch-Card Puzzle

EG: Consider conjunction of 4 clauses:

f = x  y  z  x

Variable x Variable y Variable z

Q: Any problems? Docsity.com

19

Reducing CSAT

to Punch-Card Puzzle

A: (2nd^ Idea) Just add the card whose right column is completely filled in, and left column completely open:

Claim: This actually works in general!

In fact…

20

Reducing CSAT

to Punch-Card Puzzle

LEMMA: Suppose a boolean expression f is transformed into a card puzzle according to 1st idea. Then if f is unsatisfiable, not even 1 column can be filled.

Proof of lemma: If 1 column can be filled, we can assume it’s the left column by flipping all cards if it wasn’t. By construction, each card will fill in a row exactly when its variable has the corresponding truth value. Thus filling in the left column, means that f is satisfiable. We’ve shown that if even 1 column is fillable, then f is satisfiable, which is equivalent to lemma.//Docsity.com