Home > Operation Research calculators > Two-Phase method example

3. Two-Phase method example ( Enter your problem )
  1. Algorithm & Example-1
  2. Example-2
  3. Example-3
  4. Infeasible solution example
Other related methods
  1. Formulate linear programming model
  2. Graphical method
  3. Simplex method (BigM method)
  4. Two-Phase method
  5. Primal to dual conversion
  6. Dual simplex method
  7. Integer simplex method
  8. Branch and Bound method
  9. 0-1 Integer programming problem
  10. Revised Simplex method

2. Example-2
(Previous example)
4. Infeasible solution example
(Next example)

3. Example-3





Find solution using Two-Phase method
MAX Z = 5x1 + 8x2
subject to
3x1 + 2x2 >= 3
x1 + 4x2 >= 4
x1 + x2 <= 5
and x1,x2 >= 0


Solution:
Problem is
Max `Z``=````5``x_1`` + ``8``x_2`
subject to
```3``x_1`` + ``2``x_2``3`
`````x_1`` + ``4``x_2``4`
`````x_1`` + ````x_2``5`
and `x_1,x_2 >= 0; `


-->Phase-1<--

The problem is converted to canonical form by adding slack, surplus and artificial variables as appropiate

1. As the constraint-1 is of type '`>=`' we should subtract surplus variable `S_1` and add artificial variable `A_1`

2. As the constraint-2 is of type '`>=`' we should subtract surplus variable `S_2` and add artificial variable `A_2`

3. As the constraint-3 is of type '`<=`' we should add slack variable `S_3`

After introducing slack,surplus,artificial variables
Max `Z``=`` - ````A_1`` - ````A_2`
subject to
```3``x_1`` + ``2``x_2`` - ````S_1`` + ````A_1`=`3`
`````x_1`` + ``4``x_2`` - ````S_2`` + ````A_2`=`4`
`````x_1`` + ````x_2`` + ````S_3`=`5`
and `x_1,x_2,S_1,S_2,S_3,A_1,A_2 >= 0`


Iteration-1 `C_j``0``0``0``0``0``-1``-1`
`B``C_B``X_B``x_1``x_2``S_1``S_2``S_3``A_1``A_2`MinRatio
`(X_B)/(x_2)`
`A_1``-1``3``3``2``-1``0``0``1``0``(3)/(2)=1.5`
`A_2``-1``4``1``(4)``0``-1``0``0``1``(4)/(4)=1``->`
`S_3``0``5``1``1``0``0``1``0``0``(5)/(1)=5`
`Z=-7` `Z_j``-4``-6``1``1``0``-1``-1`
`Z_j-C_j``-4``-6``uarr``1``1``0``0``0`


Negative minimum `Z_j-C_j` is `-6` and its column index is `2`. So, the entering variable is `x_2`.

Minimum ratio is `1` and its row index is `2`. So, the leaving basis variable is `A_2`.

`:.` The pivot element is `4`.

Entering `=x_2`, Departing `=A_2`, Key Element `=4`

`R_2`(new)`= R_2`(old) `-: 4`
`R_2`(old) = `4``1``4``0``-1``0``0`
`R_2`(new)`= R_2`(old) `-: 4``1``1/4``1``0``-1/4``0``0`


`R_1`(new)`= R_1`(old) - `2 R_2`(new)
`R_1`(old) = `3``3``2``-1``0``0``1`
`R_2`(new) = `1``1/4``1``0``-1/4``0``0`
`2 xx R_2`(new) = `2``1/2``2``0``-1/2``0``0`
`R_1`(new)`= R_1`(old) - `2 R_2`(new)`1``5/2``0``-1``1/2``0``1`


`R_3`(new)`= R_3`(old) - `R_2`(new)
`R_3`(old) = `5``1``1``0``0``1``0`
`R_2`(new) = `1``1/4``1``0``-1/4``0``0`
`R_3`(new)`= R_3`(old) - `R_2`(new)`4``3/4``0``0``1/4``1``0`


Iteration-2 `C_j``0``0``0``0``0``-1`
`B``C_B``X_B``x_1``x_2``S_1``S_2``S_3``A_1`MinRatio
`(X_B)/(x_1)`
`A_1``-1``1``(5/2)``0``-1``1/2``0``1``(1)/(5/2)=2/5=0.4``->`
`x_2``0``1``1/4``1``0``-1/4``0``0``(1)/(1/4)=4`
`S_3``0``4``3/4``0``0``1/4``1``0``(4)/(3/4)=16/3=5.3333`
`Z=-1` `Z_j``-5/2``0``1``-1/2``0``-1`
`Z_j-C_j``-5/2``uarr``0``1``-1/2``0``0`


Negative minimum `Z_j-C_j` is `-5/2` and its column index is `1`. So, the entering variable is `x_1`.

Minimum ratio is `0.4` and its row index is `1`. So, the leaving basis variable is `A_1`.

`:.` The pivot element is `5/2`.

Entering `=x_1`, Departing `=A_1`, Key Element `=5/2`

`R_1`(new)`= R_1`(old) `xx2/5`
`R_1`(old) = `1``5/2``0``-1``1/2``0`
`R_1`(new)`= R_1`(old) `xx2/5``2/5``1``0``-2/5``1/5``0`


`R_2`(new)`= R_2`(old) - `1/4 R_1`(new)
`R_2`(old) = `1``1/4``1``0``-1/4``0`
`R_1`(new) = `2/5``1``0``-2/5``1/5``0`
`1/4 xx R_1`(new) = `1/10``1/4``0``-1/10``1/20``0`
`R_2`(new)`= R_2`(old) - `1/4 R_1`(new)`9/10``0``1``1/10``-3/10``0`


`R_3`(new)`= R_3`(old) - `3/4 R_1`(new)
`R_3`(old) = `4``3/4``0``0``1/4``1`
`R_1`(new) = `2/5``1``0``-2/5``1/5``0`
`3/4 xx R_1`(new) = `3/10``3/4``0``-3/10``3/20``0`
`R_3`(new)`= R_3`(old) - `3/4 R_1`(new)`37/10``0``0``3/10``1/10``1`


Iteration-3 `C_j``0``0``0``0``0`
`B``C_B``X_B``x_1``x_2``S_1``S_2``S_3`MinRatio
`x_1``0``2/5``1``0``-2/5``1/5``0`
`x_2``0``9/10``0``1``1/10``-3/10``0`
`S_3``0``37/10``0``0``3/10``1/10``1`
`Z=0` `Z_j``0``0``0``0``0`
`Z_j-C_j``0``0``0``0``0`


Since all `Z_j-C_j >= 0`

Hence, optimal solution is arrived with value of variables as :
`x_1=2/5,x_2=9/10`

Max `Z=0`

-->Phase-2<--

we eliminate the artificial variables and change the objective function for the original,
Max `Z=5x_1 + 8x_2 + 0S_1 + 0S_2 + 0S_3`

Iteration-1 `C_j``5``8``0``0``0`
`B``C_B``X_B``x_1``x_2``S_1``S_2``S_3`MinRatio
`(X_B)/(S_2)`
`x_1``5``2/5``1``0``-2/5``(1/5)``0``(2/5)/(1/5)=2``->`
`x_2``8``9/10``0``1``1/10``-3/10``0`---
`S_3``0``37/10``0``0``3/10``1/10``1``(37/10)/(1/10)=37`
`Z=46/5` `Z_j``5``8``-6/5``-7/5``0`
`Z_j-C_j``0``0``-6/5``-7/5``uarr``0`


Negative minimum `Z_j-C_j` is `-7/5` and its column index is `4`. So, the entering variable is `S_2`.

Minimum ratio is `2` and its row index is `1`. So, the leaving basis variable is `x_1`.

`:.` The pivot element is `1/5`.

Entering `=S_2`, Departing `=x_1`, Key Element `=1/5`

`R_1`(new)`= R_1`(old) `xx5`
`R_1`(old) = `2/5``1``0``-2/5``1/5``0`
`R_1`(new)`= R_1`(old) `xx5``2``5``0``-2``1``0`


`R_2`(new)`= R_2`(old) + `3/10 R_1`(new)
`R_2`(old) = `9/10``0``1``1/10``-3/10``0`
`R_1`(new) = `2``5``0``-2``1``0`
`3/10 xx R_1`(new) = `3/5``3/2``0``-3/5``3/10``0`
`R_2`(new)`= R_2`(old) + `3/10 R_1`(new)`3/2``3/2``1``-1/2``0``0`


`R_3`(new)`= R_3`(old) - `1/10 R_1`(new)
`R_3`(old) = `37/10``0``0``3/10``1/10``1`
`R_1`(new) = `2``5``0``-2``1``0`
`1/10 xx R_1`(new) = `1/5``1/2``0``-1/5``1/10``0`
`R_3`(new)`= R_3`(old) - `1/10 R_1`(new)`7/2``-1/2``0``1/2``0``1`


Iteration-2 `C_j``5``8``0``0``0`
`B``C_B``X_B``x_1``x_2``S_1``S_2``S_3`MinRatio
`(X_B)/(S_1)`
`S_2``0``2``5``0``-2``1``0`---
`x_2``8``3/2``3/2``1``-1/2``0``0`---
`S_3``0``7/2``-1/2``0``(1/2)``0``1``(7/2)/(1/2)=7``->`
`Z=12` `Z_j``12``8``-4``0``0`
`Z_j-C_j``7``0``-4``uarr``0``0`


Negative minimum `Z_j-C_j` is `-4` and its column index is `3`. So, the entering variable is `S_1`.

Minimum ratio is `7` and its row index is `3`. So, the leaving basis variable is `S_3`.

`:.` The pivot element is `1/2`.

Entering `=S_1`, Departing `=S_3`, Key Element `=1/2`

`R_3`(new)`= R_3`(old) `xx2`
`R_3`(old) = `7/2``-1/2``0``1/2``0``1`
`R_3`(new)`= R_3`(old) `xx2``7``-1``0``1``0``2`


`R_1`(new)`= R_1`(old) + `2 R_3`(new)
`R_1`(old) = `2``5``0``-2``1``0`
`R_3`(new) = `7``-1``0``1``0``2`
`2 xx R_3`(new) = `14``-2``0``2``0``4`
`R_1`(new)`= R_1`(old) + `2 R_3`(new)`16``3``0``0``1``4`


`R_2`(new)`= R_2`(old) + `1/2 R_3`(new)
`R_2`(old) = `3/2``3/2``1``-1/2``0``0`
`R_3`(new) = `7``-1``0``1``0``2`
`1/2 xx R_3`(new) = `7/2``-1/2``0``1/2``0``1`
`R_2`(new)`= R_2`(old) + `1/2 R_3`(new)`5``1``1``0``0``1`


Iteration-3 `C_j``5``8``0``0``0`
`B``C_B``X_B``x_1``x_2``S_1``S_2``S_3`MinRatio
`S_2``0``16``3``0``0``1``4`
`x_2``8``5``1``1``0``0``1`
`S_1``0``7``-1``0``1``0``2`
`Z=40` `Z_j``8``8``0``0``8`
`Z_j-C_j``3``0``0``0``8`


Since all `Z_j-C_j >= 0`

Hence, optimal solution is arrived with value of variables as :
`x_1=0,x_2=5`

Max `Z=40`


This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then Submit Here



2. Example-2
(Previous example)
4. Infeasible solution example
(Next example)





Share this solution or page with your friends.


 
Copyright © 2024. All rights reserved. Terms, Privacy
 
 

.