How to Calculate Zj and Cj-Zj in the Simplex Method
Публикувано на June 27, 2026 · от Simplex Method Calculator Editorial Team
The Zj and Cj minus Zj rows tell the simplex method which variable to bring into the basis and when to stop. Here is exactly how to calculate them.
What Is Zj?
For each column j, Zj is the sum of (Cb times the column entry) over all rows, where Cb is the objective coefficient of the basic variable in that row.
Zj = Cb1 x a1j + Cb2 x a2j + … + Cbm x amj
Zj represents the amount of objective value that would be lost by removing the current basic variables to bring in one unit of variable j.
What Is Cj-Zj?
Cj minus Zj is the net change in the objective if variable j enters the basis, where Cj is that variable’s objective coefficient.
- For a maximization problem, a positive Cj minus Zj means the objective can still be improved; the most positive value marks the entering variable. The tableau is optimal when every Cj minus Zj is less than or equal to zero.
- For a minimization problem, you look for the most negative value and stop when all are greater than or equal to zero.
Worked Example
In the initial tableau of a maximization problem with only slack variables in the basis, every Cb is 0, so Zj = 0 for all columns and Cj minus Zj simply equals Cj. That is why the variable with the largest objective coefficient usually enters first. After the first pivot, the Cb values change and Zj must be recomputed for the next iteration.
You can watch Zj and Cj minus Zj recalculated at every step in the simplex method tableau calculator or the step-by-step calculator.