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_inline546 and the right-hand-sides are nonnegative. We will explain the steps of the simplex method while we progress through an example.

example77

First, we convert the problem into standard form by adding slack variables tex2html_wrap_inline550 and tex2html_wrap_inline552 .

tex2html_wrap_inline554

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

displaymath560

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

  equation87

Our goal is to maximize z, while satisfying these equations and, in addition, tex2html_wrap_inline564 , tex2html_wrap_inline566 , tex2html_wrap_inline550 , tex2html_wrap_inline552 .

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_inline540 , tex2html_wrap_inline574 . 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_inline578 and tex2html_wrap_inline580 . A basic solution is obtained from the system of equations by setting the nonbasic variables to zero. Here this yields

displaymath582

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_inline540 or tex2html_wrap_inline574 . 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_inline594 must remain tex2html_wrap_inline596 ). 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_inline526 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_inline540 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_inline540 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_inline604

This yields

tex2html_wrap_inline606

with basic solution tex2html_wrap_inline608

Now, try the pivot element in Row 2.

tex2html_wrap_inline610

This yields

tex2html_wrap_inline612

with basic solution tex2html_wrap_inline614

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_inline596 . With the second pivot, we get tex2html_wrap_inline618 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_inline620 in Rows 1 and 2 of (1.1). Here we get tex2html_wrap_inline622 in Row 1 and tex2html_wrap_inline624 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_inline628 , 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_inline606

with basic solution tex2html_wrap_inline608

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

tex2html_wrap_inline642

with basic solution tex2html_wrap_inline644

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_inline646

Since the above example has only two variables, it is interesting to interpret the steps of the simplex method graphically. See Figure 1.1. The simplex method starts in the corner point tex2html_wrap_inline648 with z=0. Then it discovers that z can increase by increasing, say, tex2html_wrap_inline540 . Since we keep tex2html_wrap_inline656 , this means we move along the tex2html_wrap_inline540 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_inline578 becomes zero. So, after the first pivot, we are at the point tex2html_wrap_inline662 . Rule 1 discovers that z can be increased by increasing tex2html_wrap_inline574 while keeping tex2html_wrap_inline668 . This means that we move along the boundary of the feasible region tex2html_wrap_inline670 until we reach another constraint! After pivoting, we reach the optimal point tex2html_wrap_inline672 .

   figure262
Figure 1.1: Graphical Interpretation

exercise275


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

Michael A. Trick
Mon Aug 24 14:57:03 EDT 1998