Simplex Method
Simplex Method
Objective Function:
Numerical optimization software
Maximize: Z = 3X1 - 2X2 - 3X3 + 3X4
Subject to:
2X1 - 1X2 - 1X3 + 1X4 ≤ 4
X 1 , X2 , X3 , X4 ≥ 0
The problem will be adapted to the standard linear programming model, adding the
slack, surplus and / or artificial variables in each of the constraints:
Constraint 1: It has a sign "≤" (less than or equal) so the slack variable will
be added S1.
Constraint 2: It has a negative independent term. All coefficients will be
multiplied by -1 and their sign will be changed from "≤" (less than or
equal) to "≥" (greater than or equal). In this way, it corresponds to subtract
the surplus variable S2 and add the artificial variable A1.
Constraint 3: It has a sign "≤" (less than or equal) so the slack variable will
be added S3.
Constraint 4: It has a negative independent term. All coefficients will be
multiplied by -1 and their sign will be changed from "≤" (less than or
equal) to "≥" (greater than or equal). In this way, it corresponds to subtract
the surplus variable S4 and add the artificial variable A2.
The problem has artificial variables so we will use the two-phase method. In the
first phase, the objective function seeks to minimize the sum of the artificial
variables.
https://www.pmcalculators.com/simplex-method-calculator/ 1/5
13/04/2025 00:34 Simplex Method Calculator - Two Phase Online 🥇
The problem is shown below in standard form. The coefficient 0 (zero) will be placed
where it corresponds to create our table:
Objective Function:
Maximize: Z = 0X1 + 0X2 + 0X3 + 0X4 + 0S1 + 0S2 + 0S3 + 0S4 + 1A1 + 1A2
Subject to:
2X1 - 1X2 - 1X3 + 1X4 + 1S1 + 0S2 + 0S3 + 0S4 + 0A1 + 0A2 = 4
1X1 + 1X2 + 1X3 - 1X4 + 0S1 - 1S2 + 0S3 + 0S4 + 1A1 + 0A2 = 5
2X1 - 3X2 + 3X3 - 3X4 + 0S1 + 0S2 + 1S3 + 0S4 + 0A1 + 0A2 = 6
-2X1 - 3X2 + 3X3 - 3X4 + 0S1 + 0S2 + 0S3 - 1S4 + 0A1 + 1A2 = 6
Solution
Initial Table - Phase I
Ta ble 1 Cj 0 0 0 0 0 0 0 0 1 1
Cb B a se X1 X2 X3 X4 S1 S2 S3 S4 A1 A2 R
0 S1 2 -1 -1 1 1 0 0 0 0 0 4
1 A1 1 1 1 -1 0 -1 0 0 1 0 5
0 S3 2 -3 3 -3 0 0 1 0 0 0 6
1 A2 -2 -3 3 -3 0 0 0 -1 0 1 6
https://www.pmcalculators.com/simplex-method-calculator/ 2/5
13/04/2025 00:34 Simplex Method Calculator - Two Phase Online 🥇
Z -1 -2 4 -4 0 -1 0 -1 0 0 11
Enter the variable X3 and the variable S3 leaves the base. The pivot element is 3
Iteration 1
Ta ble 2 Cj 0 0 0 0 0 0 0 0 1 1
Cb B a se X1 X2 X3 X4 S1 S2 S3 S4 A1 A2 R
0 S1 8/3 -2 0 0 1 0 1/3 0 0 0 6
1 A1 1/3 2 0 0 0 -1 -1/3 0 1 0 3
0 X3 2/3 -1 1 -1 0 0 1/3 0 0 0 2
1 A2 -4 0 0 0 0 0 -1 -1 0 1 0
Z -11/3 2 0 0 0 -1 -4/3 -1 0 0 3
Enter the variable X2 and the variable A1 leaves the base. The pivot element is 2
Iteration 2
Ta ble 3 Cj 0 0 0 0 0 0 0 0 1 1
Cb Base X1 X2 X3 X4 S1 S2 S3 S4 A1 A2 R
0 S1 3 0 0 0 1 -1 0 0 1 0 9
https://www.pmcalculators.com/simplex-method-calculator/ 3/5
13/04/2025 00:34 Simplex Method Calculator - Two Phase Online 🥇
1 A2 -4 0 0 0 0 0 -1 -1 0 1 0
Z -4 0 0 0 0 0 -1 -1 -1 0 0
The iterations of the first phase have been completed and there are artificial variables
in the base. However, they have a value of 0, so their rows are linearly dependent and
can be removed from the matrix. We go to the second phase:
Ta ble 1 Cj 3 -2 -3 3 0 0 0 0
Cb Base X1 X2 X3 X4 S1 S2 S3 S4 R
0 S1 3 0 0 0 1 -1 0 0 9
Enter the variable X1 and the variable S1 leaves the base. The pivot element is 3
Iteration 1
Ta ble 2 Cj 3 -2 -3 3 0 0 0 0
Cb B a se X1 X2 X3 X4 S1 S2 S3 S4 R
3 X1 1 0 0 0 1/3 -1/3 0 0 3
https://www.pmcalculators.com/simplex-method-calculator/ 4/5
13/04/2025 00:34 Simplex Method Calculator - Two Phase Online 🥇
Enter the variable S3 and the variable X3 leaves the base. The pivot element is 1/6
Iteration 2
Ta bl e 3 Cj 3 -2 -3 3 0 0 0 0
Cb B a se X1 X2 X3 X4 S1 S2 S3 S4 R
3 X1 1 0 0 0 1/3 -1/3 0 0 3
-2 X2 0 1 1 -1 -1/3 -2/3 0 0 2
0 S3 0 0 6 -6 -5/3 -4/3 1 0 6
Z 0 0 1 -1 5/3 1/3 0 0 5
The problem has an unbounded solution (not limited). The variable X4 must enter the
base but no variable can leave.
https://www.pmcalculators.com/simplex-method-calculator/ 5/5