






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 overview of the simplex algorithm for solving linear programming (lp) problems. It covers the general steps of the simplex algorithm, converting an lp problem to canonical form, putting it into tableau form, identifying variables to enter and leave the solution, and testing for optimality. The document also includes an example problem and its solution in tableau form.
Typology: Exams
1 / 12
This page cannot be seen from the preview
Don't miss anything!







1 General Steps of the Simplex Algorithm
A Formulate the LP Problem B Convert the Problem to "Canonical" Form C Put the Problem into Tableau Form D Identify Variable to Enter Solution (Basis) E Identify Variable to Leave Solution F Determine Values in New (Revised) Tableau G Test for Optimality. If Optimal, Stop. Otherwise, Go to Step D.
2 Converting an LP Problem to "Canonical Form"
A Types of Constraints
There are three types of constraints in linear programming:
1 # inequalities; 2 $ inequalities; 3 = equalities.
Each type requires special treatment to be converted to "canonical" form.
B Canonical Form
An LP problem that is in canonical form has two properties:
1 Each constraint is of the equality ( = ) form.
2 Each constraint has its own variable to represent the constraint in the whole problem. This representative variable has three properties:
(A) The coefficient on the representative variable is +1 in its own constraint. (B) The coefficient on the representative variable is 0 in all other constraints. (C) The objective function coefficient for the representative variable will be either a 0 or M (a very large number); the sign (+/-) on M depends on the nature (maximization, minimization) of the objective function.
C Converting Constraints to Canonical Form
"Less than or equal to" ( # ) constraints state that the linear combination of decision variables is smaller than, or at most equal to, the constant of the right hand side (RHS) of the inequality. Since the RHS is a constant dictated by the nature of the problem, we must add to the left side of the inequality to make it an equality. We use a slack variable to do this.
For example, let the i th constraint be: 2 X 1 + 3 X 2 # 200
We add a slack variable (call it Sli ) to this i th constraint to make it an equality as follows:
2 X 1 + 3 X 2 + 1 Sli = 200
Note that property (A) is met. Further, since Sli represents only constraint i, its coefficient it all other constraints will be 0 [property (B)]. A slack variable (usually) represents the unused amount (slack) of a resource available to a decision maker. Since it generally contributes nothing to profit and nothing to cost, its objective function coefficient is usually 0 (zero). {There are rare times when a nonzero objective function coefficient is appropriate for a slack variable.}
"Greater than or equal to" ( $ ) constraints state that the linear combination of decision variables is larger than, or at worst (best) equal to, the constant of the right hand side (RHS) of the inequality. Since the RHS is a constant dictated by the nature of the problem, we must subtract from the left side of the inequality to make it an equality. We use a surplus variable to do this.
For example, let the j
th constraint be:
We subtract a surplus variable (call it Suj ) to this j th constraint to make it an equality as follows:
3 X 1 + 2 X 2 - 1 Suj = 350
Note that property (A) is not met for a surplus variable. Thus, for each $ constraint, we need an additional variable to put the constraint in canonical form. We call this additional variable an artificial variable (call it Arj ), and we add it to the left hand side of the equation. Thus the above equation would become:
3 X 1 + 2 X 2 - 1 Suj + 1 Arj = 350
Note that an artificial variable meets properties (A) and (B) above. An artificial variable is just that -- artificial. It is a mathematical device used to get an LP problem into canonical form ready for simplex solution. It is not real. It does not have any real meaning with regard to the problem being solved.
Consequently, we need to drive an artificial variable out of the problem solution, and keep it out of solution as we move towards an optimal solution. To do this, we assign an objective function value to each artificial variable so penalizing that the simplex will eliminate them from the solution and keep them out of solution forever. Let M be a number quite large, many times larger than any other objective function coefficient value. Then if the objective function calls for a maximization , we would assign each artificial variable an objective function coefficient of -M so that the simplex has to eliminate all artificial variables in order to avoid bankruptcy. Likewise, if the objective function calls for a minimization. we would assign each artificial variable an objective function coefficient of +M so that the simplex has to eliminate all artificial variables in order to avoid bankruptcy.
3 = Constraints
Equality constraints are already equalities. They require neither slack nor surplus variables to convert them for the canonical form. Thus to meet the three properties [(A) through (C)] of the representative variable, we need only add an artificial variable to each equality constraint.
3 Example Problem (maximization)
Let us use the following example problem to demonstrate putting an LP problem into canonical form.
A The Problem
subject to: 3 X + 4 Y # 400 (1) 5 X - 2 Y $ 100 (2) 4 X + 5 Y = 500 (3)
B Canonical Form of the Example Problem
MAX 2 X + 3 Y + 0 Sl 1 + 0 Su 2 - M Ar 2 - M Ar 3 subject to: 3 X + 4 Y + 1 Sl 1 = 400 (1') 5 X - 2 Y - 1 Su 2 + 1 Ar 2 = 100 (2') 4 X + 5 Y + 1 Ar 3 = 500 (3')
Then each Z (^) j value of the Zj row is computed as follows:
i
m
=
1
That is, for column j in the A matrix, we multiply row i's coefficient by the objective function coefficient of the basis variable listed in row i, and then we sum up these m products to get Zj. Finally, we subtract Zj from the objective function coefficient (Cj ) of variable j to get the Cj - Z (^) j row values. The generic layout of the tableau for the simplex LP problem is shown in Table 4.
Table 4. Generic Layout of the Tableau Form of the Simplex LP Problem.
Objective Function Coefficients, Cj 6
C 1 C 2 ....... Cm
Constraint ID
Cbj Variables in Basis
Decision Variables Supplementary Variables
RHS (Bi )
1 Cb1 Vb1 A-Matrix Coefficients for all Variables in all Constraints for the Current Iteration's Tableau
2 Cb2 Vb2 B 2
... ... ... ...
m Cbm Vbm Bm
Z (^) j Z 1 Z 2 ...... Z (^) n Obj Fn Value, Z
Cj - Z (^) j C 1 - Z 1 C 2 - Z 2 ...... Cn - Z (^) n
5 Example Problem in Tableau Form
The Puck and Pawn Co. (PPC) example problem from the graphical solution section of this handout is shown in tableau form in Table 5. The symbol "M/C" stands for "Machine Center". Recall the following definitions for the decision variables: (1) H, for number of hockey sticks made each day; (2) C, for number of chess sets made each day.
Table 5. Tableau Form of the Simplex Model for the PPC Problem.
Cj 6 2 4 0 0 0
Con- straint
Cbj Variables in Basis
H C Sl 1 Sl 2 Sl 3 RHS (Bi )
M/C A 0 Sl 1 4 6 1 0 0 120
M/C B 0 Sl 2 2 6 0 1 0 72
M/C C 0 7 Sl 3 out
Z (^) j 0 0 0 0 0 0
Cj - Z (^) j 2 4 0 0 0
8 in
The variables in the basis (current solution variables) are identified by the "identity matrix" columns of the A- matrix. For example, Sl 1 has a 1 in the row representing constraint M/C A and 0's in all other rows. Therefore, Sl 1 is currently in the basis in the row 1 position. Likewise, Sl 2 is in the row 2 position in the basis and Sl 3 is in the row 3 position.
As described above, the Zj value for each column of A, and for the RHS, is computed by multiplying the Cbj value for each row times the row coefficient for the j column, and then adding these products. For example, Z 2 (for the variable C) is computed as (0)(6) + (0)(6) + (0)(1) = 0. The Cj - Z (^) j row entries are computed, for each column, by subtracting the Zj for that column from the Cj value for that column.
Table 5 represents the initial tableau for the PPC example problem.
6 Identify Variable to Enter Solution
The Cj - Z (^) j row of the current tableau is examined to determine if an improvement (toward optimality) may be made. For maximization problems , any positive entry in the Cj - Z (^) j row indicates that an improvement may be made. In Table 4, there are two such entries: (1) a 2 in the "H" column; and (2) a 4 in the C column. Since we would like to increase our profit as quickly as possible, we would select C (chess sets) to enter the solution. Each chess set, at the margin, would add $4.00 to our overall profit. The "C" column in Table 5 is boldfaced to indicate C will be the incoming variable for the next iteration of the optimal solution of this problem.
7 Identify Variable to Leave Solution
Whenever a variable is brought into the solution (basis), another variable must leave the solution. the aij values in the entering variable column indicate the amount of the RHS used for every unit of the entering variable that is put in the current solution. Further, the amount of the RHS is the maximum that is available. Thus the maximum amount of entering variable that can be put in the current solution is computed as follows:
Max Amount = Min{i}
i i } a (^) ij aij
For the first iteration of the PPC problem, Max Amt = Min {120/6, 72/6, 10/1 } = Min{20, 12, 10} = 10 units of C (10 chess sets). Thus Sl 3 (representing constraint 3) is the variable leaving the basis. In the next tableau, C will be shown in the row currently occupied by Sl 3.
8 Determine Values in New (Revised) Tableau
In the current tableau, the column representing the entering variable is called the pivot column (C column, example problem); and the row representing the leaving variable is called the pivot row ( Sl 3 row, example problem). The intersection of the pivot column and the pivot row is called the pivot element. This value is 1 for the PPC example problem.
The steps for revising the tableau -- this process is called "iterating" or an "iteration" -- are as follow:
A Convert the pivot row (representing the leaving variable) of the old tableau to a row in the new tableau that represents the variable which is entering the basis (solution).
B Convert the remaining rows of the old tableau to rows in the new tableau that reflect the miriad of changes in resource availability, et cetera , caused by bringing a different variable into the solution mix. The process for doing this conversion is either one of the following:
(1) Pivot Method (2) Algebraic Substitution
These processes are demonstrated below.
C Recompute values for the Zj and (Cj - Z (^) j ) rows.
Table 7. First Iteration, with All Rows of A-Matrix Converted, for PPC Example Problem.
Cj 6 2 4 0 0 0
Con- straint
Cbj Variables in Basis
H C Sl 1 Sl 2 Sl 3 RHS (Bi )
M/C A 0 Sl 1 4 0 1 0 -6 60
M/C B 0 Sl 2 2 0 0 1 -6 12
M/C C 4 C 0 1 0 0 1 10
Z (^) j
Cj - Z (^) j
We then substitute this expression for the entering variable (C) into each of the "equations" (rows) of the old tableau to derive equivalent "equations" (rows) for the new tableau. This is done as follows for the PPC example problem:
Row 1: 4 H + 6 C + 1 Sl 1 + 0 Sl 2 + 0 Sl 3 = 120 4 H + 6[10 - 1 Sl 3 ] + 1 Sl 1 + 0 Sl 2 + 0 Sl 3 = 120 or 4 H + 0 C + 1 Sl 1 + 0 Sl 2 - 6 Sl 3 = 60
Row 2: 2 H + 6 C + 0 Sl 1 + 1 Sl 2 + 0 Sl 3 = 72 2 H + 6[10 - 1 Sl 3 ] + 0 Sl 1 + 1 Sl 2 + 0 Sl 3 = 72 or 2 H + 0 C + 0 Sl 1 + 1 Sl 2 - 6 Sl 3 = 12
These results (shown in Table 7) are identical with the results of the pivot method shown above. The student should choose that method which she/he finds easiest to understand and implement.
8.C Recompute values for the Z (^) j and (Cj - Z (^) j ) rows
The Z (^) j row and (Cj - Z (^) j ) row values for the new tableau are computed as described above.
8.C.1 Z (^) j Row Values
Using the formula from Section 4, the Zj row values are computed as shown in Table 8. For example, for the C column, Zj = (0)(0) + (0)(0) + (4)(1) = 4.
8.C.2 (Cj - Z (^) j ) Row Values
For each column in Table 8, the (Cj - Z (^) j ) row value is computed by subtracting the Z (^) j value from the corresponding Cj value. For example, for the Sl 3 column, Cj - Z (^) j = 0 - 4 = -.
Before continuing the process of finding the optimal solution, let us examine Table 8 -- the current improved solution -- for the information contains therein. First, the current solution is to make 10 units of C (chess sets) which will yield a profit of $40. Second, after making those 10 units of C, there will be 60 hours of M/C A time remaining and 12 hours of M/C B time remaining. All of the original 10 hours of M/C C time have been used. (Sl 3 is no longer in solution, so its value is 0.) How can these values be explained. From Table 5, we see that each unit of C requires 6 hours of M/C A time and 6 hours of M/C B time. Thus for M/C A, 120 original hours minus [10 units of C] times [6 hour/unit] = 120 - 60 = 60 hours remaining. Likewise, for MC B, 72 - [10][6] = 12 hours remaining.
Table 8. Completed First Iteration for PPC Example Problem.
Cj 6 2 4 0 0 0
Con- straint
Cbj Variables in Basis
H C Sl 1 Sl 2 Sl 3 RHS (Bi )
M/C A 0 Sl 1 4 0 1 0 -6 60
M/C B 0 Sl 2 2 0 0 1 -6 12
M/C C 4 C 0 1 0 0 1 10
Z (^) j 0 4 0 0 4 40
Cj - Z (^) j 2 0 0 0 -
9 Testing for Optimality
To test the current solution for optimality we examine the Cj - Z (^) j row of Table 8 (the current solution tableau). Since this is a maximization problem, the current solution is optimal if all values of the Cj - Z (^) j row are # 0. For the current solution, the value in the H variable column is 2 > 0, so the solution is not optimal. That is, we can improve the solution (increase our profits) by bringing one or more units of H (hockey sticks) into the basis (solution). Let us continue until we find the optimal solution.
9.A Iteration 2
9.A.1 Entering and Leaving Variables
Variable H is to enter the basis. To identify which variable is to leave the basis, we apply the formula in Section 7 to Table 8 as follows:
Min {B (^) i /aij } = Min {60/4, 12/2, 10/0} = Min {15, 12, 4 } = 12
Therefore, the leaving variable is the one in the second row of the current A-matrix: Sl 2. The pivot column and the pivot row are shown in boldface in Table 9.
9.A.2 Revising the A-Matrix Rows
From Table 8 we see that the pivot element value is 2.
9.A.2.A Revising the "Pivot Row": The new values for row 2, the pivot row in Table 9, are computed as {2, 0, 0, 1, -6, 12} ÷ 2 = {1, 0, 0, 1/2, -3, 6}. These values are shown in Table 10.
9.A.2.B Revising the Remaining Rows: Since H is the entering variable, we solve for H from the new row representing H (see Table 10) as: 1 H + 1/2 Sl 2 - 3 Sl 3 = 6, or H = [6 - 1/2 Sl 2 + 3 Sl 3 ].
Row 1 : Substituting the above value for H into row 1 of Table 9, we determine row 1 of the new tableau (Table 10) as: 4 H + 1 Sl 1 - 6 Sl 3 = 60; 4[6 - 1/2 Sl 2 + 3 Sl 3 ] + 1 Sl 1 - 6 Sl 3 = 60; or 0 H + 0 C + 1 Sl 1 - 2 Sl 2 + 6 Sl 3 = 36. These values are shown in Table 10.
Row 3 : Substituting the above value for H into row 3 of Table 9, we determine row 3 of the new tableau (Table 10) as: 0 H + 1 C + 1 Sl 3 = 10; 0[6 - 1/2 Sl 2 + 3 Sl 3 ] + 1 C + 1 Sl 3 = 10; or 0 H + 1 C + 0 Sl 1 + 0 Sl 2 + 1 Sl 3 = 10. These values are shown in Table
9.B Iteration 3
9.B.1 Entering and Leaving Variables
Examining Table 10, we see that Variable Sl 3 is to enter the basis. To identify which variable is to leave the basis, we apply the formula in Section 7 to Table 10 as follows:
Min {B (^) i /aij } = Min {36/6, 6/(-3), 10/1} = Min {6, -2, 10} = 6
Therefore, the leaving variable is the one in the first row of the current A-matrix: Sl 1. The pivot column and the pivot row are shown in boldface in Table 10.
9.B.2 Revising the A-Matrix Rows
From Table 10 we see that the pivot element value is 6.
9.B.2.A Revising the "Pivot Row": The new values for row 1, the pivot row in Table 10, are computed as {0, 0, 1, -2, 6, 36} ÷ 6 = {0, 0, 1/6, -1/3, 1, 6}. These values are shown in Table 11.
9.B.2.B Revising the Remaining Rows: Since Sl 3 is the entering variable, we solve for Sl 3 from the new row representing Sl 3 (see Table 11) as: 1/6 Sl 1 - 1/3 Sl 2 + 1 Sl 3 = 6, or Sl 3 = [6 - 1/6 Sl 1 + 1/3 Sl 2 ].
Row 2 : Substituting the above value for Sl 3 into row 2 of Table 9, we determine row 2 of the new tableau (Table 11) as: 1 H + 1/2 Sl 2 - 3 Sl 3 = 6; 1 H + 1/2 Sl 2 - 3[6 - 1/6 Sl 1
Row 3 : Substituting the above value for Sl 3 into row 3 of Table 9, we determine row 3 of the new tableau (Table 11) as: 0 H + 1 C + 1 Sl 3 = 10; 0 H + 1 C + 1[6 - 1/6 Sl 1 + 1/ Sl 2 ] = 10; or 0 H + 1 C - 1/6 Sl 1 + 1/3 Sl 2 + 0 Sl 3 = 4. These values are shown in Table
Table 11. Tableau for Third Iteration of PPC Example Problem.
Cj 6 2 4 0 0 0
Con- straint
Cbj Variables in Basis
H C Sl 1 Sl 2 Sl 3 RHS (Bi )
M/C A 0 Sl 3 0 0 1/6 -1/3 1 6
M/C B 2 H 1 0 1/2 - 1/2 0 24
M/C C 4 C 0 1 - 1/6 1/3 0 4
Z (^) j 2 4 1/3 1/3 0 64
Cj - Z (^) j 0 0 - 1/3 - 1/3 0
9.B.3 Computing the Zj Row and (Cj - Z (^) j ) Row Values
We use Table 11 to compute the values of the Zj Row and (Cj - Z (^) j ) Row.
9.B.3.A Zj Row: The new values for the Zj row are found as {2, 4, 1/3, 1/3, 0, 64}. For example, for Sl 1 , Z (^) j = (0)(1/6) + (2)(1/2) + (4)(-1/6) = 1 - 4/6 = 1/.
9.B.3.B (Cj - Z (^) j ) Row: The new values for the Cj - Z (^) j row are found as {0, 0, -1/3, -1/3, 0}. For example, for Sl 1 , (Cj - Z (^) j ) = 0 -(1/3) = -1/3.
9.B.4 Testing for Optimality
Since all entries of the Cj - Z (^) j row in Table 11 are # 0, the current solution is optimal. We are finished solving the PPC LP problem.
9.C Identifying the Optimal Solution
The optimal solution to the PPC problem is found in Table 11. At a minimum, a manager should want to know the answers to the following questions: (1) What product(s) should be made, and how many units of each product should be made? (2) Which resources are completely used and which are not? (3) For those resources not completely used, how many units will remain? (4) If, according to the optimal solution, a product should not be made, by how much must I raise its profit (or lower its cost) so that it is a competitive product in the optimal solution? (5) For each resource, how much should he be willing to pay to acquire another unit (at the margin), and how much should he charge if someone wants to buy a unit (at the margin) from him?
9.C.1 Products to Be Made { Question 1 }
The optimal solution from Table 11 is summarized in the following Table 12.
Table 12. Summary of the Optimal Solution.
Product Units Profit/Unit Product Profit
Hockey Stick 24 2 48
Chess Set 4 4 16
9.C.2 Resources Analyses { Questions 2 and 3 }
There were three scarce resources in the PPC problem -- the hours in each of machine centers A, B, and C. Each scarce resource was represented by a slack variable. If a slack variable remains in the optimal solution , then its corresponding scarce resource was not totally exhausted ; the value of the slack variable is the amount of the resource remaining at optimality. { The corresponding constraint is referred to as a loose constraint. } If a slack variable is not included in the optimal solution, its value is zero and its corresponding scarce resource was totally exhausted. { The corresponding constraint is referred to as a tight constraint. } Analyses of the scarce resources for the PPC problem are summarized in Table 13.
Table 13. Summary of Scarce Resources Analyses.
Machine Center A B C
Original Hours Available 120 72 10
Hours Remaining (Slack) 0 0 6
Hours Used 120 72 4
For Product H 96 48 0
For Product C 24 24 4
Constraint Is ( tight/loose ) Tight Tight Loose