Simplex Method Solver
Solve linear programs with full tableaus, pivot highlighting, shadow prices, and step-by-step analysis — including two-phase handling of ≥ and = constraints.
Related solvers
What is the Simplex Method?
George Dantzig’s Simplex algorithm (1947) solves linear programs by walking from vertex to adjacent vertex of the feasible polytope, always improving the objective, until no improving edge remains.
Standard form & slack
Inequalities become equalities with slack (≤), surplus (≥), and artificial variables (= / ≥). Two-phase Simplex first drives artificials to zero (Phase I), then optimizes the true objective (Phase II) without letting artificials re-enter.
Pivot rules
Entering: largest positive Cⱼ−Zⱼ (max) or most negative (min). Leaving: minimum ratio test θᵢ = bᵢ / aᵢₖ for aᵢₖ > 0. The pivot cell is their intersection.
Shadow prices
At an optimal basis, the shadow price of constraint i is how much Z improves if the right-hand side bᵢ increases by one unit (within the allowable range). Tight constraints usually have nonzero shadow prices; slack ones are often zero (complementary slackness).
Termination
Optimal when no improving column remains. Unbounded when an entering column has no positive pivot. Infeasible when Phase I cannot drive artificials to zero.
1. Maximization with ≤
Maximize: Z = 3x₁ + 4x₂
- x₁ + 2x₂ ≤ 100 · 2x₁ + x₂ ≤ 120 · x₁ + x₂ ≤ 80
Optimal: x₁ ≈ 46.67, x₂ ≈ 26.67, Z ≈ 246.67
2. Minimization with ≥
Minimize: Z = 3x₁ + 2x₂
- x₁ + x₂ ≥ 4 · 2x₁ + x₂ ≥ 6
Two-phase Simplex → Optimal: x₁ = 2, x₂ = 2, Z = 10
3. Equality constraint
Maximize: Z = 3x₁ + 2x₂
- x₁ + x₂ = 4 · x₁ ≤ 3
Artificial variable for = → Optimal: x₁ = 3, x₂ = 1, Z = 11
Frequently Asked Questions
1. What is the purpose of slack variables in the Simplex Method?
2. In which direction do we move through the feasible region using Simplex?
3. How do we select the entering variable for maximization?
4. What is the minimum ratio test used for?