Duality & Shadow Prices
Convert a linear program to canonical form, build its dual, solve both with Simplex, and check strong duality — dual variables match resource shadow prices.
Related solvers
Primal–dual pair
Every linear program (the primal) has a companion dual. For the standard form
the dual is
Strong duality
If either problem has an optimal solution, so does the other, and the optimal values are equal: Z* = W*. If the primal is unbounded, the dual is infeasible (and vice versa).
Shadow prices = dual variables
At optimality, each dual variable yᵢ* equals the shadow price of primal constraint i — the rate of change of Z* when bᵢ increases by one unit (within the allowable range).
What this solver does
Mixed ≥ / = / min problems are rewritten into canonical max + ≤ form, the dual is built, both LPs are solved with Simplex, and strong duality plus shadow↔y* matching are reported.
Classic max / ≤ example
Max 3x₁ + 5x₂ s.t. x₁ ≤ 4, 2x₂ ≤ 12 → dual Min 4y₁ + 12y₂ s.t. y₁ ≥ 3, 2y₂ ≥ 5. Optimum Z* = W* = 42 with y* = (3, 2.5) = shadow prices.
Min / ≥ example
Min 3x₁ + 2x₂ s.t. x₁ + x₂ ≥ 4, 2x₁ + x₂ ≥ 6 → converted to max form, dual formed, both solved. Original Z* = 10 at (2, 2).