Lecture 9: P, NP, and NP-hardness

September 18th, 2007

Wednesday’s lecture will be on the dreaded topic of NP-hardness. Although the concept was first established as recently as 1971, when the Cook-Levin theorem showed the existence of an NP-complete problem, there are innumerable NP-Complete problems lurking out there in the wild, no matter what field of research you go into (let alone in computer science). According to Christos Papadimitrious, 6000 new NP-Completeness results are proved each year. Here are some examples, taken from Kevin Wayne, of NP-Complete problems in the wild. Where possible, I’ve linked to actual documentation of this fact.

All of which goes to say, it’s important to understand NP-hardness, because the odds are high that you’ll bump into an NP-hard problem sooner rather than later.

Update: Scott’s question in class was: how do we express the operation of sorting as a decision problem in the form described ?

Answer: One way of doing this is to define the language SORT as the set of all pairs ($latex \sigma,\mu$), where $latex \sigma=(x_1,x_2,\ldots{x_n})$, $latex \mu=(y_1,y_2,\ldots{y_n})$, and $latex (\sigma,\mu)$ is in SORT if $latex \mu$ equals $latex \sigma$ in sorted order. Notice that you can check membership in $latex O(n\log{n})$ by sorting $latex \sigma$ in $latex O(n\log{n})$ time and verifying that it equals $latex \mu$ in linear time, but it’s not clear that you can do anything any faster. You can check that $latex \mu$ is sorted in linear time, but how do you check that it contains exactly the same multi-set of elements as $latex \sigma$ ?

4 Responses to “Lecture 9: P, NP, and NP-hardness”

  1. A. Star Says:

    Just to be sure, you mean “…by sorting \sigma in O(n \log{n}) time…” not in \log{n} time, right?

  2. admin Says:

    ah yes. I’ll fix that.

  3. Sarvani Says:

    I was randomly going through some questions on polynomial reduction when I came across this question:

    Prove that: L is polynomial time reducible to (L complement) iff (L complement) is polynomial time reducible to L.

    Any pointers on how to prove this?

    Thanks!

  4. admin Says:

    It’s clear that if we prove one side we prove the other, since we can interchange $latex L$ and $latex \overline{L}$. So let’s try to prove the following claim

    If $latex L$ is p-time reducible to $latex \overline{L}$, then $latex \overline{L}$ is p-time reducible to $latex L$

    There must be a reduction T running in polytime that takes an instance X of $latex L$ and converts it to an instance Y of $latex \overline{L}$. Since this runs in polytime, the two instance sizes are polynomially related. Now let’s say we are given an instance Y of $latex \overline{L}$. What we’d like to do is invert T to find the X on which T would have produced Y. If we can do this, then by the correctness of T we know that the mapping Y to X will be a correct reduction (i.e X in L iff Y in $latex \overline{L}$, etc). But since the set of candidate X is polynomial in the length of Y, we merely enumerate all of them and check for each of them whether T(X) = Y. In p-time we’ll find the X that works, and we are done.

Leave a Reply