You are on page 1of 16

Operations Research 1 The Two-Phase Simplex Method

Dr. zgr Kabak

The Two-Phase Simplex Method


It is an alternative to the Big M method. bfs is found at the first phase. Problem is solved using simplex methos at the second phase.

Steps: 1. Convert each inequality constraint to the standard form 2. If constraint i is a or = constraint, add an artificial variable ai. Also add the sign restriction ai 0 3. For now, ignore the original LPs objective function. Instead solve an LP whose objective function is min w (sum of all the artificial variables). (Phase I LP).

The act of solving the Phase I LP will force the artificial variables to be zero.

The Two-Phase Simplex Method


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.

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.

drop all columns in the optimal Phase I tableau that correspond to the artificial variables, combine the original objective function with the constraints from the optimal Phase I tableau (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.

drop from the optimal Phase I tableau all nonbasic artificial variables and any variable from the original problem that has a negative coefficient in row 0 of the optimal Phase I tableau combine the original objective function with the constraints from the optimal Phase I tableau (Phase II LP). The optimal solution to the Phase II LP is the optimal solution to the original LP

The Two-Phase Simplex Method Case 2 - Example


Bevco Example Decision Variables:


x1 : the quantity of ounces of orange soda in a bottle of Oranj x2 : the quantity of ounces of orange juice in a bottle of Oranj

Objective Function

Min z = 2 x1 + 3 x2

Constraints

4

0,5 x1 + 0,25 x2 4 x1 + 3 x2 20 x1 + x2 = 10 x 1 , x2 0

(Sugar Constraint) (Vit. C constraint) (10 oz. in bottle) (sign restrictions)

The Two-Phase Simplex Method Case 2 - Example

Phase I, initial tableau w' 1 x1 2 1 1 x2 4 1 -1 1 1 s1 e2 -1 a2 a3 RHS 30 4 20 10 BV w'=30 s1=4 a2=20 a3=10 16 20/3* 10 Ratio

3
1

Phase I, Optimal tableau w' 1 1 1 1


5

x1

x2

s1

e2 0 -1/8 -1/2 1/2

a2 -1 1/8 1/2 -1/2

a3 -1 -5/8 -1/2 3/2

RHS 0 1/4 5 5

BV w'=0 s1=1/4 x2=5 x1=5

The Two-Phase Simplex Method Case 2 - Example


Phase II Min z = 2 x1 + 3 x2
Z 1 1 1 1 x1 x2 s1 e2 -1/2 -1/8 -1/2 1/2 RHS 25 1/4 5 5 BV Z=25 s1=1/4 x2=5 x1=5

The Two-Phase Simplex Method Case 1 - Example


Suppse 36mg.Vitamin C is required for Oranj. min z = 2x1 + 3x2


yle ki; 1/2 x1 +1/4 x2 4 x1 + 3x2 36 x1 + x2 = 10 x1, x2 0

Phase I, initial tableau


w' 1 x1 2 1 1
7

x2 4 3

s1 1

e2 -1 -1

a2

a3

RHS 46 4

BV w'=46 s1=4 a2=36 a3=10

Ratio 16 12 10*

1 1

36 10

The Two-Phase Simplex Method Case 1 - Example

Phase I, optimal tableau


w' 1 x1 -2 -2 1 1 1 -1 1 x2 s1 e2 -1 a2 a3 -4 -1/4 -3 1 ST 6 3/2 6 10 TD w'=6 s1=3/2 a2=6 x2=10

The Two-Phase Simplex Method Case 3 - Example


Max z = 40x1 + 10x2 +7x5 + 14x6 S.t. x1 - x2 +2x5 =0 -2x1 + x2 -2x5 =0 x1 + x3 + x5 - x6 = 3 2x2 + x3 + x4 + 2x5 + x6 = 4 x1, x2, x3, x4 0 Phase I, initial tableau
w 1 x1 x2 x3 0 1 -2 1
9

x4 0 0 0 0 1

x5 1 2 -2 1 2

x6 -1 0 0 -1 1

a1 1

a2

a3

RHS 3 0

BV w=3 a1=0 a2=0 a3=3 x4=4

0 -1 1 0 2

1 0 0

1 1

0 3 4

1
1

The Two-Phase Simplex Method Case 3 - Example

Phase I, optimal tableau


w 1 x1 x2 x3 -1 1 -2 1 -1 0 -1 1 0 2 0 0 0 1 0 x4 0 0 0 0 1 x5 0 2 -2 1 1 x6 0 0 0 -1 2 1 1 a1 a2 a3 -1 0 0 1 -1 RHS 0 0 0 3 1 BV w=0 a1=0 a2=0 x3=3 x4=1

Phase II, initial tableau


Z 1 x2 -10 -1 1 0
10

x3 0 0 0 1 0

x4 0 0 0 0 1

x5 -7 2 -2 1 1

x6 -14 0 0 -1

a1 1

a2

RHS 0 0

BV z=0 a1=0 a2=0 x3=3 x4=1

0 3 1

The Two-Phase Simplex Method Case 3 - Example

Phase II, initial tableau


Z 1 x2 4 0 1 1 0 x3 0 0 0 1 0 x4 7 0 0 x5 0 2 0 3/2 1/2 x6 0 0 0 0
1

a1 1

a2

ST 7 0

TD z=7 a1=0 a2=0 x3=7/2 x6=1/2

0 7/2

Solution to the original problem: z = 7, x3 =7/2, x6 = 1/2, x2 = x5 = x4 =x3= 0.


11

Unrestricted-in-Sign Variables

if some variables are allowed to be unrestricted in sign (urs), the ratio test and therefore the simplex algorithm are no longer valid. LP with unrestricted-in-sign variables can be transformed into an LP in which all variables are required to be nonnegative. For each urs variable xi

xi urs

definine two new variables xi and xi. Substitute xi - xi for xi in each constraint and in the objective function. add the sign restrictions xi 0 and xi 0.

xi = xi xi

xi, xi0

12

x2 = x2 x2

Example

Use Big M and two-phase methods to folve following LP: min z = -3x1 + x2 yle ki; x1 - 2x2 2 x1 - x2 - 3 x1, x2 0

Big M Method: Initial Tableau Z 1 x1 3 -1 Z 1 x1 0 1 0 x2 -M-1 -2 1 e1 -M -1 a1 1 -1 a1 -3 1 1 e2 -M 0 -1 1 a2 0 0 1 e2 -M a2 RHS Ratio 5M 2 2 3 RHS 5M-6 2 5

1th iteration optimal tableau x2 e1 -M+5 -M+3 -2 -1 -1 -1

Two-phase simplex: Phase 1.: min w= a1+a2 Initial tableau w 1 x1 0 1 -1 x2 -1 -2 1 e1 -1 -1 a1 1 -1 1 e2 -1 a2 ST 5 2 3

For the Big M method, explain why the simplex method never would choose an artificial variable to be an entering basic variable once all the artificial variables are nonbasic.

rnek

You are given the tableau shown below for a maximization problem. Give conditions on the unknowns a1, a2, a3, b, and c that make the following statements true: 1. The current solution is optimal. 2. The current solution is optimal, and there are alternative optimal solutions. 3. The LP is unbounded (in this part, assume that b 0).
Z 1 0 0 0
17

x1 -c -1 a2 a3

x2 2 a1 -4 3

x3 0 1 0 0

x4 0 0 1 0

x5 0 0 0 1

rhs 10 4 1 b

You might also like