Big M Method: Steps and Solved Example with Every Tableau
Published on October 16, 2026 · by Simplex Method Calculator Editorial Team
The ordinary simplex method needs a starting basis, and slack variables provide one only when every constraint is ≤ with a non-negative right-hand side. As soon as a problem contains a ≥ or an = constraint, there is no obvious starting solution. The Big M method solves this by adding artificial variables and giving them a huge penalty, M, in the objective function so that the simplex method removes them on its own.
This guide explains the method, then solves a complete example with every tableau. The Big M method calculator uses this approach, so you can follow the same pivots step by step.
Slack, Surplus and Artificial Variables
Each constraint type needs different helper variables:
| Constraint | What to add | Example |
|---|---|---|
| ≤ | + slack variable | x1 + 2x2 ≤ 4 becomes x1 + 2x2 + s3 = 4 |
| ≥ | − surplus variable + artificial variable | 4x1 + 3x2 ≥ 6 becomes 4x1 + 3x2 − s2 + a2 = 6 |
| = | + artificial variable | 3x1 + x2 = 3 becomes 3x1 + x2 + a1 = 3 |
The surplus variable cannot start the basis because its coefficient is −1, which would make it negative. The artificial variable has a +1 coefficient, so it can. Artificial variables have no real meaning, which is why every one of them must reach zero in the final answer. More detail is in our guide to slack, surplus and artificial variables.
How the Penalty Works
Each artificial variable gets the coefficient M in the objective, where M is larger than any other number in the problem:
- Minimization: add +M times each artificial variable, so keeping one costs a huge amount.
- Maximization: add −M times each artificial variable, so keeping one loses a huge amount.
Because the penalty dominates every other term, the simplex method drives the artificial variables out of the basis as early as it can, and then continues optimizing the real objective.
Big M Method Steps
- Convert every constraint to an equation with slack, surplus and artificial variables.
- Add the artificial variables to the objective with the penalty M (sign as above).
- Build the initial tableau with slack and artificial variables in the basis.
- Compute Cj − Zj. Entries will be of the form “number + number × M”. Compare them by the M part first, then by the plain number.
- Pivot with the usual entering and leaving rules until the tableau is optimal.
- Read the answer. If an artificial variable is still positive in the optimal tableau, the problem is infeasible.
Solved Example
Minimize Z = 4x1 + x2
Subject to
- 3x1 + x2 = 3
- 4x1 + 3x2 ≥ 6
- x1 + 2x2 ≤ 4
- x1, x2 ≥ 0
Setting Up
Add a1 to the first constraint, subtract surplus s2 and add a2 to the second, and add slack s3 to the third. To use the maximization rules, we maximize −Z instead of minimizing Z:
Maximize −Z = −4x1 − x2 − M a1 − M a2
The variable order below is x1, x2, a1, s2, a2, s3, the same order the calculator uses.
Initial Tableau
| 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 | −4 + 7M | −1 + 4M | 0 | −M | 0 | 0 | −Z = −9M |
The M parts decide the entering variable. x1 has 7M, the largest, so x1 enters. Ratios: 3/3 = 1, 6/4 = 1.5, 4/1 = 4. a1 leaves, pivot = 3.
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 | 1/3 + (5/3)M | 4/3 − (7/3)M | −M | 0 | 0 | −Z = −4 − 2M |
One artificial variable is gone. x2 has the largest positive Cj − Zj, so x2 enters. Ratios: 1 / (1/3) = 3, 2 / (5/3) = 6/5, 3 / (5/3) = 9/5. a2 leaves, pivot = 5/3.
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 | 8/5 − M | 1/5 | −1/5 − M | 0 | −Z = −18/5 |
Both artificial variables are now out of the basis, so the solution x1 = 3/5, x2 = 6/5 is feasible, with Z = 18/5. It is not optimal yet: the surplus variable s2 has a positive Cj − Zj of 1/5. s2 enters. Ratios use positive entries only: 3/5 ÷ 1/5 = 3 and 1 / 1 = 1. s3 leaves, pivot = 1.
Tableau 4 (Optimal)
| Basis | x1 | x2 | a1 | s2 | a2 | s3 | RHS |
|---|---|---|---|---|---|---|---|
| x1 | 1 | 0 | 2/5 | 0 | 0 | −1/5 | 2/5 |
| x2 | 0 | 1 | −1/5 | 0 | 0 | 3/5 | 9/5 |
| s2 | 0 | 0 | 1 | 1 | −1 | 1 | 1 |
| Cj − Zj | 0 | 0 | 7/5 − M | 0 | −M | −1/5 | −Z = −17/5 |
Every Cj − Zj is now zero or negative (remember that M is huge, so 7/5 − M is negative). The tableau is optimal.
Answer
- x1 = 2/5 = 0.4, x2 = 9/5 = 1.8
- Minimum Z = 4(0.4) + 1.8 = 17/5 = 3.4
- s2 = 1, so the second constraint is exceeded by 1: 4(0.4) + 3(1.8) = 7, which is 1 more than 6.
Check the other constraints: 3(0.4) + 1.8 = 3 ✓ and 0.4 + 2(1.8) = 4 ✓.
Notice that the first feasible solution (Tableau 3, Z = 3.6) was not the optimal one. A common exam mistake is to stop as soon as the artificial variables leave the basis.
Advantages and Disadvantages
- One phase. The whole problem is solved in a single sequence of tableaus.
- Easy to set up by hand. You only need to add the penalty terms.
- Messy arithmetic. Every Cj − Zj entry carries an M term, which makes hand calculation slower.
- Numerical risk on computers. If M is replaced by a real number, it must be large enough to dominate but not so large that rounding errors appear. The two-phase method avoids this problem entirely. For a side-by-side comparison, read Big M method vs two-phase method.
Try It
Enter 4x1 + x2, choose minimize, and type the three constraints (3x1 + x2 = 3, 4x1 + 3x2 >= 6, x1 + 2x2 <= 4) in the Big M method calculator. It adds a1, s2, a2 and s3 for you and makes the same four pivots. The calculator uses M = 1,000,000 as a number and displays very large values in millions, so an entry this guide writes as −4 + 7M appears as 7M; the choices and the final answer are identical.