NP Hard and NP Complete: Presented by and On 22-10-2024
NP Hard and NP Complete: Presented by and On 22-10-2024
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 :
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
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
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).
NP-Hard NP-Complete
3. not all np hard problems are np complete 3. all np complete problems are Np hard