What is linear programming?
A plain-English business guide · Published July 10, 2026 · 8 min read
Linear programming (LP) is a mathematical method for finding the single best decision when your choices, resources, and rules can be expressed as straight-line relationships. It is the workhorse behind decades of measurable savings in procurement, scheduling, routing, product mix, inventory, and supply-chain design — the same decisions the Optimal platform automates every day.
If you have ever built a spreadsheet with a target cell, a set of adjustable inputs, and a list of "must not exceed" rules, you have described a linear program. LP just solves it exactly — instantly, at scale, and across millions of variables that a human planner cannot hold in mind at once.
The three parts of every linear program
Every LP model is made of the same three ingredients:
- 1Decision variablesThe things you are choosing. How many units of product A to make? How many trucks to dispatch on lane B? How many pounds of raw material to buy from supplier C?
- 2Objective functionThe single quantity you are trying to maximize (profit, throughput, service level) or minimize (cost, distance, waste). Only one number wins.
- 3ConstraintsThe rules the answer must respect. Machine capacity, contract minimums, working-hour limits, inventory balance, service commitments, budgets, physics.
A tiny example, end-to-end
A bakery makes two products: bread and croissants. Bread earns $2 profit; croissants earn $3. Each bread uses 1 hour of oven time and 1 lb of flour. Each croissant uses 2 hours of oven time and 1 lb of flour. You have 8 oven-hours and 5 lb of flour today. What should you bake?
Maximize 2·bread + 3·croissants (profit)
Subject to 1·bread + 2·croissants ≤ 8 (oven-hours)
1·bread + 1·croissants ≤ 5 (flour)
bread, croissants ≥ 0An LP solver returns the answer in milliseconds: bake 2 breads and 3 croissants for a profit of $13. It also tells you the oven is fully booked while you still have flour to spare — so the oven is the bottleneck, and the shadow price on oven-hours reveals exactly how much a ninth hour would be worth.
Why "linear"?
"Linear" means every relationship is proportional: doubling the batch doubles the flour and doubles the profit. That restriction sounds severe, but it is what makes LP exactly solvable at industrial scale. Real problems with millions of variables — like a national trucking network or a multi-plant production plan — are routinely solved to proven optimality in seconds. Nonlinear and heuristic methods cannot make that promise.
When decisions have to be whole numbers (you cannot dispatch 2.6 trucks or open half a shift), the problem becomes an integer linear program (ILP) or mixed-integer linear program (MILP). Modern solvers handle those too — and virtually every real business problem is a MILP.
What linear programming is used for in business
The same LP engine powers wildly different decisions. A few we see every week:
- Procurement & sourcingAward volume across suppliers to hit the lowest total landed cost while honoring contract minimums, lane capacities, and diversification rules. Typical savings: 6–12%.
- Scheduling & workforceAssign shifts, crews, and machines so every task is covered at the lowest labor cost, without violating skills, availability, or overtime limits. Typical savings: 5–10%.
- Routing & shippingChoose the lanes, modes, and truckloads that deliver on time at the lowest cost — often collapsing multi-day planning cycles into minutes. Typical savings: 8–15%.
- Product mix & pricingPick the SKU mix that maximizes margin under demand, capacity, and material constraints — not just revenue. Typical savings: 4–9%.
- Inventory & bills of materialsDecide what to stock, where, and in what form — even across complex BOMs and substitutions. Typical savings: 5–11%.
- Supply-chain designChoose which plants, warehouses, and lanes to operate to serve demand at the lowest total cost. Typical savings: 6–12%.
Linear programming vs. AI
LP and AI are not rivals — they are teammates. AI is excellent at predicting what demand, prices, and lead times will be. LP is excellent at deciding what to do about those predictions given every rule the business must follow. Optimal Applications combine both: AI forecasts feed a linear-programming decision engine that returns the single best plan, provably optimal, respecting every real-world constraint.
Frequently asked questions
What is linear programming in simple terms?
What is the objective function?
What is a shadow price?
What is the difference between LP and integer LP?
Do I need a data scientist to use LP?
Keep reading
More guides are on the way. In the meantime: