happytails.ai

Linear programming solver

Maximize or minimize a linear objective under linear constraints with exact fractions. The result is an optimal solution, or a proof that the problem is infeasible or unbounded.

Programs are limited to 4,000 characters, 40 lines, 12 variables, 24 constraints, 2,000 pivots and exact values of 1,024 digits. Everything is computed on your device in a background worker with a 15 second limit. Downloads are a JSON report and CSV tables of variables and constraints. Objective first, then one constraint per line with <=, >= or =. Up to 4,000 characters. Review the settings before running.

Your result

Report a problem or share an idea.

How to use Linear programming solver
  1. Write the objective on the first line, such as maximize 40x + 30y.
  2. Add one constraint per line, such as x + y <= 12.
  3. Choose whether all variables must be nonnegative, then run the solver.
  4. Review the solution, shadow prices and certificate, then download JSON or CSV.

Useful next steps

Method

The solver uses the two-phase simplex method with Bland's smallest-index rule, which cannot cycle on degenerate problems. All arithmetic uses exact fractions. Source: R. G. Bland, New finite pivoting rules for the simplex method, Mathematics of Operations Research 2(2), 1977.

Certificates

An optimal answer comes with dual multipliers that prove no better value exists. An infeasible problem comes with Farkas multipliers that combine the constraints into an impossible inequality. An unbounded problem comes with a feasible point and a direction that improves the objective forever. Each certificate is checked exactly against your constraints.

Writing the program

Use <=, >= or = in each constraint, and variable names such as x, y or x1. A line such as x, y >= 0 adds one bound per variable. Strict inequalities and products of variables are not supported.