The model for this tool
One decision variable per debt per month: x = the payment to that debt that month. A balance recursion keeps everything linear — each month’s balance is last month’s balance grown by that month’s rate (promo-aware) minus that month’s payment. Minimizing total payments is the same as minimizing interest, because the principal is fixed.
minimize Σ payments
subject to balance(i, t) = balance(i, t−1)·(1 + rate) − payment(i, t)
balance(i, t) ≥ 0 for t before the horizon
balance(i, T) = 0 every debt dead by month T
Σᵢ payment(i, t) ≤ budgetWith 3 debts and a 35-month horizon that is 105 payment variables and ~140 rules — a small program by industrial standards, solved here in milliseconds.
The idea in one sentence
Linear programming answers the question "what is the best plan when every rule and every goal is a straight-line relationship?" — it finds the allocation that pushes a goal (cost, interest, priority score) as far as it can go without breaking any rule.
The word "programming" is 1940s operations-research slang for "planning," not computer programming. The method was invented to allocate scarce materials (L. Kantorovich, USSR, 1939; G. Dantzig, USA, 1947) and has been a standard tool in logistics, finance, and economics ever since — the 1975 Nobel Prize in Economics went to its founders.
Why the best plan sits on a corner
Every rule in this tool is a line (or flat boundary), so the set of legal plans is a flat-sided shape — a polygon in two dimensions, a polyhedron in more. This tool's goal is also linear, which means its "equal-value" lines are straight and parallel.
Picture sliding a ruler across the shape in the improving direction: the last point of the shape it touches is always a corner (vertex) — or a whole edge if two corners tie. That is the fundamental theorem of linear programming, and it is why a computer never has to check the infinitely many interior plans: only the finite list of corners, and in practice only a short walk among them.
How the payoff optimizer actually solves it
The solver in this page is the simplex method (Dantzig, 1947). It starts at one corner of the legal shape and repeatedly walks along an edge to a strictly better neighboring corner — choosing the first improving direction by index (Bland’s rule) — until no neighbor is better. That final corner is provably optimal.
A subtlety the solver also handles: a rule set can contradict itself ("save $600 and spend $620"), in which case no plan exists at all — the tool tells you instead of guessing. The walk always terminates (the implementation uses Bland's rule, which forbids cycling), and it is deterministic: the same inputs always produce the same plan.
Why "saved $0" is sometimes the best answer
Run this tool on fixed-rate debts with room in the budget and it will report that the guided plan equals avalanche, payment for payment. That is not a failure — it is a certificate. The linear program has searched every schedule (including exotic ones that split payments five ways) and found none cheaper than the classic highest-APR-first order. The fixed rule is provably optimal precisely where it was designed to work.
The moment APRs change mid-plan — a 0% window expiring is the classic case — that proof breaks: the highest-rate debt changes identity, and re-solving each month (what the guided plan does) beats any order fixed at month one.
Shadow prices: what one more dollar a month buys
Every constraint of the program carries a shadow price — the change in the optimal interest bill if that constraint loosened by one unit. The budget rows’ prices sum to the value of finding one extra dollar every month: typically several dollars of interest erased, because the extra dollar compounds forward through every remaining month of the plan.
The payoff rows price differently: extending the horizon by one month (being allowed one month slower) has a price too — usually negative in cost terms, which is the interest one extra month of dragging costs you.