0% found this document useful (0 votes)
30 views9 pages

NP Hard and NP Complete: Presented by and On 22-10-2024

Uploaded by

fakebolthe
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)
30 views9 pages

NP Hard and NP Complete: Presented by and On 22-10-2024

Uploaded by

fakebolthe
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/ 9

NP Hard and NP Com

Presented by m.poorna teja and sk.thayeeb on 22-10-2024.


What is P and NP?
P :

1. P stands for "Polynomial problem".

2. a problem is said to be polynomial problem , if it can be solve in polynomial time using deterministic algorithm

3. example:

Common examples include sorting algorithms (like Merge Sort), searching algorithms (like Binary
Search), and graph algorithms (like Dijkstra's shortest path).

NP :

1.NP stands for "Nondeterministic Polynomial Time."

2. A problem that cannot be solved in polynomial time but can be verifiable in polynomial time using non-deterministi

3.example:

the Traveling Salesman Problem, the Knapsack Problem, and the Boolean satisfiability problem (SAT).
P is a Subset of NP
Categories of Algorithms
depending upon the computing time algorithm divided into two categories
1.Polynomial time

2.Exponential time

1.Polynomial time :

1. Algorithm which takes less time to complete given task is known as polynomial time
2. ex :

a. Linear search :n

b.Binary search : logn

2.Exponential time :

1. Algorithm which takes more time to complete even it is small task is called Exponential time
2. ex:

a.0/1 Knapsack

b.traveling sales person


Classification of Problems
1.NP COMPLETE
2.NP HARD
1. NP COMPLETE :

1. NP-Complete problems are the hardest problems in the NP class. If you


can find a polynomial-time solution for one NP-Complete problem, you

2. can solve all Solutions


Verification: problemscan
in NP
beinverified
polynomial time.
in polynomial time.
3. Examples: Traveling Salesman Problem (decision version)
2. NP HARD :

1. It is at least as hard as the hardest problems in NP, but it does not have to
be in NP itself (solutions may not be verifiable quickly).

2. Verification: Solutions may not be verifiable in polynomial time.


3. Examples: the Traveling Salesman Problem with no decision criteria.
Difference between NP-Hard and NP-Complete

NP-Hard NP-Complete

1. Time is unknown 1. Time is Known

2. np-hard is not a decision problem 2. np complete is decision problem

3. not all np hard problems are np complete 3. all np complete problems are Np hard

You might also like