Professional Documents
Culture Documents
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
***P IS A SUBSET OF NP
REDUCTION
A REDUCE
B
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)