NP-complete problems

Not every problem can be solved in polynomial time, that is, in time O(nk), where n is the size of the input and k is a constant independent of the input.

A decision problem is a question, the correct answer to which is either Yes or No.   Decision problems can be categorized as being in one of three categories:

  1. P -- there is a polynomial P such that every instance I of the problem can be solved in time bounded by P(size of I)
    Example: Is array X in sorted order?
  2. not P -- there does not exist any polynomial P such that every instance I of the problem can be solved in time bounded by P(size of I)
    Example: Will program X ever stop?
  3. unknown -- it is not known whether there exists a polynomial P such that every instance I of the problem can be solved in time bounded by P(size of I)

The "unknown" category can be split into two parts:

  1. NP-complete -- a special class of problems, as seen below
    Example: Can set X of integers be partitioned into two subsets such that the sum of the integers in one subset is equal to the sum of the integers in the other subset?
  2. clueless
    Example: Can integer X be expressed as the product of two integers that each are greater than 1?

The NP-complete problems have these characteristics:

An optimization problem can usually be expressed as a polynomial sequence of decision problems and so can be said to be polynomially equivalent to the corresponding decision problem.

Example:
  Find the minimum cost spanning tree.
  Is there a spanning tree with cost at most c?

The big question:   Is P ≠ NP?


Dan Hirschberg
Last modified: Oct 28, 2003