0% found this document useful (0 votes)
115 views11 pages

A Presentation On Daa

This presentation discusses P, NP, NP-hard, and NP-complete problems. P problems can be solved in polynomial time, while NP problems cannot be solved in polynomial time but can be verified in polynomial time. NP-hard problems are the hardest in NP, such that any NP problem can be reduced to an NP-hard problem in polynomial time. NP-complete problems are NP and NP-hard - they are the intersection between the two classes. Examples given include the subset sum problem and travelling salesman problem.

Uploaded by

Priyanshu Baruah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views11 pages

A Presentation On Daa

This presentation discusses P, NP, NP-hard, and NP-complete problems. P problems can be solved in polynomial time, while NP problems cannot be solved in polynomial time but can be verified in polynomial time. NP-hard problems are the hardest in NP, such that any NP problem can be reduced to an NP-hard problem in polynomial time. NP-complete problems are NP and NP-hard - they are the intersection between the two classes. Examples given include the subset sum problem and travelling salesman problem.

Uploaded by

Priyanshu Baruah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

A PRESENTATION ON

P AND NP PROBLEMS
EXAMPLE OF NP-HARD AND
NP-COMPLETE PROBLEMS
P-PROBLEMS
 These problems are the those which are
solvable in polynomial time
Specifically they are the problems that
can be solved in time O(nk) , k is constant.
P-PROBLEMs
• In computtational complexity theory,p,also
known as PTIME or DTIME(n0(1)),is a
fundamental complexity class.It contains all
decision problems that can be solved by a
deterministic Turing machine using a
polynomial amount of computation time,or
polynomial.
P-PROBLEMS
• This class includes those languages,which are
recognized by some deterministic turing
machine (DTM) in Ptime.
P-PROBLEMS
• Solve example in Ptime
• Multiplication 3X5

Problem Algorithm Yes No


Odd Number Divided by 2 5 6
Prime(n) Divided by 1 0r n 53 51
NP-CLASS PROBLEMS
• A problem which cannot be solved in
polynomial time but is verified in polynomial
time is known as Non Deterministic
Polynomial or NP-Class problems.
• It is a complexity class used to classify decision
problems.
• Ex: Su-Do-Ku, Prime Factor, Scheduling,
Travelling salesman
PROPERTIES:

•THE NP CLASS PROBLEM, VERIFIABLE IN POLYNOMIAL


TIME.
•THE P CLASS PROBLEMS ARE ALSO NOT ONLY SOLVED
IN POLYNOMIAL TIME BUT ARE ALSO VERIFIED IN
POLYNOMIAL TIME
***NP PROBLEMS ARE-
• HARD TO SOLVE
• EASY TO VERIFY
• TAKES EXPONENTIAL TIME

***P IS A SUBSET OF NP
REDUCTION

A REDUCE
B

LET A AND B ARE TWO PROBLEMS THEN PROBLEM A REDUCES TO


PROBLEM B IF THERE IS AWAY TO TO SOLVE A BY DETERMNISTIC
ALGORITHM THAT SOLVE B IN POLYNOMIAL TIME.
•IF A IS REDUCIBLE TO B AND B IN P THEN A IN P
•A IS NOT IN P IMPLIES B IS NOT IN P
NP-HARD PROBLEMS
• A PROBLEM IS NP-HARD IF EVERY PROBLEM IN
NP CAN BE POLYNOMIAL REDUCED TO IT

NP P REDUCE

POLYNOMIAL
NP-
TIME HARD
NP-COMPLETE PROBLEM
• A PROBLEM IS NP-HARD IF EVERY PROBLEM IN
NP CAN BE POLYNOMIAL REDUCED TO IT

P
NP

POLYNOMIAL
**THE CLASS OF NP-COMPLETE
TIME NP- PROBLEM IS THE INTERSECTION
COMPLETE
OF THE NP AND NP-HARD
PROBLEM.
EXAMPLE
• SUBSET SUM PROBLEM
S IS A SET OF INTEGER.
FIND A SUBSET OF ‘S’ SUCH THAT SUM OF ELEMENTS OF THAT SUBSET IS N.
S={-1,2,7,10,6,2,1}
N=5
A={-1,6} , B={2,6)

• TRAVELLING SALESMAN PROBLEM

You might also like