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` |
| `Z` | `+` | | | | | | | | | | | | | | | | `` | `` | `A_1` | ` + ` | `` | `A_2` | = | `0` |
|
| `` | `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` |
|
Simplex tableau is
Tableau-0
| `"Basis"` | `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `A_1` | `A_2` | `RHS` | |
| `R_1` `Z` | `0` | `0` | `0` | `0` | `0` | `1` | `1` | `0` | |
| `R_2` `A_1` | `3` | `2` | `-1` | `0` | `0` | `1` | `0` | `3` | |
| `R_3` `A_2` | `1` | `4` | `0` | `-1` | `0` | `0` | `1` | `4` | |
| `R_4` `S_3` | `1` | `1` | `0` | `0` | `1` | `0` | `0` | `5` | |
Make the Z-row consistent with the rest of the table (set coefficient of basis variables to 0 in Z-row)
`R_1`(new)`= R_1`(old) - `R_2`(old)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `A_1` | `A_2` | `RHS` |
| `R_1`(old) = | `0` | `0` | `0` | `0` | `0` | `1` | `1` | `0` |
| `R_2`(old) = | `3` | `2` | `-1` | `0` | `0` | `1` | `0` | `3` |
| `R_1`(new)`= R_1`(old) - `R_2`(old) | `-3` | `-2` | `1` | `0` | `0` | `0` | `1` | `-3` |
`R_1`(new)`= R_1`(old) - `R_3`(old)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `A_1` | `A_2` | `RHS` |
| `R_1`(old) = | `-3` | `-2` | `1` | `0` | `0` | `0` | `1` | `-3` |
| `R_3`(old) = | `1` | `4` | `0` | `-1` | `0` | `0` | `1` | `4` |
| `R_1`(new)`= R_1`(old) - `R_3`(old) | `-4` | `-6` | `1` | `1` | `0` | `0` | `0` | `-7` |
Tableau-1
| `"Basis"` | `x_1` | `x_2``darr` | `S_1` | `S_2` | `S_3` | `A_1` | `A_2` | `RHS` | `"Ratio"=(RHS)/(x_2)` |
| `R_1` `Z` | `-4` | `-6` | `1` | `1` | `0` | `0` | `0` | `-7` | |
| `R_2` `A_1` | `3` | `2` | `-1` | `0` | `0` | `1` | `0` | `3` | `(3)/(2)=1.5` |
| `R_3` `A_2` | `1` | `(4)` | `0` | `-1` | `0` | `0` | `1` | `4` | `(4)/(4)=1``->` |
| `R_4` `S_3` | `1` | `1` | `0` | `0` | `1` | `0` | `0` | `5` | `(5)/(1)=5` |
Most Negative `Z` is `-6`. So,
the entering variable is `x_2`.
Minimum ratio is `1`. So,
the leaving basis variable is `A_2`.
`:.`
The pivot element is `4`.
Entering `=x_2`, Departing `=A_2`, Key Element `=4`
`R_3`(new)`= R_3`(old) `-: 4`
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `A_1` | `A_2` | `RHS` |
| `R_3`(old) = | `1` | `4` | `0` | `-1` | `0` | `0` | `1` | `4` |
| `R_3`(new)`= R_3`(old) `-: 4` | `0.25` | `1` | `0` | `-0.25` | `0` | `0` | `0.25` | `1` |
`R_2`(new)`= R_2`(old) - `2 R_3`(new)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `A_1` | `A_2` | `RHS` |
| `R_2`(old) = | `3` | `2` | `-1` | `0` | `0` | `1` | `0` | `3` |
| `R_3`(new) = | `0.25` | `1` | `0` | `-0.25` | `0` | `0` | `0.25` | `1` |
| `2 xx R_3`(new) = | `0.5` | `2` | `0` | `-0.5` | `0` | `0` | `0.5` | `2` |
| `R_2`(new)`= R_2`(old) - `2 R_3`(new) | `2.5` | `0` | `-1` | `0.5` | `0` | `1` | `-0.5` | `1` |
`R_4`(new)`= R_4`(old) - `R_3`(new)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `A_1` | `A_2` | `RHS` |
| `R_4`(old) = | `1` | `1` | `0` | `0` | `1` | `0` | `0` | `5` |
| `R_3`(new) = | `0.25` | `1` | `0` | `-0.25` | `0` | `0` | `0.25` | `1` |
| `R_4`(new)`= R_4`(old) - `R_3`(new) | `0.75` | `0` | `0` | `0.25` | `1` | `0` | `-0.25` | `4` |
`R_1`(new)`= R_1`(old) - `-6 R_3`(new)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `A_1` | `A_2` | `RHS` |
| `R_1`(old) = | `-4` | `-6` | `1` | `1` | `0` | `0` | `0` | `-7` |
| `R_3`(new) = | `0.25` | `1` | `0` | `-0.25` | `0` | `0` | `0.25` | `1` |
| `-6 xx R_3`(new) = | `-1.5` | `-6` | `0` | `1.5` | `0` | `0` | `-1.5` | `-6` |
| `R_1`(new)`= R_1`(old) - `-6 R_3`(new) | `-2.5` | `0` | `1` | `-0.5` | `0` | `0` | `1.5` | `-1` |
Tableau-2
| `"Basis"` | `x_1``darr` | `x_2` | `S_1` | `S_2` | `S_3` | `A_1` | `A_2` | `RHS` | `"Ratio"=(RHS)/(x_1)` |
| `R_1` `Z` | `-2.5` | `0` | `1` | `-0.5` | `0` | `0` | `1.5` | `-1` | |
| `R_2` `A_1` | `(2.5)` | `0` | `-1` | `0.5` | `0` | `1` | `-0.5` | `1` | `(1)/(2.5)=0.4``->` |
| `R_3` `x_2` | `0.25` | `1` | `0` | `-0.25` | `0` | `0` | `0.25` | `1` | `(1)/(0.25)=4` |
| `R_4` `S_3` | `0.75` | `0` | `0` | `0.25` | `1` | `0` | `-0.25` | `4` | `(4)/(0.75)=5.3333` |
Most Negative `Z` is `-2.5`. So,
the entering variable is `x_1`.
Minimum ratio is `0.4`. So,
the leaving basis variable is `A_1`.
`:.`
The pivot element is `2.5`.
Entering `=x_1`, Departing `=A_1`, Key Element `=2.5`
`R_2`(new)`= R_2`(old) `-: 2.5`
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `A_1` | `A_2` | `RHS` |
| `R_2`(old) = | `2.5` | `0` | `-1` | `0.5` | `0` | `1` | `-0.5` | `1` |
| `R_2`(new)`= R_2`(old) `-: 2.5` | `1` | `0` | `-0.4` | `0.2` | `0` | `0.4` | `-0.2` | `0.4` |
`R_3`(new)`= R_3`(old) - `0.25 R_2`(new)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `A_1` | `A_2` | `RHS` |
| `R_3`(old) = | `0.25` | `1` | `0` | `-0.25` | `0` | `0` | `0.25` | `1` |
| `R_2`(new) = | `1` | `0` | `-0.4` | `0.2` | `0` | `0.4` | `-0.2` | `0.4` |
| `0.25 xx R_2`(new) = | `0.25` | `0` | `-0.1` | `0.05` | `0` | `0.1` | `-0.05` | `0.1` |
| `R_3`(new)`= R_3`(old) - `0.25 R_2`(new) | `0` | `1` | `0.1` | `-0.3` | `0` | `-0.1` | `0.3` | `0.9` |
`R_4`(new)`= R_4`(old) - `0.75 R_2`(new)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `A_1` | `A_2` | `RHS` |
| `R_4`(old) = | `0.75` | `0` | `0` | `0.25` | `1` | `0` | `-0.25` | `4` |
| `R_2`(new) = | `1` | `0` | `-0.4` | `0.2` | `0` | `0.4` | `-0.2` | `0.4` |
| `0.75 xx R_2`(new) = | `0.75` | `0` | `-0.3` | `0.15` | `0` | `0.3` | `-0.15` | `0.3` |
| `R_4`(new)`= R_4`(old) - `0.75 R_2`(new) | `0` | `0` | `0.3` | `0.1` | `1` | `-0.3` | `-0.1` | `3.7` |
`R_1`(new)`= R_1`(old) - `-2.5 R_2`(new)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `A_1` | `A_2` | `RHS` |
| `R_1`(old) = | `-2.5` | `0` | `1` | `-0.5` | `0` | `0` | `1.5` | `-1` |
| `R_2`(new) = | `1` | `0` | `-0.4` | `0.2` | `0` | `0.4` | `-0.2` | `0.4` |
| `-2.5 xx R_2`(new) = | `-2.5` | `0` | `1` | `-0.5` | `0` | `-1` | `0.5` | `-1` |
| `R_1`(new)`= R_1`(old) - `-2.5 R_2`(new) | `0` | `0` | `0` | `0` | `0` | `1` | `1` | `0` |
Tableau-3
| `"Basis"` | `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `A_1` | `A_2` | `RHS` | |
| `R_1` `Z` | `0` | `0` | `0` | `0` | `0` | `1` | `1` | `0` | |
| `R_2` `x_1` | `1` | `0` | `-0.4` | `0.2` | `0` | `0.4` | `-0.2` | `0.4` | |
| `R_3` `x_2` | `0` | `1` | `0.1` | `-0.3` | `0` | `-0.1` | `0.3` | `0.9` | |
| `R_4` `S_3` | `0` | `0` | `0.3` | `0.1` | `1` | `-0.3` | `-0.1` | `3.7` | |
Since all `Z_j >= 0`
Hence, optimal solution is arrived with value of variables as :
`x_1=0.4,x_2=0.9`
Max `Z=0`
-->Phase-2<--
we eliminate the artificial variables and change the objective function for the original,
`Z - 5x_1 - 8x_2=0`
Simplex tableau is
Tableau-0
| `"Basis"` | `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `RHS` | |
| `R_1` `Z` | `-5` | `-8` | `0` | `0` | `0` | `0` | |
| `R_2` `x_1` | `1` | `0` | `-0.4` | `0.2` | `0` | `0.4` | |
| `R_3` `x_2` | `0` | `1` | `0.1` | `-0.3` | `0` | `0.9` | |
| `R_4` `S_3` | `0` | `0` | `0.3` | `0.1` | `1` | `3.7` | |
Make the Z-row consistent with the rest of the table (set coefficient of basis variables to 0 in Z-row)
`R_1`(new)`= R_1`(old) + `5 R_2`(old)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `RHS` |
| `R_1`(old) = | `-5` | `-8` | `0` | `0` | `0` | `0` |
| `R_2`(old) = | `1` | `0` | `-0.4` | `0.2` | `0` | `0.4` |
| `5 xx R_2`(new) = | `5` | `0` | `-2` | `1` | `0` | `2` |
| `R_1`(new)`= R_1`(old) + `5 R_2`(old) | `0` | `-8` | `-2` | `1` | `0` | `2` |
`R_1`(new)`= R_1`(old) + `8 R_3`(old)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `RHS` |
| `R_1`(old) = | `0` | `-8` | `-2` | `1` | `0` | `2` |
| `R_3`(old) = | `0` | `1` | `0.1` | `-0.3` | `0` | `0.9` |
| `8 xx R_3`(new) = | `0` | `8` | `0.8` | `-2.4` | `0` | `7.2` |
| `R_1`(new)`= R_1`(old) + `8 R_3`(old) | `0` | `0` | `-1.2` | `-1.4` | `0` | `9.2` |
Tableau-1
| `"Basis"` | `x_1` | `x_2` | `S_1` | `S_2``darr` | `S_3` | `RHS` | `"Ratio"=(RHS)/(S_2)` |
| `R_1` `Z` | `0` | `0` | `-1.2` | `-1.4` | `0` | `9.2` | |
| `R_2` `x_1` | `1` | `0` | `-0.4` | `(0.2)` | `0` | `0.4` | `(0.4)/(0.2)=2``->` |
| `R_3` `x_2` | `0` | `1` | `0.1` | `-0.3` | `0` | `0.9` | `(0.9)/(-0.3)` (ignore, denominator is -ve) |
| `R_4` `S_3` | `0` | `0` | `0.3` | `0.1` | `1` | `3.7` | `(3.7)/(0.1)=37` |
Most Negative `Z` is `-1.4`. So,
the entering variable is `S_2`.
Minimum ratio is `2`. So,
the leaving basis variable is `x_1`.
`:.`
The pivot element is `0.2`.
Entering `=S_2`, Departing `=x_1`, Key Element `=0.2`
`R_2`(new)`= R_2`(old) `-: 0.2`
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `RHS` |
| `R_2`(old) = | `1` | `0` | `-0.4` | `0.2` | `0` | `0.4` |
| `R_2`(new)`= R_2`(old) `-: 0.2` | `5` | `0` | `-2` | `1` | `0` | `2` |
`R_3`(new)`= R_3`(old) + `0.3 R_2`(new)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `RHS` |
| `R_3`(old) = | `0` | `1` | `0.1` | `-0.3` | `0` | `0.9` |
| `R_2`(new) = | `5` | `0` | `-2` | `1` | `0` | `2` |
| `0.3 xx R_2`(new) = | `1.5` | `0` | `-0.6` | `0.3` | `0` | `0.6` |
| `R_3`(new)`= R_3`(old) + `0.3 R_2`(new) | `1.5` | `1` | `-0.5` | `0` | `0` | `1.5` |
`R_4`(new)`= R_4`(old) - `0.1 R_2`(new)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `RHS` |
| `R_4`(old) = | `0` | `0` | `0.3` | `0.1` | `1` | `3.7` |
| `R_2`(new) = | `5` | `0` | `-2` | `1` | `0` | `2` |
| `0.1 xx R_2`(new) = | `0.5` | `0` | `-0.2` | `0.1` | `0` | `0.2` |
| `R_4`(new)`= R_4`(old) - `0.1 R_2`(new) | `-0.5` | `0` | `0.5` | `0` | `1` | `3.5` |
`R_1`(new)`= R_1`(old) - `-1.4 R_2`(new)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `RHS` |
| `R_1`(old) = | `0` | `0` | `-1.2` | `-1.4` | `0` | `9.2` |
| `R_2`(new) = | `5` | `0` | `-2` | `1` | `0` | `2` |
| `-1.4 xx R_2`(new) = | `-7` | `0` | `2.8` | `-1.4` | `0` | `-2.8` |
| `R_1`(new)`= R_1`(old) - `-1.4 R_2`(new) | `7` | `0` | `-4` | `0` | `0` | `12` |
Tableau-2
| `"Basis"` | `x_1` | `x_2` | `S_1``darr` | `S_2` | `S_3` | `RHS` | `"Ratio"=(RHS)/(S_1)` |
| `R_1` `Z` | `7` | `0` | `-4` | `0` | `0` | `12` | |
| `R_2` `S_2` | `5` | `0` | `-2` | `1` | `0` | `2` | `(2)/(-2)` (ignore, denominator is -ve) |
| `R_3` `x_2` | `1.5` | `1` | `-0.5` | `0` | `0` | `1.5` | `(1.5)/(-0.5)` (ignore, denominator is -ve) |
| `R_4` `S_3` | `-0.5` | `0` | `(0.5)` | `0` | `1` | `3.5` | `(3.5)/(0.5)=7``->` |
Most Negative `Z` is `-4`. So,
the entering variable is `S_1`.
Minimum ratio is `7`. So,
the leaving basis variable is `S_3`.
`:.`
The pivot element is `0.5`.
Entering `=S_1`, Departing `=S_3`, Key Element `=0.5`
`R_4`(new)`= R_4`(old) `-: 0.5`
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `RHS` |
| `R_4`(old) = | `-0.5` | `0` | `0.5` | `0` | `1` | `3.5` |
| `R_4`(new)`= R_4`(old) `-: 0.5` | `-1` | `0` | `1` | `0` | `2` | `7` |
`R_2`(new)`= R_2`(old) + `2 R_4`(new)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `RHS` |
| `R_2`(old) = | `5` | `0` | `-2` | `1` | `0` | `2` |
| `R_4`(new) = | `-1` | `0` | `1` | `0` | `2` | `7` |
| `2 xx R_4`(new) = | `-2` | `0` | `2` | `0` | `4` | `14` |
| `R_2`(new)`= R_2`(old) + `2 R_4`(new) | `3` | `0` | `0` | `1` | `4` | `16` |
`R_3`(new)`= R_3`(old) + `0.5 R_4`(new)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `RHS` |
| `R_3`(old) = | `1.5` | `1` | `-0.5` | `0` | `0` | `1.5` |
| `R_4`(new) = | `-1` | `0` | `1` | `0` | `2` | `7` |
| `0.5 xx R_4`(new) = | `-0.5` | `0` | `0.5` | `0` | `1` | `3.5` |
| `R_3`(new)`= R_3`(old) + `0.5 R_4`(new) | `1` | `1` | `0` | `0` | `1` | `5` |
`R_1`(new)`= R_1`(old) - `-4 R_4`(new)
| `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `RHS` |
| `R_1`(old) = | `7` | `0` | `-4` | `0` | `0` | `12` |
| `R_4`(new) = | `-1` | `0` | `1` | `0` | `2` | `7` |
| `-4 xx R_4`(new) = | `4` | `0` | `-4` | `0` | `-8` | `-28` |
| `R_1`(new)`= R_1`(old) - `-4 R_4`(new) | `3` | `0` | `0` | `0` | `8` | `40` |
Tableau-3
| `"Basis"` | `x_1` | `x_2` | `S_1` | `S_2` | `S_3` | `RHS` | |
| `R_1` `Z` | `3` | `0` | `0` | `0` | `8` | `40` | |
| `R_2` `S_2` | `3` | `0` | `0` | `1` | `4` | `16` | |
| `R_3` `x_2` | `1` | `1` | `0` | `0` | `1` | `5` | |
| `R_4` `S_1` | `-1` | `0` | `1` | `0` | `2` | `7` | |
Since all `Z_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