BU CS 332 Theory of Computation Lecture 20: Reading: More on NP - - PowerPoint PPT Presentation

bu cs 332 theory of computation
SMART_READER_LITE
LIVE PREVIEW

BU CS 332 Theory of Computation Lecture 20: Reading: More on NP - - PowerPoint PPT Presentation

BU CS 332 Theory of Computation Lecture 20: Reading: More on NP Sipser Ch 7.3 7.5 P vs. NP Mark Bun April 13, 2020 Goals of complexity theory Ultimate goal: Classify problems according to their feasibility and inherent computational


slide-1
SLIDE 1

BU CS 332 – Theory of Computation

Lecture 20:

  • More on NP
  • P vs. NP

Reading: Sipser Ch 7.3‐7.5

Mark Bun April 13, 2020

slide-2
SLIDE 2

Goals of complexity theory

Ultimate goal: Classify problems according to their feasibility and inherent computational difficulty Decision problems which can be solved efficiently Can we exhibit general classes of problems which are either in

  • r provably not in ?

Some problems provably require exponential time! (Chapter 9) : A fundamental and practically important class of problems which have defied classification, but nevertheless exhibits important structure ( completeness)

4/13/2020 CS332 ‐ Theory of Computation 2

slide-3
SLIDE 3

Nondeterministic Time and NP

4/13/2020 CS332 ‐ Theory of Computation 3

slide-4
SLIDE 4

Nondeterministic time

Let A NTM runs in time if on every input

,

halts on within at most steps on every computational branch

4/13/2020 CS332 ‐ Theory of Computation 4

slide-5
SLIDE 5

Deterministic vs. nondeterministic time

4/13/2020 CS332 ‐ Theory of Computation 5

Deterministic Nondeterministic

accept or reject reject accept

𝒖𝒐

reject accept reject

slide-6
SLIDE 6

Deterministic vs. nondeterministic time

4/13/2020 CS332 ‐ Theory of Computation 6

𝑥 𝑥 𝑥 𝑥 Finite control 𝑥 ⊔ # 𝑥 𝑥 1 3 3 7 Input 𝑥 to 𝑂 (read‐only) Simulation tape (run 𝑂 on 𝑥 using nondeterministic choices from tape 3) Address in computation tree

Theorem: Let be a function. Every NTM running in time has an equivalent single‐tape TM running in time Proof: Simulate NTM by 3‐tape TM

slide-7
SLIDE 7

Deterministic vs. nondeterministic time

4/13/2020 CS332 ‐ Theory of Computation 7

Theorem: Let be a function. Every NTM running in time has an equivalent single‐tape TM running in time Proof: Simulate NTM by 3‐tape TM

  • # leaves:
  • # nodes:

Running time: To simulate one root‐to‐node path: Total time:

input simulation address

slide-8
SLIDE 8

Deterministic vs. nondeterministic time

4/13/2020 CS332 ‐ Theory of Computation 8

Theorem: Let be a function. Every NTM running in time has an equivalent single‐tape TM running in time Proof: Simulate NTM by 3‐tape TM in time We know that a 3‐tape TM can be simulated by a single‐ tape TM with quadratic overhead, hence we get running time

= · =

slide-9
SLIDE 9

Difference in time complexity

Extended Church‐Turing Thesis: At most polynomial difference in running time between all (reasonable) deterministic models At most exponential difference in running time between deterministic and nondeterministic models

4/13/2020 CS332 ‐ Theory of Computation 9

slide-10
SLIDE 10

Nondeterministic time

Let A NTM runs in time if on every input

,

halts on within at most steps on every computational branch is a class (i.e., set) of languages: A language if there exists an NTM that 1) Decides , and 2) Runs in time

4/13/2020 CS332 ‐ Theory of Computation 10

slide-11
SLIDE 11

NTIME explicitly

A language if there exists an NTM such that, on every input

  • 1. Every computational branch of

halts in either the accept or reject state within steps 2. iff there exists an accepting computational branch of

  • n input

3. iff every computational branch of rejects on input (or dies with no applicable transitions)

4/13/2020 CS332 ‐ Theory of Computation 11

slide-12
SLIDE 12

Complexity class

Definition: is the class of languages decidable in polynomial time on a nondeterministic TM

  • 4/13/2020

CS332 ‐ Theory of Computation 12

slide-13
SLIDE 13

Hamiltonian Path

4/13/2020 CS332 ‐ Theory of Computation 13

slide-14
SLIDE 14

The following nondeterministic algorithm accepts in time

. , where

, adjacency matrix encoding On input : (Vertices of are numbers )

  • 1. Nondeterministically guess a sequence
  • f numbers
  • 2. Check that
  • is a permutation: Every

number appears exactly once

  • 3. Check that

, , and there is an edge from every to

  • 4. Accept if all checks pass, otherwise, reject.

4/13/2020 CS332 ‐ Theory of Computation 14

slide-15
SLIDE 15

An alternative characterization of

“Languages with polynomial‐time verifiers” A verifier for a language is a deterministic algorithm such that iff there exists a string such that accepts Running time of a verifier is only measured in terms of is a polynomial‐time verifier if it runs in time polynomial in

  • n every input

(Without loss of generality, is polynomial in , i.e.,

for some constant

)

4/13/2020 CS332 ‐ Theory of Computation 15

slide-16
SLIDE 16

has a polynomial‐time verifier

Certificate : Verifier : On input : (Vertices of are numbers )

  • 1. Check that
  • is a permutation: Every

number appears exactly once

  • 2. Check that

, , and there is an edge from every to

  • 3. Accept if all checks pass, otherwise, reject.

4/13/2020 CS332 ‐ Theory of Computation 16

slide-17
SLIDE 17

NP is the class of languages with polynomial‐ time verifiers

Theorem: A language iff there is a polynomial‐ time verifier for Proof:

4/13/2020 CS332 ‐ Theory of Computation 17

slide-18
SLIDE 18

4/13/2020 CS332 ‐ Theory of Computation 18