1 LINEAR PROGRAMMING THE SIMPLE METHOD () Problems involving both slack and surplus variables A linear programming model has to be extended to comply with the requirements of the simplex procedure, that is,. All equations must be equalities.. All variables must be present in all equations. (I) (II) In the case of constraints, slack variables are added to the actual variables to make the equation an equality. In the case of constraints, surplus variables are used to make the equation an equality. A surplus variable is the difference between the total value of the true (decision) variables and the number (usually, total resource available) on the right-hand side of the equation. Thus, a surplus variable will always have a negative value. Consider the following linear programming problem: Minimise cost = Subect to + = 5000, There are three constraints, consisting of one equality, one smaller than or equal to and one greater than or equal to. The model should now be modified as follows: +, + S, S, S S 0 = 5000 = 500 = 750 where S is a slack variable and S is a surplus variable.
2 The presence of a surplus variable causes a problem when drawing the first simplex tableau because of its negative value. In any maximisation problem, this tableau must satisfy the following requirements:. All the slack variables (and thus surplus variables as well) must form part of the initial solution mix (basis).. The table must contain as many rows as there are constraints.. The elements in the columns of variables appearing in the basis must form a unit vector. If S is included in the basis, the elements of the S will be 0, 0 and and thus not a unit vector. Furthermore, the values of the true variables being 0 in the initial solution, this would imply that S would assume a negative value in the initial solution (it can be easily checked by means of the third equality that, if = 0, S = 750). This is definitely contrary to the nonnegativity restriction all variables must have a positive value. () Artificial variables This problem is solved by adding an artificial variable (denoted by A i ) to the equation, that is, a variable that has a positive value. Artificial variables are also used in equations which are already equalities in order to comply with the requirements () and () above. Just remember that an artificial variable has no significance pertaining to the solution of the problem it is used merely to find a solution mix in the first simplex tableau. Although artificial variables will always form part of the initial solution mix, the obective is to remove them as soon as possible by means of the simplex procedure. As long as an artificial variable still appears in the solution mix, the final solution has not yet been found. As any other variable, artificial variables are included in the obective function but the value attached to them creates another problem. In minimisation problems, since the obective is to find the lowest cost possible, a very large value is allocated to artificial variables. This value is denoted by M where M is a very large positive value. The above linear programming model is thus rewritten as Minimise cost = MA + MA Subect to + + A + 0A = , + 0 +, S before using the simplex procedure. + S, S S, A, A + 0A + 0A 0 + 0A + A = 500 = 750
3 Example (slack variables only) [Maximisation] Linpro Limited, a manufacturing enterprise, produces two products, namely product A and product B. Both products are manufactured from the same raw material and processed by the same machine. The available machine capacity is 600 hours and kilogram of raw materials are available. The production of one unit of product A utilises 0 minutes of machine time while one unit of product B takes one hour to produce. To produce one unit of product A,.5 kg of raw material is required whereas 0 kg is required for one unit of product B. The marginal income of product A, of which a maximum of 700 units can be sold, amounts to R4 per unit. Product B has a marginal income of R6 per unit. The company wants to determine what combination of product A and product B must be produced in order to obtain maximum profit. Formulate a linear programming model for the above problem and hence find the optimal solution by using the simplex method. Solution We first identify our decision variables, obective function and thus write down the constraints. Let the decision variables = number of units of product A to be manufactured and = number of units of product B to be manufactured [Decision variables are normally those which appear in the obective function. It is always better to use similar symbols instead of the traditional x and y to avoid confusion. We can, for example, choose to denote our decision variables by the first letters of the names of the products. However, for the simplex method, it is advisable to use indexed variables.] The obective function may be formulated as follows (it can be obtained from the table below): Maximise Profit = A table may also reveal to be helpful in understanding the problem better and to write down the constraints easily as well. Consider the following: Product A Product B Total available resource Machine capacity (hrs) Raw material (kg) Demand (at most) 700 Marginal income R4 R6 The constraints follow: ,
4 4 Now, we must prepare this linear system of inequalities before using the simplex method. We convert all inequalities to equalities by introducing slack variables. The new model is Maximise Profit = subect to S = , 0 + S where S, S and S are slack variables. + S = 0000 = 700 Tableau of the initial solution Solution mix Quantity S S S S S S The first simplex tableau C Solution mix Quantity S S S 0 S S S Z C Z [Explanation for notation C (row) = coefficients of variables in the obective function C (column) = coefficients of solution mix variables in the obective function Z = sum of the products of the C column elements and corresponding variable column elements. For example, the bold zero in the table is obtained as follows: ( 0 ) + (0 0) + (0 0) ] Note that the shaded cell gives the optimal profit.
5 5 The simplex procedure can be summarised as follows:. Find the pivot column the column that has the greatest positive entry in the C row. If there are no positive entries in a tableau, it means that the optimal Z solution has already been reached. C Solution mix Quantity S S S 0 S S S Z C Z 4 6* Find the pivot row. Divide each solution mix entry in the Quantity column by its corresponding entry in the pivot column and record the result in the Ratio column. The smallest non-negative ratio determines the pivot row. C Solution mix Quantity S S S Ratio 0 S * 0 S S Z C Z Pivot row. Select the pivot element in order to start applying basic row operations. The pivot element is found at the intersection of the pivot row and the pivot column. It indicates which variable will enter the solution mix and which one will leave. In the above table, the pivot element is (indicated in bold). We deduce that will enter the solution mix and that S will leave. Why S? Simply because, it is the solution mix slack variable which is found in the first row.
6 6 The second simplex tableau Now, we have to perform basic row operations in order to make the column entries identical to those in the unit vector that was in the S column. In this context, we will consider only two (out of the possible three) basic row operations:. Multiply a row by a non-zero constant.. Add a multiple of a row to another row. C Solution mix Quantity S S S Ratio 0 S * 0 S S Z C Z Pivot row For example, if we have to make 0 (indicated in bold above) become 0, we have to take 0 subtract 0 times (the pivot element). In so doing, all the entries of the second row must also subtract 0 times the entries in the first. Remember, we only consider the entries in the rows involving the solution mix variables in this case, S and S. The last entry in the pivot column being a zero, we don t need any further basic row operations at least one good thing here! The entries of the Z and C Z rows need to be recalculated. The complete second simplex tableau looks like C Solution mix Quantity S S S S S Z C Z This procedure is repeated until there are no more positive entries in the case we would have reached the optimal solution. C Z row, in which
7 7 The third simplex tableau C Solution mix Quantity S S S Ratio S * 0 S Z C Z Pivot row pivot column The largest positive entry in the last row is so that the pivot column is the column. The ratios of Quantity: are recalculated and it is found that 5 is the smallest non-negative value, meaning that the pivot row is the S row. Thus, the pivot element is 7.5 (indicated in bold) so that S has to leave the solution mix for to enter. Logically, we don t expect any other tableaus to come up since both decision variables have entered the solution mix! Using basic row operations, we first divide the second row entries by 7.5 to obtain a in its place before converting the 0.5 and in the same column to zeros. C Solution mix Quantity S S S S S Z C Z Basic row operations: First row minus half second row and third row minus second row. C Solution mix Quantity S S S S Z C Z
8 8 As predicted, this is the final simplex tableau since there are no more positive entries in the last row. We have therefore reached the optimal solution! Remember that the slack variable S is not a decision variable. Interpretation of the final simplex tableau. The final (optimal) solution is = 5 and = so that the optimal profit is R40. In fact, this solution mix corresponds to a corner-point (vertex) on graph. Note that each number in the columns of the variables occurring in the solution mix represents a unit vector.. The entry at the intersection of the S column and the C Z row, 4.67, represents the amount by which the total profit will decrease for every unit of S added to the solution mix, that is, R4.67. If the available machine hours are reduced by one hour, will be reduced by.67 units in the solution mix whereas will be increased by. units. Decrease in profit = R6.67 = R0.00 Increase in profit = R4. = R 5. Net decrease in profit = R The entry at the intersection of the S column and the Z row, 4.67, represents the amount by which the total profit will increase if one additional machine hour is made available for the production of product A and production B (that is, 60 machine hours). The shadow price with respect of one machine hour is thus R The entry at the intersection of the S column and the Z row, 0., is the shadow price with respect to one kilogram of raw material. If the available raw material is increased by one kilogram, the total profit will increase by cents. 5. The entry at the intersection of the S column and the Z row, 0, is the shadow price with respect to the demand for product A. Since the current solution mix does not fully satisfy the demand for product A, ( S =.67 ), an increase in the demand for this product will have no influence on the total profit.
9 9 Example (slack and artificial variables) [Minimisation] A producer of fertiliser receives an order to supply exactly 5000 kg of fertiliser, consisting of a special mixture of phosphate and ammonium nitrate. The mixture must not contain more than 500 kg of phosphate and not less than 750 kg of ammonium nitrate. The cost per kilogram of phosphate and ammonium nitrate are R6 and R8 respectively. The producer would like to determine the ratio in which raw materials must be combined so as to limit costs to a minimum. Formulate a linear programming model for the above problem and hence find the optimal solution by using the simplex method. Solution We first identify our decision variables, obective function and thus write down the constraints. Let the decision variables = number of kg of phosphate and = number of kg of ammonium nitrate The obective function may be formulated as follows: Minimise Cost = The constraints are +, [Note that this the very same example on artificial variables mentioned above.] The above linear programming model is thus modified as Minimise cost = MA + MA Subect to + + A + 0A = , + 0 +, S before using the simplex procedure. + S, S S, A, A + 0A + 0A 0 + 0A + A = 500 = 750
10 0 Tableau of the initial solution Solution mix Quantity S S A A A S A The first simplex tableau C M M Solution mix Quantity S S A A M A S M A Z 5750M M M 0 M M M C Z 6 M 8 M 0 M 0 0 This time, to identify the pivot column, we have to find the largest negative entry in the C Z row (since this is a minimisation problem). This is the column because, remember, M is a large positive number so that 8 M is more negative than 6 M. C M M Solution mix Quantity S S A A M A S M A Z 5750M M M 0 M M M C Z 6 M 8 M* 0 M 0 0 Pivot column
11 To identify the pivot row, the ratios Quantity: have to be calculated and the Ratio column created. Again, the smallest non-negative entry determines the pivot row. C M M Solution mix Quantity S S A A Ratio M A S M A * Z 5750M M M 0 M M M C Z 6 M 8 M 0 M 0 0 Pivot row The pivot element is therefore (indicated in bold above), that is, enters and A leaves the solution mix. By means of basic row operations, we make the column become a unit vector and calculate the values of Z and C Z accordingly to obtain the following tableau: The second simplex tableau C M M Solution mix Quantity S S A A M A S Z 450M M 8 0 M 8 M M+8 C Z 6 M 0 0 M+8 0 M 8 The pivot column, row (the ratios are recalculated) and element are again identified. C M M Solution mix Quantity S S A A Ratio A M 0 S * Z 450M M 8 0 M 8 M M+8 C Z 6 M* 0 0 M+8 0 M 8
12 After applying the relevant basic row operations, we obtain The third simplex tableau C M M Solution mix Quantity S S A A M A Z 750M M M 8 M M+8 C Z 0 0 M 6 M+8 0 M 8 The procedure is repeated since there is still an artificial variable in the solution mix (that is, a negative entry in the last row, M+8; the pivot column, row (the ratios are recalculated) and element are again identified. C M M Solution mix Quantity S S A A Ratio M A * Z 750M M M 8 M M+8 C Z 0 0 M 6 M+8* 0 M 8 The fourth (and final) simplex tableau C M M Solution mix Quantity S S A A 0 S Z C Z M 8 M
13 Interpretation of the final tableau In order to minimise cost, the mix must consist of 500 kg phosphate ( ) and 500 kg of ammonium nitrate ( ). In this mix, the minimum requirement set for ammonium nitrate will be exceeded by 750 kg ( S ). The minimum total cost amounts to R7000.
14 4 () Extraordinary situations The following circumstances may also arise when the simplex method is applied. CASES HOW TO RECOGNISE THEM IN A SIMPLE TABLEAU Multiple optimal solutions Degeneracy Infeasibility Unbounded solutions If the index of a variable not contained in the solution mix is zero in the final tableau, it means that there is more than one optimal solution. Mathematically, the inclusion of this variable in the solution mix will not change the value of the obective function. One or more constraints are redundant as a result of this, two equally small non-negative ratios may occur in the table when the pivot row is to be identified. If the incorrect one is selected, the only problem is that an extra iteration will be carried out. This case is easily recognised if there is still an artificial variable in the solution mix whilst all the indices indicate that an optimal solution has been found. When identifying the pivot row, all the ratios will be either negative or. It means that one or more variables can increase indefinitely without the constraints being exceeded in a maximisation problem.
15 5 (4) Key concepts Artificial variable A variable that is only used in equations and constraints to find a feasible initial solution. Index row C Z This represents the net amount by which the obective function will increase (if positive) or decrease (if negative) if one additional unit of a variable is added to the solution mix. Lower limit for shadow prices The level to which a limited resource can be reduced with a constant reduction in the profit for each unit by which the resource is reduced. Pivot column The column with the largest positive (negative) entry in the C Z row in the case of a maximisation (minimisation) problem. Pivot row Pivot variable Principal row The row with the smallest non-negative ratio between the quantity column and the number in the pivot column. The ratio represents the maximum quantity of the pivot variable that can be included in the next solution mix. The variable in the pivot row is replaced by the pivot variable in the next simplex tableau. The variable that will enter the solution mix. The new row in the next simplex tableau that replaces the pivot row in the previous tableau. The value of the principal row is determined by dividing the pivot row by the pivot number. Shadow prices The values of the slack variables in the Z row. A shadow price is the value of one additional unit of resource that is already being fully utilised. Slack variable Solution mix Surplus variable Upper bound for shadow prices Z row A variable added to a constraint to change it to an equality. It represents the unused portion of the resource. A combination of variables in the obective function representing a possible solution to the linear programming problem. A variable added to a constraint to change it to an equality. It represents the quantity by which the utilisation of a resource exceeds the prescribed minimum. The level to which a limited resource can be reduced while the profit decreases by a constant amount with the removal of each unit of the resource. It represents the total value of the solution mix in the quantity column. It further shows the amount by which the total value will be reduced if one additional unit of a slack variable is added to the solution mix.
16 6 Exercises Questions for discussion. Briefly explain the purpose of the simplex method as well as the procedure that is followed.. Enumerate the points of similarity between the simplex method and the graphical method. Under what circumstances will preference be given to each method?. Define the following terms and indicate under what circumstances each is used: (a) slack variable (b) surplus variable (c) artificial variable 4. How will you go about selecting the following after the first simplex tableau has been completed? (a) the pivot column (b) the pivot row (c) the pivot element 5. Explain fully why the row with the smallest ratio is identified as the pivot row. 6. Describe the lost important differences between maximisation and minimisation problems in the application of the simplex method. 7. Why should an artificial variable appear in the optimal solution mix and what should the decision-maker do if this happens? 8. Explain what additional information is made available by the final simplex tableau.
17 7 Linear programming problem Toskry Limited manufactures three types of videocassette tapes: The L-500 with a recording time of two hours The L-750 with a recording time of three hours The P-000 with a recording time of eight hours The production manager consults you to help him determine the number of units of each type of cassette tape to be manufactured per week, given an available production capacity of 450 hours per week. The cassette tapes are packed in containers of 00 cassettes each, which must be considered as a unit for production purposes. The production manager has the following information available: L-500 L-750 P-000 Production cost per unit (rands) Production time per unit (mins) The following information is provided by the marketing manager: The demand for the L-500 is virtually indefinite and it is dispatched to the trade as it becomes available, without taking permanent orders. There is a permanent order of 00 units of the L-750 per week. However, if more is produced, it could be sold without difficulty. The P-000 is specially manufactured for Video Scene Limited, which has placed an order of 50 units per week. The profit margin of the company is the same for all three types of tapes. Required (a) (b) (c) Formulate a linear programming model. Construct an extended model that can be solved by means of the simplex method. Find the optimal solution. Solution to the linear programming problem Minimise Cost = Subect to ,, 00 = 50 0
18 8 Minimise Cost = MA + MA Subect to , + S, S, S + A, S + A, A, A = 450 = 00 = 50 0 Tableau of the initial solution Solution mix Quantity S S A A S A A The first simplex tableau C M M Solution mix Quantity S S A A Ratio 0 S M A * A M Z 50M 0 M M 0 M M M C Z 0 45 M* 70 M 0 M 0 0 The second simplex tableau C M M Solution mix Quantity S S A A Ratio 0 S M A * Z M 0 45 M M C Z M* 0 45 M 45 0
19 9 The third and final simplex tableau C M M Solution mix Quantity S S A A 0 S Z C Z M 45 M 70 Optimal solution: 00, 50 Minimum profit = R = = Courtesy Mr. Raesh Gunesh (