4. Standard form-2 using Two-Phase method : Example-1
Find solution using Revised Simplex (Two-Phase) method MAX Z = x1 + x2 subject to 2x1 + 5x2 <= 6 x1 + x2 >= 2 and x1,x2 >= 0
Solution: Problem is
Max `Z` | `=` | `` | `` | `x_1` | ` + ` | `` | `x_2` |
| subject to | `` | `2` | `x_1` | ` + ` | `5` | `x_2` | ≤ | `6` | `` | `` | `x_1` | ` + ` | `` | `x_2` | ≥ | `2` |
| and `x_1,x_2 >= 0; ` |
Step-1 : The problem is converted to canonical form by adding slack, surplus and artificial variables as appropiate
After introducing slack,surplus,artificial variables
`` | `2` | `x_1` | ` + ` | `5` | `x_2` | ` + ` | `` | `S_1` | | | | | | | = | `6` | `` | `` | `x_1` | ` + ` | `` | `x_2` | | | | ` - ` | `` | `S_2` | ` + ` | `` | `A_1` | = | `2` |
|
The problem is converted to canonical form by adding slack, surplus and artificial variables as appropiate
After introducing slack,surplus,artificial variables
`` | `` | `Z'` | ` - ` | `` | `x_1` | ` - ` | `` | `x_2` | | | | | | | | | | | | | = | `0` | | | | ` - ` | `3` | `x_1` | ` - ` | `6` | `x_2` | ` - ` | `` | `S_1` | ` + ` | `` | `S_2` | | | | ` + ` | `` | `x_5` | = | `-2` | | | | `` | `2` | `x_1` | ` + ` | `5` | `x_2` | ` + ` | `` | `S_1` | | | | | | | | | | = | `6` | | | | `` | `` | `x_1` | ` + ` | `` | `x_2` | | | | ` - ` | `` | `S_2` | ` + ` | `` | `A_1` | | | | = | `2` |
|
Now represent the new system of constraint equations in the matrix form `[[1,-1,-1,0,0,0,0],[0,-3,-6,-1,1,0,1],[0,2,5,1,0,0,0],[0,1,1,0,-1,1,0]][[Z'],[x_1],[x_2],[S_1],[S_2],[A_1],[x_5]]=[[0],[-2],[6],[2]]`
or `[[1,-c],[0,A]][[Z],[x]]=[[0,b]]; x>=0`
where `e=beta_0,a_4=beta_1,a_5=beta_2,a_6=beta_3`
Step-2 : The basis matrix `B_1` of order `(3+1)=4` can be expressed as
`B_1=[beta_0,beta_1,beta_2,beta_3]=[[1,0,0,0],[0,1,-1,0],[0,0,1,0],[0,0,0,1]]`
Then, `B_1^(-1)=[[1,C_B B^(-1)],[0,B^(-1)]]=1; B=[[1,-1,0],[0,1,0],[0,0,1]]=[beta_1,beta_2,beta_3]; C_B=[0,0,0]`
Phase-1
| | Basis Inverse `B_1^(-1)` | | | Additional table | `B` | `X_B` | `beta_0` `Z'` | `beta_1` `x_5` | `beta_2` `S_1` | `beta_3` `A_1` | `y_1` `C_k-Z_k` | Min Ratio `(X_B)/(y_1)` | `x_1` | `x_2` | `S_2` | `Z'` | `0` | `1` | `0` | `0` | `0` | | --- | `-1` | `-1` | `0` | `x_5` | `-2` | `0` | `1` | `-1` | `0` | | --- | `-3` | `-6` | `1` | `S_1` | `6` | `0` | `0` | `1` | `0` | | --- | `2` | `5` | `0` | `A_1` | `2` | `0` | `0` | `0` | `1` | | --- | `1` | `1` | `-1` |
Iteration=1 : Repeat steps 3 to 5 to get new solution Step-3: To select the vector corresponding to a non-basic variable to enter into the basis, we compute `z_k-c_k="Min" {(z_j-c_j)<0;}`
`="Min"{(2^(nd)" row of " B_1^(-1)) ("Columns " a_j " not in basis")}`
`="Min"{[[0,1,-1,0]] [[-1,-1,0],[-3,-6,1],[2,5,0],[1,1,-1]]}`
`="Min"{[[-5,-11,1]]}`
`=-11` (correspnds to `z_2-c_2`)
Thus, vector `x_2` is selected to enter into the basis, for `k=2`
Step-4: To select a basic variable to leave the basis, we compute `y_k` for k=2, as follows
`y_2= B_1^(-1) a_2=[[1,0,0,0],[0,1,-1,0],[0,0,1,0],[0,0,0,1]] [[-1],[-6],[5],[1]]=[[-1],[-11],[5],[1]]`
and `X_B = [[0],[-2],[6],[2]]`
Now, calculate the minimum ratio to select the basic variable to leave the basis `x_(Br)/y_(rk)= "Min" {x_(Bi)/y_(ik), y_(ik)>0}`
`="Min"{(6)/(5),(2)/(1)}`
`="Min"{6/5,2}`
`=6/5 ("correspnds to " x_(B2)/y_(22))`
Thus, vector `S_1` is selected to leave the basis, for `r=2`
The table with new entries in column `y_2` and the minimum ratio
| | Basis Inverse `B_1^(-1)` | | | Additional table | `B` | `X_B` | `beta_0` `Z'` | `beta_1` `x_5` | `beta_2` `S_1` | `beta_3` `A_1` | `y_2` `C_k-Z_k` | Min Ratio `(X_B)/(y_2)` | `x_1` | `x_2` | `S_2` | `Z'` | `0` | `1` | `0` | `0` | `0` | `-1` | --- | `-1` | `-1` | `0` | `x_5` | `-2` | `0` | `1` | `-1` | `0` | `-11` | --- | `-3` | `-6` | `1` | `S_1` | `6` | `0` | `0` | `1` | `0` | `5` | `6/5` | `2` | `5` | `0` | `A_1` | `2` | `0` | `0` | `0` | `1` | `1` | `2` | `1` | `1` | `-1` |
The table solution is now updated by replacing variable `S_1` with the variable `x_2` into the basis.
For this we apply the following row operations in the same way as in the simplex method
| `X_B` | `beta_1` | `beta_2` | `beta_3` | `y_2` | `R_1` | `0` | `0` | `0` | `0` | `-1` | `R_2` | `-2` | `1` | `-1` | `0` | `-11` | `R_3` | `6` | `0` | `1` | `0` | `5` | `R_4` | `2` | `0` | `0` | `1` | `1` |
`R_3`(new)`= R_3`(old)` -: 5``R_3`(old) = | `6` | | `0` | `1` | `0` | `R_3`(new)`= R_3`(old)` -: 5` | `6/5` | | `0` | `1/5` | `0` |
`R_1`(new)`= R_1`(old) + `R_3`(new)`R_1`(old) = | `0` | | `0` | `0` | `0` | `R_3`(new) = | `6/5` | | `0` | `1/5` | `0` | `R_1`(new)`= R_1`(old) + `R_3`(new) | `6/5` | | `0` | `1/5` | `0` |
`R_2`(new)`= R_2`(old) + `11 R_3`(new)`R_2`(old) = | `-2` | | `1` | `-1` | `0` | `R_3`(new) = | `6/5` | | `0` | `1/5` | `0` | `11 xx R_3`(new) = | `66/5` | | `0` | `11/5` | `0` | `R_2`(new)`= R_2`(old) + `11 R_3`(new) | `56/5` | | `1` | `6/5` | `0` |
`R_4`(new)`= R_4`(old) - `R_3`(new)`R_4`(old) = | `2` | | `0` | `0` | `1` | `R_3`(new) = | `6/5` | | `0` | `1/5` | `0` | `R_4`(new)`= R_4`(old) - `R_3`(new) | `4/5` | | `0` | `-1/5` | `1` |
The improved solution is
| | Basis Inverse `B_1^(-1)` | | | Additional table | `B` | `X_B` | `beta_0` `Z'` | `beta_1` `x_5` | `beta_2` `x_2` | `beta_3` `A_1` | `y_2` `C_k-Z_k` | Min Ratio `(X_B)/(y_2)` | `x_1` | `S_1` | `S_2` | `Z'` | `6/5` | `1` | `0` | `1/5` | `0` | | --- | `-1` | `0` | `0` | `x_5` | `56/5` | `0` | `1` | `6/5` | `0` | | --- | `-3` | `0` | `1` | `x_2` | `6/5` | `0` | `0` | `1/5` | `0` | | --- | `2` | `1` | `0` | `A_1` | `4/5` | `0` | `0` | `-1/5` | `1` | | --- | `1` | `0` | `-1` |
Iteration=2 : Repeat steps 3 to 5 to get new solution Step-3: To select the vector corresponding to a non-basic variable to enter into the basis, we compute `z_k-c_k="Min" {(z_j-c_j)<0;}`
`="Min"{(2^(nd)" row of " B_1^(-1)) ("Columns " a_j " not in basis")}`
`="Min"{[[0,1,6/5,0]] [[-1,0,0],[-3,0,1],[2,1,0],[1,0,-1]]}`
`="Min"{[[-3/5,6/5,1]]}`
`=-3/5` (correspnds to `z_1-c_1`)
Thus, vector `x_1` is selected to enter into the basis, for `k=1`
Step-4: To select a basic variable to leave the basis, we compute `y_k` for k=1, as follows
`y_1= B_1^(-1) a_1=[[1,0,1/5,0],[0,1,6/5,0],[0,0,1/5,0],[0,0,-1/5,1]] [[-1],[-3],[2],[1]]=[[-3/5],[-3/5],[2/5],[3/5]]`
and `X_B = [[6/5],[56/5],[6/5],[4/5]]`
Now, calculate the minimum ratio to select the basic variable to leave the basis `x_(Br)/y_(rk)= "Min" {x_(Bi)/y_(ik), y_(ik)>0}`
`="Min"{(6/5)/(2/5),(4/5)/(3/5)}`
`="Min"{3,4/3}`
`=4/3 ("correspnds to " x_(B3)/y_(31))`
Thus, vector `A_1` is selected to leave the basis, for `r=3`
The table with new entries in column `y_1` and the minimum ratio
| | Basis Inverse `B_1^(-1)` | | | Additional table | `B` | `X_B` | `beta_0` `Z'` | `beta_1` `x_5` | `beta_2` `x_2` | `beta_3` `A_1` | `y_1` `C_k-Z_k` | Min Ratio `(X_B)/(y_1)` | `x_1` | `S_1` | `S_2` | `Z'` | `6/5` | `1` | `0` | `1/5` | `0` | `-3/5` | --- | `-1` | `0` | `0` | `x_5` | `56/5` | `0` | `1` | `6/5` | `0` | `-3/5` | --- | `-3` | `0` | `1` | `x_2` | `6/5` | `0` | `0` | `1/5` | `0` | `2/5` | `3` | `2` | `1` | `0` | `A_1` | `4/5` | `0` | `0` | `-1/5` | `1` | `3/5` | `4/3` | `1` | `0` | `-1` |
The table solution is now updated by replacing variable `A_1` with the variable `x_1` into the basis.
For this we apply the following row operations in the same way as in the simplex method
| `X_B` | `beta_1` | `beta_2` | `beta_3` | `y_1` | `R_1` | `6/5` | `0` | `1/5` | `0` | `-3/5` | `R_2` | `56/5` | `1` | `6/5` | `0` | `-3/5` | `R_3` | `6/5` | `0` | `1/5` | `0` | `2/5` | `R_4` | `4/5` | `0` | `-1/5` | `1` | `3/5` |
`R_4`(new)`= R_4`(old) `xx5/3``R_4`(old) = | `4/5` | | `0` | `-1/5` | `1` | `R_4`(new)`= R_4`(old) `xx5/3` | `4/3` | | `0` | `-1/3` | `5/3` |
`R_1`(new)`= R_1`(old) + `3/5 R_4`(new)`R_1`(old) = | `6/5` | | `0` | `1/5` | `0` | `R_4`(new) = | `4/3` | | `0` | `-1/3` | `5/3` | `3/5 xx R_4`(new) = | `4/5` | | `0` | `-1/5` | `1` | `R_1`(new)`= R_1`(old) + `3/5 R_4`(new) | `2` | | `0` | `0` | `1` |
`R_2`(new)`= R_2`(old) + `3/5 R_4`(new)`R_2`(old) = | `56/5` | | `1` | `6/5` | `0` | `R_4`(new) = | `4/3` | | `0` | `-1/3` | `5/3` | `3/5 xx R_4`(new) = | `4/5` | | `0` | `-1/5` | `1` | `R_2`(new)`= R_2`(old) + `3/5 R_4`(new) | `12` | | `1` | `1` | `1` |
`R_3`(new)`= R_3`(old) - `2/5 R_4`(new)`R_3`(old) = | `6/5` | | `0` | `1/5` | `0` | `R_4`(new) = | `4/3` | | `0` | `-1/3` | `5/3` | `2/5 xx R_4`(new) = | `8/15` | | `0` | `-2/15` | `2/3` | `R_3`(new)`= R_3`(old) - `2/5 R_4`(new) | `2/3` | | `0` | `1/3` | `-2/3` |
The improved solution is
| | Basis Inverse `B_1^(-1)` | | | Additional table | `B` | `X_B` | `beta_0` `Z'` | `beta_1` `x_5` | `beta_2` `x_2` | `beta_3` `x_1` | `y_1` `C_k-Z_k` | Min Ratio `(X_B)/(y_1)` | `A_1` | `S_1` | `S_2` | `Z'` | `2` | `1` | `0` | `0` | `1` | | --- | `0` | `0` | `0` | `x_5` | `12` | `0` | `1` | `1` | `1` | | --- | `0` | `0` | `1` | `x_2` | `2/3` | `0` | `0` | `1/3` | `-2/3` | | --- | `0` | `1` | `0` | `x_1` | `4/3` | `0` | `0` | `-1/3` | `5/3` | | --- | `1` | `0` | `-1` |
Iteration=3 : Repeat steps 3 to 5 to get new solution Step-3: To select the vector corresponding to a non-basic variable to enter into the basis, we compute `z_k-c_k="Min" {(z_j-c_j)<0;}`
`="Min"{(2^(nd)" row of " B_1^(-1)) ("Columns " a_j " not in basis")}`
`="Min"{[[0,1,1,1]] [[0,0,0],[0,0,1],[0,1,0],[1,0,-1]]}`
`="Min"{[[1,1,0]]}`
Since all `Z_j-C_j >= 0`
Hence, optimal solution is arrived with value of variables as : `x_1=4/3,x_2=2/3`
Max `Z=2`
Phase-2 We maximize `Z'` instead of `x_5`
Artificial variables will be removed from additional table
| | Basis Inverse `B_1^(-1)` | | | Additional table | `B` | `X_B` | `beta_0` `Z'` | `beta_1` `x_5` | `beta_2` `x_2` | `beta_3` `x_1` | `y_0` `C_k-Z_k` | Min Ratio `(X_B)/(y_0)` | `S_1` | `S_2` | `Z'` | `2` | `1` | `0` | `0` | `1` | | --- | `0` | `0` | `x_5` | `12` | `0` | `1` | `1` | `1` | | --- | `0` | `1` | `x_2` | `2/3` | `0` | `0` | `1/3` | `-2/3` | | --- | `1` | `0` | `x_1` | `4/3` | `0` | `0` | `-1/3` | `5/3` | | --- | `0` | `-1` |
Iteration=1 : Repeat steps 3 to 5 to get new solution Step-3: To select the vector corresponding to a non-basic variable to enter into the basis, we compute `z_k-c_k="Min" {(z_j-c_j)<0;}`
`="Min"{(1^(st)" row of " B_1^(-1)) ("Columns " a_j " not in basis")}`
`="Min"{[[1,0,0,1]] [[0,0],[0,1],[1,0],[0,-1]]}`
`="Min"{[[0,-1]]}`
`=-1` (correspnds to `z_2-c_2`)
Thus, vector `S_2` is selected to enter into the basis, for `k=2`
Step-4: To select a basic variable to leave the basis, we compute `y_k` for k=2, as follows
`y_2= B_1^(-1) a_2=[[1,0,0,1],[0,1,1,1],[0,0,1/3,-2/3],[0,0,-1/3,5/3]] [[0],[1],[0],[-1]]=[[-1],[0],[2/3],[-5/3]]`
and `X_B = [[2],[12],[2/3],[4/3]]`
Now, calculate the minimum ratio to select the basic variable to leave the basis `x_(Br)/y_(rk)= "Min" {x_(Bi)/y_(ik), y_(ik)>0}`
`="Min"{(2/3)/(2/3)}`
`="Min"{1}`
`=1 ("correspnds to " x_(B2)/y_(22))`
Thus, vector `x_2` is selected to leave the basis, for `r=2`
The table with new entries in column `y_2` and the minimum ratio
| | Basis Inverse `B_1^(-1)` | | | Additional table | `B` | `X_B` | `beta_0` `Z'` | `beta_1` `x_5` | `beta_2` `x_2` | `beta_3` `x_1` | `y_2` `C_k-Z_k` | Min Ratio `(X_B)/(y_2)` | `S_1` | `S_2` | `Z'` | `2` | `1` | `0` | `0` | `1` | `-1` | --- | `0` | `0` | `x_5` | `12` | `0` | `1` | `1` | `1` | `0` | --- | `0` | `1` | `x_2` | `2/3` | `0` | `0` | `1/3` | `-2/3` | `2/3` | `1` | `1` | `0` | `x_1` | `4/3` | `0` | `0` | `-1/3` | `5/3` | `-5/3` | --- | `0` | `-1` |
The table solution is now updated by replacing variable `x_2` with the variable `S_2` into the basis.
For this we apply the following row operations in the same way as in the simplex method
| `X_B` | `beta_1` | `beta_2` | `beta_3` | `y_2` | `R_1` | `2` | `0` | `0` | `1` | `-1` | `R_2` | `12` | `1` | `1` | `1` | `0` | `R_3` | `2/3` | `0` | `1/3` | `-2/3` | `2/3` | `R_4` | `4/3` | `0` | `-1/3` | `5/3` | `-5/3` |
`R_3`(new)`= R_3`(old) `xx3/2``R_3`(old) = | `2/3` | | `0` | `1/3` | `-2/3` | `R_3`(new)`= R_3`(old) `xx3/2` | `1` | | `0` | `1/2` | `-1` |
`R_1`(new)`= R_1`(old) + `R_3`(new)`R_1`(old) = | `2` | | `0` | `0` | `1` | `R_3`(new) = | `1` | | `0` | `1/2` | `-1` | `R_1`(new)`= R_1`(old) + `R_3`(new) | `3` | | `0` | `1/2` | `0` |
`R_2`(new)`= R_2`(old)`R_2`(old) = | `12` | | `1` | `1` | `1` | `R_2`(new)`= R_2`(old) | `12` | | `1` | `1` | `1` |
`R_4`(new)`= R_4`(old) + `5/3 R_3`(new)`R_4`(old) = | `4/3` | | `0` | `-1/3` | `5/3` | `R_3`(new) = | `1` | | `0` | `1/2` | `-1` | `5/3 xx R_3`(new) = | `5/3` | | `0` | `5/6` | `-5/3` | `R_4`(new)`= R_4`(old) + `5/3 R_3`(new) | `3` | | `0` | `1/2` | `0` |
The improved solution is
| | Basis Inverse `B_1^(-1)` | | | Additional table | `B` | `X_B` | `beta_0` `Z'` | `beta_1` `x_5` | `beta_2` `S_2` | `beta_3` `x_1` | `y_2` `C_k-Z_k` | Min Ratio `(X_B)/(y_2)` | `S_1` | `x_2` | `Z'` | `3` | `1` | `0` | `1/2` | `0` | | --- | `0` | `0` | `x_5` | `12` | `0` | `1` | `1` | `1` | | --- | `0` | `0` | `S_2` | `1` | `0` | `0` | `1/2` | `-1` | | --- | `1` | `1` | `x_1` | `3` | `0` | `0` | `1/2` | `0` | | --- | `0` | `0` |
Iteration=2 : Repeat steps 3 to 5 to get new solution Step-3: To select the vector corresponding to a non-basic variable to enter into the basis, we compute `z_k-c_k="Min" {(z_j-c_j)<0;}`
`="Min"{(1^(st)" row of " B_1^(-1)) ("Columns " a_j " not in basis")}`
`="Min"{[[1,0,1/2,0]] [[0,0],[0,0],[1,1],[0,0]]}`
`="Min"{[[1/2,1/2]]}`
Since all `Z_j-C_j >= 0`
Hence, optimal solution is arrived with value of variables as : `x_1=3,x_2=0`
Max `Z=3`
This material is intended as a summary. Use your textbook for detail explanation. Any bug, improvement, feedback then
|