NP Hard and NP Complete(s)

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 7

NP HARD AND NP

COMPLETE
SUBMITTED BY:
Meenakshi P D
P AND NP CLASSES
 Computing time of algorithms fall into 2 groups:
 Polynomial time taking algorithms
 Exponential time taking algorithms

 P is the set of deterministic algorithms which take polynomial time.


 Linear search
 Binary search
 Bubble sort
 Merge sort

 NP is the set of non-deterministic algorithms but they take polynomial time.


 0/1 Knapsack problem
 TSP
 Graph colouring
CONT’D

 To convert the 2nd group(exponential) into 1st (polynomial)


 Write non-deterministic polynomial time algorithm
 Relate the algorithms
 A base problem has to be determined-Satisfiablity
 The satisfiability problem is to determine if a formula is true for some assignment of truth
values to the variables.
 Conjunctive Normal Form formula is used.
NP HARD

 NP (Non-deterministic-polynomial Time): These are the decision problems which can be


verified in polynomial time. 
 A decision problem L is NP-Hard if
L' ≤p L for all L' ϵ NP.
 We say that a decision problem L is NP-hard if every problem in NP is polynomial time
reducible to L.
 If we can solve these problems in polynomial time, we can solve any NP problem that can
possibly exist.
 Now suppose we found that L’ is reducible to L, then it means that L is at least as hard as
L’.
NP COMPLETE

 Definition: NP-Complete L is NP-complete if
L ϵ NP and
L is NP-hard
 Highly informally, it means that L is one of the hardest problems in NP.
 NP-Complete: These are the problems which are both NP and NP-Hard. That means, if we
can solve these problems, we can solve any other NP problem and the solutions to these
problems can be verified in polynomial time.
 Now suppose we have a NP-Complete problem L and it is reducible to L’ then L’ is at least
as hard as L and since L is an NP-hard problem therefore L’ will also be at least NP-hard ,
it may be NP-complete also.
RELATION
THANK YOU

You might also like