Search code examples
algorithmnp

Showing NP, NP-Completeness, or NP-Hardness


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

Solution

  • 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