Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Simplex Algorithm for Linear Programming: Solving LP Problems, Exams of Production and Operations Management

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

Pre 2010

Uploaded on 08/18/2009

koofers-user-98r
koofers-user-98r 🇺🇸

4.5

(1)

10 documents

1 / 12

Toggle sidebar

Related documents


Partial preview of the text

Download Simplex Algorithm for Linear Programming: Solving LP Problems and more Exams Production and Operations Management in PDF only on Docsity! Module LP.99 Simplex Solutions to an LP Problem Dr. Stafford MSC 600 Revised 04/14/05 Page 1 of 12 pages LINEAR PROGRAMMING Module LP.99 SOLVING LP PROBLEMS: THE SIMPLEX ALGORITHM 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 1 # Constraints "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 ith constraint be: 2 X1 + 3 X2 # 200 We add a slack variable (call it Sli ) to this i th constraint to make it an equality as follows: 2 X1 + 3 X2 + 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.} Module LP.99 Simplex Solutions to an LP Problem Dr. Stafford MSC 600 Revised 04/14/05 Page 2 of 12 pages 2 $ Constraints "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 jth constraint be: 3 X1 + 2 X2 $ 350 We subtract a surplus variable (call it Suj ) to this j th constraint to make it an equality as follows: 3 X1 + 2 X2 - 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 X1 + 2 X2 - 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 MAX 2 X + 3 Y 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 Sl1 + 0 Su2 - M Ar2 - M Ar3 subject to: 3 X + 4 Y + 1 Sl1 = 400 (1') 5 X - 2 Y - 1 Su2 + 1 Ar2 = 100 (2') 4 X + 5 Y + 1 Ar3 = 500 (3') Module LP.99 Simplex Solutions to an LP Problem Dr. Stafford MSC 600 Revised 04/14/05 Page 5 of 12 pages The variables in the basis (current solution variables) are identified by the "identity matrix" columns of the A- matrix. For example, Sl1 has a 1 in the row representing constraint M/C A and 0's in all other rows. Therefore, Sl1 is currently in the basis in the row 1 position. Likewise, Sl2 is in the row 2 position in the basis and Sl3 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, Z2 (for the variable C) is computed as (0)(6) + (0)(6) + (0)(1) = 0 . The Cj - Zj 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 - Zj 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 - Zj 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} B , { B }i i a aij ij ⎡ ⎣ ⎢ ⎢ ⎤ ⎦ ⎥ ⎥ ≥ 0 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 Sl3 (representing constraint 3) is the variable leaving the basis. In the next tableau, C will be shown in the row currently occupied by Sl3. 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 ( Sl3 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 - Zj) rows. Module LP.99 Simplex Solutions to an LP Problem Dr. Stafford MSC 600 Revised 04/14/05 Page 6 of 12 pages 8.A Converting the Pivot Row The row in the new tableau that replaces the pivot row in the old tableau is computed by dividing each element in the pivot row by the pivot element. For the PPC example problem, the computations are {0, 1, 0, 0, 1, 10 } ÷ 1 = {0, 1, 0, 0, 1, 10}. The preliminary results of "iterating" are shown in Table 6. Table 6. First Iteration, with Pivot Row Converted, for PPC Example Problem. Cj 6 2 4 0 0 0 Con- straint Cbj Variables in Basis H C Sl1 Sl2 Sl3 RHS (Bi) M/C A 0 Sl1 M/C B 0 Sl2 M/C C 4 C 0 1 0 0 1 10 Zj Cj - Zj 8.B Converting the Remaining Rows Each of the remaining A-matrix rows from the old tableau is converted to its replacement row in the new tableau in exactly the same manner, using either of the processes -- pivot method or algebraic substitution -- mentioned above. 8.B.1 Pivot Method First, we define (i ("gamma sub i") as the value of the intersection of the pivot column from the old tableau with the row of the old tableau that is being replaced. Second, we let NR (new row) represent the new row in the new tableau that represents the variable which is being brought into the basis. Then each of the remaining rows for the new tableau are computed by the following formula: {New Row}i = {Old Row}i - [ (i]{NR} Let i = 1 (M/C A constraint row in which Sl1 currently resides). Then: {New Row}1 = {Old Row}1 - [ (1]{NR} = {4, 6, 1, 0, 0, 120} - [6]{0, 1, 0, 0, 1, 10} = {4-0, 6-6, 1-0, 0-0, 0-6, 120-60} = {4, 0, 1, 0, -6, 60} Likewise, let i = 2 (M/C B constraint row in which Sl2 currently resides). Then: {New Row}2 = {Old Row}2 - [ (2]{NR} = {2, 6, 0, 1, 0, 72} - [6]{0, 1, 0, 0, 1, 10} = {2, 0, 0, 1, -6, 12} These results are shown in Table 7. 8.B.2 Algebraic Substitution First, solve NR (the new row in the new tableau that represents the entering variable) for the entering variable. This entering variable is C (chess sets) for the PPC example problem. Doing so, 0 H + 1 C + 0 Sl1 + 0 Sl2 + 1 Sl3 = 10 or C = 10 - 1 Sl3 Module LP.99 Simplex Solutions to an LP Problem Dr. Stafford MSC 600 Revised 04/14/05 Page 7 of 12 pages 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 Sl1 Sl2 Sl3 RHS (Bi) M/C A 0 Sl1 4 0 1 0 -6 60 M/C B 0 Sl2 2 0 0 1 -6 12 M/C C 4 C 0 1 0 0 1 10 Zj Cj - Zj 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 Sl1 + 0 Sl2 + 0 Sl3 = 120 4 H + 6[10 - 1 Sl3] + 1 Sl1 + 0 Sl2 + 0 Sl3 = 120 or 4 H + 0 C + 1 Sl1 + 0 Sl2 - 6 Sl3 = 60 Row 2: 2 H + 6 C + 0 Sl1 + 1 Sl2 + 0 Sl3 = 72 2 H + 6[10 - 1 Sl3] + 0 Sl1 + 1 Sl2 + 0 Sl3 = 72 or 2 H + 0 C + 0 Sl1 + 1 Sl2 - 6 Sl3 = 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 Zj and (Cj - Zj) rows The Zj row and (Cj - Zj) row values for the new tableau are computed as described above. 8.C.1 Zj 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 - Zj) Row Values For each column in Table 8, the (Cj - Zj) row value is computed by subtracting the Zj value from the corresponding Cj value. For example, for the Sl3 column, Cj - Zj = 0 - 4 = -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. (Sl3 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. Module LP.99 Simplex Solutions to an LP Problem Dr. Stafford MSC 600 Revised 04/14/05 Page 10 of 12 pages 9.B Iteration 3 9.B.1 Entering and Leaving Variables Examining Table 10, we see that Variable Sl3 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 {Bi/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: Sl1. 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 Sl3 is the entering variable, we solve for Sl3 from the new row representing Sl3 (see Table 11) as: 1/6 Sl1 - 1/3 Sl2 + 1 Sl3 = 6, or Sl3 = [6 - 1/6 Sl1 + 1/3 Sl2]. Row 2: Substituting the above value for Sl3 into row 2 of Table 9, we determine row 2 of the new tableau (Table 11) as: 1 H + 1/2 Sl2 - 3 Sl3 = 6; 1 H + 1/2 Sl2 - 3[6 - 1/6 Sl1 + 1/3 Sl2] = 6; or 1 H + 0 C + 1/2 Sl1 - 1/2 Sl2 + 0 Sl3 = 24. These values are shown in Table 11. Row 3: Substituting the above value for Sl3 into row 3 of Table 9, we determine row 3 of the new tableau (Table 11) as: 0 H + 1 C + 1 Sl3 = 10; 0 H + 1 C + 1[6 - 1/6 Sl1 + 1/3 Sl2] = 10; or 0 H + 1 C - 1/6 Sl1 + 1/3 Sl2 + 0 Sl3 = 4. These values are shown in Table 11. 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 Sl1 Sl2 Sl3 RHS (Bi) M/C A 0 Sl3 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 Zj 2 4 1/3 1/3 0 64 Cj - Zj 0 0 - 1/3 - 1/3 0 9.B.3 Computing the Zj Row and (Cj - Zj) Row Values We use Table 11 to compute the values of the Zj Row and (Cj - Zj) 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 Sl1, Zj = (0)(1/6) + (2)(1/2) + (4)(-1/6) = 1 - 4/6 = 1/3 . 9.B.3.B (Cj - Zj) Row: The new values for the Cj - Zj row are found as {0, 0, -1/3, -1/3, 0}. For example, for Sl1, (Cj - Zj) = 0 -(1/3) = -1/3. Module LP.99 Simplex Solutions to an LP Problem Dr. Stafford MSC 600 Revised 04/14/05 Page 11 of 12 pages 9.B.4 Testing for Optimality Since all entries of the Cj - Zj 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 TOTALS 28 64 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 Module LP.99 Simplex Solutions to an LP Problem Dr. Stafford MSC 600 Revised 04/14/05 Page 12 of 12 pages 9.C.3 Sensitivity Analyses of Decision Variable Coefficients {Question 4} The entries in the (Cj - Zj) row in the decision variable columns in the optimal solution tableau are used to perform sensitivity analyses of the objective function coefficients (Cj's). These values are normally referred to as "reduced costs" (the textbook calls them "relative profits"). The value of a (Cj- Zj) entry indicates by how much the current value of the corresponding Cj must be increased (for maximization problems) in order that the corresponding decision variable becomes competitive to enter the solution mix (basis). Decision variables already in the solution mix will have (Cj- Zj) entry values of zero. For the PPC problem, both decision variables (hockey sticks and chess sets) are already in solution, so their (Cj- Zj) entry values equal zero. 9.C.4 Sensivtiity Analyses of (RHS Resource Availability Coefficients {Question 5 } The entries in the (Cj - Zj) row in the slack and surplus variable columns in the optimal solution tableau are used to perform sensitivity analyses of the RHS coefficients for scarce resources (slacks) and constrained minimum requirements (surpluses). These values are normally referred to as "dual prices" or "shadow prices". The (absolute) value of a (Cj- Zj) entry for a slack variable (representing a scarce resource) is a value below which the decision maker should be willing to acquire more units of the resource, and is a value above which the decision maker should be willing to sell one (or more) of his currently available units of the resource. To put it another way, the objective function will change (upward for profit maximization) by this value if one more unit of the scarce resource, at the margin, can be obtained; and the objective function will change (downward for profit maximization) by this value if one unit of the scarce resource, at the margin, is taken away from the decision maker. For the PPC problem, the sensitivity analyses of the three scarce resources are summarized in Table 14. Table 14. Sensitivity Analyses of (RHS) Scarce Resources. Scarce Resource M/C A M/C B M/C C Constraint Is (tight/loose) Tight Tight Loose (Cj - Zj) Value - 1/3 - 1/3 0 Sensitivity of Z (profit function) ) profit per +1 unit $ 0.333 $ 0.333 $ 0 ) profit per -1 unit -$ 0.333 -$ 0.333 $ 0
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved