Simplex Algorithm: Step by Step
Simplex Algorithm: Step by Step
Simplex Algorithm: Step by Step
This note shows the step by step procedure how to solve the problem using Simplex Algorithm (method).
Let’s consider the following LP model.
Max Z = 3 x1 + 5x2
s.t. x1 ≤ 4
2x2 ≤ 12
3 x1 + 2x2 ≤ 18
x1, x2 ≥ 0
Iteration 0: setting
1. Change the original problem to standard form (Augmented form of the model). See lecture note
for how to make standard form.
B.V. Z X1 X2 X3 X4 X5 RHS
Z 1 -3 -5 0 0 0 0
X3 0 1 0 1 0 0 4
X4 0 0 2 0 1 0 12
X5 0 3 2 0 0 1 18
Note that the basic variables are the slack or excess variables at the setting.
Solution at this tableau: (X1, X2, X3, X4, X5) = (0, 0, 4, 12, 18) with Z = 0
*the right hand side (RHS) values are the solution.
Note: Basic variables (x3, x4 and x5) make identity matrix (see shaded area). In every tableau, at
each iteration, basic variables always will make identity matrix.
Iteration 1:
The cell in intersection of entering and leaving variable is called “pivot.” See the table below
(shaded cell) in this example.
B.V. Z X1 X2 X3 X4 X5 RHS
Z
X3
X4 2
X5
B.V. Z X1 X2 X3 X4 X5 RHS
Z
X3
X2 0/2 0/2 2/2 0/2 1/2 0/2 12/2
X5
B.V. Z X1 X2 X3 X4 X5 RHS
Z
X3
X2 0 0 1 0 1/2 0 6
X5
Optimization
Calculations to update the table (to make 0 for X2 column entries except pivot).
Old Z-row) 1 -3 -5 0 0 0 0
+ New X2-row ×5) 0 0 5 0 5/2 0 30
New Z-row) 1 -3 0 0 5/2 0 30
Old X5-row) 0 3 2 0 0 1 18
+ New X2-row ×-2) 0 0 -2 0 -1 0 -12
New X5-row) 0 3 0 0 -1 1 6
B.V. Z X1 X2 X3 X4 X5 RHS
Z 1 -3 0 0 5/2 0 30
X3 0 1 0 1 0 0 4
X2 0 0 1 0 1/2 0 6
X5 0 3 0 0 -1 1 6
• Note that basic variables are X3 = 4, X2 = 6, and X5 = 30 and non-basic variables are X1 = X4 = 0.
• Solution at this tableau: (X1, X2, X3, X4, X5) = (0, 6, 4, 0, 6) with Z = 30 (see RHS value in Z-row)
• Also note that columns X3, X2 and X5 make the identity matrix (exclude Z-row).
Iteration 2:
Old X3-row) 0 1 0 1 0 0 4
+ New X1-row ×-1) 0 -1 0 0 1/3 -1/3 -2
New X3-row) 0 0 0 1 1/3 -1/3 2
B.V. Z X1 X2 X3 X4 X5 RHS
Z 1 0 0 0 3/2 1 36
X3 0 0 0 1 1/3 -1/3 2
X2 0 0 1 0 1/2 0 6
X1 0 1 0 0 -1/3 1/3 2
• Note that basic variables are X3 = 2, X2 = 6, and X1 = 2 and non-basic variables are X4 = X5 = 0.
• Solution at this tableau: (X1, X2, X3, X4, X5) = (2, 6, 2, 0, 0) with Z = 36
• Also note that columns X3, X2 and X1 make the identity matrix.
At the second iteration, the simplex algorithm found the optimal solution. The Optimal solution is (X1,
X2, X3, X4, X5) = (2, 6, 2, 0, 0) and this generates the objective value 36.