BU CS 332 Theory of Computation Lecture 21: Reading: NP - - PowerPoint PPT Presentation

bu cs 332 theory of computation
SMART_READER_LITE
LIVE PREVIEW

BU CS 332 Theory of Computation Lecture 21: Reading: NP - - PowerPoint PPT Presentation

BU CS 332 Theory of Computation Lecture 21: Reading: NP Completeness Sipser Ch 7.3 7.5 Cook Levin Theorem Reductions Mark Bun April 15, 2020 Last time: Two equivalent definitions of 1) is the class of languages decidable


slide-1
SLIDE 1

BU CS 332 – Theory of Computation

Lecture 21:

  • NP‐Completeness
  • Cook‐Levin Theorem
  • Reductions

Reading: Sipser Ch 7.3‐7.5

Mark Bun April 15, 2020

slide-2
SLIDE 2

Last time: Two equivalent definitions of

1) is the class of languages decidable in polynomial time

  • n a nondeterministic TM
  • 2) A polynomial‐time verifier for a language is a

deterministic ‐time algorithm such that iff there exists a string such that accepts Theorem: A language iff there is a polynomial‐time verifier for

4/15/2020 CS332 ‐ Theory of Computation 2

slide-3
SLIDE 3

Examples of languages: SAT

“Is there an assignment to the variables in a logical formula that make it evaluate to ?”

  • Boolean variable: Variable that can take on the value

/ (encoded as 0/1)

  • Boolean operations:
  • Boolean formula: Expression made of Boolean variables

and operations. Ex:

  • An assignment of 0s and 1s to the variables satisfies a

formula if it makes the formula evaluate to 1

  • A formula

is satisfiable if there exists an assignment that satisfies it

4/15/2020 CS332 ‐ Theory of Computation 3

slide-4
SLIDE 4

Examples of languages: SAT

Ex:

  • Satisfiable?

Ex:

  • Satisfiable?

Claim:

4/15/2020 CS332 ‐ Theory of Computation 4

slide-5
SLIDE 5

Examples of languages: TSP

“Given a list of cities and distances between them, is there a ‘short’ tour of all of the cities?” More precisely: Given

  • A number of cities
  • A function
  • giving the distance

between each pair of cities

  • A distance bound

4/15/2020 CS332 ‐ Theory of Computation 5

slide-6
SLIDE 6

vs.

Question: Does ? Philosophically: Can every problem with an efficiently verifiable solution also be solved efficiently? A central problem in mathematics and computer science

4/15/2020 CS332 ‐ Theory of Computation 6

EXP NP P If P  NP If P = NP EXP P = NP

slide-7
SLIDE 7

A world where

  • Many important decision problems can be solved in

polynomial time ( , , , etc.)

  • Many search problems can be solved in polynomial time

(e.g., given a natural number, find a prime factorization)

  • Many optimization problems can be solved in polynomial

time (e.g., find the lowest energy conformation of a protein)

4/15/2020 CS332 ‐ Theory of Computation 7

slide-8
SLIDE 8

A world where

  • Secure cryptography becomes impossible

An NP search problem: Given a ciphertext , find a plaintext and encryption key that would encrypt to

  • AI / machine learning become easy: Identifying a consistent

classification rule is an NP search problem

  • Finding mathematical proofs becomes easy: NP search

problem: Given a mathematical statement and length bound , is there a proof of with length at most ? General consensus:

4/15/2020 CS332 ‐ Theory of Computation 8

slide-9
SLIDE 9

NP‐Completeness

4/15/2020 CS332 ‐ Theory of Computation 9

slide-10
SLIDE 10

What about a world where

Believe this to be true, but very far from proving it implies that there is a problem in which cannot be solved in polynomial time, but it might not be a useful one Question: What would allow us to conclude about problems we care about? Idea: Identify the “hardest” problems in NP Find such that iff

4/15/2020 CS332 ‐ Theory of Computation 10

slide-11
SLIDE 11

Recall: Mapping reducibility

Definition: A function

∗ ∗ is computable if there is a TM

which, given as input any

∗, halts with only

  • n

its tape. Definition: Language is mapping reducible to language , written

  • if there is a computable function

∗ ∗ such that for

all strings

∗, we have

4/15/2020 CS332 ‐ Theory of Computation 11

slide-12
SLIDE 12

Polynomial‐time reducibility

Definition: A function

∗ ∗ is polynomial‐time computable if there

is a polynomial‐time TM which, given as input any

∗,

halts with only

  • n its tape.

Definition: Language is polynomial‐time reducible to language , written

  • if there is a polynomial‐time computable function

∗ ∗

such that for all strings

∗, we have

4/15/2020 CS332 ‐ Theory of Computation 12

slide-13
SLIDE 13

Implications of poly‐time reducibility

Theorem: If

  • and

then Proof: Let decide in poly time, and let be a poly‐ time reduction from to . The following TM decides in poly time:

4/15/2020 CS332 ‐ Theory of Computation 13

slide-14
SLIDE 14

NP‐completeness

Definition: A language is NP‐complete if 1) and 2) Every language is poly‐time reducible to , i.e.,

  • (“

is NP‐hard”)

4/15/2020 CS332 ‐ Theory of Computation 14

slide-15
SLIDE 15

Implications of NP‐completeness

Theorem: Suppose is NP‐complete. Then iff Proof:

4/15/2020 CS332 ‐ Theory of Computation 15

slide-16
SLIDE 16

Implications of NP‐completeness

Theorem: Suppose is NP‐complete. Then iff Consequences of being NP‐complete: 1) If you want to show , you just have to show 2) If you want to show , you just have to show 3) If you already believe , then you believe

4/15/2020 CS332 ‐ Theory of Computation 16

slide-17
SLIDE 17

Cook‐Levin Theorem and NP‐Complete Problems

4/15/2020 CS332 ‐ Theory of Computation 17

slide-18
SLIDE 18

Cook‐Levin Theorem

Theorem: (Boolean satisfiability) is NP‐complete Proof: Already know . Need to show every problem in reduces to (later?)

4/15/2020 CS332 ‐ Theory of Computation 18

Stephen A. Cook (1971) Leonid Levin (1973)

slide-19
SLIDE 19

New NP‐complete problems from old

Lemma: If

  • and
  • , then
  • (poly‐time reducibility is transitive)

Theorem: If and

  • for some NP‐complete

language , then is also NP‐complete

4/15/2020 CS332 ‐ Theory of Computation 19

slide-20
SLIDE 20

New NP‐complete problems from old

4/15/2020 CS332 ‐ Theory of Computation 20

All problems below are NP‐complete and hence poly‐time reduce to one another!

SAT 3SAT DIR-HAM-CYCLE INDEPENDENT SET VERTEX COVER GRAPH 3-COLOR HAM-CYCLE TSP SUBSET-SUM SCHEDULING PLANAR 3-COLOR SET COVER

by definition of NP‐completeness

slide-21
SLIDE 21

(3‐CNF Satisfiability)

Definition(s):

  • A literal either a variable of its negation

,

  • A clause is a disjunction (OR) of literals

Ex.

  • A 3‐CNF is a conjunction (AND) of clauses where each

clause contains exactly 3 literals Ex.

  • 4/15/2020

CS332 ‐ Theory of Computation 21

slide-22
SLIDE 22

is NP‐complete

Theorem: is NP‐complete Proof idea: 1) is in NP (why?) 2) Show that

  • Idea of reduction: Given a poly‐time algorithm converting

an arbitrary formula into a 3CNF such that is satisfiable iff is satisfiable

4/15/2020 CS332 ‐ Theory of Computation 22