wild-inter.net

Linear programs

An LP with two or three variables, drawn: every constraint is a half-plane (in 3D a half-space), the feasible region is their intersection. Slide the line (plane) of equal objective value through the picture and watch where it leaves the region. Switch constraints on and off to make the LP unbounded or infeasible; drag the arrow to turn the objective.

Objective
View
Feasible region
\(z\;=\)
What you see
The LP
click a constraint to switch it off or on
Input as text
One line per item; lines starting with # are comments.
vars s k — the variables (two or three of them; the first is the horizontal axis, in 3D the third points up).
max 195s + 255k or min 2x + 3y — the objective.
4s + 4k <= 5000 | Orchard | red — a constraint: linear expressions on both sides of <=, >= or = (also ≤, ≥; chains like 0 <= x <= 4 give two constraints; x, y >= 0 one per variable). After | an optional name, then optionally a colour (red blue green teal purple brown pink olive gray or #hex) and off for a constraint that starts switched off.
nonneg — shorthand for x ≥ 0 for every variable.
view -30 1450 -30 950 — the visible window (\(x\) range, then \(y\), in 3D also \(z\)); both axes are drawn to the same scale.
label s #Sossenheimer Roter trees — an axis label; unit € — a prefix for objective values; title … — the name in the menu.

The page address can carry an LP, too: #lp=hessy picks a prepared one, &min flips the objective, &off=2,5 switches constraints off (numbered from 1 as in the list), &present opens the presentation view. #src=… holds a whole LP in the format above (URL-encoded); “current LP” then “Load” and the address bar give you such a link.

Simplex tabs. “Load” puts the LP into the tab that is open. There every variable needs x ≥ 0, “≥” constraints are multiplied by −1, and “=” is not allowed; up to eight variables (pictures for two or three) and twelve constraints. The tab “Simplex” also needs the origin to be feasible; the full story runs Phase I otherwise. stretch scales the three axes of a 3D picture to the same length. Addresses: #simplex or #full, with &lp=walk, &step=5, and in the full story &rule=bland (dantzig, best, click).