# Linear Programming Solver (Graphical Method)

Optimize a 2-variable objective function subject to linear inequality constraints using the graphical corner-point method with this free solver.

---

- **Canonical URL:** https://dothecalculation.com/calculators/linear-programming-calculator
- **Category:** Math calculators
- **Publisher:** Do The Calculation (https://dothecalculation.com)
- **Cost:** Free, no account or sign-up required
- **Privacy:** Runs entirely in the browser; inputs are never sent to a server
- **Methodology:** https://dothecalculation.com/methodology

---

## Linear Programming Solver

Solve 2-variable linear programming models. Maximize or minimize objective functions subject to inequality constraints.

- Custom objective coefficients
- Multiple inequality constraints
- Feasible region vertices solver

## Understanding Linear Programming and Optimization

Linear programming (LP) is a mathematical optimization method used to determine the best possible outcome (such as maximizing profit or minimizing cost) in a given mathematical model, subject to a set of linear constraints. Widely used in business, logistics, manufacturing, and economics, linear programming helps managers allocate limited resources (like time, labor, raw materials, or capital) to achieve maximum efficiency.

A linear programming problem consists of a linear objective function that we want to optimize, and a set of linear inequality or equality constraints that restrict the decision variables. Because the relationships are linear, the set of all feasible solutions forms a convex polygon called the feasible region. According to the Fundamental Theorem of Linear Programming, the optimal solution always occurs at one of the corner points (vertices) of this feasible region.

This calculator solves 2-variable linear programming problems using the graphical corner-point method: it evaluates the coordinates of every vertex of the feasible region formed by two constraints, checks each against the objective function, and identifies the optimal coordinates and maximum/minimum value.

## How to Use This Calculator

Choose Maximize or Minimize, enter the objective function coefficients \(A\) and \(B\) (for \(Z = Ax + By\)), then enter the coefficients of two "less than or equal to" constraints. The calculator finds every candidate vertex, filters out any that violate a constraint or the non-negativity requirement, and reports the vertex that optimizes \(Z\).

## Mathematical Formulation of Linear Programming Models

A standard 2-variable linear programming model is formulated as:

Optimize (Maximize or Minimize) the objective function: $$Z = c_1 x + c_2 y$$

Subject to the constraints:

$$a_{11} x + a_{12} y \leq b_1$$

$$a_{21} x + a_{22} y \leq b_2$$

$$x \geq 0, \quad y \geq 0 \quad \text{(Non-negativity constraints)}$$

The intersection of these half-planes forms the feasible region. This calculator identifies the intersection points of the constraint boundary lines, filters out points that violate any constraints, and tabulates the objective values for the remaining valid vertices.

## Worked Case Study: Maximizing Production Profit

Let us maximize \(Z = 3x + 4y\) subject to these constraints:

1. \(x + 2y \leq 8\) (Constraint 1)

2. \(3x + 2y \leq 12\) (Constraint 2)

3. \(x \geq 0,\; y \geq 0\)

First, we find the boundary line intersections:

- The axes intersections for Constraint 1 are \((0, 4)\) and \((8, 0)\).

- The axes intersections for Constraint 2 are \((0, 6)\) and \((4, 0)\).

- The intersection of Constraint 1 and Constraint 2 is found by solving the simultaneous equations: \(x + 2y = 8\) and \(3x + 2y = 12\). Subtracting the equations gives \(2x = 4 \implies x = 2\), which gives \(y = 3\). The intersection is \((2, 3)\).

Now, we filter every candidate point (origin, both axis intercepts of each constraint, and the intersection) against both inequalities. \((8, 0)\) fails Constraint 2 (\(3(8) + 2(0) = 24 > 12\)) and \((0, 6)\) fails Constraint 1 (\(0 + 2(6) = 12 > 8\)), so they're excluded. The remaining feasible vertices are \((0, 0)\), \((4, 0)\), \((2, 3)\), and \((0, 4)\).

Finally, we evaluate the objective function \(Z = 3x + 4y\) at each vertex:

- At \((0, 0)\): \(Z = 0\)

- At \((4, 0)\): \(Z = 3(4) + 0 = 12\)

- At \((0, 4)\): \(Z = 0 + 4(4) = 16\)

- At \((2, 3)\): \(Z = 3(2) + 4(3) = 6 + 12 = 18\)

The maximum value is \(Z = 18\), occurring at the coordinate \((2, 3)\) — matching what the calculator returns for its default inputs.

## Feasible Regions and Boundary Constraints

The shape of the feasible region determines whether a solution exists. If the constraints contradict each other (for example, requiring \(x \geq 5\) and \(x \leq 2\)), the feasible region is empty, and the problem has no solution (infeasibility). If the feasible region is unbounded (extending infinitely) in the direction of optimization, the objective function can grow infinitely, representing an unbounded solution.

Our graphical solver displays the boundary lines and identifies the vertices, helping you identify these edge cases visually.

## Related Calculators

Finding the exact intersection of the two constraint lines here uses the same simultaneous-equation method as the [system of equations calculator](/calculators/system-of-equations-calculator). For optimization problems without linear constraints, a numerical root finder like the [bisection method calculator](/calculators/bisection-method-calculator) can locate where a function's derivative equals zero instead.

## Frequently asked questions

### What is linear programming?

Linear programming is a mathematical optimization technique used to find the maximum or minimum value of a linear function subject to linear inequality constraints.

### What is the objective function?

The objective function is the linear equation representing the quantity you want to maximize (like profit) or minimize (like cost), written as Z = c₁x + c₂y.

### What is the feasible region?

The feasible region is the set of all coordinate points (x, y) that satisfy all the linear inequality constraints simultaneously.

### What is the Fundamental Theorem of Linear Programming?

The theorem states that if a linear programming problem has an optimal solution, it must occur at one of the corner points (vertices) of the feasible region.

### How does the graphical method work?

The graphical method plots all constraint lines on a coordinate plane, identifies the feasible region, locates its corner points, and evaluates the objective function at each corner to find the optimal value. This is the method this calculator uses.

### What is an inconsistent or infeasible problem?

An infeasible problem occurs when no points satisfy all constraints simultaneously, meaning there is no feasible region and no solution.

### What is an unbounded solution?

An unbounded solution occurs when the feasible region is infinite in the direction of optimization, allowing the objective function to grow without limit.

### What are decision variables?

Decision variables are the unknown quantities (x and y) that you solve for to optimize the objective function.

### What are non-negativity constraints?

Non-negativity constraints require that decision variables cannot be negative (x ≥ 0, y ≥ 0), representing real-world limitations (like producing a positive quantity of goods).

### Can this solver handle more than two variables, or more than two constraints?

No — this graphical solver is fixed to exactly two decision variables and two "≤" constraints. Problems with three or more variables, or additional constraints, require algebraic methods like the Simplex algorithm, which this tool doesn't implement.

### What is the Simplex method, and does this calculator use it?

The Simplex method is an algebraic algorithm that solves linear programming problems of any size by moving along the edges of the feasible region from vertex to vertex. This calculator does not implement the Simplex algorithm — it uses the graphical corner-point method instead, which only works for two variables but arrives at the same kind of vertex-based optimum for problems that size.

### What is sensitivity analysis in linear programming?

Sensitivity analysis determines how changes in the coefficients of the objective function or constraints affect the optimal solution. It isn't computed by this calculator, which reports the optimum for the exact inputs you give it.

## Related concepts

- **Simplex Method** — An algebraic algorithm used to solve multi-variable linear programming problems, distinct from the graphical method this calculator uses.
- **Feasible Region** — The convex polygon representing the set of all valid solutions satisfying the constraints.
- **Duality** — The principle that every linear programming problem has a corresponding dual problem that yields the same optimal value.

## Related guides

- [Ratio and Proportion Guide: Simplify, Solve, Split Totals](https://dothecalculation.com/blog/math/ratio-and-proportion) — Learn how to simplify ratios, solve proportions, and split totals with worked examples tied to the live DTC ratio calculator.

## Related calculators

- [System of Linear & Nonlinear Equations Solver](https://dothecalculation.com/calculators/system-of-equations-calculator) — Solve a system of two linear equations via Cramer’s Rule, or a line-and-parabola nonlinear system via substitution, with clear steps and an intersection graph.
- [Arithmetic & Geometric Sequence Solver](https://dothecalculation.com/calculators/number-sequence-calculator) — Generate terms, calculate general formulas, and sum series for arithmetic and geometric progressions with this free solver.
- [Cross Multiplication Calculator](https://dothecalculation.com/calculators/cross-multiplication-calculator) — Use our free cross multiplication calculator to solve equations with fractions. Shows step-by-step work for proportions and fraction comparisons.
- [Ratio and Proportion Calculator](https://dothecalculation.com/calculators/ratio-proportion-calculator) — Simplify ratios, solve proportions, and divide quantities by ratio instantly with this free step-by-step ratio calculator.
- [Matrix Algebra & Linear Equations Solver](https://dothecalculation.com/calculators/matrix-solver) — Calculate determinants, inverses, and transposes, and solve 2×2 or 3×3 systems of linear equations instantly with this free matrix algebra tool.
- [Modular Arithmetic & Congruence Solver](https://dothecalculation.com/calculators/modular-arithmetic-calculator) — Perform modular addition, multiplication, and exponentiation, and solve linear modular congruence equations with clear steps.

---

_This mathematical solver is designed for academic, engineering, and educational analysis. Rounding errors, numerical tolerances, or algorithm constraints might apply near poles, boundary conditions, or complex coordinate spaces. Always verify critical computations independently._

---

_Source: [Do The Calculation](https://dothecalculation.com/calculators/linear-programming-calculator). Quote freely with attribution and a link to this page._
