Back

The origin of linear programming

Linear programming was initially developed independently by George B. Dantzig and Leonid Kantorovich in the first half of the 20th century for solving resource planning problems. Even though linear programming is insufficient for many modern-day applications in operations research, it was useful in many economic and military contexts in the early days.

Graphical example

To motivate the subject of linear programming (LP), we begin with a planning problem that can be solved graphically.

Problem. Say you are a vendor of lemonade and lemon juice. Each unit of lemonade requires 1 lemon and 2 litres of water. Each unit of lemon juice requires 3 lemons and 1 litre of water. Each unit of lemonade gives a profit of \(\$ 3\). Each unit of lemon juice gives a profit of \(\$ 2\). You have 6 lemons and 4 litres of water available. How many units of lemonade and lemon juice should you make to maximize profit?

If we let \(x\) denote the number of units of lemonade to be made and let \(y\) denote the number of units of lemon juice to be made, then the profit is given by \(3x + 2y\) dollars. We call \(3x + 2y\) the objective function. Note that there are a number of constraints that \(x\) and \(y\) must satisfied. First of all, \(x\) and \(y\) should be nonnegative. The number of lemons needed to make \(x\) units of lemonade and \(y\) units of lemon juice is \(x+3y\) and cannot exceed 6. The number of litres of water needed to make \(x\) units of lemonade and \(y\) units of lemon juice is \(2x+y\) and cannot exceed 4. Hence, to determine the maximum profit, we need to maximize \(3x + 2y\) subject to \(x\) and \(y\) satisfying the constraints \(x + 3y \leq 6\), \(2x + y \leq 4\), \( x \geq 0\), and \(y \geq 0.\)

A more compact way to write the problem is as follows: \[\begin{array}{rrcrll} \mbox{maximize } & 3x & + & 2y & \\ \mbox{subject to} & x & + & 3y & \leq & 6 \\ & 2x & +& y & \leq & 4 \\ & x & & & \geq & 0 \\ & & & y & \geq & 0. \\ \end{array}\]

We can solve this maximizationproblem graphically as follows. We first sketch the set of \(\begin{bmatrix} x\\ y\end{bmatrix}\) satisfying the constraints, called the feasible region, on the \((x,y)\)-plane. We then take the objective function \(3x+2y\) and turn it into an equation of a line \(3x+2y = z\) where \(z\) is a parameter. Note that as the value of \(z\) increases, the line defined by the equation \(3x+2y=z\) moves in the direction of the normal vector \(\begin{bmatrix} 3 \\ 2\end{bmatrix}\). We call this direction the direction of improvement. Determining the maximum value of the objective function, called the optimal value, subject to the contraints amounts to finding the maximum value of \(z\) so that the line defined by the equation \(3x+2y=z\) still intersects the feasible region.

Graphical sketch for the lemonade and lemon juice problem

In the figure above, the lines with \(z\) at 0, 4 and 6.8 have been drawn. From the picture, we can see that if \(z\) is greater than 6.8, the line defined by \(3x+2y = z\) will not intersect the feasible region. Hence, the profit cannot exceed \(\$6.8\).

As the line \(3x+2y = 6.8\) does intersect the feasible region, \(6.8\) is the maximum value for the objective function. Note that there is only one point in the feasible region that intersects the line \(3x+2y=6.8\), namely \(\begin{bmatrix} x \\ y\end{bmatrix} = \begin{bmatrix} 1.2 \\ 1.6\end{bmatrix}.\) In other words, to maximize profit, we want to make 1.2 units of lemonade and 1.6 units of lemon juice.

Remark. Note that the solution stipulates that fractional units of lemonade and lemon juice be made. In practical applications, fractional units might not make sense. In such cases, we might add constraints to impose that \(x\) and \(y\) be integers.

The above solution method can hardly be regarded as rigorous because we relied on a picture to conclude that \(3x + 2y \leq 6.8\) for all \(\begin{bmatrix} x\\y\end{bmatrix}\) satisfying the constraints. But we can actually show this algebraically.

Note that multiplying both sides of the constraint \(x + 3y \leq 6\) gives \(0.2x + 0.6 y \leq 1.2\), and multiplying both sides of the constraint \(2x + y \leq 4\) gives \(2.8x + 1.4 y \leq 5.6\). Hence, any \(\begin{bmatrix} x\\y\end{bmatrix}\) that satisfies both \(x+3y\leq 6\) and \(2x+y \leq 4\) must also satisfy \( (0.2x+0.6y) + (2.8x+1.4y) \leq 1.2 + 5.6\), which simplifies to \(3x + 2y \leq 6.8\) as desired! (Here, we used the fact that if \(a \leq b\) and \(c \leq d\), then \(a+c \leq b+d\).)

Now, one might ask if it is always possible to find an algebraic proof like the one above for similar problems. If the answer is “yes”, how does one find such a proof? We will see answers to this question later on.

Before we end, let us consider the following problem: \[\begin{array}{rrcrll} \mbox{minimize } & -2x & + & y & \\ \mbox{subject to} & -x & + & y & \leq & 3 \\ & x & - & 2y & \leq & 2 \\ & x & & & \geq & 0 \\ & & & y & \geq & 0. \\ \end{array}\] Note that for any \(t \geq 0\), \(\begin{bmatrix} x \\ y\end{bmatrix} = \begin{bmatrix} t \\ t\end{bmatrix}\) satisfies all the constraints. The value of the objective function at \(\begin{bmatrix} x \\ y\end{bmatrix} = \begin{bmatrix} t \\ t\end{bmatrix}\) is \(-t\). As \(t \rightarrow \infty\), the value of the objective function tends to \(-\infty\). Therefore, there is no minimum value for the objective function. The problem is said to be unbounded. Later on, we will see how to detect unboundedness algorithmically. Until then, we rely on inspection to identifying such a family of solutions whenever possible.

Exercise. Check that unboundedness can also be established by using \(\begin{bmatrix} x \\ y\end{bmatrix} = \begin{bmatrix} 2t+2 \\ t\end{bmatrix}\) for \(t \geq 0\).

Worked examples

  1. Show that the problem \[ \begin{array}{rl} \text{Minimize} & -x + y \\ \text{Subject to} & 2x - y \geq 0 \\ & x + 3y \geq 3 \end{array} \] is unbounded.

  2. Suppose that you are shopping for dietary supplements to satisfy your required daily intake of 0.40mg of nutrient \(M\) and 0.30mg of nutrient \(N\). There are three popular products on the market. The costs and the amounts of the two nutrients are given in the following table:

    Product 1 Product 2 Product 3
    Cost $27 $31 $24
    Amount of \(M\) per daily serving 0.16 mg 0.21 mg 0.11 mg
    Amount of \(N\) per daily serving 0.19 mg 0.13 mg 0.15 mg

    You want to determine how much of each product you should buy so that the daily intake requirements of the two nutrients are satisfied at minimum cost. Formulate your problem as a linear programming problem, assuming that you can buy a fractional number of each product.