Linear Programming Solver
Maximize or minimize under linear constraints, with the graph and every tableau.
Try before you buy.
- Free preview: your problem as read and a watermarked graph of its constraint lines, with the optimum, the corner values, the tableaux and every figure hidden.
- Locked until you unlock it: download and copy.
- Unlock: Pro pass, ₹179 for 30 days or ₹79 for 1 week, a one-time payment that never renews. Unlock: Pro pass, $5.99 for 30 days or $2.99 for 1 week, a one-time payment that never renews.
Ways to unlock shows how to get the full result.
Printing this result is locked in the free preview.
Solution
This is the last result worked out. Fix the input above to update it.
Locked in the free preview. Opens the ways to unlock this result.
Locked in the free preview. Batch runs unlock with a pass.
Locked in the free preview. Query results unlock with a pass.
About the Linear Programming Solver
Type an objective such as Z = 3x + 5y, choose maximize or minimize, and list the constraints one per line — x + 2y ≤ 14, 3x − y ≥ 0, x + y = 10, even 2 ≤ x ≤ 8. The solver works in exact fractions, so an answer such as x = 2/5 is never rounded to 0.39999.
With two variables it shows the corner-point method taught in school: the graph with every constraint line, the shaded feasible region and its corner points, the value of Z at each corner and the optimum, with the half-plane test when the region is unbounded. For any problem — up to 15 variables and 25 constraints — it runs the simplex method and shows every tableau: the standard form with slack, surplus and artificial variables, both phases of the two-phase method, the entering and leaving variables, the ratio test, the pivot and each row operation. It detects problems with no feasible point, an unbounded objective and multiple optimal solutions, and gives the shadow price of every constraint with the ranges over which the solution stays optimal.
How to use it
- Choose Maximize or Minimize and type the objective, such as Z = 3x + 5y (a different name such as P = 50chairs + 80tables works too).
- Type the constraints one per line with ≤, ≥ or = (or <=, >=). Put a label and a colon before a line to name it (Labour: 2x + 3y ≤ 120). Keep All variables ≥ 0 ticked for the usual non-negativity conditions, or write “x unrestricted” for a variable that may be negative.
- Pick the entering-variable rule — the most negative reduced cost, as most textbooks use, or Bland’s rule — and whether numbers show as exact fractions or decimals.
- Read the optimum, then the graph and corner table (for two variables) and every simplex tableau, with the constraint check and the shadow prices below.
- Copy the solution with all tableaux, or download a CSV file or the graph as PNG or SVG — with a Pro pass or after unlocking this result; without one you see the free preview.
Examples
Maximize Z = 3x + 5y subject to x ≤ 4, 2y ≤ 12, 3x + 2y ≤ 18, x, y ≥ 0
Maximum Z = 36 at x = 2, y = 6; shadow prices 0, 3/2 and 1
The second and third constraints are binding. Raising the right-hand side of 2y ≤ 12 by one unit (anywhere between 6 and 18) adds 3/2 to Z.
Maximize Z = 4x + y subject to x + y ≤ 50, 3x + y ≤ 90, x, y ≥ 0
Corners (0, 0), (30, 0), (20, 30), (0, 50) give Z = 0, 120, 110, 50: the maximum is 120 at (30, 0)
Minimize Z = 4x₁ + x₂ subject to 3x₁ + x₂ = 3, 4x₁ + 3x₂ ≥ 6, x₁ + 2x₂ ≤ 4
Minimum Z = 17/5 at x₁ = 2/5, x₂ = 9/5
The = and ≥ rows need artificial variables, so phase I first finds a feasible point and phase II then improves it.
Maximize Z = 3x + 9y subject to x + 3y ≤ 60, x + y ≥ 10, x ≤ y
Z = 180 at (15, 15) and at (0, 20), and at every point of the segment between them
The objective is parallel to the boundary x + 3y = 60, so a whole edge of the region is optimal.
Minimize Z = −50x + 20y subject to 2x − y ≥ −5, 3x + y ≥ 3, 2x − 3y ≤ 12
The smallest corner value is −300 at (6, 0), but the half-plane −50x + 20y < −300 meets the region: Z has no minimum
Common uses
- Checking homework and exam answers for the graphical method and the simplex method, tableau by tableau.
- Planning a product mix that maximizes profit within limits on labour, machine time and material.
- Finding the cheapest blend or diet that meets nutrient or quality requirements.
- Reading shadow prices to decide which resource is worth buying more of, and how far the plan holds.
- Teaching how slack, surplus and artificial variables, degeneracy and Bland’s rule work, with exact numbers.
The corner-point method
For two variables, each constraint a·x + b·y ≤ c is a half-plane bounded by the line a·x + b·y = c. The points that satisfy every constraint form the feasible region, a convex polygon or an unbounded convex area. If the objective has an optimum, it is reached at a corner point (a vertex where two boundary lines meet), so it is enough to evaluate Z at every corner, as NCERT Class 12 Mathematics, chapter 12 teaches.
On a bounded region the largest corner value is the maximum and the smallest the minimum. On an unbounded region a corner value M is the maximum only if the open half-plane Z > M has no point in common with the region (for a minimum, Z < m); the solver shows such a point when one exists. When two adjacent corners give the same optimal value, every point of the edge between them is optimal.
The simplex method, step by step
- Standard form. Each ≤ row gets a slack variable (x + 2y + s₁ = 14), each ≥ row a surplus variable and an artificial variable, each = row an artificial variable. A row with a negative right-hand side is first multiplied by −1. A variable that may be negative is written x = x⁺ − x⁻.
- Phase I. When there are artificial variables, the solver maximizes W = −(sum of the artificial variables). If W ends below 0, no point satisfies all constraints. Otherwise the final basis is a feasible point, and any artificial variable still in it at level 0 is pivoted out.
- Phase II. Each tableau’s bottom row holds the reduced costs z_j − c_j. A negative entry can enter the basis; the ratio test (right-hand side ÷ positive column entry, smallest wins) picks the row that leaves; the pivot step divides the pivot row and clears the column. When no reduced cost is negative, the tableau is optimal.
- Minimizing. A minimum of Z is found as the maximum of Z′ = −Z, so the tableaux of a minimization show the row Z′.
The two-phase method and the tableau are described in Dantzig’s Linear Programming and Extensions.
Choosing the entering variable: Dantzig or Bland
Most textbooks bring in the column with the most negative reduced cost (Dantzig’s rule). On degenerate problems that rule can cycle — return to a basis it has seen and never finish. Bland’s rule brings in the lowest-numbered column with a negative reduced cost and, on a tie in the ratio test, removes the basic variable with the lowest number; Bland proved that it never cycles. With the first rule selected, the solver changes to Bland’s rule by itself if a basis repeats, and says so.
Shadow prices and ranges
At the optimum, the shadow price of a constraint is the change in the optimal Z when its right-hand side rises by one unit, read from the final tableau as y = c_B·B⁻¹. It holds while the right-hand side stays in the range shown — beyond it a different corner becomes optimal. A non-binding constraint (one with slack) has shadow price 0. The reduced cost of a variable at 0 says how much Z changes per unit if that variable is forced up, and each objective coefficient has a range over which the same point stays optimal. When the optimum is degenerate (a basic variable equals 0), a shadow price may hold in one direction only.
Limitations
- Up to 15 variables and 25 constraints (an unrestricted variable counts once but takes two columns of the tableau).
- Continuous variables only: the solver does not look for whole-number (integer) solutions.
- Coefficients are read as exact fractions; numbers with more than 30 digits are refused, and so is scientific notation such as 1e5 (type 100000), which could be misread as a variable named e5.
- Shadow prices and ranges are not shown when a constraint repeats others (it is dropped during phase I).
- The graph is drawn for problems with two variables; with more, the simplex tableaux give the answer.
Privacy
On this device: nothing is sent
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
What do I get without a pass?
Without a pass, Linear Programming Solver shows your problem as read and a watermarked graph of its constraint lines, with the optimum, the corner values, the tableaux and every figure hidden. Until you unlock it, the result can’t be downloaded or copied. A Pro, Premium or Ultimate pass, a one-time payment that never renews, unlocks the full result. The pricing page lists the passes and their prices.
How do I solve a linear programming problem graphically?
Draw each constraint as a line, keep the side that satisfies it, and find the corner points of the region where all of them overlap. Evaluate the objective at each corner: on a bounded region the largest value is the maximum and the smallest the minimum. For Z = 4x + y with x + y ≤ 50 and 3x + y ≤ 90, the corners (0, 0), (30, 0), (20, 30) and (0, 50) give 0, 120, 110 and 50, so the maximum is 120 at (30, 0).
When do I need the two-phase simplex method?
When a constraint is ≥ or = (or a ≤ row has a negative right-hand side), the slack variables alone do not give a starting basis, so artificial variables are added. Phase I drives them to 0 to find a feasible point; phase II then optimizes the real objective from there. The solver shows both phases tableau by tableau.
How can I tell that there are multiple optimal solutions?
In the final simplex tableau a variable that is not in the basis has a reduced cost of 0, so bringing it in changes the point but not Z. On a graph it shows as the objective line lying along an edge of the feasible region. The solver lists the optimal corner points and says that every point between them is optimal too.
What does an unbounded solution mean?
The objective can be made as large (or, for a minimum, as small) as you like while every constraint still holds: some column could enter the basis, but no entry in it is positive, so the ratio test finds no limit. It usually means a constraint is missing from the model. The solver gives a direction along which Z improves without end.
What is a shadow price?
The amount by which the optimal objective changes when the right-hand side of one constraint grows by one unit, other things equal. In the product-mix example, the constraint 2y ≤ 12 has shadow price 3/2: with 13 instead of 12, the maximum rises from 36 to 37.5. It applies within the range shown — here while the right-hand side stays between 6 and 18.
Why are my answers fractions?
Corner points are where lines meet, so they are often fractions such as (2/5, 9/5). The solver keeps every number exact so the working can be checked by hand; switch Numbers to decimals if you prefer to read them rounded.