What is linear programming?
A plain-English business guide · Published July 10, 2026 · 8 min read
Linear programming (LP) is a mathematical method for optimizing a defined objective within a model 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 solvers work within those modeled relationships. Solve time and solution quality depend on the model, data, solver, and stopping conditions.
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 allows LP solvers to optimize a linear objective subject to linear constraints. A reported optimum applies to the formulated model; performance and real-world usefulness depend on the model and data.
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 also support these formulations; the appropriate model depends on the decision.
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.
- Scheduling & workforceAssign shifts, crews, and machines so every task is covered at the lowest labor cost, without violating skills, availability, or overtime limits.
- Routing & shippingChoose the lanes, modes, and truckloads that deliver on time at the lowest cost — often collapsing multi-day planning cycles into minutes.
- Product mix & pricingPick the SKU mix that maximizes margin under demand, capacity, and material constraints — not just revenue.
- Inventory & bills of materialsDecide what to stock, where, and in what form — even across complex BOMs and substitutions.
- Supply-chain designChoose which plants, warehouses, and lanes to operate to serve demand at the lowest total cost.
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 can support planning inputs, while optimization evaluates a defined objective and modeled constraints. Review both AI outputs and optimization assumptions before applying results.
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: