Lecture 9: P, NP, and NP-hardness
September 18th, 2007Wednesday’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.
- Aerospace engineering: optimal mesh partitioning for finite elements.
- Biology: protein folding.
- Chemical engineering: heat exchanger network synthesis.
- Civil engineering: equilibrium of urban traffic flow.
- Economics: computation of arbitrage in financial markets with friction.
- Electrical engineering: VLSI layout.
- Environmental engineering: optimal placement of contaminant sensors.
- Financial engineering: find minimum risk portfolio of given return.
- Game theory: find Nash equilibrium that maximizes social welfare.
- Genomics: phylogeny reconstruction.
- Mechanical engineering: structure of turbulence in sheared flows.
- Medicine: reconstructing 3-D shape from biplane angiocardiogram.
- Operations research: optimal resource allocation.
- Physics: partition function of 3-D Ising model in statistical mechanics.
- Politics: Shapley-Shubik voting power.
- Pop culture: Minesweeper consistency, and Tetris.
- Statistics: optimal experimental design.
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$ ?
September 20th, 2007 at 8:51 pm
Just to be sure, you mean “…by sorting \sigma in O(n \log{n}) time…” not in \log{n} time, right?
September 20th, 2007 at 10:49 pm
ah yes. I’ll fix that.
October 11th, 2007 at 1:29 pm
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!
October 12th, 2007 at 11:57 pm
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
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.