100% found this document useful (1 vote)
62 views

NP Hard and NP Complete(s)

The document discusses NP hard and NP complete problems. It defines P as problems solvable in polynomial time, like sorting, and NP as problems checkable in polynomial time, like the knapsack problem. NP hard problems are the hardest in NP, meaning any NP problem can be reduced to an NP hard problem. NP complete problems are both in NP and NP hard - if you can solve one NP complete problem in polynomial time, you can solve any problem in NP. The satisfiability problem is used as a base NP complete problem to show other problems are NP complete by reducing them to satisfiability.

Uploaded by

srinidhi pai
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
100% found this document useful (1 vote)
62 views

NP Hard and NP Complete(s)

The document discusses NP hard and NP complete problems. It defines P as problems solvable in polynomial time, like sorting, and NP as problems checkable in polynomial time, like the knapsack problem. NP hard problems are the hardest in NP, meaning any NP problem can be reduced to an NP hard problem. NP complete problems are both in NP and NP hard - if you can solve one NP complete problem in polynomial time, you can solve any problem in NP. The satisfiability problem is used as a base NP complete problem to show other problems are NP complete by reducing them to satisfiability.

Uploaded by

srinidhi pai
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/ 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