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:

  1. 1
    Decision variables
    The 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?
  2. 2
    Objective function
    The single quantity you are trying to maximize (profit, throughput, service level) or minimize (cost, distance, waste). Only one number wins.
  3. 3
    Constraints
    The 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 ≥ 0

An 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 & sourcing
    Award volume across suppliers to hit the lowest total landed cost while honoring contract minimums, lane capacities, and diversification rules. Typical savings: 6–12%.
  • Scheduling & workforce
    Assign 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 & shipping
    Choose 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 & pricing
    Pick the SKU mix that maximizes margin under demand, capacity, and material constraints — not just revenue. Typical savings: 4–9%.
  • Inventory & bills of materials
    Decide what to stock, where, and in what form — even across complex BOMs and substitutions. Typical savings: 5–11%.
  • Supply-chain design
    Choose 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?
A method for finding the best possible outcome — highest profit, lowest cost, shortest route — when your decisions and rules can be written as straight-line equations.
What is the objective function?
The single quantity you are maximizing or minimizing. Every candidate answer is scored by this function, and the optimizer returns the highest-scoring one that satisfies every constraint.
What is a shadow price?
How much the objective would improve if a binding constraint were relaxed by one unit. Shadow prices tell you which constraints are actually costing you money.
What is the difference between LP and integer LP?
LP allows fractional answers; integer LP (ILP / MILP) forces whole numbers where reality demands them — trucks, shifts, awarded suppliers.
Do I need a data scientist to use LP?
No. Modern optimization platforms — Optimal included — expose LP through business-friendly workflows. The math runs underneath; planners see decisions, savings, and trade-offs.

More guides are on the way. In the meantime: