Enter your values
Set up your objective and constraints
Optimize a linear function of two nonnegative variables with the corner-point method.
Constraints
All variables are restricted to x ≥ 0 and y ≥ 0.
Use ≤ for a maximum limit, ≥ for a minimum requirement, or = for an exact condition. Coefficients and right-hand sides may be negative; feasible solutions still require x and y to be nonnegative.
What is a linear programming calculator?
Linear programming is a method for maximizing or minimizing a linear objective while satisfying a set of linear constraints. This calculator handles two decision variables, x and y, with nonnegativity restrictions.
Important terms
- Objective function
- The linear quantity to maximize or minimize, written here as c₁x + c₂y.
- Constraint
- A linear inequality or equality that limits which x-y pairs are allowed.
- Feasible region
- The set of all points that satisfy every constraint and x ≥ 0, y ≥ 0.
- Corner point
- A vertex where two boundary lines meet; a finite linear-programming optimum occurs at a feasible vertex.
When this method is useful
- Compare production plans when materials, labor, or machine time are limited.
- Find a least-cost combination that still meets minimum requirements.
- Learn graphing and the corner-point method for two-variable linear programs.
Formula and variables
- x, y
- Decision variables, restricted to nonnegative values in this calculator.
- c₁, c₂
- Objective coefficients that determine the value z.
- aᵢ, bᵢ, dᵢ
- Coefficients and right-hand side for constraint i.
- z
- The objective value being maximized or minimized.
Each constraint defines a half-plane or boundary line. Their intersection with the nonnegative quadrant is the feasible region. Evaluate the objective at every feasible vertex; the largest or smallest value is the finite optimum.
Domain note: This tool solves continuous linear programs with two nonnegative variables and up to eight linear constraints. It does not enforce integer-valued decisions or solve general nonlinear programs.
How to use this calculator
- 1
Choose whether the objective should be maximized or minimized, then enter its x and y coefficients.
- 2
Enter each constraint as an x coefficient, a y coefficient, a relation (≤, ≥, or =), and a right-hand side.
- 3
Interpret the calculator's variable domain as x ≥ 0 and y ≥ 0; add constraints to describe resource limits or requirements.
- 4
Calculate to graph the feasible region and list the feasible intersections of constraint boundaries and axes.
- 5
Compare objective values at the listed vertices. The highlighted vertex gives the optimum when a finite optimum exists.
Step-by-step examples
Example 1
Problem: Maximize z = 3x + 5y subject to x + y ≤ 8, x ≤ 4, y ≤ 6, x ≥ 0, and y ≥ 0.
Substitution: The feasible vertices are (0, 0), (4, 0), (4, 4), (2, 6), and (0, 6). Their objective values are 0, 12, 32, 36, and 30.
Result: The maximum is z = 36 at (x, y) = (2, 6).
The resource boundary x + y = 8 meets y = 6 at (2, 6). This point satisfies every limit and gives the largest objective value among all feasible corners.
Example 2
Problem: Minimize z = 2x + 3y subject to x + y ≥ 6, x ≤ 5, y ≤ 5, x ≥ 0, and y ≥ 0.
Substitution: The feasible region is the part of the 5-by-5 box above x + y = 6. The lowest-cost feasible corners include (1, 5) and (5, 1), with objective values 17 and 13.
Result: The minimum is z = 13 at (x, y) = (5, 1).
Because x has the smaller cost coefficient, the minimum uses as much x as the x ≤ 5 constraint allows while meeting the total requirement.
Rules, edge cases, and related ideas
Why check vertices?
A linear function changes at a constant rate across the plane. On a polygonal feasible region, a finite maximum or minimum is attained at a vertex (and may also be attained along an entire edge).
What the graph shows
The shaded polygon is the common intersection of the constraint half-planes inside the first quadrant. Boundary lines are plotted from the entered equations; points are checked against all constraints.
Edge cases and limitations
- Conflicting constraints can leave no feasible points; the calculator reports an infeasible model rather than a fabricated optimum.
- A feasible ray may allow the objective to increase or decrease without limit; the calculator reports an unbounded direction.
- A redundant constraint may not change the feasible region or optimum.
- If an objective is constant along an optimal edge, multiple feasible points share the same best value; the listed corner still gives a valid optimum.
How this differs from a related concept
The graphical method is especially useful for two decision variables because it makes the feasible region and active constraints visible. Larger models generally use simplex, interior-point, or specialized optimization algorithms instead of a two-axis graph.
Understand the result
A feasible result means at least one point meets all constraints. An optimal result is the best feasible objective value. If the region is infeasible, the constraints conflict; if the objective is unbounded in an improving direction, no finite best value exists.
Common mistakes
- Using the wrong inequality direction: ≤ represents an upper limit, while ≥ represents a minimum requirement.
- Forgetting nonnegativity. This calculator includes x ≥ 0 and y ≥ 0 automatically.
- Comparing only the intercepts instead of evaluating the objective at every feasible corner.
- Treating a continuous answer as an integer plan. Integer restrictions require an integer-programming model.
Frequently asked questions
What does a linear programming calculator find?
It finds the maximum or minimum of a linear objective while satisfying the entered linear constraints and the nonnegative-variable restrictions.
How does the graphical method work?
Each constraint creates a half-plane. Their overlap is the feasible region. The calculator checks its corner points and compares the objective values there.
Can this solve three or more variables?
No. This calculator is designed for two variables so the feasible region can be plotted on a standard x-y graph.
Why is the result unbounded?
The constraints allow movement in a direction that keeps improving the objective without limit. A missing resource limit may be the cause.
Why is my model infeasible?
At least two constraints may conflict, or the right-hand sides may not permit any point with x ≥ 0 and y ≥ 0. Review the inequalities and units.