Take the 2-minute tour ×
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It's 100% free, no registration required.

Stupid question: In theory linear programming is in P and integer programming is NP-hard, but since computers can only manipulate numbers with finite precision, in practice a computer is using integers for linear programming. Because of this, shouldn't LP and IP be in the same complexity class?

share|improve this question
5  
Adding a little to jmite's answer: There are many cases in which integrality constraints make the problem much harder. For example the fractional knapsack problem can be solved in polynomial time, though the integer knapsack problem is NP-Hard. So this is not only something that is true for LP and IP. –  Zachary Frenette 23 hours ago
5  
Even if we consider that computers perform operations with integers, then it does not mean that the returned solution is an integer; it can be rational, i.e., ratio of two integers. And that gives a lot more flexibility. And of course, we cannot always convert a rational solution to a feasible solution for the IP. In general, the IP will have more constraints on the variables than just asking for integral solution. Think of a $0,1$ integer program. –  megas 23 hours ago
    
It's not that hard to manipulate numbers with infinite precision if you want to, especially when they're rational. Finite precision is merely an optimization to reduce runtimes. –  Hurkyl 17 hours ago
1  
@Hurkyl "It's not that hard to manipulate numbers with infinite precision if you want to, especially when they're rational." There is a strict subset of the real numbers called the computable numbers, which includes rationals + numbers like sqrt(2) etc...and is defined as the set of numbers computable by a Turing machine. Those which are not included there, cannot, by definition, be manipulated by a computer. –  Sasha the Noob 17 hours ago

3 Answers 3

The short answer: because you can use Integers to simulate Booleans for SAT, but when you don't restrict yourself to this, then you can't actually simulate SAT. You'll get a feasible answer, but it no longer carries any meaning in terms of whatever SAT instance you were trying to simulate.

The tough answer to this is that we don't know that they aren't in the same complexity class. Nobody has a proof that $P \neq NP$. If we understood the deeper reasons why the problems were so different, that would require that we understood why the complexity classes were different, which we don't.

share|improve this answer

The reason linear programming is "efficient" is that the solution space may be represented by a single convex polyhedron. If one is trying to find the "highest" vertex on that polyhedron (one may apply a linear transform to any linear programming problem to make "height" correspond to the quantity to be maximized), then from any vertex one may travel along edges to the highest point without ever having to go "downhill". What makes integer programming "hard" is that there isn't a continuous solution space, but there are instead many disjoint solution spaces, and no way to work incrementally toward the optimal solution.

share|improve this answer

The other answers are correct, but I find them a bit technical. Suppose you have swept (eliminated) a matrix and are looking for any solution and the matrix looks like this:

column x1 x2 x3 x4 x5 x6 | solution
-----------------------------------
       1           1  1  | 3
          1              | 1
             1     1     | 2
                2  1  1  | 1  

In lineair programming, you can now set the non-pivot columns (x5,x6) to 0, and set x4 to 0.5 and find a trivial solution. In integer programming, you cannot just set the non-pivot columns to 0. The solution is harder (NP-hard) to find. Note also that the solutions are in $Q$, so this is not directly related to finite/infinite precision.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.