Two Phase Simplex Method: Steps and Solved Example (Phase 1 and Phase 2)
Diterbitkan pada October 16, 2026 · oleh Simplex Method Calculator Editorial Team
The two phase method is the standard way to start the simplex method when a linear program has ≥ or = constraints. Like the Big M method, it uses artificial variables to create a starting basis. Unlike Big M, it never mixes a huge penalty number into the real objective. Instead it splits the work into two clean stages:
- Phase 1 finds a feasible starting solution by removing every artificial variable.
- Phase 2 starts from that solution and optimizes the original objective.
This guide gives the steps and solves a complete example. We use the same problem as our Big M method guide, so you can compare the two approaches table by table.
Two Phase Method Steps
Phase 1
- Convert every constraint to an equation: add slack variables to ≤ constraints, subtract a surplus and add an artificial variable for ≥ constraints, and add an artificial variable for = constraints.
- Replace the original objective with a new one: minimize W = the sum of all artificial variables. (Equivalently, maximize −W.)
- Solve this Phase 1 problem with the ordinary simplex method.
- Check the result:
- If the minimum W is greater than 0, the original problem has no feasible solution. Stop.
- If W = 0, every artificial variable is zero and you have a feasible basis. Go to Phase 2.
Phase 2
- Delete the artificial columns from the final Phase 1 tableau.
- Put the original objective coefficients back in the Cj row and recompute Zj and Cj − Zj.
- Continue with the ordinary simplex method until the tableau is optimal.
Solved Example
Minimize Z = 4x1 + x2
Subject to
- 3x1 + x2 = 3
- 4x1 + 3x2 ≥ 6
- x1 + 2x2 ≤ 4
- x1, x2 ≥ 0
After adding helper variables:
- 3x1 + x2 + a1 = 3
- 4x1 + 3x2 − s2 + a2 = 6
- x1 + 2x2 + s3 = 4
Phase 1
Objective: minimize W = a1 + a2, which we solve as maximize −W = −a1 − a2. The Cj row is 0 for x1, x2, s2 and s3, and −1 for a1 and a2.
Phase 1, Tableau 1
| Basis | x1 | x2 | a1 | s2 | a2 | s3 | RHS |
|---|---|---|---|---|---|---|---|
| a1 | 3 | 1 | 1 | 0 | 0 | 0 | 3 |
| a2 | 4 | 3 | 0 | −1 | 1 | 0 | 6 |
| s3 | 1 | 2 | 0 | 0 | 0 | 1 | 4 |
| Cj − Zj | 7 | 4 | 0 | −1 | 0 | 0 | −W = −9 |
The starting W is 9, the sum of the two artificial variables (3 + 6). x1 enters (7 is the largest Cj − Zj). Ratios: 3/3 = 1, 6/4 = 1.5, 4/1 = 4. a1 leaves.
Phase 1, Tableau 2
| Basis | x1 | x2 | a1 | s2 | a2 | s3 | RHS |
|---|---|---|---|---|---|---|---|
| x1 | 1 | 1/3 | 1/3 | 0 | 0 | 0 | 1 |
| a2 | 0 | 5/3 | −4/3 | −1 | 1 | 0 | 2 |
| s3 | 0 | 5/3 | −1/3 | 0 | 0 | 1 | 3 |
| Cj − Zj | 0 | 5/3 | −7/3 | −1 | 0 | 0 | −W = −2 |
W has dropped to 2. x2 enters. Ratios: 1 / (1/3) = 3, 2 / (5/3) = 6/5, 3 / (5/3) = 9/5. a2 leaves.
Phase 1, Tableau 3
| Basis | x1 | x2 | a1 | s2 | a2 | s3 | RHS |
|---|---|---|---|---|---|---|---|
| x1 | 1 | 0 | 3/5 | 1/5 | −1/5 | 0 | 3/5 |
| x2 | 0 | 1 | −4/5 | −3/5 | 3/5 | 0 | 6/5 |
| s3 | 0 | 0 | 1 | 1 | −1 | 1 | 1 |
| Cj − Zj | 0 | 0 | −1 | 0 | −1 | 0 | −W = 0 |
All Cj − Zj ≤ 0 and W = 0. Both artificial variables have left the basis, so the problem is feasible. Phase 1 is complete with the basic feasible solution x1 = 3/5, x2 = 6/5, s3 = 1.
Phase 2
Delete the a1 and a2 columns. Restore the real objective, maximize −Z = −4x1 − x2, so the Cj row is −4 for x1, −1 for x2 and 0 for s2 and s3. Recompute Zj and Cj − Zj with Cb = −4 for x1, −1 for x2 and 0 for s3.
Phase 2, Tableau 1
| Basis | Cb | x1 | x2 | s2 | s3 | RHS |
|---|---|---|---|---|---|---|
| x1 | −4 | 1 | 0 | 1/5 | 0 | 3/5 |
| x2 | −1 | 0 | 1 | −3/5 | 0 | 6/5 |
| s3 | 0 | 0 | 0 | 1 | 1 | 1 |
| Cj − Zj | 0 | 0 | 1/5 | 0 | −Z = −18/5 |
How the s2 entry is found: Zj = (−4)(1/5) + (−1)(−3/5) + 0(1) = −1/5, so Cj − Zj = 0 − (−1/5) = 1/5. It is positive, so the solution Z = 18/5 can still be improved. s2 enters. Ratios: (3/5) / (1/5) = 3 and 1 / 1 = 1. s3 leaves.
Phase 2, Tableau 2 (Optimal)
| Basis | Cb | x1 | x2 | s2 | s3 | RHS |
|---|---|---|---|---|---|---|
| x1 | −4 | 1 | 0 | 0 | −1/5 | 2/5 |
| x2 | −1 | 0 | 1 | 0 | 3/5 | 9/5 |
| s2 | 0 | 0 | 0 | 1 | 1 | 1 |
| Cj − Zj | 0 | 0 | 0 | −1/5 | −Z = −17/5 |
All Cj − Zj ≤ 0, so the tableau is optimal.
Answer
- x1 = 2/5 = 0.4, x2 = 9/5 = 1.8
- Minimum Z = 17/5 = 3.4
This matches the Big M solution exactly. The pivots in Phase 1 are even the same as the first two Big M pivots; the difference is that the two-phase method never has to carry M through the arithmetic.
What If Phase 1 Ends with W Greater Than 0?
Then no combination of x1 and x2 satisfies every constraint, and the problem is infeasible. For example, the constraints 2x1 + x2 ≤ 2 and 3x1 + 4x2 ≥ 12 cannot both hold for non-negative x1 and x2, and Phase 1 for that problem cannot reduce W to zero. This and the other unusual outcomes are covered in special cases in the simplex method.
Artificial Variable Still in the Basis at Zero
Occasionally Phase 1 ends with W = 0 but an artificial variable still in the basis with value 0 (a degenerate case). The usual fix is to pivot it out on any non-zero entry in its row in a non-artificial column. If its row has no such entry, the constraint was redundant and the row can be deleted.
Two Phase Method vs Big M
| Two phase method | Big M method | |
|---|---|---|
| Number of stages | Two | One |
| Uses a large number M | No | Yes |
| Hand arithmetic | Simpler numbers | Every Cj − Zj has an M term |
| Detects infeasibility | W greater than 0 after Phase 1 | Artificial variable positive at the end |
| Preferred by software | Yes | Rarely |
A longer discussion is in Big M method vs two phase method.
Check Your Answer
The 2-phase simplex method calculator solves problems with artificial variables using the Big M technique, so its intermediate tableaus look like the Big M version rather than the Phase 1 and Phase 2 tables above. It reaches the same optimal solution, x1 = 0.4, x2 = 1.8 and Z = 3.4, which makes it a quick way to confirm your final answer.