DAA (Unit 5)
DAA (Unit 5)
Tsacable Can
tme
be dol vable in reasonabla (Pslymonay
Inbackable
nablotosle thomin Ylasonabo ti hre
becision
optimizaticn
AYe all prslomy duablu poly nomastimo- Nb
Net n polynomjal timo b ) D(") o(n!)
Andoision prsblom is
Dols a
ghaph b have a mst wt <w.
patient information
Field Name obl Data Type
Y Patient ID AutoNumber
First Name
Primary Key
Middle Name
Cut
Last Name
Gender 4d Copy
DOB Paste
Time
Contact No Ea Insert Rows er
Address
Delete Rows
Pin code
per
Buitd.
Referred By
Consulting Dr Properties
Save the file and now let's start entering data of individual patient.
Entering data intodatabase
Notice the database view of the table appear in front of you to add data to it. Now
the field names are displayed as headings and a blank row is provided to enter data.
Now that you have specified the ata type, text that effect can only be entered in
that field.
Notice when you type data in the. last field and press the TAB key the pointer
automaticaliy moves to the next record. Now that you have successfully entered
data into the first record, type the remaining which you need to add. Once the data
entry is over save thc file in your directory.
A/19/7c1s
Prnels 6z2108 O, y
Result:
Solve
Figure characteristics
2.following
1. suppose thereReductions: 5.3 oNP
in One and Penclosing
NPAco-NP.possibiliy
The The polynomial showing be
B is of the Figure: NPaoNP) P PNoND
transformation
answers
in :
In
that one the case (a)
polynomial key Four
Polyrnomial wemore Let that another as
are time. concepls Problem the
possibilities
have us P NP
same. NP nnost
consider indicates
1T,HCST
Thanh
HOD takes an We NP.
time,Rn Problei A
)
problem
i.e. algorithm consider in unlikely.
(©)
tim to
polynomial
the showing NPnoN NP
co
we a be P= afor
proper-subset
answer B, NP
NPAco-NP,relationships
(b)
transforn that that problemtheNP-Complete NDoND
we
a IfNP (d) (P)
for time. transform we V/P problem
LIShe
a already to is
is closed among
butrelation. NP
instarnoe Problem B
the (or to
"yes"
answer any problem say be NP
if instance decision
know NP-complete complexity
under
is (a)
and not
a P
for how is complement,
of only an
Problem) closed NP
B a to
A of instance classes,
into
ass if
the Asolve is: under co-NP.
an
instanoe into
answer
answer in of A,
some complement. thenMost each In
no Yes
polynomial the which
for NP=
ßof instance problem. we researchers
diagram,
for ß
is would co-NP,
aB. yes
no
also time. (d)
Printer
eayPDE
Drive created
BCLusirg wve ß
"yes". of Now like NP but one
regard
Finally = region
with B suppose to co-NP need it
solve this
the we not
problem Ainpolynomial time,
Asinabove figuro, the algorthm solve an
algorithm transforms it into instance Bof
reduction
1. Given an instance a of problem A, the
problem B,
2, Run polynomial tinhedecision algofor Bon instance p.
3. Use the aty ofp as ans fora.
AL
4|@2010 Mr.Shankar Thawkar, HODIT, HCST Crastud usro
BCL easyPDF
NP-Comnplete: Polynomial-tinereductions provide a fornal means for showing that
as hard as another, to within a one problem is at least
polynomial-time factor. That is,if Li SPL2, then
factor harder than La, which is why the Li is not more than a
less than or equal to" notation for polynomial
define the set of NP-complete languages, which are reduction is mnemonic. can now
We
the hardest problems in NP.
A language l. (0, 1)" is NP-complete it
1. LENP, and
2. L SpL for every l.'e NP.
Ifa language L. satisties property 2, but not
necessarily property 1, we say that L is NP-hard. We also define
to be the class of NPC
NP-complete languages.
*********** k s* ** * *
******* ******** * *** * ***
*****
5.5SAT
ABoolean formula is a formula where the variables and
operations are Boolean (0/1):
(atb+-d+e)(-at-c)(-btctdie)(at-etre)
OR: +, AND: (), NOT:
*********** *************>
k*****
ckt
Ceatfre
Super-polynomial in the size of the checking each one takes (2) time, which is
no polynomial time circuit. In fact, as has been claimed, there is
algorithm exists that solves the strong evidence that
satisfiability is NP-complete. circuit-satisfiability problem because circuit
Theorem: Prove that
CRCUIT-SAT belongs to NP.
Proof: We assume that two inputs to
polynomial time
problem. One of the inputs is Boolean circuit C algorithm A that can verify CIRCUIT-SAT
and another is a certificate
assignment of Boolean values tothe circuit. corresponding to the
The Algorithm A is
constructed as: for each logic gate in circuit, it checks that
provided by the certificate on I/P wires is the values
Ce SA correctly computed as a function of values on the
wires. Then if the output of entire circuit is output
1, the algorithm o/p is 1.
equals to the size of circuit i.e. The certificate has a length
polynomial in size. So CIRCUIT-SAT problem is verified in
polynomial time. It nmeans that CIRCUIT-SAT is NP problem.
k * * * * *** * *
***** *** * ** k*** **
*****
=lv)) A1
proper operation of a
variable xi . The p
For cach wire xi in the circuit C, the formula p has a wires. The
expressed as a formula involving the variables of its incident
gte can nowbe output variable with
is the AND of the circuit
lormula produced by the reduction algorithm
the conjunction of clauses describing the operation of each gate.
For the circuit in the figure, the formula is
(X6-(x4 Axi)
Y-(rlvx2)
X5=¬x3
So d=(xlvx2) A3)
Let us consider the satisfiable truth assign1mentxl=1, x2= 1,x3-O
satisfiable or not.
whether a given boolean formula in 3-CNF is
In 3-CNF-SAT, The problem is
0 1 I
0 0
0 0 0
Note: the symbol is called if and only if and its value is l if values of l-side =r-side, otherwise 0.]
10 |@2010 MrShankar Thaw kar. HOn T HCsT
BCL easyPD
Printer Driver
disjunctive normalform (or
build aformula in
Using the trudh-able entries that evaluate to 0, we
DNP) an OR of AND's
computed in polynomial
We can see that the 3-CNFformula is in 3-CNF and the reduction is
time. ***********
*************** **************** *****%****k**
timo is o(nlrgn)
tegminoog foom
(Siqma Stav) = ho Set , alf t -logth Stings
Using characters from the alhabet z
denotod
’ Astoing 0is a prefix os a stong x,
=y for Soma
ab C ab cca
cca I ab cca