NP Hard and NP Complete

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

NPMRD and NP(omple tr

tyt errpho.
(cimputa hional pnl,h
Proslend

infulne alo and hane


it canD Le sowod
an
and forne potbn
pelynomikl t ime algonthn a tine. algoths
,hal Can be
Cnc hec. can De
polynonial tlme alqo

bacable
Deinition of P-ctasc' - the problems -thalcan be soved
arse calle
pelnorad tine by dutigmintta alges
"ptahds to poynoal

NP-clas - The Probe tha Caunbe sotneel


Degh of .

non delemshe alges one ealla


in potfnonial tinne by
Ne proslane lon deEm nctie poty nomad ine
Ex! Twave thng p Graph tef omhgoten IGnapsae
ttanltoan Ckh

NP- clay

NP-tomplule
NP-hand

o u ndettand
-3uncnen ne uwe l
Vauee Bandon bhemtheset x
I- choice lA) (hocaee any
LeedHo irli'cale unsulcess t l nphu
3.
Ne-han
Aucibe decvton preldenu
prolole that ene hancn one

NP- hand:
Non-Qetennislie dlgotathimn tos ca1chirg.
peoblen to deanch
Consideog the Set S[t : x], x>/
epecified elenent e in he
give the output, the fncle (i)
and element
of the dearching
detismiiste seasch algohn
e non -
the PAoblem u as follows,
tor
NDSeach x, e).
(s.
dlgosithim;-
i:choice (1,x);
if (si]e)
then

outpot(i),
SUccessC);

else

output (o:
failuse (3
ecsiOn Paoblern anol cpimiali on Psoblern
, Gien a staing S, and sting S, does
S, appeas as
and 's do s and s
2, Given tuo ses S and
?
Contain the csame dset of elements
3 Given a giaph G with integu wtights
hae
intgea k, does
on it edges and veght
a minimum ópanning t e of
atmot K ?

datufiabibty.
9 Boolean Vasiables ; ,X2 ,
2, Boole a connectives o any boolean
furetons ottk one tawo inputt ancd ore
Butput asuch as A (AND), VCOR), ~CNoT),
’ Cimplica bor), o C and only if) anod
3 pasenthess
NP- HARD AND NP- CoMPLET E CAS SE S
"p' is tke class of decision Aobbms
polynomially bounchd. "p s
dlefineol ony fot decisiorn pAobtens.
"Np is the class of deeiion piobem
for cohich these is poly nomially
boonoltd 2on - de tesminisic algoithn.
NP -Conpe te paoblems
TCx)
X ounses
(aninpot laninput
NP ttaud paoblems det l, and l br paobl

by by a oleluministio
s a cway to solue
using adationinitie
S

polynomial ime algoubhin dhat dolues Ly in


polynomi al ine aqoutthm
This implies that it we bae
polynomi a time.
tne ayoithm jor ho, then we tan
polynomial
in polynomial time.
Solwe h
The comple xilies ot Np-Haud & NP - Corplete
meas edd
Complezity of an algorithm isparameto
by wing tti input dength as the
dnalgouhmoxis of polynomial comp
CoOK THEOREN, Cooti heonem stli that
Satishabig
Satital y is in P.
hen it eman to bee Shoon tha i Satistalily
to roWe, hI statomnt,

hau lo okstnh a pon'al ine


kte s h
son qothm
non de le minishc. deci hat
Sueh
terhl' rput .
and he time emple
pobnomd othen the

' olgo
to cornshuc
Ihe time heeded

hon delmnsha algothm


delminshc 2 in P

You might also like