What Is Linear Programming and How Is It Used in Business?

A bakery with one oven, one mixer, and a limited flour delivery has to decide what to bake. That tiny decision has the exact same shape as airline scheduling, factory planning, and ingredient blending. Here's the math behind all of it.

By Petrus Sheya

August 12, 2026 · 8 min read

You run a small bakery. Every morning you decide how many croissants and how many muffins to bake. Croissants sell for more, but they hog your one oven. Muffins sell for less, but your mixer can only churn out so many trays. Flour is shared between both, and the delivery truck already left for the day.

So what do you bake this morning to make the most money?

This isn't a made-up puzzle for a textbook. It's the exact shape of decisions running behind the scenes at real companies, every day: airlines deciding how many seats to sell at each fare, factories splitting machine hours between products, farms deciding what to plant, refineries deciding what to blend into a batch of fuel. Different industries, same underlying question. Maximize (or minimize) something, while a handful of limited resources hold you back.

There's a branch of math built specifically to answer that question. It's called linear programming, and once you see how it works, you'll start noticing the pattern everywhere a business has to divide something scarce.


Why the pricier product doesn't always win

Let's put real numbers on the bakery. The oven can only handle 6 batches of croissants a day. The mixer can only handle 8 batches of muffins. And flour is shared: each croissant batch eats 2 kg, each muffin batch eats 1 kg, and you've got 16 kg total.

We call the two things we're choosing the decision variables. Let's call them xx, the number of croissant batches, and yy, the number of muffin batches. The thing we're trying to maximize, profit, is the objective function. And the limits on oven, mixer, and flour are the constraints. We write the whole setup like this:

maximize z=pAx+5y\text{maximize } z = p_A x + 5y subject to x6,y8,2x+y16,x,y0\text{subject to } x \le 6, \quad y \le 8, \quad 2x + y \le 16, \quad x, y \ge 0

where pAp_A is however much a croissant batch sells for, and each muffin batch earns a flat $5.

Every constraint here is a straight line, and a straight line splits the plane into an "allowed" side and a "not allowed" side. Stack all three limits together and you get a single shape: the region where every rule is obeyed at once. We call this the feasible region, and every corner of that shape is a candidate for the best plan. If you want the full geometric reason the answer always lands exactly on a corner and never in the middle, we proved it from scratch in our piece on the simplex method. Here, we just want to use that fact.

Here's where most people's intuition breaks. You'd think that as croissants get more valuable, you should just gradually shift more of your oven and flour toward them. But that's not what happens. The best plan holds perfectly still, then jumps.

Slide the croissant price and watch the winning plan. It does not drift, it jumps.

(0, 0)(6, 0)(6, 4)(4, 8)(0, 8)
Best plan (croissants, muffins)(4, 8)
Profit$64.00
Tipping point$10.00

Drag the price up slowly from 2.Nothingchangesabouttheplanatall,rightupuntil2. Nothing changes about the plan at all, right up until 10.00. Cross that line and the whole plan flips at once, from mostly muffins to maxing out the oven on croissants. There's no in-between plan. It's one corner or the other, and the switch happens all at once.

This is why real pricing decisions, ad budgets, and production schedules move in sudden jumps instead of smooth drifts when a cost or a price shifts. There's a tipping point sitting there the whole time, doing nothing, until you cross it.


Not every resource is actually holding you back

Look at the winning plan once croissant price is under $10: 4 croissant batches, 8 muffin batches. Quick question: is the oven actually a problem for this plan? It can handle 6, we're only using 4. It's got room to spare.

But the mixer is maxed out at 8, and the flour is completely gone, all 16 kg used. Those two are the real limits. The oven is just... along for the ride.

We call a constraint binding when it's used up completely, and slack when there's room left over. This distinction matters a lot in practice, because it tells you exactly which resource is actually worth fighting for.

Click a resource. Watch which ones are maxed out at this plan, and which have room to spare.

plan (4, 8)
Used / available8 / 8
Slack0
StatusBINDING

Click through the three resources. Notice that only the mixer and the flour show zero slack. If you were the bakery owner trying to grow the business, spending money on a bigger oven would be a complete waste right now. It's not the thing stopping you. The binding constraints are the only ones worth paying attention to.

Businesses use this idea constantly, often without naming it. It's why a factory manager doesn't upgrade every machine at once. They look for the one machine that's running flat out while the others sit idle, and they fix that one first.


What's one more kilogram of flour actually worth?

Now for the interesting part. If flour is binding, that means more flour would let you do more. But how much more, exactly? What would you actually pay for an extra kilogram?

Let's fix the prices (croissants at 8,muffinsat8, muffins at 5) and instead vary how much flour you have. As the flour budget grows, the feasible region gets bigger, and profit climbs. But it doesn't climb at a constant rate.

Press play and watch the flour budget grow. The profit curve bends every time a different resource takes over as the bottleneck.

mixer capsoven capsflour budget (kg) →
Profit$72.00
Shadow price (per kg)$4.00
Real bottleneck nowflour

Press play and watch the curve. From 0 kg up to 8 kg, every extra kilogram of flour is worth exactly 5,becauseitsgoingstraightintomuffinsandmuffinsearn5, because it's going straight into muffins and muffins earn 5 each. At 8 kg, the mixer caps out at 8 muffin batches, so flour has to start going toward croissants instead, and each extra kilogram is now only worth $4. Past 20 kg, the oven caps out too, and flour stops mattering entirely. Extra flour just sits there.

This "extra dollar of profit per extra unit of resource" number has a name: the shadow price. It's not the price you paid for the flour. It's what one more unit of it is actually worth to you, right now, given everything else that's also limiting you. If a supplier offered you flour at 4.50akilogramwhileyourshadowpricewas4.50 a kilogram while your shadow price was 5, buying it would be a clear win. Offered at 4.50onceyourshadowpricedroppedto4.50 once your shadow price dropped to 4, it'd be a loss. The shadow price tells a business exactly how much to pay for more of a scarce resource, and exactly when to stop.


Linear programming isn't only about making more

Everything so far has been about maximizing profit. But the same tool works just as well in reverse: hitting a requirement for the least possible cost. This flavor of the problem is where linear programming actually got its start. During World War II, economists were asked to find the cheapest possible diet that still met the army's nutrition requirements, and the method they built to solve it became the foundation of the whole field.

Picture a company blending trail mix from two ingredients: peanuts, at 3akilogram,andcashews,at3 a kilogram, and cashews, at 8 a kilogram. Every batch needs to weigh at least 10 kg, and it needs to hit a minimum "quality score", where cashews contribute more quality per kilogram than peanuts do. We write this as:

minimize cost=3x+8y\text{minimize cost} = 3x + 8y subject to x+y10,2x+5yQ,x,y0\text{subject to } x + y \ge 10, \quad 2x + 5y \ge Q, \quad x, y \ge 0

where xx is kilograms of peanuts, yy is kilograms of cashews, and QQ is the required quality score.

Raise the required quality score and watch the cheapest recipe swap peanuts for cashews once the cheap option can't hit the bar.

x + y = 102x + 5y = 20(10.0, 0.0)
Peanuts (kg)10.0
Cashews (kg)0.0
Cheapest cost$30.00

Slide the required quality up. At first, nothing changes, an all-peanut batch already clears the bar, and peanuts are cheaper, so why use anything else? But once the requirement passes a threshold, an all-peanut batch can't hit the target anymore, no matter how much of it you use. That's when cashews start entering the mix, and the cost starts climbing.

Notice the shape is the same story as the bakery, just flipped. Instead of a profit line pushed as far out as possible, it's a cost line pulled in as close as possible, stopped by the same kind of straight-edged region. Same math, same corner logic, opposite direction. This exact setup runs procurement decisions for food manufacturers, fuel blending at refineries, and feed mixing on farms, anywhere a business needs to hit a spec at the lowest possible price.


Where this actually runs the world

Once you know what to look for, linear programming shows up constantly:

  • Airlines decide how many seats to release at each fare class, weeks before a flight, to squeeze the most revenue out of a fixed number of seats.
  • Factories split limited machine hours and labor across multiple products, exactly like the bakery.
  • Logistics companies route trucks and assign drivers to minimize fuel and time, subject to delivery deadlines and vehicle capacity.
  • Banks and investment funds split a portfolio across assets to hit a target return while staying inside risk limits.
  • Refineries and food manufacturers blend raw ingredients to hit a spec, exactly like the trail mix example, but at a much bigger scale.

None of these look like a bakery on the surface. But strip away the story and they're all the same shape: a straight-line goal, pulled taut against straight-line limits.

One honest caveat: real business problems often need whole numbers. You can't schedule half a flight or hire a third of a worker. When variables have to land on whole numbers, the problem becomes a close cousin called integer programming, which is harder to solve but builds directly on everything here.

The plain-English version: linear programming takes a business goal and a set of hard limits, and finds the exact best plan by checking the corners of the shape those limits carve out. The best plan almost never sits in the safe middle. It sits pushed all the way up against the resources you're most short on, and the value of relaxing any one of those limits, its shadow price, tells you precisely what it's worth to get more of it.