









































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An explanation of the Simplex Method for solving linear programming problems. It includes an example of the Wyndor Glass Co. problem and its solution using the Simplex Method. The document also discusses how to adapt the method to other model forms and the disadvantages of certain approaches.
Typology: Summaries
1 / 81
This page cannot be seen from the preview
Don't miss anything!










































































109
We now are ready to begin studying the simplex method, a general procedure for solving linear programming problems. Developed by George Dantzig in 1947, it has proved to be a remarkably efficient method that is used routinely to solve huge problems on today’s computers. Except for its use on tiny problems, this method is always executed on a com- puter, and sophisticated software packages are widely available. Extensions and variations of the simplex method also are used to perform postoptimality analysis (including sensi- tivity analysis) on the model. This chapter describes and illustrates the main features of the simplex method. The first section introduces its general nature, including its geometric interpretation. The fol- lowing three sections then develop the procedure for solving any linear programming model that is in our standard form (maximization, all functional constraints in form, and nonnegativity constraints on all variables) and has only nonnegative right-hand sides bi in the functional constraints. Certain details on resolving ties are deferred to Sec. 4.5, and Sec. 4.6 describes how to adapt the simplex method to other model forms. Next we discuss postoptimality analysis (Sec. 4.7), and describe the computer implementation of the simplex method (Sec. 4.8). Section 4.9 then introduces an alternative to the simplex method (the interior-point approach) for solving large linear programming problems.
The simplex method is an algebraic procedure. However, its underlying concepts are geo- metric. Understanding these geometric concepts provides a strong intuitive feeling for how the simplex method operates and what makes it so efficient. Therefore, before delving into algebraic details, we focus in this section on the big picture from a geometric viewpoint. To illustrate the general geometric concepts, we shall use the Wyndor Glass Co. ex- ample presented in Sec. 3.1. (Sections 4.2 and 4.3 use the algebra of the simplex method to solve this same example.) Section 5.1 will elaborate further on these geometric con- cepts for larger problems. To refresh your memory, the model and graph for this example are repeated in Fig. 4.1. The five constraint boundaries and their points of intersection are highlighted in this figure because they are the keys to the analysis. Here, each constraint boundary is a line that forms the boundary of what is permitted by the corresponding constraint. The points
of intersection are the corner-point solutions of the problem. The five that lie on the cor- ners of the feasible region —(0, 0), (0, 6), (2, 6), (4, 3), and (4, 0)—are the corner-point feasible solutions ( CPF solutions ). [The other three—(0, 9), (4, 6), and (6, 0)—are called corner-point infeasible solutions .] In this example, each corner-point solution lies at the intersection of two constraint boundaries. (For a linear programming problem with n decision variables, each of its corner-point solutions lies at the intersection of n constraint boundaries. 1 ) Certain pairs of the CPF solutions in Fig. 4.1 share a constraint boundary, and other pairs do not. It will be important to distinguish between these cases by using the following general definitions. For any linear programming problem with n decision variables, two CPF solutions are ad- jacent to each other if they share n 1 constraint boundaries. The two adjacent CPF so- lutions are connected by a line segment that lies on these same shared constraint bound- aries. Such a line segment is referred to as an edge of the feasible region. Since n 2 in the example, two of its CPF solutions are adjacent if they share one constraint boundary; for example, (0, 0) and (0, 6) are adjacent because they share the x 1 0 constraint boundary. The feasible region in Fig. 4.1 has five edges, consisting of the five line segments forming the boundary of this region. Note that two edges emanate from each CPF solution. Thus, each CPF solution has two adjacent CPF solutions (each lying at the other end of one of the two edges), as enumerated in Table 4.1. (In each row
110 4 SOLVING LINEAR PROGRAMMING PROBLEMS: THE SIMPLEX METHOD
(4, 0) (6, 0)
(0, 6)
(0, 9)
(2, 6)
(4, 3)
(4, 6)
(0, 0)
Feasible region
x 1 0
3 x 1 2 x 2 18
x 2 0
x 1 4
2 x 2 12
Maximize Z 3 x 1 5 x 2 , subject to x 1 4 12 18
2 x 2 3 x 1 2 x 2 and x 1 0, x 2 0
x 2
x 1
FIGURE 4. Constraint boundaries and corner-point solutions for the Wyndor Glass Co. problem.
(^1) Although a corner-point solution is defined in terms of n constraint boundaries whose intersection gives this solution, it also is possible that one or more additional constraint boundaries pass through this same point.
3. Solve for the intersection of the new set of constraint boundaries: (0, 6). (The equations for these constraint boundaries, x 1 0 and 2 x 2 12, immediately yield this solution.) Optimality Test: Conclude that (0, 6) is not an optimal solution. (An adjacent CPF solution is better.) Iteration 2: Move to a better adjacent CPF solution, (2, 6), by performing the fol- lowing three steps. 1. Considering the two edges of the feasible region that emanate from (0, 6), choose to move along the edge that leads to the right. (Moving along this edge increases Z , whereas backtracking to move back down the x 2 axis decreases Z .) 2. Stop at the first new constraint boundary encountered when moving in that direction: 3 x 1 2 x 2 12. (Moving farther in the direction selected in step 1 leaves the feasible region.) 3. Solve for the intersection of the new set of constraint boundaries: (2, 6). (The equa- tions for these constraint boundaries, 3 x 1 2 x 2 18 and 2 x 2 12, immediately yield this solution.) Optimality Test: Conclude that (2, 6) is an optimal solution, so stop. (None of the ad- jacent CPF solutions are better.)
This sequence of CPF solutions examined is shown in Fig. 4.2, where each circled num- ber identifies which iteration obtained that solution. Now let us look at the six key solution concepts of the simplex method that provide the rationale behind the above steps. (Keep in mind that these concepts also apply for solving problems with more than two decision variables where a graph like Fig. 4.2 is not available to help quickly find an optimal solution.)
The Key Solution Concepts The first solution concept is based directly on the relationship between optimal solutions and CPF solutions given at the end of Sec. 3.2.
112 4 SOLVING LINEAR PROGRAMMING PROBLEMS: THE SIMPLEX METHOD
(4, 0)
(0, 6)
(2, 6)
(4, 3)
(0, 0)
Feasible region
x 1
x 2 Z 30 Z 36
Z 27
Z 12
Z 0
(^12)
0
FIGURE 4. This graph shows the sequence of CPF solutions (, , ) examined by the simplex method for the Wyndor Glass Co. problem. The optimal solution (2, 6) is found after just three solutions are examined.
Solution concept 1: The simplex method focuses solely on CPF solutions. For any problem with at least one optimal solution, finding one requires only find- ing a best CPF solution. 1
Since the number of feasible solutions generally is infinite, reducing the number of solu- tions that need to be examined to a small finite number ( just three in Fig. 4.2) is a tremen- dous simplification. The next solution concept defines the flow of the simplex method. Solution concept 2: The simplex method is an iterative algorithm (a systematic solution procedure that keeps repeating a fixed series of steps, called an itera- tion, until a desired result has been obtained) with the following structure. Initialization: Set up to start iterations, including finding an initial CPF solution.
Optimality test: Is the current CPF solution optimal?
If no If yes → Stop.
Iteration: Perform an iteration to find a better CPF solution.
When the example was solved, note how this flow diagram was followed through two it- erations until an optimal solution was found. We next focus on how to get started. Solution concept 3: Whenever possible, the initialization of the simplex method chooses the origin (all decision variables equal to zero) to be the initial CPF so- lution. When there are too many decision variables to find an initial CPF solu- tion graphically, this choice eliminates the need to use algebraic procedures to find and solve for an initial CPF solution.
Choosing the origin commonly is possible when all the decision variables have nonneg- ativity constraints, because the intersection of these constraint boundaries yields the ori- gin as a corner-point solution. This solution then is a CPF solution unless it is infeasible because it violates one or more of the functional constraints. If it is infeasible, special pro- cedures described in Sec. 4.6 are needed to find the initial CPF solution. The next solution concept concerns the choice of a better CPF solution at each iteration. Solution concept 4: Given a CPF solution, it is much quicker computationally to gather information about its adjacent CPF solutions than about other CPF so- lutions. Therefore, each time the simplex method performs an iteration to move from the current CPF solution to a better one, it always chooses a CPF solution that is adjacent to the current one. No other CPF solutions are considered. Con- sequently, the entire path followed to eventually reach an optimal solution is along the edges of the feasible region.
4.1 THE ESSENCE OF THE SIMPLEX METHOD 113
(^1) The only restriction is that the problem must possess CPF solutions. This is ensured if the feasible region is bounded.
variables. To illustrate, consider the first functional constraint in the Wyndor Glass Co. example of Sec. 3.
x 1 4.
The slack variable for this constraint is defined to be
x 3 4 x 1 ,
which is the amount of slack in the left-hand side of the inequality. Thus,
x 1 x 3 4.
Given this equation, x 1 4 if and only if 4 x 1 x 3 0. Therefore, the original con- straint x 1 4 is entirely equivalent to the pair of constraints
x 1 x 3 4 and x 3 0. Upon the introduction of slack variables for the other functional constraints, the original linear programming model for the example (shown below on the left) can now be replaced by the equivalent model (called the augmented form of the model) shown below on the right:
Original Form of the Model Augmented Form of the Model 1
4.2 SETTING UP THE SIMPLEX METHOD 115
Maximize Z 3 x 1 5 x 2 , subject to x 1 2 x 2 4 3 x 1 2 x 2 12 3 x 1 2 x 2 18 and x 1 0, x 2 0.
Maximize Z 3 x 1 5 x 2 , subject to (1) x 1 x 3 4 (2) 2 x 2 x 4 12 (3) 3 x 1 2 x 2 x 5 18 and xj 0, for j 1, 2, 3, 4, 5.
Although both forms of the model represent exactly the same problem, the new form is much more convenient for algebraic manipulation and for identification of CPF solutions. We call this the augmented form of the problem because the original form has been aug- mented by some supplementary variables needed to apply the simplex method. If a slack variable equals 0 in the current solution, then this solution lies on the con- straint boundary for the corresponding functional constraint. A value greater than 0 means that the solution lies on the feasible side of this constraint boundary, whereas a value less than 0 means that the solution lies on the infeasible side of this constraint boundary. A demonstration of these properties is provided by the demonstration example in your OR Tutor entitled Interpretation of the Slack Variables. The terminology used in the preceding section (corner-point solutions, etc.) applies to the original form of the problem. We now introduce the corresponding terminology for the augmented form.
An augmented solution is a solution for the original variables (the decision vari- ables ) that has been augmented by the corresponding values of the slack variables.
(^1) The slack variables are not shown in the objective function because the coefficients there are 0.
For example, augmenting the solution (3, 2) in the example yields the augmented solu- tion (3, 2, 1, 8, 5) because the corresponding values of the slack variables are x 3 1, x 4 8, and x 5 5. A basic solution is an augmented corner-point solution. To illustrate, consider the corner-point infeasible solution (4, 6) in Fig. 4.1. Augmenting it with the resulting values of the slack variables x 3 0, x 4 0, and x 5 6 yields the corresponding basic solution (4, 6, 0, 0, 6). The fact that corner-point solutions (and so basic solutions) can be either feasible or infeasible implies the following definition: A basic feasible (BF) solution is an augmented CPF solution. Thus, the CPF solution (0, 6) in the example is equivalent to the BF solution (0, 6, 4, 0, 6) for the problem in augmented form. The only difference between basic solutions and corner-point solutions (or between BF solutions and CPF solutions) is whether the values of the slack variables are included. For any basic solution, the corresponding corner-point solution is obtained simply by delet- ing the slack variables. Therefore, the geometric and algebraic relationships between these two solutions are very close, as described in Sec. 5.1. Because the terms basic solution and basic feasible solution are very important parts of the standard vocabulary of linear programming, we now need to clarify their algebraic properties. For the augmented form of the example, notice that the system of functional constraints has 5 variables and 3 equations, so Number of variables number of equations 5 3 2. This fact gives us 2 degrees of freedom in solving the system, since any two variables can be chosen to be set equal to any arbitrary value in order to solve the three equations in terms of the remaining three variables.^1 The simplex method uses zero for this arbitrary value. Thus, two of the variables (called the nonbasic variables ) are set equal to zero, and then the si- multaneous solution of the three equations for the other three variables (called the basic vari- ables ) is a basic solution. These properties are described in the following general definitions. A basic solution has the following properties:
1. Each variable is designated as either a nonbasic variable or a basic variable. 2. The number of basic variables equals the number of functional constraints (now equa- tions). Therefore, the number of nonbasic variables equals the total number of vari- ables minus the number of functional constraints. 3. The nonbasic variables are set equal to zero. 4. The values of the basic variables are obtained as the simultaneous solution of the sys- tem of equations (functional constraints in augmented form). (The set of basic vari- ables is often referred to as the basis. ) 5. If the basic variables satisfy the nonnegativity constraints, the basic solution is a BF solution.
116 4 SOLVING LINEAR PROGRAMMING PROBLEMS: THE SIMPLEX METHOD
(^1) This method of determining the number of degrees of freedom for a system of equations is valid as long as the system does not include any redundant equations. This condition always holds for the system of equations formed from the functional constraints in the augmented form of a linear programming model.
It is just as if Eq. (0) actually were one of the original constraints; but because it already is in equality form, no slack variable is needed. While adding one more equation, we also have added one more unknown ( Z ) to the system of equations. Therefore, when using Eqs. (1) to (3) to obtain a basic solution as described above, we use Eq. (0) to solve for Z at the same time. Somewhat fortuitously, the model for the Wyndor Glass Co. problem fits our stan- dard form, and all its functional constraints have nonnegative right-hand sides b (^) i. If this had not been the case, then additional adjustments would have been needed at this point before the simplex method was applied. These details are deferred to Sec. 4.6, and we now focus on the simplex method itself.
118 4 SOLVING LINEAR PROGRAMMING PROBLEMS: THE SIMPLEX METHOD
We continue to use the prototype example of Sec. 3.1, as rewritten at the end of Sec. 4.2, for illustrative purposes. To start connecting the geometric and algebraic concepts of the simplex method, we begin by outlining side by side in Table 4.2 how the simplex method solves this example from both a geometric and an algebraic viewpoint. The geometric viewpoint (first presented in Sec. 4.1) is based on the original form of the model (no slack variables), so again refer to Fig. 4.1 for a visualization when you examine the second col- umn of the table. Refer to the augmented form of the model presented at the end of Sec. 4.2 when you examine the third column of the table. We now fill in the details for each step of the third column of Table 4.2.
Initialization The choice of x 1 and x 2 to be the nonbasic variables (the variables set equal to zero) for the initial BF solution is based on solution concept 3 in Sec. 4.1. This choice eliminates the work required to solve for the basic variables ( x 3 , x 4 , x 5 ) from the following system of equations (where the basic variables are shown in bold type): x 1 0 and x 2 0 so (1) x 1 x 3 4 x 3 4 (2) 2 x 2 x 4 12 x 4 12 (3) 3 x 1 2 x 2 x 5 18 x 5 18 Thus, the initial BF solution is (0, 0, 4, 12, 18). Notice that this solution can be read immediately because each equation has just one basic variable, which has a coefficient of 1, and this basic variable does not appear in any other equation. You will soon see that when the set of basic variables changes, the sim- plex method uses an algebraic procedure (Gaussian elimination) to convert the equations to this same convenient form for reading every subsequent BF solution as well. This form is called proper form from Gaussian elimination.
Optimality Test The objective function is Z 3 x 1 5 x 2 ,
so Z 0 for the initial BF solution. Because none of the basic variables ( x 3 , x 4 , x 5 ) have a nonzero coefficient in this objective function, the coefficient of each nonbasic variable ( x 1 , x 2 ) gives the rate of improvement in Z if that variable were to be increased from zero (while the values of the basic variables are adjusted to continue satisfying the system of equations). 1 These rates of improvement (3 and 5) are positive. Therefore, based on so- lution concept 6 in Sec. 4.1, we conclude that (0, 0, 4, 12, 18) is not optimal. For each BF solution examined after subsequent iterations, at least one basic variable has a nonzero coefficient in the objective function. Therefore, the optimality test then will use the new Eq. (0) to rewrite the objective function in terms of just the nonbasic vari- ables, as you will see later.
4.3 THE ALGEBRA OF THE SIMPLEX METHOD 119
TABLE 4.2 Geometric and algebraic interpretations of how the simplex method solves the Wyndor Glass Co. problem
Method Sequence Geometric Interpretation Algebraic Interpretation
Initialization Choose (0, 0) to be the initial CPF Choose x 1 and x 2 to be the nonbasic solution. variables ( 0) for the initial BF solution: (0, 0, 4, 12, 18). Optimality Not optimal, because moving along Not optimal, because increasing either test either edge from (0, 0) increases Z. nonbasic variable ( x 1 or x 2 ) increases Z. Iteration 1 Step 1 Move up the edge lying on the x 2 Increase x 2 while adjusting other axis. variable values to satisfy the system of equations. Step 2 Stop when the first new constraint Stop when the first basic variable ( x 3 , boundary (2 x 2 12) is reached. x 4 , or x 5 ) drops to zero ( x 4 ). Step 3 Find the intersection of the new pair With x 2 now a basic variable and x 4 of constraint boundaries: (0, 6) is the now a nonbasic variable, solve the new CPF solution. system of equations: (0, 6, 4, 0, 6) is the new BF solution. Optimality Not optimal, because moving along the Not optimal, because increasing one test edge from (0, 6) to the right increases Z. nonbasic variable ( x 1 ) increases Z. Iteration 2 Step 1 Move along this edge to the right. Increase x 1 while adjusting other variable values to satisfy the system of equations. Step 2 Stop when the first new constraint Stop when the first basic variable ( x 2 , boundary (3 x 1 2 x 2 18) is reached. x 3 , or x 5 ) drops to zero ( x 5 ). Step 3 Find the intersection of the new pair With x 1 now a basic variable and x 5 of constraint boundaries: (2, 6) is the now a nonbasic variable, solve the new CPF solution. system of equations: (2, 6, 2, 0, 0) is the new BF solution. Optimality (2, 6) is optimal, because moving (2, 6, 2, 0, 0) is optimal, because test along either edge from (2, 6) decreases Z. increasing either nonbasic variable ( x 4 or x 5 ) decreases Z.
(^1) Note that this interpretation of the coefficients of the xj variables is based on these variables being on the right- hand side, Z 3 x 1 5 x 2. When these variables are brought to the left-hand side for Eq. (0), Z 3 x 1 5 x 2 0, the nonzero coefficients change their signs.
with x 3 in Eq. (1) of the example.] However, for each equation where the coefficient of the entering basic variable is strictly positive ( 0), this test calculates the ratio of the right-hand side to the coefficient of the entering basic variable. The basic variable in the equation with the minimum ratio is the one that drops to zero first as the entering basic variable is increased.
At any iteration of the simplex method, step 2 uses the minimum ratio test to determine which basic variable drops to zero first as the entering basic variable is increased. De- creasing this basic variable to zero will convert it to a nonbasic variable for the next BF solution. Therefore, this variable is called the leaving basic variable for the current iter- ation (because it is leaving the basis).
Thus, x 4 is the leaving basic variable for iteration 1 of the example.
Solving for the New BF Solution (Step 3 of an Iteration)
Increasing x 2 0 to x 2 6 moves us from the initial BF solution on the left to the new BF solution on the right.
Initial BF solution New BF solution Nonbasic variables: x 1 0, x 2 0 x 1 0, x 4 0 Basic variables: x 3 4, x 4 12, x 5 18 x 3 ?, x 2 6, x 5 ?
The purpose of step 3 is to convert the system of equations to a more convenient form (proper form from Gaussian elimination) for conducting the optimality test and (if needed) the next iteration with this new BF solution. In the process, this form also will identify the values of x 3 and x 5 for the new solution. Here again is the complete original system of equations, where the new basic vari- ables are shown in bold type (with Z playing the role of the basic variable in the objec- tive function equation):
(0) Z 3 x 1 5 x 2 0. (1) x 1 x 3 4. (2) 2 x 2 x 4 12. (3) 3 x 1 2 x 2 x 5 18.
Thus, x 2 has replaced x 4 as the basic variable in Eq. (2). To solve this system of equations for Z , x 2 , x 3 , and x 5 , we need to perform some elementary algebraic operations to re- produce the current pattern of coefficients of x 4 (0, 0, 1, 0) as the new coefficients of x 2. We can use either of two types of elementary algebraic operations:
1. Multiply (or divide) an equation by a nonzero constant. 2. Add (or subtract) a multiple of one equation to (or from) another equation.
To prepare for performing these operations, note that the coefficients of x 2 in the above system of equations are 5, 0, 2, and 3, respectively, whereas we want these coefficients to become 0, 0, 1, and 0, respectively. To turn the coefficient of 2 in Eq. (2) into 1, we use the first type of elementary algebraic operation by dividing Eq. (2) by 2 to obtain
(2) x 2
x 4 6.
4.3 THE ALGEBRA OF THE SIMPLEX METHOD 121
To turn the coefficients of 5 and 3 into zeros, we need to use the second type of elementary algebraic operation. In particular, we add 5 times this new Eq. (2) to Eq. (0), and subtract 2 times this new Eq. (2) from Eq. (3). The resulting complete new system of equations is
(0) Z 3 x 1
x 4 30 (1) x 1 x 3 4 (2) x 2
x 4 6 (3) 3 x 1 x 4 x 5 6. Since x 1 0 and x 4 0, the equations in this form immediately yield the new BF solu- tion, ( x 1 , x 2 , x 3 , x 4 , x 5 ) (0, 6, 4, 0, 6), which yields Z 30. This procedure for obtaining the simultaneous solution of a system of linear equa- tions is called the Gauss-Jordan method of elimination, or Gaussian elimination for short.^1 The key concept for this method is the use of elementary algebraic operations to reduce the original system of equations to proper form from Gaussian elimination, where each basic variable has been eliminated from all but one equation ( its equation) and has a coefficient of 1 in that equation.
Optimality Test for the New BF Solution The current Eq. (0) gives the value of the objective function in terms of just the current nonbasic variables
Z 30 3 x 1
x 4.
Increasing either of these nonbasic variables from zero (while adjusting the values of the basic variables to continue satisfying the system of equations) would result in moving to- ward one of the two adjacent BF solutions. Because x 1 has a positive coefficient, in- creasing x 1 would lead to an adjacent BF solution that is better than the current BF solu- tion, so the current solution is not optimal.
Iteration 2 and the Resulting Optimal Solution Since Z 30 3 x 1 ^52 ^ x 4 , Z can be increased by increasing x 1 , but not x 4. Therefore, step 1 chooses x 1 to be the entering basic variable. For step 2, the current system of equations yields the following conclusions about how far x 1 can be increased (with x 4 0):
x 3 4 x 1 0 ⇒ x 1
x 2 6 0 ⇒ no upper bound on x 1.
x 5 6 3 x 1 0 ⇒ x 1
2 minimum.
Therefore, the minimum ratio test indicates that x 5 is the leaving basic variable.
122 4 SOLVING LINEAR PROGRAMMING PROBLEMS: THE SIMPLEX METHOD
(^1) Actually, there are some technical differences between the Gauss-Jordan method of elimination and Gaussian elimination, but we shall not make this distinction.
interactively with your OR Courseware), we recommend the tabular form described in this section. 1 The tabular form of the simplex method records only the essential information, namely, (1) the coefficients of the variables, (2) the constants on the right-hand sides of the equa- tions, and (3) the basic variable appearing in each equation. This saves writing the sym- bols for the variables in each of the equations, but what is even more important is the fact that it permits highlighting the numbers involved in arithmetic calculations and recording the computations compactly. Table 4.3 compares the initial system of equations for the Wyndor Glass Co. prob- lem in algebraic form (on the left) and in tabular form (on the right), where the table on the right is called a simplex tableau. The basic variable for each equation is shown in bold type on the left and in the first column of the simplex tableau on the right. [Although only the xj variables are basic or nonbasic, Z plays the role of the basic variable for Eq. (0).] All variables not listed in this basic variable column ( x 1 , x 2 ) automatically are nonbasic variables. After we set x 1 0, x 2 0, the right side column gives the resulting solution for the basic variables, so that the initial BF solution is ( x 1 , x 2 , x 3 , x 4 , x 5 ) (0, 0, 4, 12,
124 4 SOLVING LINEAR PROGRAMMING PROBLEMS: THE SIMPLEX METHOD
TABLE 4.3 Initial system of equations for the Wyndor Glass Co. problem (a) Algebraic Form (b) Tabular Form Coefficient of: Basic Right Variable Eq. Z x 1 x 2 x 3 x 4 x 5 Side (0) Z 3 x 1 5 x 2 x 3 x 4 x 5 0 Z (0) 1 3 5 0 0 0 0 (1) Z 3 x 1 5 x 2 x 3 x 4 x 5 4 x 3 (1) 0 1 0 1 0 0 4 (2) Z 3 x 1 2 x 2 x 3 x 4 x 5 12 x 4 (2) 0 0 2 0 1 0 12 (3) Z 3 x 1 2 x 2 x 3 x 4 x 5 18 x 5 (3) 0 3 2 0 0 1 18
(^1) A form more convenient for automatic execution on a computer is presented in Sec. 5.2.
Summary of the Simplex Method (and Iteration 1 for the Example)
Initialization. Introduce slack variables. Select the decision variables to be the initial nonbasic variables (set equal to zero) and the slack variables to be the initial basic vari- ables. (See Sec. 4.6 for the necessary adjustments if the model is not in our standard form—maximization, only functional constraints, and all nonnegativity constraints— or if any b (^) i values are negative.) For the Example: This selection yields the initial simplex tableau shown in Table 4.3 b , so the initial BF solution is (0, 0, 4, 12, 18).
Optimality Test. The current BF solution is optimal if and only if every coefficient in row 0 is nonnegative ( 0). If it is, stop; otherwise, go to an iteration to obtain the next BF solution, which involves changing one nonbasic variable to a basic variable (step 1) and vice versa (step 2) and then solving for the new solution (step 3). For the Example: Just as Z 3 x 1 5 x 2 indicates that increasing either x 1 or x 2 will increase Z , so the current BF solution is not optimal, the same conclusion is drawn from the equation Z 3 x 1 5 x 2 0. These coefficients of 3 and 5 are shown in row 0 of Table 4.3 b.
Iteration. Step 1: Determine the entering basic variable by selecting the variable (au- tomatically a nonbasic variable) with the negative coefficient having the largest absolute value (i.e., the “most negative” coefficient) in Eq. (0). Put a box around the column be- low this coefficient, and call this the pivot column. For the Example: The most negative coefficient is 5 for x 2 (5 3), so x 2 is to be changed to a basic variable. (This change is indicated in Table 4.4 by the box around the x 2 column below 5.) Step 2: Determine the leaving basic variable by applying the minimum ratio test. Minimum Ratio Test
1. Pick out each coefficient in the pivot column that is strictly positive ( 0). 2. Divide each of these coefficients into the right side entry for the same row. 3. Identify the row that has the smallest of these ratios. 4. The basic variable for that row is the leaving basic variable, so replace that variable by the entering basic variable in the basic variable column of the next simplex tableau.
4.4 THE SIMPLEX METHOD IN TABULAR FORM 125
TABLE 4.4 Applying the minimum ratio test to determine the first leaving basic variable for the Wyndor Glass Co. problem Coefficient of: Basic Right Variable Eq. Z x 1 x 2 x 3 x 4 x 5 Side Ratio
Z (0) 1 3 5 0 0 0 0 x 3 (1) 0 1 0 1 0 0 4 x 4 (2) 0 0 2 0 1 0 12 6 minimum
x 5 (3) 0 3 2 0 0 1 18 ^182 9
^12 2
Iteration 2 for the Example and the Resulting Optimal Solution
The second iteration starts anew from the second tableau of Table 4.6 to find the next BF solution. Following the instructions for steps 1 and 2, we find x 1 as the entering basic vari- able and x 5 as the leaving basic variable, as shown in Table 4.7. For step 3, we start by dividing the pivot row (row 3) in Table 4.7 by the pivot num- ber (3). Next, we add to row 0 the product, 3 times the new row 3. Then we subtract the new row 3 from row 1. We now have the set of tableaux shown in Table 4.8. Therefore, the new BF solution is (2, 6, 2, 0, 0), with Z 36. Going to the optimality test, we find that this solution is optimal because none of the coefficients in row 0 is negative, so the algorithm is finished. Consequently, the optimal solution for the Wyndor Glass Co. problem (before slack vari- ables are introduced) is x 1 2, x 2 6. Now compare Table 4.8 with the work done in Sec. 4.3 to verify that these two forms of the simplex method really are equivalent. Then note how the algebraic form is supe- rior for learning the logic behind the simplex method, but the tabular form organizes the
4.4 THE SIMPLEX METHOD IN TABULAR FORM 127
TABLE 4.6 First two simplex tableaux for the Wyndor Glass Co. problem
Coefficient of: Basic Right Iteration Variable Eq. Z x 1 x 2 x 3 x 4 x 5 Side
Z (0) 1 3 5 0 0 0 0 0^ x^3 (1)^0 ^1 ^0 1 ^0 0 x 4 (2) 0 0 2 0 1 0 12 x 5 (3) 0 3 2 0 0 1 18
Z (0) 1 3 0 0 ^52 0 30
1^ x^3 (1)^0 ^1 ^0 1 ^0 0 x 2 (2) 0 0 1 0 ^12 0 6 x 5 (3) 0 3 0 0 1 1 6
TABLE 4.7 Steps 1 and 2 of iteration 2 for the Wyndor Glass Co. problem
Coefficient of: Basic Right Iteration Variable Eq. Z x 1 x 2 x 3 x 4 x 5 Side Ratio
Z (0) 1 3 0 0 ^52 0 30
x 3 (1) 0 1 0 1 0 0 4 ^41 4 1 x 2 (2) 0 0 1 0 ^12 0 6
x 5 (3) 0 3 0 0 1 1 6 ^63 2 minimum
work being done in a considerably more convenient and compact form. We generally use the tabular form from now on. An additional example of applying the simplex method in tabular form is available to you in the OR Tutor. See the demonstration entitled Simplex Method — Tabular Form.
128 4 SOLVING LINEAR PROGRAMMING PROBLEMS: THE SIMPLEX METHOD
TABLE 4.8 Complete set of simplex tableaux for the Wyndor Glass Co. problem Coefficient of: Basic Right Iteration Variable Eq. Z x 1 x 2 x 3 x 4 x 5 Side Z (0) 1 3 5 0 0 0 0 0^ x^3 (1)^0 ^1 ^0 1 ^0 ^0 x 4 (2) 0 0 2 0 1 0 12 x 5 (3) 0 3 2 0 0 1 18
Z (0) 1 3 0 0 ^52 0 30
1^ x^3 (1)^0 ^1 ^0 1 ^0 ^0 x 2 (2) 0 0 1 0 ^12 0 6 x 5 (3) 0 3 0 0 1 1 6
Z (0) 1 0 0 0 ^32 1 36
x 3 (1) 0 0 0 1 ^13 ^13 2 2 x 2 (2) 0 0 1 0 ^12 0 6
x 1 (3) 0 1 0 0 ^13 ^13 2
You may have noticed in the preceding two sections that we never said what to do if the various choice rules of the simplex method do not lead to a clear-cut decision, because of either ties or other similar ambiguities. We discuss these details now.
Tie for the Entering Basic Variable Step 1 of each iteration chooses the nonbasic variable having the negative coefficient with the largest absolute value in the current Eq. (0) as the entering basic variable. Now sup- pose that two or more nonbasic variables are tied for having the largest negative coeffi- cient (in absolute terms). For example, this would occur in the first iteration for the Wyn- dor Glass Co. problem if its objective function were changed to Z 3 x 1 3 x 2 , so that the initial Eq. (0) became Z 3 x 1 3 x 2 0. How should this tie be broken? The answer is that the selection between these contenders may be made arbitrarily. The optimal solution will be reached eventually, regardless of the tied variable chosen, and there is no convenient method for predicting in advance which choice will lead there