About Linear programming, Lecture notes of Logistics

About Linear programming in HCMC IU

Typology: Lecture notes

2021/2022

Uploaded on 03/04/2023

peiu-tngannn
peiu-tngannn 🇻🇳

2 documents

1 / 10

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
BY: Dr. Hiba G. Fareed
50
The Two-Phase Simplex Method
When a basic feasible solution is not readily available, the two-phase simplex
method may be used as an alternative to the Big M method. In the two-phase simplex
method, we add artificial variables to the same constraints as we did in the Big M
method. Then we find a bfs to the original LP by solving the Phase I LP. In the Phase I
LP, the objective function is to minimize the sum of all artificial variables. At the
completion of Phase I, we reintroduce the original LP’s objective function and determine
the optimal solution to the original LP.
The following steps describe the two-phase simplex method. Note that steps 1–3
for the two-phase simplex are identical to steps 1–4 for the Big M method.
Steps
1) Modify the constraints so that the right-hand side of each constraint is
nonnegative. This requires that each constraint with a negative right-hand side be
multiplied through by _1.
2) Identify each constraint that is now (after step 1) or = constraint. In step 3, we
will add an artificial variable to each constraint.
3) Convert each inequality constraint to the standard form. If constraint i is
constraint, then add a slack variable si. If constraint i is constraint, subtract an
excess variable ei.
4) If (after step 2) constraint i is or = constraint, add an artificial variable ai.
5) For now, ignore the original LP’s objective function. Instead solve an LP whose
objective function is min W = (sum o f all the artificial variables). This is called
the Phase I LP. The act of solving the Phase I LP will force the artificial
variables to be zero.
Because each ai 0, solving the Phase I LP will result in one of the
following three cases:
Case 1 The optimal value of W is greater than zero. In this case, the
original LP has no feasible solution.
Case 2 The optimal value of W is equal to zero, and no artificial variables
are in the optimal Phase I basis. In this case, we drop all columns in the
optimal Phase I tableau that corresponds to the artificial variables. We
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download About Linear programming and more Lecture notes Logistics in PDF only on Docsity!

BY: Dr. Hiba G. Fareed

The Two-Phase Simplex Method

When a basic feasible solution is not readily available, the two-phase simplex method may be used as an alternative to the Big M method. In the two-phase simplex method, we add artificial variables to the same constraints as we did in the Big M method. Then we find a bfs to the original LP by solving the Phase I LP. In the Phase I LP, the objective function is to minimize the sum of all artificial variables. At the completion of Phase I, we reintroduce the original LP’s objective function and determine the optimal solution to the original LP. The following steps describe the two-phase simplex method. Note that steps 1– 3 for the two-phase simplex are identical to steps 1– 4 for the Big M method.

Steps

  1. Modify the constraints so that the right-hand side of each constraint is nonnegative. This requires that each constraint with a negative right-hand side be multiplied through by _1.
  2. Identify each constraint that is now (after step 1) ≥ or = constraint. In step 3, we will add an artificial variable to each constraint.
  3. Convert each inequality constraint to the standard form. If constraint i is ≤ constraint, then add a slack variable si. If constraint i is ≥ constraint, subtract an excess variable ei.
  4. If (after step 2) constraint i is ≥ or = constraint, add an artificial variable ai_._
  5. For now, ignore the original LP’s objective function. Instead solve an LP whose objective function is min W = (sum of all the artificial variables). This is called the Phase I LP. The act of solving the Phase I LP will force the artificial variables to be zero. Because each ai ≥ 0, solving the Phase I LP will result in one of the following three cases: Case 1 The optimal value of W is greater than zero. In this case, the original LP has no feasible solution. Case 2 The optimal value of W is equal to zero, and no artificial variables are in the optimal Phase I basis. In this case, we drop all columns in the optimal Phase I tableau that corresponds to the artificial variables. We

BY: Dr. Hiba G. Fareed now combine the original objective function with the constraints from the optimal Phase I tableau. This yields the Phase II LP. The optimal solution to the Phase II LP is the optimal solution to the original LP. Case 3 The optimal value of W is equal to zero and at least one artificial variable is in the optimal Phase I basis. In this case, we can find the optimal solution to the original LP if at the end of Phase I we drop from the optimal Phase I tableau all nonbasic artificial variables and any variable from the original problem that has a negative coefficient in objective row of the optimal Phase I tableau. Before solving examples illustrating Cases 1–3, we briefly discuss why W > 0 corresponds to the original LP having no feasible solution and W = 0 corresponds to the original LP having at least one feasible solution. Maximize Z = 4 x + 5 y Subject to 2 x + 3 y ≤ 6 3 x + y ≥ 3 x, y ≥ 0 First, convert the constrains to equations Maximize Z = 4 x + 5 y Subject to 2 x + 3 y + s 1 = 6 3 x + y - e + a = 3 x, y (^) , s 1 , e, a ≥ 0 Example: Case 2

BY: Dr. Hiba G. Fareed Since there is no positive number in the objective row, we will stop. The optimal basis s = 4 and x = 1. The optimal objective value W = 0 and a is not in the optimal Phase I basis. Therefore, we have Case 2 Hence, we can generate Phase II initial tableau by changing the objective function row into the original objective function (Z = 4 x + 5 y ). Also, drop the artificial column Phase II x y s e Z s 0 7/3 1 2/3 0 4 x 1 1/3 0 - 1/3 0 1 Z - 4 - 5 0 0 1 0 Since x is one of the basis we need to convert - 4 in objective row to 0 x y s e Z s 0 7/3 1 2/3 0 4 x 1 1/3 0 - 1/3 0 1 Z 0 - 11/3 0 - 4/3 1 4 Use Simplex Method. Choose the most negative element in the objective row x y s e Z y 0 1 3/7 2/7 0 12/ x 1 0 - 1/7 - 3 / 7 0 3/ Z 0 0 11/7 - 2 / 7 1 72/ x y s e Z e 0 7/2 3/2 1 0 6 x 1 3/2 1/2 0 0 3 Z 0 1 2 0 1 12

R 3 = R 3 + 4 R 2

BY: Dr. Hiba G. Fareed Since all the elements of the objective row are nonnegative, then we will stop. The optimal solution to the Phase II LP is the optimal solution to the original LP and equal to x = 3 , y = 0 with Z = 12 Minimize Z = 2 x + 3 y Subject to ଵ ଶ x + ଵ ସ y ≤ 4 x + 3 y ≥ 36 x + y = 10 x, y ≥ 0 Phase I LP Minimize W = a 1 + a 2 Subject to ଵ ଶ x + ଵ ସ y + s + 0e + 0a 1 + 0a 2 + 0W = 4 x + 3 y + 0s - e + a 1 + 0a 2 + 0W= 36 x + y + 0s + 0e + 0a 1 + a 2 + 0W = 10 x, y (^) , s , e, a 1 , a 2 ≥ 0 After setting the objective function equal to zero we have the following tableau x y s e a 1 a 2 W s 1/ 2 1/4 1 0 0 0 0 4 1 3 0 - 1 1 0 0 36 1 1 0 0 0 1 0 10 W 0 0 0 0 - 1 - 1 1 0 Now, eliminate the artificial variables in the objective function row by converting it to 0 Example: Case 1 R 4 = R 4 + R 2

BY: Dr. Hiba G. Fareed Maximize Z = 40 x 1 + 10 x 2 + 7 x 5 + 14 x 6 Subject to x 1 - x 2 + 2 x 5 = 0

  • 2 x 1 + x 2 - 2 x 5 = 0 x 1 + x 3 + x 5 - x 6 = 3 x 2 + x 3 + x 4 + 2 x 5 + x 6 = 4 x 1 , x 2 , x 3 , x 4 , x 5 , x 6 ≥ 0 Convert the constrains to equations by adding artificial variables (active variables ). Note : we can use x 4 as a basic (active ) variable. Therefor we will add only 3 artificial variables for the first three variables. Phase I LP Minimize W = a 1 + a 2 + a 3 Subject to x 1 - x 2 + 2 x 5 + a 1 +0 a 2 +0 a 3 + 0W = 0
  • 2 x 1 + x 2 - 2 x 5 +0 a 1 + a 2 +0 a 3 + 0W = 0 x 1 + x 3 + x 5 - x 6 +0 a 1 +0 a 2 + a 3 + 0W = 3 x 2 + x 3 + x 4 + 2 x 5 + x 6 +0 a 1 +0 a 2 + 0a 3 + 0W = 4 x 1 , x 2 , x 3 , x 4 , x 5 , x 6 , a 1 , a 2 , a 3 ≥ 0 x 1 x 2 x 3 x 4 x 5 x 6 a 1 a 2 a 3 W a 1 1 - 1 0 0 2 0 1 0 0 0 0 a 2 - 2 1 0 0 - 2 0 0 1 0 0 0 a 3 1 0 1 0 1 - 1 0 0 1 0 3 x 4 0 1 1 1 2 1 0 0 0 0 4 W 0 0 0 0 0 0 - 1 - 1 - 1 1 0 Example: Case 3 R 5 = R 5 + R 1

BY: Dr. Hiba G. Fareed

Now we will start simplex method. Choose the greatest positive number in the objective row

 - a 1 1 - x 1 x 2 x 3 x 4 x 5 x 6 a 1 a 2 a 3 W - a 2 - 2 1 0 0 - - a 3 1 0 1 0 1 - - x - W 1 - 1 0 0 2 0 0 - 1 - - a 1 1 - x 1 x 2 x 3 x 4 x 5 x 6 a 1 a 2 a 3 W - a 2 - 2 1 0 0 - - a 3 1 0 1 0 1 - - x - W - 1 0 0 0 0 0 0 0 - - a 1 1 - x 1 x 2 x 3 x 4 x 5 x 6 a 1 a 2 a 3 W - a 2 - 2 1 0 0 - - a 3 1 0 1 0 1 - - x - W 0 0 1 0 1 - - a 1 1 - x 1 x 2 x 3 x 4 x 5 x 6 a 1 a 2 a 3 W - a 2 - 2 1 0 0 - - x 3 1 0 1 0 1 - - x 4 - 1 2 0 1 1 2 0 0 - - W - 1 0 0 0 0 0 0 0 - 
  • R 5 = R 5 + R
  • R 5 = R 5 + R - R 4 = R 4 - R
    • R 5 = R 5 - R

BY: Dr. Hiba G. Fareed x 2 x 3 x 4 x 5 x 6 a 1 a 2 Z a 1 - 1 0 0 2 0 1 0 0 0 a 2 1 0 0 - 2 0 0 1 0 0 x 3 1 1 1/2 3/2 0 0 0 0 7/ x 6 1 0 1/2 1/2 1 0 0 0 1/ Z 4 0 7 0 0 0 0 1 7 Since all the elements of the objective row are nonnegative, then we will stop. The optimal solution to the Phase II LP is the optimal solution to the original LP and equal to x 1 = 0 , x 2 = 0, x 3 = 7/2 , x 4 = 0, x 5 = 0, and x 6 = 1/2 with Z = 7