next previous up

Lecture 18: Linear Programming

(This material is not covered in Fraser, Bernhardt and Jewkes. A good reference text is Hillier and Lieberman, ``Introduction to Operations Research'', published by Holden-Day; the fourth edition of this text came out in 1986, and a fifth edition has come out since.)

The Problem

The XYZ company manufactures mobile phones. It is currently considering introducing two new lines of phone, the Standard and the Executive. Each phone needs a battery, a chip, and an injection-moulded plastic case. As a result of successful mergers in the past few years, the XYZ company has its own chip-manufacturing line for making Intel 48 chips, and its own battery factory for producing Everlast II batteries, both of which are used in their existing phone model, the Reliant.

XYZ also has its own injection-moulder. There is some spare capacity in each of these production facilities: the chip production facility for the Intel 48 chip is 4% underutilized, and the battery production facility is 12% underutilized. The injection moulder has 18% spare capacity.

The Standard phone will use Intel 48 chips, while the chip needed for the Executive, the Intel 60, is available in unlimited quantity from a reliable outside supplier. On the other hand, production of the Executive phone requires Everlast II batteries, while the Everlast I's needed for the Standard phone can be purchased in unlimited quantity from another reliable outside supplier.

To produce a thousand Intel 48's a year will use 1% of the capacity of the company's chip foundry. Producing a thousand Everlast II's a year will use 2% of the capacity of the battery production line. Producing 1000 Standard plastic cases would use 3% of the annual capacity of the injection moulder, while 1000 of the lighter Executive model would only use 2% of capacity.

Market research indicates that the Standard can probably be sold for $3.00 net profit, after meeting all costs, while the Executive can be sold for $5.00 profit.

So, the question facing XYZ management is, what product mix will maximize their expected profit for the coming year?

Formalization of the Problem

The relevant information can be summarised in the following table:
Line Product (% of capacity used per 1000) Available Capacity
Standard Executive
Chip 1 0 4
Battery 0 2 12
Mould 3 2 18
Profit ($1000/1000) 3 5

Let us refer to the number of Standards to be produced as x1 and the number of Executives as x2. To keep the numbers manageable, we'll suppose that each of these variables represents the production rate in units of one thousand. We call x1 and x2 the decision variables for the problem. Our goal is to maximize the profit for the coming year, which is given by

Z = 3x1 + 5x2

(The units here are thousands of dollars. Strictly, we should multiply through by (P/F,i,1), to bring the profit back to present time. But multiplying through by a constant factor won't affect the position of the maximum, so we'll leave it out to keep things simple.)

We refer to Z as the objective function, since our objective is to maximize it. We do this maximization subject to constraints imposed by the limited resources available. Specifically, any solution needs to satisfy the constraints:

x1 <= 4

2x2 <= 12

3x1 + 2x2 <= 18

We refer to these as functional constraints. We should also note that we can't decide to produce a negative number of phones -- this is obvious to us, but we need to make it explicit in the mathematical formulation, to avoid coming up with meaningless answers. So we have to add two non-negativity contraints,

x1 >= 0

x2 >= 0

The problem is now in the standard form for linear programming problems: an objective function that is to be maximized, subject to a number of constraints. We go on to examine solution methods.

Two Variables: Graphical Solution

For cases like the one we have here, where there are just two decision variables, there is a quick and easy solution method. This method involves graphical construction, and is hence somewhat difficult to illustrate with the limited graphical capabilities of html. But here's how it works:

First, draw a pair of axes labelled x1 (horizontal axis) and x2 (vertical axis). Shade the area below the horizontal axis and the area to the left of the vertical axis, indicating that there can be no solution in these regions (since both variables have to be non-negative.)

Now plot the line

x1 = 4.

Shade the region to the right of this line: there can be no feasible solutions here, since the first inequality isn't satisfied. Similarly, plot the line

x2=6

Shade the region above this line, since the second inequality isn't satisfied there. Lastly, plot the line

3x1+2x2 = 18

Shade the region where inequality 3 is not satisfied. You should now have a closed, convex, unshaded region, containing all of the feasible values of the two parameters.

The last step is to locate the optimum solution. Suppose the optimum value of Z were 10. Draw the line

3x1 + 5x2 = 10

This cuts through the unshaded region, so there are solutions giving a net profit of $10,000. Are there better solutions? Suppose Z=20. The line

3x1 + 5x2 = 20

also cuts the unshaded region, so there are solutions giving a net profit of $20,000. Notice that the line for Z=20 is parallel to the line with Z=10. You can now slide a ruler over the diagram, keeping it parallel to these lines, and move it north-east until it intersects the unshaded region in a single point. This is then the location of the optimum solution. If you've done everything right, it should be at x1 = 2, x2 = 6, for a total profit of $36,000. (Check that this fits all the constraints.)

So we now have a solution method that works as long as we have no more than two decision variables. Real-life optimization problems may involve thousands of variables, so this method is of limited general usefulness. We will go on to examine a more powerful method, keeping the present example as an illustration.

General Statement of the Problem

The relevant information can be summarised in the following table:
Resource Resource Usage per unit of Activity Amount of Resource Available
1 2 ... n
1 a11 a12 ... a1n b1
2 a21 a22 ... a2n b2
. . . . . .
m am1 am2 ... amn bm
Delta Z/unit of activity c1 c2 ... cn
Level of activity x1 x2 ... xn

The Simplex Method

To develop a general solution method, let's look carefully at the solution of the two-variable problem: First, we need to introduce some definitions. We will refer to any assignment of values to the decision variables as a solution. (This is an unusual way of speaking; normally if I ask for the solution to a problem, I'm expecting a correct solution; but in the perverse world of linear programmers, anything counts as a solution.) Next, a feasible solution is a solution that satisfies all the constraint equations. Then an optimal solution is a feasible solution with the maximal value of Z. (This is the case that corresponds to what ordinary people would mean by a solution.)

Notice that the graph we drew to solve the problem has a convex region containing all the feasible solutions. This region has corners, and the solution values at these corners are referred to as feasible corner-point solutions. Two corner-point solutions are adjacent if they are connected by a single edge.

I claim that the following statements are obviously true:

  1. If there is exactly one optimal solution, it must be at a corner point.
  2. If there are multiple optimal solutions, at least two must be at adjacent corner points.
  3. There are only a finite number of corner-point solutions.
  4. If a corner-point solution is better than the adjacent solutions, it's the best of all.

If these statements are true, then the following method should work:

  1. Start at a corner-point feasible solution
  2. Move to a better adjacent corner-point feasible solution
  3. Test for optimality: is the current solution better than the adjacent solutions? If not, go to step 2. If it is, then it's the optimal solution, and we've finished.

These steps are easy to apply if we have just two variables and a diagram, but we'd like an algorithm that can be applied to any number of variables. To do this, we have to re-arrange the problem a bit. First, we change the functional inequalities to equations by introducing additional variables:

x1 + x3 = 4

2x2 + x4 = 12

3x1 + 2x2 + x5 = 18

where the three new variables, x3, x4, and x5, are defined to be non-negative. We call these new variables slack variables. (The idea is that x3, for example, represents the unused capacity, or `slack', in the chip production line.)

Now, we have added m slack variables to the original n variables, and we have m equations constraining the variables. So we have n degrees of freedom, which we can use to set the values of some variables arbitrarily. (We actually always set them to zero.) We call the variables currently set to zero, non-basic variables. The others (obviously) we call basic variables. So at any time, there will be n non-basic variables and m basic variables.

Now, to get started on the simplex method, we set all the original variables (x1 and x2 in the case of the XYZ company) to zero, and let the slack variables be non-zero.

So for the XYZ problem, the initial basic feasible solution is (0,0,4,12,18). This gives us an objective function of zero, which is not very optimal, but at least it's a start. Next, we look at the objective function, and ask which non-basic variable has the greatest potential to improve its value. Looking at

Z = 3x1 + 5x2

, we at once see that increasing x2 will have the greater effect on Z. So we decide to make x2 basic. We call x2 the entering basic variable. If we're going to make x2 basic, we must make one of the current basic variables non-basic. Which one? To decide this, we look at each of the constraint equations, and see how the values of the current basic variables must change as the value of x2 increases. By inspection, x4 must become zero as soon as x2=6. So we have identified x4 as the leaving basic variable.


next
next previous

John Jones
Mar 3 10:38:23 PDT 2008