7
  • If linear programming suggests that we need $2.5$ trucks to deliver goods, why can't we round up and say $3$ trucks are needed?

  • If linear programming suggests we can afford only $3.7$ workers, then why can't we just round down to $3$ workers?

When can we not use this rounding technique?

Souradeep Nanda
  • 279
  • 2
  • 14

3 Answers3

9

In $\mathbb R$, one can simply round down or round up to obtain an element of $\mathbb Z$. Only two choices!

However, in $\mathbb R^n$, one has $2^n$ ways of rounding to obtain an element of the integer lattice $\mathbb Z^n$. For example, if $n=100$, one has $2^{100} \approx 10^{30}$ possible ways of rounding.

Of course, one can round all entries of an $n$-dimensional vector down or up, but do note that the Euclidean distance between the two farthest vertices of the hypercube $[0,1]^n$ is $\sqrt n$. If $n=100$, then $\sqrt{100} = 10$.

Unfortunately, to the best of my knowledge, there is no guarantee that the solution to the integer program will be found via one of the $2^n$ possible rounding schemes.

Fortunately, some linear programs have integer solutions and, thus, no rounding is required.

7

If there are only constraints that place a lower bound on the number of trucks, but no constraints that place an upper limit on the number of trucks, then of course you can round up. That will still give you a solution.

However, there are multiple caveats:

  • First, this isn't always possible. Sometimes there are both constraints that place lower limits and constraints that place upper limits. It can happen that taking a solution and rounding gives you something that is no longer a solution.

  • Even if the result of the rounding is a solution, there is no guarantee that it is the best out of all solutions that uses integers. There may be some other way to choose integers for all the variables that is better than the solution you got by rounding.

If you want solutions that are all integer, then you have an integer linear programming problem. Integer linear programming (ILP) is harder than linear programming (LP). In particular, there are polynomial-time algorithms for LP, but ILP is NP-hard, so there is most likely no polynomial-time algorithm for ILP (unless P=NP, which is considered unlikely).

D.W.
  • 167,959
  • 22
  • 232
  • 500
4

Here is a 2d region where rounding the optimal continuous solution (top right) will always give an invalid integer solution:

1.4x-1.1\ <\ y\ <\ 1.1x+0.2

Here is a 2d region where rounding the optimal continuous solution (green vertex) may give you a valid integer solution 0,1, but will never give you the optimal integer solution 2,1 (blue vertex). Maximizing y+5x for positive x, y.

4x-8<y<-0.4x+1.9