17.dual3

49
Dual simplex method for solving the primal

Upload: myth-soumith

Post on 10-Nov-2015

218 views

Category:

Documents


0 download

DESCRIPTION

engineering optimization

TRANSCRIPT

  • Dual simplex method for solving the primal

  • In this lecture we describe the important Dual Simplex method and illustrate the method by doing one or two problems.

  • Dual Simplex MethodSuppose a basic solution satisfies the optimality conditions but not feasible, we apply dual simplex algorithm. In regular Simplex method, we start with a Basic Feasible solution (which is not optimal) and move towards optimality always retaining feasibility. In the dual simplex method, the exact opposite occurs. We start with an (more than) optimal solution (which is not feasible) and move towards feasibility always retaining optimality conditions. The algorithm ends once we obtain feasibility.

  • The objective function must satisfy the optimality conditions of the regular Simplex method.All the constraints must be of the type .To start the dual Simplex method, the following three conditions are to be met:(Note: As in the simplex method, we must have an identity matrix in the constraint matrix; however, the RHS constants bi need NOT be 0.)3. All variables should be 0.

  • In any iteration, we first decide the leaving variable and then decide which variable should enter (the basis).Dual Feasibility Condition(=Condition for a variable to leave (the basis))The leaving variable, xi, is the basic variable having the most negative value (i.e. in the Simplex tableau, the corresponding constraint row has the most negative RHS). Ties are broken arbitrarily. If all the basic variables are 0, the algorithm ends and we have obtained the optimal solution.

  • The entering variable, xj , is determined from among the non-basic variables as the one for which the ratio is least, where zj - cj is the coefficient of xj in the z-row, aij is the coefficient of xj in the leaving variable row. Ties are broken arbitrarily. If no variable can enter the basis, the problem has no feasible solution. (Why?)Dual Optimality Condition (=Condition for a non-basic variable xj to enter the basis)

  • Problem 2(a) Problem Set 4.4A Page 141Solve by Dual Simplex method Minimize subject to

  • Putting it in the form all constraints of the type and adding slack variables, the problem becomes Minimize subject toSince all the objective coefficients are 0 and the problem is minimization, optimality is met. We start the solution by writing the Simplex tableau.

  • s2 0 -1 -2 0 1 -10 z 1 -2 -3 0 0 0 Basic z x1 x2 s1 s2 Sols1 0 2 2 1 0 30x2 0 1/2 1 0 -1/2 5 z 1 -1/2 0 0 -3/2 15s1 0 1 0 1 1 20This is the optimal tableau. Optimal sol: x1= 0, x2=5; Optimum Value: z =15

  • (0,0)(10,0)(15,0)(0,5)(0,15)2x1+2x2=30x1+2x2=102x1+3x2=302x1+3x2=152x1+3x2=452x1+3x2=20

  • ProblemSolve by Dual Simplex method Minimize subject to

  • Putting it in the form all constraints of the type and adding slack variables, the problem becomes Minimize subject toSince all the objective coefficients are 0 and the problem is minimization, optimality is met. We start the solution by writing the Simplex tableau.

  • s2 0 -1 -2 0 1 -10 z 1 -2 -3 0 0 0 Basic z x1 x2 s1 s2 Sols1 0 - 2 -2 1 0 -30s2 0 0 -1 -1/2 1 5 z 1 0 -1 -1 0 30x1 0 1 1 -1/2 0 15This is the optimal tableau. Optimal sol: x1=15, x2=0; Optimum Value: z =30

  • Problem 2(c) Problem Set 4.4A Page 142Solve by Dual Simplex method subject toThat is subject toMinimizeNote this !

  • Adding slack variables, the problem becomes Minimize subject toSince all the objective coefficients are 0 and the problem is minimization, optimality is met. We start the solution by writing the Simplex tableau.

  • s2 0 0 -4/3 0 1 -1/3 -1/3s3 0 -3 1 0 0 1 -2s2 0 -1 -1 0 1 0 -1 z 1 -4 -2 0 0 0 0 Basic z x1 x2 s1 s2 s3 Sols1 0 1 1 1 0 0 1s1 0 0 4/3 1 0 1/3 1/3 z 1 0 -10/3 0 0 -4/3 8/3x1 0 1 -1/3 0 0 -1/3 2/3z 1 0 0 0 -5/2 -1/2 7/2s1 0 0 0 1 1 0 0x2 0 0 1 0 -3/4 1/4 1/4x1 0 1 0 0 -1/4 -1/4 3/4Optimal Tableau

  • Problem (From Hillier & Lieberman)Solve by Dual Simplex method subject toMaximize

  • Adding slack variables, the problem becomes Maximize subject toSince all the objective coefficients are 0 and the problem is maximization, optimality is met. We start the solution by writing the Simplex tableau.

  • x2 0 0 1 0 -1 0 3s3 0 -1 1 0 0 1 2s2 0 0 -1 0 1 0 -3 z 1 1 1 0 0 0 0 Basic z x1 x2 s1 s2 s3 Sols1 0 1 1 1 0 0 8s1 0 1 0 1 1 0 5 z 1 1 0 0 1 0 - 3 s3 0 -1 0 0 1 1 - 1z 1 0 0 0 2 1 - 4s1 0 0 0 1 2 0 4x2 0 0 1 0 -1 0 3x1 0 1 0 0 -1 -1 1Optimal Tableau

  • Problem (From Hillier & Lieberman)Consider the following LPP: subject toMaximize

  • Write the dual of the above problem.Solve the problem by Regular Simplex method.Solve the dual by the dual Simplex method.Compare the resulting sequence of basic solutions with the complementary basic solutions obtained in part (b).

  • Solution: subject toMinimize(a) The Dual of the given LPP is:(b) We now solve the given LPP by regular Simplex method.

  • s2 0 0 2/3 - 1/3 1 0 2s3 0 5 3 0 0 1 27s2 0 1 1 0 1 0 6 z 1 -3 - 2 0 0 0 0 Basic z x1 x2 s1 s2 s3 Sols1 0 3 1 1 0 0 12x1 0 1 1/3 1/3 0 0 4 z 1 0 - 1 1 0 0 12 s3 0 0 4/3 - 5/3 0 1 7z 1 0 0 1/2 3/2 0 15x1 0 1 0 1/2 -1/2 0 3x2 0 0 1 - 1/2 3/2 0 3s3 0 0 0 - 1 - 2 1 3Optimal Tableau

  • (c) We now solve the dual by Dual Simplex method.Putting it in the form all constraints of the type and adding slack variables, the problem becomes subject toMinimize

  • t2 0 0 -2/3 - 4/3 -1/3 1 -1t2 0 -1 -1 -3 0 1 - 2 w 1 -12 -6 -27 0 0 0 Basic w y1 y2 y3 t1 t2 Solt1 0 -3 -1 -5 1 0 - 3y1 0 1 1/3 5/3 -1/3 0 1 w 1 0 - 2 - 7 - 4 0 12 w 1 0 0 - 3 - 3 - 3 15y1 0 1 0 1 -1/2 1/2 1/2y2 0 0 1 2 1/2 - 3/2 3/2Optimal Tableau

  • We now enumerate the basic solutions of the primal & the complementary basic solutionsThus we observe that dual Simplex method solves the dual on the primal tableau. 0 (0,0, 12, 6,27) Y 0 (0,0, 0,-3, -2) N 1 (4,0, 0, 2, 7) Y 12 (1,0, 0, 0, -1) N 2 (3,3, 0, 0,3) Y 15 (1/2,3/2, 0, 0, 0) Y

    Itera-tion No.Primal Basic SolutionFea-sible?z= wCompl. Basic SolutionFea-sible?

  • Problem 3 Problem Set 4.4A Page 142Dual Simplex with Artificial ConstraintsConsider the LPP Maximizesubject to

  • Adding the surplus variables s1 and s2 to the first and second constraints and the slack variable s3 to the third constraint, the LPP becomes Maximizesubject to

  • The starting Basic Solution consisting of surplus s1 and s2 and slack s3 is infeasible as s1 = -4 and s2 = -3. However the dual Simplex method is NOT applicable as the optimality condition is not met. We will solve the problem by augmenting the artificial constraintwhere M is large enough NOT to eliminate any feasible points of the original solution space. Using the new constraint row as the pivot row and taking x1 as the entering variable as it has the most negative coefficient in the z-row will give an all-optimal objective function row. Next we carry out the dual simplex method. The working follows.

  • s4 0 1 0 1 0 0 0 1 Ms3 0 0 6 -1 0 0 1 -4 8-4Ms1 0 0 -3 7 1 0 0 2 -4+2Mz 1 0 1 1 0 0 0 2 2Ms3 0 4 6 3 0 0 1 0 8s2 0 1 -9 1 0 1 0 0 -3 z 1 -2 1 -1 0 0 0 0 0 Basic z x1 x2 x3 s1 s2 s3 s4 Sols1 0 -2 -3 5 1 0 0 0 -4s2 0 0 -9 0 0 1 0 -1 -3- Mx1 0 1 0 1 0 0 0 1 MNow dual simplex method starts: s3 leaves;s4 enters the basisWe now allow s4 to leave and x1 to enter the basis

  • x1 0 1 0 11/14 0 1/7 3/14 0 9/7s2 0 0 -21/2 1/4 0 1 -1/4 0 -5x1 0 1 3/2 3/4 0 0 1/4 0 2s4 0 0 0 3/14 0 -1/7 -3/14 1 -9/7+Ms1 0 0 0 13/2 1 0 1/2 0 0z 1 0 0 25/42 0 8/21 17/42 0 44/21s4 0 0 -3/2 1/4 0 0 -1/4 1 -2+M z 1 0 4 1/2 0 0 1/2 0 4 Basic z x1 x2 x3 s1 s2 s3 s4 Sols1 0 0 0 13/2 1 0 1/2 0 0 x2 0 0 1 -1/42 0 -2/21 1/42 0 10/21This is the optimal tableau.

  • Problem 4(b) Problem Set 4.4A Page 142Dual Simplex with Artificial ConstraintsConsider the LPPMaximizesubject to

  • Adding the slack variable s1 to the first constraint and the surplus variables s2 and s3 to the second and third constraints, the LPP becomes Maximizesubject to

  • The starting Basic Solution consisting of slack s1 and surplus s2 and s3 is infeasible as s2 = - 4 and s3 = - 3. However the dual Simplex method is NOT applicable as the optimality condition is not met. We will solve this by augmenting the artificial constraintwhere M is large enough NOT to eliminate any feasible points of the original solution space. Using the new constraint row as the pivot row and taking x1 as the entering variable as it has the negative coefficient in the z-row will give an all-optimal objective function row. Next we carry out the dual simplex method. The working follows.

  • s3 0 0 2 0 0 1 2 -3+2Ms4 0 1 0 0 0 0 1 Mz 1 0 3 0 0 0 1 Ms3 0 -2 2 0 0 1 0 -3s2 0 -1 -1 0 1 0 0 -4 z 1 -1 3 0 0 0 0 0 Basic z x1 x2 s1 s2 s3 s4 Sols1 0 1 -1 1 0 0 0 2We now allow x1 to enter and s4 to leave the basis s2 0 0 -1 0 1 0 1 -4+ Mx1 0 1 0 0 0 0 1 MNow dual simplex method starts: s1 leaves;s4 enters the basis s1 0 0 -1 1 0 0 -1 2 - M

  • x1 0 1 - 1 1 0 0 0 2s2 0 0 -1 0 1 0 1 -4+ Mx1 0 1 0 0 0 0 1 Ms3 0 0 0 2 0 1 0 1s4 0 0 1 -1 0 0 1 M - 2z 1 0 2 1 0 0 0 2s3 0 0 2 0 0 1 2 -3+2M z 1 0 3 0 0 0 1 M Basic z x1 x2 s1 s2 s3 s4 Sols1 0 0 - 1 1 0 0 - 1 2 - Ms2 0 0 - 2 1 1 0 0 -2

  • x1 0 1 0 1/2 -1/2 0 0 3s2 0 0 -2 1 1 0 0 -2x1 0 1 -1 1 0 0 0 2s3 0 0 0 2 0 1 0 1s4 0 0 0 -1/2 1/2 0 1 M - 3z 1 0 0 2 1 0 0 0s3 0 0 0 2 0 1 0 1 z 1 0 2 1 0 0 0 2 Basic z x1 x2 s1 s2 s3 s4 Sols4 0 0 1 -1 0 0 1 M - 2x2 0 0 1 -1/2 -1/2 0 0 1This is the optimal tableau.

  • Generalized Simplex AlgorithmThe (primal) Simplex algorithm starts with a feasible solution which is not optimal and then moves towards optimality always retaining the feasibility. The dual Simplex algorithm starts with (better than) optimal solution which is not feasible and moves towards feasibility always retaining the optimality. What if the starting solution is neither feasible nor optimal? We have to use either (primal) Simplex Algorithm with Artificial variables or Dual Simplex Algorithm with Artificial constraints.

  • In both these algorithms we look for corner point solutions (feasible or not). The generalized Simplex algorithm exploits this fact and without using artificial variables or constraints moves from one corner point solution to another till optimality is obtained (or the criterion that the problem is unbounded or infeasible is detected). We illustrate with two examples.We now redo Problem 4(b) of Problem Set 4.4A Page 142 without adding an artificial constraint. The starting Simplex tableau is neither feasible nor optimal.

  • s1 0 0 -2 1 1 0 -2 We now allow s1 to leave the basis as it has the ve value and x2 to enter as it has the only ve coefficient in the leaving row.s3 0 0 4 0 -2 1 5z 1 0 4 0 -1 0 4s3 0 -2 2 0 0 1 -3s2 0 -1 -1 0 1 0 -4 z 1 -1 3 0 0 0 0 Basic z x1 x2 s1 s2 s3 Sols1 0 1 -1 1 0 0 2We now allow s2 to leave the basis as it has the most ve value and x1 to enter as it satisfies the minimum ratio test.x1 0 1 1 0 -1 0 4

  • x1 0 1 0 1/2 -1/2 0 3s3 0 0 0 2 0 1 1 z 1 0 0 2 1 0 0 Basic z x1 x2 s1 s2 s3 Solx2 0 0 1 -1/2 -1/2 0 1This is the optimal tableau

  • Problem 4(c) Problem Set 4.4A Page 143Consider the LPP Minimizesubject to

  • Adding the slack variable s2 to the second constraint and the surplus variables s1 and s3 to the first and third constraints, the LPP becomes Minimizesubject to

  • x1 0 1 -4 -1 0 0 5 s2 0 1 -3 0 1 0 1The new s2 row shows that the problem has no feasible solution.s3 0 0 -3 -2 0 1 9z 1 0 3 1 0 0 5s3 0 -2 5 0 0 1 -1 z 1 1 -1 0 0 0 0 Basic z x1 x2 s1 s2 s3 Sols1 0 -1 4 1 0 0 -5We now allow s1 to leave the basis as it has the most ve value and x1 to enter as it has the only ve coefft in the leaving row.s2 0 0 1 1 1 0 -4

  • Problem 4(b) Problem Set 4.4A Page 142Consider the LPP Maximizesubject to

  • Adding the slack variable s1 to the first constraint and the surplus variables s2 and s3 to the second and third constraints, the LPP becomes Maximizesubject toWe did this by generalized Simplex algorithm earlier. We redo it in another way.

  • s3 0 0 0 2 0 1 0 1x1 0 1 -1 1 0 0 0 2z 1 0 2 1 0 0 0 2s3 0 -2 2 0 0 1 0 -3s2 0 -1 -1 0 1 0 0 -4 z 1 -1 3 0 0 0 0 0 Basic z x1 x2 s1 s2 s3 s4 Sols1 0 1 -1 1 0 0 0 2We now allow x1 to enter and s1 to leave the basis s2 0 0 -2 1 1 0 0 -2Now dual simplex method starts: s2 leaves;x2 enters the basis

  • s3 0 0 0 2 0 1 0 1x2 0 0 1 -1/2 -1/2 0 0 1 z 1 0 0 2 1 0 0 0 Basic z x1 x2 s1 s2 s3 s4 Solx1 0 1 0 1/2 -1/2 0 0 3This is the optimal tableauMax z = 0; x1 = 3; x2 = 1.

  • (3,1) Optimal SolutionSFz = -3