next up previous contents
Next: Alternate Optimal SolutionsDegeneracy, Up: The Simplex Method Previous: Linear Programs in Standard

Solution of Linear Programs by the Simplex Method

For simplicity, in this course we solve ``by hand'' only the case where the constraints are of the form tex2html_wrap_inline8156 and the right-hand-sides are nonnegative. We will explain the steps of the simplex method while we progress through an example.

example2577

First, we convert the problem into standard form by adding slack variables tex2html_wrap_inline8160 and tex2html_wrap_inline8162 .

tex2html_wrap_inline8164

Let z denote the objective function value. Here, tex2html_wrap_inline8168 or, equivalently,

displaymath8170

Putting this equation together with the constraints, we get the following system of linear equations.

  equation2587

Our goal is to maximize z, while satisfying these equations and, in addition, tex2html_wrap_inline8174 , tex2html_wrap_inline8176 , tex2html_wrap_inline8160 , tex2html_wrap_inline8162 .

Note that the equations are already in the form that we expect at the last step of the Gauss-Jordan procedure. Namely, the equations are solved in terms of the nonbasic variables tex2html_wrap_inline5252 , tex2html_wrap_inline5256 . The variables (other than the special variable z) which appear in only one equation are the basic variables. Here the basic variables are tex2html_wrap_inline5270 and tex2html_wrap_inline7840 . A basic solution is obtained from the system of equations by setting the nonbasic variables to zero. Here this yields

displaymath8192

Is this an optimal solution or can we increase z? (Our goal)

By looking at Row 0 above, we see that we can increase z by increasing tex2html_wrap_inline5252 or tex2html_wrap_inline5256 . This is because these variables have a negative coefficient in Row 0. If all coefficients in Row 0 had been nonnegative, we could have concluded that the current basic solution is optimum, since there would be no way to increase z (remember that all variables tex2html_wrap_inline6632 must remain tex2html_wrap_inline8206 ). We have just discovered the first rule of the simplex method.

Rule 1 If all variables have a nonnegative coefficient in Row 0, the current basic solution is optimal.

Otherwise, pick a variable tex2html_wrap_inline6740 with a negative coefficient in Row 0.

The variable chosen by Rule 1 is called the entering variable. Here let us choose, say, tex2html_wrap_inline5252 as our entering variable. It really does not matter which variable we choose as long as it has a negative coefficient in Row 0. The idea is to pivot in order to make the nonbasic variable tex2html_wrap_inline5252 become a basic variable. In the process, some basic variable will become nonbasic (the leaving variable). This change of basis is done using the Gauss-Jordan procedure. What is needed next is to choose the pivot element. It will be found using Rule 2 of the simplex method. In order to better understand the rationale behing this second rule, let us try both possible pivots and see why only one is acceptable.

First, try the pivot element in Row 1.

tex2html_wrap_inline8214

This yields

tex2html_wrap_inline8216

with basic solution tex2html_wrap_inline8218

Now, try the pivot element in Row 2.

tex2html_wrap_inline8220

This yields

tex2html_wrap_inline8222

with basic solution tex2html_wrap_inline8224

Which pivot should we choose? The first one, of course, since the second yields an infeasible basic solution! Indeed, remember that we must keep all variables tex2html_wrap_inline8206 . With the second pivot, we get tex2html_wrap_inline8228 which is infeasible. How could we have known this ahead of time, before actually performing the pivots? The answer is, by comparing the ratios tex2html_wrap_inline8230 in Rows 1 and 2 of (7.1). Here we get tex2html_wrap_inline8232 in Row 1 and tex2html_wrap_inline8234 in Row 2. If you pivot in a row with minimum ratio, you will end up with a feasible basic solution (i.e. you will not introduce negative entries in the Right Hand Side), whereas if you pivot in a row with a ratio which is not minimum you will always end up with an infeasible basic solution. Just simple algebra! A negative pivot element would not be good either, for the same reason. We have just discovered the second rule of the simplex method.

Rule 2 For each Row i, tex2html_wrap_inline8238 , where there is a strictly positive ``entering variable coefficient'', compute the ratio of the Right Hand Side to the ``entering variable coefficient''. Choose the pivot row as being the one with MINIMUM ratio.

Once you have idendified the pivot element by Rule 2, you perform a Gauss-Jordan pivot. This gives you a new basic solution. Is it an optimal solution? This question is addressed by Rule 1, so we have closed the loop. The simplex method iterates between Rules 1, 2 and pivoting until Rule 1 guarantees that the current basic solution is optimal. That's all there is to the simplex method.

After our first pivot, we obtained the following system of equations.

tex2html_wrap_inline8216

with basic solution tex2html_wrap_inline8218

Is this solution optimal? No, Rule 1 tells us to choose tex2html_wrap_inline5256 as entering variable. Where should we pivot? Rule 2 tells us to pivot in Row 2, since the ratios are tex2html_wrap_inline8246 for Row 1, and tex2html_wrap_inline8248 for Row 2, and the minimum occurs in Row 2. So we pivot on tex2html_wrap_inline8250 in the above system of equations. This yields

tex2html_wrap_inline8252

with basic solution tex2html_wrap_inline8254

Now Rule 1 tells us that this basic solution is optimal, since there are no more negative entries in Row 0.

All the above computations can be represented very compactly in tableau form.

tex2html_wrap_inline8256

Since the above example has only two variables, it is interesting to interpret the steps of the simplex method graphically. See Figure 7.1. The simplex method starts in the corner point tex2html_wrap_inline8258 with z=0. Then it discovers that z can increase by increasing, say, tex2html_wrap_inline5252 . Since we keep tex2html_wrap_inline8266 , this means we move along the tex2html_wrap_inline5252 axis. How far can we go? Only until we hit a constraint: if we went any further, the solution would become infeasible. That's exactly what Rule 2 of the simplex method does: the minimum ratio rule identifies the first constraint that will be encountered. And when the constraint is reached, its slack tex2html_wrap_inline5270 becomes zero. So, after the first pivot, we are at the point tex2html_wrap_inline8272 . Rule 1 discovers that z can be increased by increasing tex2html_wrap_inline5256 while keeping tex2html_wrap_inline8278 . This means that we move along the boundary of the feasible region tex2html_wrap_inline8280 until we reach another constraint! After pivoting, we reach the optimal point tex2html_wrap_inline8282 .

   figure2762
Figure 7.1: Graphical Interpretation

exercise2775


next up previous contents
Next: Alternate Optimal SolutionsDegeneracy, Up: The Simplex Method Previous: Linear Programs in Standard

Michael A. Trick
Mon Aug 24 16:30:59 EDT 1998