7 views

Uploaded by abasthana

Rights belong with the owners

- Chapter 1 Intro Data Structure by rafiqul islam
- Ruler Folding problem Paper
- XAct Paris
- Np Complete 4up
- DFS and BFS Search Algorithm Explaned
- 2014 Qualifying Totals USAW
- Discont.ps
- CSE 101 Algorithm Lecture Notes 2
- Probabilistic Algorithms
- fullan getting reform right
- flood127.0.0.1
- sigmod16a
- valuetools-preprint
- cos210
- Data Structure and Algorithms
- Front End Handbook 2017 (1)
- Eop Errata
- 032163537 x
- Memory Model
- Reinforcement Learning

You are on page 1of 20

13-1

The Class NP

Andrei Bulatov

Beyond P

We have seen that the class P provides a useful model of easy

computation

This includes 2-Satisfiability and

2-Colourability

But what about 3-Satisfiability and

3-Colourability

No polynomial time algorithms for these problems are known

On the other hand

13-2

Certificates

Every yes-instance of those problems has a short and easily checkable

certificate

Satisfiability a satisfying assignment

k-Colourability a k-colouring

Hamiltonian Circuit a Hamiltonian circuit

Linear Programming a solution to the system of

inequalities

In all cases one can easily prove a positive answer

13-3

Verifiers

Definition

Definition

AAdecider

decidermachine

machine VV isiscalled

calledaa verifier

verifier for

foraalanguage

language LL ifif

LLw

w VV accepts

accepts w;c

w;c for

forsome

somestring

string c

c

A verifier is said to be polynomial time if it is a polynomial time Turing

Machine, and there is a polynomial p(x) such that, for any w L,

there is a certificate c with |c| p(|w|)

All problems from the previous slide have a polynomial time verifier

13-4

The Class NP

Definition

Definition

The

Theclass

classofoflanguages

languagesthat

thathave

havepolynomial

polynomialtime

timeverifiers

verifiersisis

called

called NP

NP

13-5

13-6

Clique

Instance: A graph G and a number k.

Question: Does G contain a clique of size k?

SubsetSum

Instance: A sequence of positive integers S {a1 , , an } and a

target integer t.

Question: Is there a subset T S such that

ai t

iT

Composite

Instance: A positive integer k.

Question: Are there positive integers u, v >1 such that k = uv?

Path

Instance: A graph G and two its vertices u and v.

Question: Is there a path connecting u and v?

13-7

Problems not in NP

No Hamiltonian Circuit

Instance: A graph G.

Question: Is it true that G has no Hamiltonian circuit?

Instance: A positive integer k.

Question: Is k prime?

13-8

Problems not in NP

Checkers

Instance: A positive integer n.

Question: Is there a winning strategy for whites in a checker game

on n n board?

13-9

Non-deterministic Machines

We can get an alternative definition of the class NP by considering

non-deterministic machines

Recall that if NT is a non-deterministic Turing Machine, then NT(x)

denotes the tree of configurations which can be entered with input

x, and NT accepts x if there is some accepting path in NT(x)

Definition

Definition

The

The time

timecomplexity

complexity ofofaa non-deterministic

non-deterministic Turing

Turing

Machine

Machine NT

NT isisthe

thefunction

functionNTime NT such

suchthat

that NTime NT ( x )

isisthe

thenumber

numberofofsteps

stepsininthe

theshortest

shortestaccepting

acceptingpath

pathofof NT(x)

NT(x)

ififthere

thereisisone,

one, otherwise

otherwiseititisisthe

thenumber

numberofofsteps

stepsininthe

theshortest

shortest

rejecting

rejectingpath

path

(If not all paths of NT(x) halt, then NTime NT ( x ) is undefined)

13-10

Definition

Definition

For

Forany

anyfunction

function f,f, we

wesay

saythat

thatthe

the nondeterministic

nondeterministic time

time

complexity

complexityofofaadecidable

decidablelanguage

language LL isisinin O(f)

O(f) ififthere

thereexists

exists

aanondeterministic

nondeterministicTuring

TuringMachine

Machine NT

NT which

whichdecides

decides L,L, and

and

constants

constants n0 and

and cc such

suchthat

thatfor

forall

allinputs

inputs xx with

with | x | n0

NTime NT ( x ) cf (| x |)

Definition

Definition

The

The nondeterministic

nondeterministictime

timecomplexity

complexityclass

class NTIME[f]

NTIME[f] isis

defined

definedtotobe

bethe

theclass

classofofall

alllanguages

languageswith

with nondeterministic

nondeterministic

time

timecomplexity

complexityinin O(f)

O(f)

13-11

An Alternative Definition of NP

Definition

Definition

NP NTIME[ n k ]

k 0

This was the original form of the definition of NP, and was first formulated

by Karp in 1972

It explains the name NP Nondeterministic Polynomial-time

13-12

Equivalence

Theorem

Theorem

The

Thetwo

twodefinitions

definitionsofof NP

NP are

areequivalent

equivalent

Proof:

If L NTIME[n k ] , then there is a nondeterministic machine

NT such that x L if and only if there is an accepting computation

path in NT(x). Furthermore, the length of these paths is in O (| x |k )

Using (some encoding of) these computation paths as the certificates,

we can construct a polynomial time verifier for L which simply checks

that each step of the computation path is valid

13-13

13-14

guessing a certificate

checking certificate

construct a non-deterministic Turing Machine that first guesses

the value of the certificate (by making a series of non-deterministic

choices), and then simulates V with that certificate.

Since the length of the certificate is polynomial in the length of the

input, this machine is a nondeterministic polynomial-time decision

procedure for L.

13-15

P and NP

All

Languages

Decidable

Languages

NP

P NP?

The

Thequestion

questionofofwhether

whetherorornot

not PPNP

NP isisone

oneofofthe

thebiggest

biggestopen

open

problems

problemsinincomputer

computerscience

science

solution guarantees an efficient way to find that solution

Virtually everyone is convinced that P NP,

but after 30 years of effort there is still no proof

Resolving this question (either way) would win a prize of $1 million

see http://www.claymath.org/prize_problems

13-16

polynomial-time reduction each class contains problems that are

reducible to each other

These equivalence classes are partially ordered by reduction

Problems in the maximal class are called complete

13-17

NP-Completeness

Definition

Definition

AAlanguage

language LL isissaid

saidtotobe

be NP-complete

NP-completeifif LLNP

NP and,

and,for

for

any

any AANP,

NP, AALL

They are all equally difficult an efficient solution to one would

solve them all

13-18

Proving NP-completeness

To show that L is NP-complete we must show that every

language in NP can be reduced to L in polynomial time

This would appear to be hard!

However, once we have one NP-complete language L0

we can show any other language L is NP-complete just by

showing L0 L

Hence the most difficult part is finding the first one

13-19

This problem was solved by Cook in 1970 (and independently by

Levin in the USSR)

Theorem

Theorem (Cook

(CookLevin)

Levin)

Satisfiability

Satisfiabilityisis NP-complete

NP-complete

13-20

- Chapter 1 Intro Data Structure by rafiqul islamUploaded bymita2006
- Ruler Folding problem PaperUploaded byVishnuprakash Puthiyakovilakath
- XAct ParisUploaded bymadhavanrajagopal
- Np Complete 4upUploaded bydinu8086
- DFS and BFS Search Algorithm ExplanedUploaded byDeepesh Saha
- Discont.psUploaded byKevin Mondragon
- CSE 101 Algorithm Lecture Notes 2Uploaded byphulam146
- fullan getting reform rightUploaded byapi-42688552
- flood127.0.0.1Uploaded byواسل عبد الرزاق
- sigmod16aUploaded byNorbert Feron
- valuetools-preprintUploaded byKernel5
- cos210Uploaded byXebi Shiekh
- Data Structure and AlgorithmsUploaded bytathagatgupta

- 2014 Qualifying Totals USAWUploaded byRussaldo13
- Front End Handbook 2017 (1)Uploaded byWil Laorej
- Eop ErrataUploaded byabasthana
- 032163537 xUploaded byprasad357
- Probabilistic AlgorithmsUploaded byabasthana
- Memory ModelUploaded byabasthana
- Reinforcement LearningUploaded byabasthana
- Functional TreesUploaded byabasthana
- Refresher - Trig Pre Calc Course ContentUploaded byabasthana
- Reinforcement LearningUploaded byabasthana
- Algorithms TheoryUploaded byabasthana

- BBA Model Questions Computer FundamentalsUploaded byscribdbillionaire
- Queen's University _ Mining Engineering- ListUploaded byNitinkiet103
- irmck341Uploaded byMeselao Meselao Meselao
- ACSRConductors.pdfUploaded byrohitshukla23
- sqaUploaded byanish5596
- Moss Ton Teaching StylesUploaded byMuhammad Zulhisham Bin Zakaria
- Chief Financial Officer in Palo Alto CA Resume Carl WisemanUploaded byCarlWiseman
- MS5837-30BAUploaded byAbdelaziz Abdelghany
- Sheredos (2016) BrentanosActPsych.pdfUploaded bybenjsher
- Layouts With Razor MVCUploaded byMohit Vaidh
- iglidur bearings for High TemperaturesUploaded byigusuk
- Traducción para inglésUploaded byArlene Cortés
- Multicomponent DistillationUploaded byAK
- reserach paperUploaded byshohag
- survey on MACHINE LEARNING IN COGNITIVE RADIOUploaded byjameelahmad
- CHAP_1.2Uploaded byDjokata
- Number TheoryUploaded bykwong
- 10.1016@j.jtrangeo.2015.06.004.pdfUploaded byMaría José
- Build a CMS in an Afternoon With PHP and MySQLUploaded byAhmed Cheikh Sidia
- YORK 913Uploaded bySamir Shah
- Noise Technical Measures CatalogueUploaded byAdela Toma
- Voltage MultiplierUploaded byabhishek
- OMG Club file 2.pdfUploaded bySherif El-soudy
- 04 PracticeUploaded byShahbaz Shoukat
- Chirisa - Solid WasteUploaded bychichi2
- Course Specs Meteorology CHEDUploaded byReymarr Hijara
- Ametek Land 198200 System 4 Lmi Digital Panel Meter User Guide Issue 4 EnUploaded bytrutlept
- Communities@One case study Anglesey Aluminium Cricket ClubUploaded byCommunities2point0
- Decoding StarlightUploaded byJesus Alan
- Chachi 420Uploaded bySurekha Yadav