Difference between NP hard and NP complete problem

Prerequiste: NP-Completeness

NP Problem:
The NP problems set of problems whose solutions are hard to find but easy to verify and are solved by Non-Deterministic Machine in polynomial time.

NP-Hard Problem:
Any decision problem Pi is called NP-Hard if and only if every problem of NP(say P<subj) is reducible to Pi in polynomial time.

NP-Complete Problem: Any problem is NP-Complete if it is a part of both NP and NP-Hard Problem.

Difference between NP-Hard and NP-Complete:

NP-hard NP-Complete
NP-Hard problems(say X) can be solved if and only if there is a NP-Complete problem(say Y) can be reducible into X in polynomial time. NP-Complete problems can be solved by deterministic algorithm in polynomial time.
To solve this problem, it must be a NP problem. To solve this problem, it must be both NP and NP-hard problem.
It is not a Decision problem. It is exclusively Decision problem .
Example: Halting problem, Vertex cover problem, Circuit-satisfiability problem, etc. Example: Determine whether a graph has a Hamiltonian cycle, Determine whether a Boolean formula is satisfiable or not, etc.

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.