Theory of NP-Completeness
P(Polynomial):Problems involving algorithms taking polynomial amounts of time to solve.
OR
Set of problems that can be solved by a deterministic turing machine in polynomial time.They are solved easily thereby called Tractable Problems.
- For example:O(1),O(n),
- O(n2)-QuickSort
- Merge and Quick Sort-O(nlogn),
- Binary Search-O(n),
- Searching,
- Element Uniqueness(No duplication),
- Graph Connectivity
NP(Non-deterministic Polynomial):
Set of problems that can be solved by a non-deterministic turing machine in polynomial time.They are difficult to solve,easy to check a given answer. If you introduce nondeterministic Turing machines and appropriately define “polynomial time,” then NP is the set of problems that an NTM can solve in polynomial time.
For example:
- Travelling Salesman Problem,
- Knapsack Problem,
- Shortest Path,
- Vertex Cover,
- Minimum Spanning Tree
NP-compete(Non-deterministic Polynomial Complete): A decision problem L is NP Complete if:
- A is NP
- Every problem in NP is reducible to A in polynomial time.
- For example:Cryptography
- Chess
- Long Simple Paths
- A problem is in the class NPC if it is in NP and is as hard as any problem in NP.
- A problem is NP-hard if all problems in NP are polynomial time reducible to it, even though it may not be in NP itself.
- P being the subset of NP and NP-Complete being the subset of NP-Hard.
Class Relationship of P, NP & NP Complete:
- P is easy in difficulty level(Path Problem).
- NP gives Graph is isomorphic(conjectured) and is medium in difficulty level.
- NP Complete is hard in difficulty level.
- NP Hard being the hardest in difficulty level.
Relationship between P and NP(P ⊆ NP):
- If P = NP:
- A huge number of seemingly difficult problems could be solved efficiently.
- Our capacity to solve many problems will scale well with the size of the problems we want to solve.
- If P ≠ NP:
- Enormous computational power would be required to solve many seemingly easy tasks.
- Our capacity to solve problems will fail to keep up with our curiosity.
0 Comments