Percentages and Math

Linear Programming Solver

Enter the objective and the constraints to find the best plan and which limits hold it back.

Your numbers

Separate with commas. Leave blank to use x1, x2, and so on. Example data.

One number per variable, such as 40, 30 for 40 x1 + 30 x2. Example data.

Constraints
Constraint 1
Constraint 2
Constraint 3

Result

Largest value of the objective

2,600

Tables = 20, Chairs = 60

Largest objective value
2,600
Tables
20
Chairs
60
Binding constraints
2

Best plan

VariableAmountContribution
Tables20800
Chairs601,800

Constraints at the best plan

ConstraintUsedRoom leftShadow price
Labor hours100 (at most 100)Binding10
Material80 (at most 80)Binding20
Table limit20 (at most 40)200
How this was calculated
  1. Maximize 40 Tables + 30 Chairs, with every variable at least 0.
  2. The two phase simplex method moves from corner to corner of the feasible region, always improving the objective, with a rule that prevents it from looping.
  3. At the best corner the objective is 2,600. Constraints with no room left are the ones that limit the plan.
  • Variables can take any non-negative value, including fractions. If you can only make whole items, round the plan carefully and re-check every constraint, because rounding can break one.

Calculated using SumPanda.com · https://sumpanda.com/linear-programming-solver/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the linear programming solver

  1. Choose whether to maximize or minimize the objective, and give the variables names if you like, separated by commas.
  2. Enter the objective coefficients, one per variable, such as 40, 30 for 40 x1 + 30 x2. The example shows a small product mix.
  3. Add each constraint: its coefficients, whether it is at most, at least or exactly the limit, and the limit itself.
  4. Read the best plan, the value of the objective, which constraints are binding, and the shadow price of each.

Formula

maximize (or minimize) c1 x1 + c2 x2 + ... + cn xn

subject to a1 x1 + a2 x2 + ... + an xn <= (or >= or =) b for every constraint

all variables x >= 0

shadow price of a constraint = change in the best value when its limit rises by 1

The two phase simplex method moves from corner to corner of the feasible region, always improving the objective, and uses Bland's rule so it can never loop. A first phase finds a feasible corner or shows there is none.

Tables and chairs

Maximize 40 Tables + 30 Chairs, with labor 2 Tables + 1 Chairs <= 100 hours, material 1 Tables + 1 Chairs <= 80 and at most 40 tables. The best plan is 20 tables and 60 chairs for a value of 2,600. Labor and material are both used up, while the table limit has 20 to spare.

The shadow price of labor is 10 and of material is 20. If the same two constraints stay binding, one more labor hour raises the best value by 10 and one more unit of material raises it by 20. The table limit has a shadow price of 0 because it is not binding. For a minimizing example, minimize 2x + 3y with x + y >= 10, x + 3y >= 15 and 2x + y >= 12: the best is x = 7.5 and y = 2.5 for a cost of 22.5.

Reading the result

A binding constraint is one with no room left: it holds the plan back, and loosening it improves the result. A constraint with room left is not limiting anything. Shadow prices rank which limits are worth relaxing, but they only hold for small changes, and at a corner where several constraints meet they may differ depending on which direction you move.

If no values satisfy every constraint at once, the tool says there is no feasible solution. If nothing stops the objective from growing forever, it says the problem is unbounded, which usually means a real limit was left out.

Limits and related tools

All variables can be any non-negative number, including fractions. For whole items, round carefully and check that every constraint still holds. For a system of equations without an objective, use the System of Equations Solver, and to weigh options on several criteria, the Decision Matrix Calculator.

More planning and optimization tools

For related planning and optimization problems, try the NPK Blend Calculator, Knapsack Optimizer and Assignment Optimizer.

Assumptions and limits

  • The objective and every constraint are linear, and every variable is zero or more.
  • Up to 8 variables and 12 constraints can be entered.
  • Coefficients and limits are numbers below 1,000,000,000 in size.
  • Example data are shown until you replace them.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

What is linear programming used for?

It finds the best use of limited resources when everything is a straight-line relationship, such as the mix of products that earns the most from fixed labor and material.

What is a shadow price?

It is how much the best objective value changes if a constraint's limit rises by one unit, while the same constraints stay binding. A non-binding constraint has a shadow price of zero.

What does infeasible mean?

No set of values satisfies all the constraints together, for example one rule needs a total of at least 10 while another allows at most 5.

What does unbounded mean?

The objective can grow without limit while still meeting every constraint. In real problems this usually means a limit such as capacity or budget is missing.