Week_4: simplex method II 1 1.introduction LPs in which all the constraints are (≤) with nonnegative right-hand sides offer a convenient all-slack starting basic feasible solution. Models involving (=) and/or (≥) constraints do not. The procedure for starting "ill-behaved" LPs with (=) and (≥) constraints is to use artificial variables that play the role of slacks at the first iteration, and then dispose of them legitimately at a later iteration. Two closely related methods are introduced here: the M-method and the two-phase method. 2.M-method The M-method starts with the LP in equation form, If equation i does not have a slack (or a variable that can play the role of a slack), an artificial variable, Ri, is added to form a starting solution similar to the convenient all-slack basic solution, However, because the artificial variables are not part of the original LP model, they are assigned a very high penalty in the objective function, thus forcing them (eventually) to equal zero in the optimum solution, This will always be the case if the problem has a feasible solution, The following rule shows how the penalty is assigned in the cases of maximization and minimization: Penalty Rule for Artificial Variables. Given M, a sufficiently large positive value (mathematically, M ∞ ), the objective coefficient of an artificial variable represents an appropriate penalty if: 𝑎𝑟𝑡𝑖𝑓𝑖𝑐𝑖𝑎𝑙 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 𝑜𝑏𝑗𝑒𝑐𝑡 𝑐𝑜𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡 = −𝑀 𝑖𝑛 𝑚𝑎𝑥𝑖𝑚𝑖𝑧𝑎𝑡𝑖𝑜𝑛 𝑝𝑟𝑜𝑏𝑙𝑒𝑚𝑠 𝑀 𝑖𝑛 𝑚𝑖𝑛𝑖𝑚𝑖𝑧𝑎𝑡𝑖𝑜𝑛 𝑝𝑟𝑜𝑏𝑙𝑒𝑚𝑠 Example: Minimize z=4x1+x2 Subject to 3x1+x2=3 4x1+3x2≥6 x1+2x2≤4 x1,x2≥0 Using x3 as a surplus in the second constraint and X4 as a slack in the third constraint, the equation form of the problem is given as: minimize z=4x1+x2 subject to 2 3x1+x2 =3 4x1+3x2 -x3 =6 x1+2x2 +x4 =4 X1,x2,x3,x4≥0 The third equation has its slack variable, X4, but the first and second equations do not. Thus, we add the artificial variables RI and Rz in the first two equations and penalize them in the objective function with M R1 + M R2 (because we are minimizing). The resulting LP is given as minimize z=4x1+x2+MR1+MR2 subject to 3x1+x2 +R1 =3 4x1+3x2-x3 +R2=6 x1+2x2 +x4 =4 x1, x2, x3, x4, R1, R2 ≥ 0 The associated starting basic solution is now given by (R1, R2, x4) = (3,6,4). M must assume a numeric value, M must be sufficiently large relative to the original objective coefficients so it will act as a penalty that forces the artificial variables to zero level in the optimal solution. Using M = 100, the starting simplex tableau is given as follows (for convenience, the zcolumn is eliminated because it does not change in aI1 the iterations): First objective function written as Minimize z-4x1-x2-0x3-100R1-100R2 And then simplex table as: basic Z R1 R2 X4 X1 -4 3 4 1 X2 -1 1 3 2 X3 0 0 -1 0 R1 -100 1 0 0 R2 -100 0 1 0 X4 0 0 0 1 solution 0 3 6 4 Before proceeding with the simplex method computations, we need to make the z-row consistent with the rest of the tableau. Specifically, in the tableau, X1=X2=X3= 0, which yields the starting basic solution Rl =3, R2=6 , and X4 = 4. This solution yields z = 100 x 3 + 100 x 6 = 900 (instead of 0, as the right-hand side of the z-row currently shows). This inconsistency stems from the fact that R1 and R2 have nonzero coefficients (-100, -100) in the z-row (compare with the all-slack starting solution in example, where the z-row coefficients of the slacks are zero). We can eliminate this inconsistency by substituting out Rj and R2 in the z-row using the appropriate constraint equations. In particular, notice the highlighted elements (= 1) in the R1-row and the Rz-row. Multiplying each of R1-row and R2-row by 100 and adding the sum to the z-row will substitute out R1 and R2 in the objective row-that is, 3 New z-row = Old z-row + (100 X R1-row + 100 x R2-row) The modified tableau thus becomes leave basic Z R1 R2 X4 inter X1 696 3 4 1 Pivot column X2 399 1 3 2 X3 -100 0 -1 0 R1 0 1 0 0 R2 0 0 1 0 X4 0 0 0 1 solution 900 3 6 4 Pivot row Because we are minimizing the objective function, the variable x1 having the most positive coefficient in the z-row (= 696) enters the solution To determine leave variable we compute ratio of solution on coefficient of pivot column and choose minimize ratio. Basic R1 R2 X4 Inter variable Solution ratio x1 3 3 X1=3/3=1 4 6 X1=6/4=3/2=1.5 1 4 X1=4/1=4 Conclusion: inter x1 variable and leave R1 variable minimize the new tableau can be computed by using the familiar Gauss-Jordan operations. 1. Replace Sl in the Basic column with XI: New xl-row = Current R1-row ÷ 3 = (1/3)(3 1 0 1 0 0 3) = (1 1/3 0 1/3 0 0 1) 2. new z-row=current z-row-(696)*new x1-row =(696 399 -100 0 0 0 900)-(696)*( 1 1/3 0 1/3 0 0 1) =(0 399-232 -100 -232 0 0 900-696)=(0 167 -100 -232 0 0 204) 3.new R2-row =current R2-row –(4)*new x1-row =(4 3 -1 0 1 0 6)-(4)*( 1 1/3 0 1/3 0 0 1) =(0 3-4/3 -1 -4/3 1 0 2 )=(0 5/3 -1 -4/3 1 0 2) 4-new x4-row=current x4-row –(1)*new x1- row =(1 2 0 0 0 1 4)-(1)( 1 1/3 0 1/3 0 0 1) =(0 2-1/3 0 -1/3 0 1 3)=(0 5/3 0 -1/3 0 1 3 ) 4 leave basic Z x1 R2 X4 X1 0 1 0 0 inter X2 167 1/3 5/3 5/3 Pivot column X3 -100 0 -1 0 R1 -232 1/3 -4/3 -1/3 R2 0 0 1 0 X4 0 0 0 1 solution 204 1 2 3 Pivot row Because we are minimizing the objective function, the variable x2 having the most positive coefficient in the z-row (=167) enters the solution To determine leave variable we compute ratio of solution on coefficient of pivot column and choose minimize ratio. Basic Inter variable Solution ratio x2 1/3 1 X2=1/(1/3)=3 5/3 2 X2=2/(5/3)=6/5 5/3 3 X2=3/(5/3)=9/5 Conclusion: inter x2 variable and leave R2 variable X1 R2 X4 minimize The last tableau shows that x2 and R2 are the entering and leaving variables, respectively. Continuing with the simplex computations, two more iterations are needed to reach the optimum: X1=2/5 X2=9/5 Z=17/5 3. Alternative Optima the objective function can assume the same optimal value at more than one solution point, thus giving rise to alternative optima. The next example shows that there is an infinite number of such solutions. It also demonstrates the practical significance of encountering such solutions. Example: Maximize z=2x1+4x2 Subject to x1+2x2≤ 5 5 x1+x2≤ 4 x1,x2 ≥0 solution: step 1: convert inequality to equality form. maximize z-2x1-4x2=0 subject to x1+2x2+x3 =5 x1+x2+ x4=4 x1,x2,x3,x4x≥ 0 step 2: determine start basic feasible solution by set x1,x2=0 (nonbasic variable) x3=5 x4=4 Basic variable leave X3 X4 Z X1 1 0 0 -2 1 1 X2 inter -4 2 1 Pivot column X3 X4 solution 0 1 0 0 0 1 0 5 4 Pivot -row Step 3: Select an entering variable (which represent large negative value of objective function ), here x2=-4 Step 4: leave variable (which represent minimum ratio value of solution on coefficient of pivot column ) Basic X3 X4 Entering X2 Solution 2 5 1 4 Conclusion: x2 enters and x3 leaves 6 Ratio (or intercept) X3=5/2=2.5 X1=4/1=4 Minimum Step 5: Determine the new basic solution by using the appropriate Gauss-Jordan Computations These computations are applied to the preceding tableau in the following manner: 1. Replace x2 in the Basic column with x3: New x2-row = Current x3-row ÷ 2 = (1/2)( 0 1 2 1 0 5) = (0 1/2 1 1/2 0 2.5) 2. new z-row=current z-row-(-4)*new x2-row =(1 -2 -4 0 0 0 )-(-4)*( 0 1/2 1 1/2 0 2.5 ) =( 1 0 0 2 0 10) 3.new x4-row =current x4-row –(1)*new x2-row =( 0 1 1 0 1 4) -(1)*( 0 1/2 1 1/2 0 2.5) =( 0 1/2 0 -1/2 1 1.5) Basic variable leave X2 X4 Z X1 inter 0 1/2 1/2 1 0 0 X2 X3 X4 solution 0 1 0 2 1/2 -1/2 0 0 1 10 2.5 1.5 Pivot column and then applied same steps Basic variable Z X2 X1 Z X1 X2 X3 X4 solution 1 0 0 0 0 1 0 1 0 2 1 -1 0 -1 2 10 1 3 Final result 1- At point B (x1=0, x2=1/2) 2- At point C (x1=3, x2=1) 7 Pivot row 8