Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing NP, NP-Completeness, or NP-Hardness

Tags:

algorithm

np

Is my understanding of the three categories correct?

To show a problem X is NP:

  1. Show that X can be verified deterministically in polynomial time (Or X is solvable using a NTM)

To show a problem X is NP-Complete:

  1. Show that X can be verified deterministically in polynomial time(Or X is solvable using a NTM)
  2. Show that given a known NP-C problem L, L ≤p X
  3. Show that given a known NP-C problem L, X ≤p L (Is this step necessary? If so, is this what differentiates a purely NP-Hard problem from a NP-C problem?)

To show a problem X is NP-Hard:

  1. Show that given a known NP-C problem L, L ≤p X
like image 652
user Avatar asked Mar 16 '23 05:03

user


1 Answers

You almost got it.

Given a problem X, to show it is NPC, you don't need to show X ≤p L, for some NPC problem L.

In fact, this is guaranteed, since you already showed that X is in NP (in 1), and you know L is NP-Complete. By definition of NP-Complete, this means there is a polynomial time reduction from ALL problems in NP to L, including from X, so basically your step (3) in proving NPC is redundant.


A more elegant way to show the statements of what needs to be done to prove each property:

To show X is NP:

  1. Show that X can be verified deterministically in polynomial time (Or X is solvable using a NTM)

To show X is NP-Hard:

  1. Show that given a known NP-Hard problem L, L ≤p X

OR

  1. Show that for any problem L in NP, L ≤p X (this is done only once actually, for SAT, and is the definition of NP-Hard).

To show a problem X is NP-Complete:

  1. Show X is NP-Hard
  2. Show X is in NP
like image 154
amit Avatar answered Mar 23 '23 03:03

amit