Simplex LP (2 variables)
Maximise an objective subject to ≤ constraints — 2-variable LP via vertex enumeration.
Overview
The Simplex LP (2 variables) tool maximises a linear objective c1 * x + c2 * y subject to a list of <= constraints. Since two-variable LPs always reach their optimum at a vertex of the feasible region, the tool enumerates vertices and picks the best one — no big matrices, no pivots, no fuss.
It is built for operations-research students learning linear programming, small-business owners doing rough production-planning sums and product strategists modelling resource trade-offs. The simplex algorithm in full generality is intimidating; two variables let you visualise the geometry.
How it works
A 2-variable LP defines a polygonal feasible region in the (x, y) plane. The optimum of a linear objective over a polygon lies at a vertex. The tool finds every pair of intersecting constraint lines (plus the axes from non-negativity), checks each intersection for feasibility, evaluates the objective there and reports the best feasible vertex.
If no feasible vertex exists, the LP is infeasible. If the feasible region is unbounded in the direction of improvement, the optimum is infinite — the tool flags both cases. For two variables there are at most O(m²) candidate vertices for m constraints, so brute-force enumeration is fast.
Examples
Max 3x + 5y
s.t. x + y <= 4, 2x + y <= 5, x,y >= 0
→ optimum 20 at (0, 4)
Max x + y
s.t. x <= 3, y <= 2, x,y >= 0
→ optimum 5 at (3, 2)
Max 2x + 3y
s.t. x + y <= 10, x <= 6, y <= 7, x,y >= 0
→ optimum 25 at (3, 7)
FAQ
Why only two variables?
Two variables let the tool visualise the feasible region and enumerate vertices in seconds. For more variables, the standard simplex algorithm is needed.
What if I want to minimise?
Negate the objective and maximise. The vertex that maximises -c . x minimises c . x.
Does it support equality or >= constraints?
Internally, yes — multiply both sides by -1 to flip a >= into <=, and represent equalities as two opposite inequalities.
How does it handle infeasibility?
If the constraint set has no feasible point, the tool reports infeasible. Check for contradictory constraints.
What is unbounded?
When the objective can grow without limit inside the feasible region. The tool detects this by noticing the optimum doesn't land at a finite vertex.