Resolve using the Simplex Method the following problem:
| Maximize | Z = f(x,y) = 3x + 2y |
| subject to: | 2x + y ≤ 18 |
| 2x + 3y ≤ 42 | |
| 3x + y ≤ 24 | |
| x ≥ 0 , y ≥ 0 |
Are considerated the following phases:
1. Turning the inequalities into equalities
Introduce a slack variable for each restrictions of the type ≤ to turn them into equalities, giving the following linear equation system:
| 2x + y + r = 18 |
| 2x + 3y + s = 42 |
| 3x +y + t = 24 |
2. Equaling the objective function to zero
| - 3x - 2y + Z = 0 |
3. Writing the initial board simplex
At columns will appear all basic variables of the problem and the slack/surplus variables. At rows you can observe, for each restriction the slack variables with its coefficients of obtained equalities, and the last row with the values resulting of substitute the value of every variable at function objetive, and operate just as was explained in the theory to get the left values from the row:
| Board I . 1st iteration | |||||||
| 3 | 2 | 0 | 0 | 0 | |||
| Base | Cb | P0 | P1 | P2 | P3 | P4 | P5 |
| P3 | 0 | 18 | 2 | 1 | 1 | 0 | 0 |
| P4 | 0 | 42 | 2 | 3 | 0 | 1 | 0 |
| P5 | 0 | 24 | 3 | 1 | 0 | 0 | 1 |
| Z | 0 | -3 | -2 | 0 | 0 | 0 | |
4. Halt condition
When at the Z row there aren't negatives values , the optimal solution of the problem has been reached. In such a case, the algorithm has finished. If it were not so, the following steps must be executed.
5. Input-output base condition
6. Calculating the coefficients of the new board.
The new coefficients of the pivot row , t (P5), are obtained dividing all of the coefficients from such row among the pivot element, 3, that is the one necessary to turn into 1.
Following, with Gaussian reduction we do zeros the remainders terms of that column, with it we get the new coefficients from the other rows including that belong to the objective function row Z.
Also, it can be done in the following way:
Pivot row: New pivot row = (Old pivot row) / (Pivot) Remainders rows: New row = (Old row) - (Coefficients from old row placed at incoming variable's colum) x (New pivot row) Lets see an example, once the pivot row has been calculated (x's (P1) row at Board II):
|
| Board II . 2nd iteration | |||||||
| 3 | 2 | 0 | 0 | 0 | |||
| Base | Cb | P0 | P1 | P2 | P3 | P4 | P5 |
| P3 | 0 | 2 | 0 | 1/3 | 1 | 0 | -2/3 |
| P4 | 0 | 26 | 0 | 7/3 | 0 | 1 | -2/3 |
| P1 | 3 | 8 | 1 | 1/3 | 0 | 0 | 1/3 |
| Z | 24 | 0 | -1 | 0 | 0 | 1 | |
Can be noticed that we have not attained the halt condition because at Z row, there is one negative, -1. We must do another iteration:
Working of analogous form that before, we obtain the board:
| Board III . 3rd iteration | |||||||
| 3 | 2 | 0 | 0 | 0 | |||
| Base | Cb | P0 | P1 | P2 | P3 | P4 | P5 |
| P2 | 2 | 6 | 0 | 1 | 3 | 0 | -2 |
| P4 | 0 | 12 | 0 | 0 | -7 | 1 | 4 |
| P1 | 3 | 6 | 1 | 0 | -1 | 0 | 1 |
| Z | 30 | 0 | 0 | 3 | 0 | -1 | |
As you can see, there is a element with minus sign in Z row, - 1, it means that we have not come still to the optimal solution. It is necessary to repeat the process:
We get the board:
| Board IV . 4th iteration | |||||||
| 3 | 2 | 0 | 0 | 0 | |||
| Base | Cb | P0 | P1 | P2 | P3 | P4 | P5 |
| P2 | 2 | 12 | 0 | 1 | -1/2 | 1/2 | 0 |
| P5 | 0 | 3 | 0 | 0 | -7/4 | 1/4 | 1 |
| P1 | 3 | 3 | 1 | 0 | 3/4 | -1/4 | 0 |
| Z | 33 | 0 | 0 | 5/4 | 1/4 | 0 | |
As in the last row, all the coefficients are positive, then the halt condition is obey, getting the optimal solution.
The optimal solution is given by the Z value, at the column of the solution values, in this case: 33. In the same column, you can notice the point where it is reached, watching the rows correspondents to the decision variables that come at base: (x,y) = (3,12)