Type an objective function and constraints in plain notation like 3x + 5y and 2x + y ≤ 18. The solver finds the exact optimum with the two-phase simplex method, shows every tableau with the pivot highlighted, and for two-variable problems draws the feasible region with its corner points.
Last updated:
Write terms like 3x, -0.5y, 2/3 x1. Variables can be any names (x, y, x1, chairs). Write x >= 0 lines yourself if you untick non-negativity.
Feasible region
Simplex tableau steps
Advertisement
Advertisement
How to use the Linear Programming Solver
Choose Maximize or Minimize and type the objective, for example 3x + 5y.
Enter the constraints, one per line, such as 3x + 2y <= 18 or x + y >= 4.
Leave “All variables ≥ 0” ticked for the usual non-negativity conditions, or untick it for free variables.
Press Solve to see the optimal value, the variable values and which constraints are binding.
Read the tableau steps below, and for two variables check the graph and corner point table.
Standard form and the simplex tableau
A linear program in this tool has the form maximize (or minimize) z = c₁x₁ + c₂x₂ + … + cₙxₙ subject to constraints aᵢ₁x₁ + … + aᵢₙxₙ (≤, ≥ or =) bᵢ, usually with every xⱼ ≥ 0. To start the simplex method each constraint becomes an equation:
Constraint type
Becomes
Starting basic variable
3x + 2y ≤ 18
3x + 2y + s₁ = 18
slack s₁ = 18
x + y ≥ 4
x + y − e₂ + a₂ = 4
artificial a₂ = 4 (removed in phase 1)
x + y = 10
x + y + a₃ = 10
artificial a₃ = 10 (removed in phase 1)
negative right side, e.g. x − y ≥ −2
multiply by −1: −x + y ≤ 2
slack
The objective row of the tableau holds z − c·x = 0, so its entries start as the negatives of the objective coefficients. Each pivot divides the pivot row by the pivot element and clears the rest of the pivot column, exactly like Gauss–Jordan elimination.
Worked example
Maximize z = 3x + 5y subject to x ≤ 4, 2y ≤ 12 and 3x + 2y ≤ 18 with x, y ≥ 0 (the default problem above).
The most negative entry in the objective row is −5, so y enters. Ratios: row 2 gives 12 ÷ 2 = 6, row 3 gives 18 ÷ 2 = 9, so s₂ leaves.
After pivoting, x has −3 in the objective row, so x enters. Ratios: row 1 gives 4, row 3 gives 6 ÷ 3 = 2, so s₃ leaves.
No negative entries remain: the optimum is x = 2, y = 6, z = 36. Constraints 2 and 3 are binding; constraint 1 has slack 2.
The graph confirms it: the corner points are (0, 0), (4, 0), (4, 3), (2, 6) and (0, 6), with z values 0, 12, 27, 36 and 30.
Tips for setting up word problems
Define the variables first: "x = number of chairs, y = number of tables". You can even type the names (chairs, tables).
One resource, one constraint: hours of labor, kilograms of material, budget. Coefficients are how much of the resource each unit uses.
"At least" means ≥, "at most" or "no more than" means ≤.
Check units: every term in a constraint must be in the same unit as its right-hand side.
Frequently asked questions
What is linear programming?
Linear programming finds the best value (largest profit, smallest cost) of a linear objective such as z = 3x + 5y when the variables must satisfy linear constraints like 3x + 2y ≤ 18. The set of points that satisfy every constraint is the feasible region, and the optimum, when it exists, is at a corner of that region.
How does the simplex method work?
It starts at a corner of the feasible region and repeatedly moves to an adjacent corner that improves the objective. In the tableau, the entering variable is the one with the most negative entry in the objective row, and the leaving variable is chosen by the minimum ratio test (right-hand side ÷ positive column entry). When no negative entries remain, the current corner is optimal.
What are slack, surplus and artificial variables?
A slack variable turns a ≤ constraint into an equation (3x + 2y + s = 18) and measures unused capacity. A surplus variable is subtracted from a ≥ constraint. Artificial variables are temporary helpers for ≥ and = rows so the simplex has a starting point; phase 1 removes them, and if it cannot, the problem is infeasible.
How is a minimization problem solved?
Minimizing z is the same as maximizing −z, so the solver negates the objective, runs the same simplex steps and reports the minimum as the negative of the final value. The tableau notes say when this conversion is used.
What does unbounded or infeasible mean?
Infeasible means no point satisfies all constraints together, for example x + y ≤ 4 and x + y ≥ 6. Unbounded means the objective can improve forever because the feasible region is open in that direction; in a real model this usually means a constraint is missing.
When is the graphical method shown?
The feasible region is drawn whenever the problem has exactly two variables. The first variable is on the horizontal axis. The corner point table lists every vertex of the region with its objective value, which is the classic graphical method taught alongside the simplex method.
Can I use more than two variables?
Yes. The simplex solver handles up to 12 variables and 20 constraints with exact fractions. Only the graph is limited to two variables; the tableau steps work for any size.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.