(PD
P NP, Np- Comrplete, Np-Hosd
TO expon ential polynomind tormpley g
TSP Knanpsack, prabl erm.
San
Polynorial donplerity algo,ex- quick sork, boiong
Scaneh
O Detrminishe Ag0 x: binaryt
LO Non deturominshe Algo Ex: Any bypo thetiond ago
Lin ear seoeh
Decision Alpo
Matrix ehan Multipi cahon
Ex- qusk
lo optisisnhion Alg Sort
P> Poyhooriad 9hile N ’ Non-deterrinisheproblam,
toogt be [Link] P, NP, NP- Complete Np-Hand
does no eanvert polyno rrrialNon-poynorria
et
a me hod to con
Dnd do64s mot ewen
a set o al deci sion problems s olwable by
(P) is
defern nis tic lgo in peynomial tyreime
e
beterosínishe Algo: The algoritn ohoseis knsan
eael anol erery step is wniguehy ole fine
O Khich Cal
as a de fermsiors he algo, ie
ipleneotet by
tor 1 l; lczn it+)
elc
alogen
Non- detorrrínishe Algo: On Th Con}
eaeh and erery step ia no wnquy detined amd
Cam nevart be irplerented by a real me isknean
(P2
1s e her yES 0r NO
algo
then thehe corresponding Algo i's decision
MAX
Ophis'2^hon Algo 1 he prsbleme finds ea ther
or opti r vale an the
Value or MIN alle
GSsoCiateol algo vs cal ed opi miaton probler,
Matrin chain muipicaton, qwck Sort
Seoch ’Pelass
Binny G) determenishi ag
1mplesentablel
(r) decreion uc oP s
YES DT No
(ti) Poynomía ype as order is
(P is A set al deusin robl em olvalale y
-dateroninis tic algo in palynatdtyte,
PCNP
Clique: It is morimtzm complete subgrph a,it
a graph has beeem
veoeices theh thi
A
A
BE sa complete Subgrnph G
3
LI probler fird a elgle from a
L2 blen; is it possibl fo find a elique of
S12& K, pha Kis itger trom gven grapk 6
5122
K=l (I Vesten )’yes
Ka=2 (I ge) ’ yes, as any ge
caplete graph
K=3 (ABE) >yes,
K=y (aBDE) yes
>No
LI d L2 e bess ey he san e
7 oph rrol2nHon taptblm ton be tonrtef to
No RNAL AORMS Therue
There are 2 tyes ; n7may
þorns long untie
|CNP> Conjwnchve Normal Poros
hee
Knonn as iteas. dase
Knon ag
(7,Vx), (x, Vau) ana Forw he le
lau ses gi be In AN
In CE
will be oin OR
HetynDisjuntine Form.
Norwad Forms.
DNEY
(*, n ) (x,^y)
boolen er pressi poss bl e to
fOs a s saishiabl e (t ue)
heck hetor the lapresS1oL
is ca ed Lko Saibali ty Problen.
This pro bl ehm
A Prob|em is Salal to be Np Hard
Sahsfinbiity problcim cem be relucef to L
(SAT L)
(P4)
ngnatermrins thc.
A p7oble r L con be reduc ed to L2(LIcL2)
t 3 a determnishic polyro riad type ago bor
LI and oi th ka hlp thes alg, cn dowedepd
molker detersin's tie poyna nal a'yo or
are
We eAm S 2Prolalems L| ama L2
equival nt ikth
Lle L2 amd LLifLI= l2
is t e set o Probl2
Np-(omp le te is o hich
Loo Np- Hard amd L e NP
LI’NP- ttand ’ SAT LI
L2 Np- (omplete L2 ¬ Np- LHaad (’ SAT« L2)
omd L2¬ NP
Np
L2 ’ decision, nor, determinishe proll em.
Hence, the maun Aithe ence oetween Np-Hard and
NP- Conplete is that Ne-onple}e shontd be lke set b
all decision paoblems but NP-Hond may be decis jon
tHerd
Note Not al NP Hud Decisidn
Probl erYS e Np-lomplete. NP. Camplete
(P5)
Statemont: Is it possib|e to WTite a program to
eheck Whelher
rbi rarayo halts
Boolean
Take ie Ve T to the algo go A as a
expression am he expresston has n' no 4 itras,
So We oay have gn no. 4 /P oor binahon S. The
olgo A helYr on omy
the bool ean apr essjOn is sats ki abl e (tr ue),
Sais isfai oblety prohlem ie NP_ Hrt This s
also decisjon prolem,
So. hs 1s a NP- Had decision pobl em
be Csmplete ik e
Nor,it
Tt it is NpBut hs Probler can nwee be
thas probl
This probler is not Np lorpd efe alhogh
it's NP-Henal.
Proue: CLIQUE deci sion problem (CDP) is N-Hand
F =^ei (ci= elause) i(lsK
Let A bea toTS la n CNF Let xi be the Vavob,
tn the torrsa F. we ill tonstu eta grph Gv, E)
Fis sotishabla.
for ny Gis defined by
(P9
V 6.)|ois a lioral in clasuse ci ?
X2X, =True
T
3
ormdl
No
So eithan TT]orA-E
dutinaion
Nor
So K= 2,
elig we is poua<e present.
shontd be pasvible hece
e posstbe
Mo clique pooolem (Cp)
APPrOxinrathon Alg0,
Ss uppose we are KJorking
Problam Ohene eaeh Goluhioni Cateting a cost 4
ppioxionaton alg0 4pi!l ef hitn a lgal o/ bueh
Ike soln mrag no be qptal bnt F ca 6e ShoAn
that he oh reter e by tte appraxi ahon ago
Can be boended by a lioro, ting kaefor,
Let us Sast tha he tost h ssfn rettIn d by
Ke appvariToton
opt a l ssf is ct
The oR ek isis the
the boanday 7ector
Or boundacy, Tatio bor he opproxiration aga
Somet s e it
t is Kno Hn as ppoerima hon ratio
pa)
f(o)
’24pprok ago
Inn Case h mnimí2otron problaom
thon I
S m t be areater
Tmmst be greater Tham I
(a)ipo) maat be alags
Approxinaton Node cover
cppsox Node CorenAgo VE)
13hile (e's not rpt )
lat (u, v) be m eege in E(+)
a dd (u) omd ( ) to C
to
reten C,
Exomple
Optial kone eo er = b.d,e
No he
Let
(a, b)> C, on te grph looks lake
the no ts bel
{abc,af ond
Nrt onsidar edge (of).
So e slop hor
C- a, 6, c d,4 tl =2 ^ppros aya ie 2tines
bad ofo
Since by proimye jon ke frd noda eoeg 6
Gmd by option aton Ke finf node eoLUrL =3