1. Gyanastra
  2. Algorithms
  3. NP-Completeness: P, NP, NP-Hard, Reductions and the Standard Problems
  4. The Venn diagrams
Free lesson, no account needed 4 min read

Algorithms · NP-Completeness: P, NP, NP-Hard, Reductions and the Standard Problems

The Venn diagrams

7.1 Under the (widely believed) assumption P≠NPP \ne NP

        +---------------------------------------------+
        |                    NP                       |
        |   +-------------------+                     |
        |   |        P          |                     |
        |   |                   |     NP-complete     |
        |   |  sorting, MST,    |   +-------------+   |
        |   |  shortest path,   |   |  SAT, 3-SAT |   |
        |   |  2-SAT, matching, |   |  clique, VC |   |
        |   |  primality, LP    |   |  HC, TSP(d) |   |
        |   +-------------------+   |  subset sum |   |
        |                           +-------------+   |
        +---------------------------------------------+

        NP and co-NP are two overlapping regions.
        Their intersection contains P (and problems such as
        primality, factoring, which are in NP ∩ co-NP).
        NP-complete problems lie in NP but, unless NP = co-NP,
        outside co-NP.

Under P≠NPP \ne NP: P is a proper subset of NP and NP-complete problems lie in NP∖PNP \setminus P. They are also outside co-NP unless NP=co-NPNP = co\text{-}NP (a separate open question: P≠NPP \ne NP alone does not settle it).

7.2 Under the hypothetical P=NPP = NP

        +---------------------------------------------+
        |                                             |
        |              P = NP = co-NP                 |
        |   (everything collapses into one class;     |
        |    NP-complete problems are in P too)       |
        |                                             |
        +---------------------------------------------+

If P=NPP = NP, then every NP-complete problem has a polynomial-time algorithm, and NP=co-NP=PNP = co\text{-}NP = P. NP-hard problems that are not in NP (like the halting problem) remain outside.

7.3 What each statement implies — a table

StatementImplication
Some NP-complete problem is in PP=NPP = NP
Some NP-complete problem is not in PP≠NPP \ne NP
Some problem in NP is not in PNo NP-complete problem is in P
P=NPP = NPNP=co-NPNP = co\text{-}NP; every NP-complete problem is in P
P≠NPP \ne NPNP-complete problems are outside P (they are outside co-NP only if also NP≠co-NPNP \ne co\text{-}NP)
Some NP-complete problem is in co-NPNP=co-NPNP = co\text{-}NP
P=NPP = NPEvery NP-hard problem that is in NP is in P
P≠NPP \ne NPNP-hard problems in NP are not in P

Pages 1–2 of 2