Optimisation: Finding the Best Answer Under Constraints
Optimisation means choosing the values of a few decisions so that one stated quantity comes out as large, or as small, as it can. Every stated rule has to hold at the same time. Three things go on paper: what may be decided, what counts as better, and what is allowed. If one of them is left unwritten, the answer is a guess. The invented Amaltas workshop's best allowed plan is eight plain crates and six lined crates a day.
Almost nothing is needed to start. Counting, a little division, and the ordinary human belief that one way of spending a day can be worth more than another. None of it needs calculus, matrix algebra or finance. One word trips people more often than any other, and that word is contribution. A reader who can add a column of figures and tell whether twenty one is more than twenty is equipped.
What three things does an optimisation problem need written down?
Start somewhere ordinary. A stall outside one office building fries samosas and vadas. The oil, the flour and the potatoes arrive in fixed quantities each morning, one fryer can only do so much before the lunch rush ends, and the two items do not earn the same amount. So the stall has a genuine question every single morning: how many of each? And it almost certainly answers that question in its head, from habit, without writing anything down.
An optimisation problem is that same question with three specific things committed to paper: what may be decided, what counts as better, and what is allowed. Miss any one of them and there is nothing to solve, only something to argue about. Write all three and the question stops being a matter of judgement and becomes a matter of arithmetic. Arithmetic is much easier to check and much harder to fudge.
The three are worth taking one at a time. The first is the list of quantities somebody is free to set. Not everything about the day is open to choice, and the things that are not belong in the third list rather than the first. The second is the single number to be pushed as high as it will go, or as low, if the number is something like waste or time. The objective has to be one number. Two numbers is two problems. The third is the list of statements that any answer must satisfy to count as an answer at all, and it is the one people leave in their heads. The limits feel obvious to whoever is standing in the workshop and completely invisible to anybody else, including a solverSoftware that hunts for the best allowed answer once a problem has been typed into it. What a solver does, and the several ways it can be confidently wrong, are covered separately..
Notice the thing all three have in common. Every one of them is written by a person. None of them is discovered in the data, measured off the shop floor or handed down by anybody. Somebody decides that the number worth pushing up is the day's contribution rather than the number of crates or the number of happy customers, and that decision is an act of judgement sitting underneath a stack of arithmetic that looks entirely objective. Every later disagreement about an optimisation result turns on that judgement, so keep hold of it.
Name the three things an optimisation problem needs written down.
What is the Amaltas workshop actually allowed to decide?
The Amaltas workshop carries every worked figure below, and it makes two things and nothing else: a plain crate and a lined crate. There is no third product waiting in the wings, no side business, and no question of changing what it makes. The only question is how many of each, today.
So the whole plan for a day is two numbers, and a quantity somebody is free to set like that is called a decision variable. They are the plain crate count and the lined crate count. Eight and six is a plan. Eleven and nothing is a plan. Nothing and nothing is a plan too, and a poor one, but it is on the list. Anything that can be said about the workshop's day is a statement about those two numbers.
Why two? Because two is what makes this drawable. Two numbers are a point on a chart: run the plain count across and the lined count up, and every conceivable plan is one dot in that picture. Three decisions would need a room and a model built inside it. A place making forty things has forty decisions and nothing to look at whatsoever. The arithmetic is identical in all three cases. Only the ability to look at it changes. A teaching case is built with two and not forty for precisely that reason.
Be careful about one confusion here. Nothing at this stage trips more people. The boards, the hours and the cloth are not decisions. The workshop does not choose how many boards arrive. They arrive. The workshop chooses how to spend them, and a decision variable holds exactly that choice.
The Amaltas workshop makes plain crates and lined crates. How many decision variables does that give, and why does the number matter here?
What counts as better, and how does that become one number?
Treatments of this subject usually begin, at about this point, to assume some knowledge of finance. One term does all the work, and it can be built from nothing but arithmetic.
When the Amaltas workshop makes and sells one plain crate, money comes in. Against that, some things were bought specifically because that crate was made: the boards that went into it, the glue, the nails. Take the second away from the first and what is left is the crate's contribution. Contribution is what one crate leaves behind after the things bought for that crate have been paid for, and it is emphatically not profit. A plain crate leaves Rs 300/-. A lined crate leaves Rs 450/-.
Why is it not profit? Because the workshop also pays for things that arrive whether the day is busy or idle. The rent does not care how many crates were made. The wages do not either. Nor does the standing orderA repeating purchase that goes out on its own every morning unless somebody cancels it. The order arrives and is paid for whether the day turns out busy or quiet. of twenty boards, which turns up daily at Rs 120/- a board and costs Rs 2,400/- whether it is used or not. Add Rs 1,900/- of rent and wages and there is Rs 4,300/- a day sitting outside the plan altogether. The rent, the wages and the standing order are not the plan's business, and that is exactly why they stay out of the number the plan is judged on.
The two contribution rates give the second of the three things. The day's contribution is Rs 300/- times the plain crate count plus Rs 450/- times the lined crate count, and the whole exercise is to make that number as large as it will go. One number, built by multiplying and adding, no judgement left in it once the two rates are fixed.
And here is the sentence to keep: once the Rs 4,300/- that does not move has been paid, a day earning Rs 5,100/- of contribution is worth Rs 800/-. Both figures are true, they describe the same day, and they differ by a factor of more than six. Somebody who quotes the first while meaning the second has not made a small error.
A day of 8 plain and 6 lined crates earns Rs 5,100/- of contribution. Is that the day's profit?
What is allowed, and where do those limits come from?
Now the third list, and every entry on it is a plain physical fact about the day rather than a policy or a preference.
Twenty boards arrive each morning. A plain crate takes one board and a lined crate takes two, so the boards used are the plain count plus twice the lined count, and that total cannot pass twenty. Next, the benches. Three benches run eight hours each, giving twenty four, less two hours a day held back for setting up, leaving twenty two bench hoursOne hour of one workbench with somebody standing at it. Two benches busy for one hour spend two bench hours, so the measure counts time and workspace together.. A plain crate takes two of them and a lined crate takes one, so twice the plain count plus the lined count cannot pass twenty two. Third, the lining. Only the lined crate uses cloth, one rollA single length of lining fabric, bought whole and used whole. Half a roll cannot be ordered, so the day's supply arrives as a count rather than as a measurement. each, and eight rolls arrive, so the lined count cannot pass eight.
Then there is a fourth rule that nobody ever writes down and every answer has to obey: neither count can fall below zero. It sounds too obvious to state. The rule is not too obvious to state, and the reason is worth understanding now rather than later. Arithmetic has no idea that a crate is a physical object. Minus three plain crates satisfies the board limit beautifully, frees up six bench hours and would let the workshop report a larger number, and only a human being knows it is nonsense. Every rule that lives in a person's head instead of being written down is a rule the arithmetic is free to break.
A plan of 9 plain and 6 lined crates: which rule does it break, and by how much?
What does the whole set of allowed plans look like?
Three things are now on paper. Two decisions, one number to push up, three limits plus the unwritten fourth. The answer will be one of these plans and nothing else, so it is worth looking at what is on the table before anything is solved.
Count only whole cratesFinished crates rather than part-built ones. Whole units keep a plan made of things a customer could take away at the end of the day., since half a crate is not something a customer takes away, and go one row at a time up the lined crate count. With no lined crates at all, the benches allow eleven plain, so the plans run from nothing to eleven: twelve of them. With one lined crate, eleven. With two, eleven again. Then ten, ten, nine, nine, and as the cloth and the boards start biting together, seven and finally five. Eighty four plans satisfy all three limits at once, and the best plan is one of those eighty four.
Draw the same thing without restricting yourself to whole numbers and each limit becomes a line, with everything on one side of it allowed and everything on the other side out. Stack the three lines together with the two zero limits and what survives is a five sided region. Specialists call an allowed plan a feasibleThe word specialists use for allowed. A plan is feasible when it breaks none of the rules, whether or not it is any good, and the shape of the set they form is covered separately. one, and the region in its own right, its shape and what can go wrong with it, is taken up separately later. For now just look at it. Seeing the answer sit on a corner explains more than any amount of description.
As the workshop makes more lined crates, the day's contribution rises. Does it keep rising all the way to eight lined crates?
Move one thing, and watch which rule takes over.
One control. The slider sets how many lined crates the Amaltas workshop makes, and the plain crate count is then pushed as high as the three limits still permit. Everything else is held still: the boards, the bench hours, the cloth and both contribution rates never move. The marker walks the upper edge of the region, the bar rescales, and the two tracks underneath show which rule is doing the stopping. The control opens at 6 lined crates, and that setting gives 8 plain and exactly Rs 5,100/-, the same figure printed above.
Choose 6 lined crates and the rules allow at most 8 plain, worth Rs 5,100/- of contribution for the day. At this setting both the boards and the bench hours run out together, which is what makes this plan the best one allowed. This is the best allowed plan, and it is the figure printed above. 2 rolls of cloth are left on the shelf.
Educational illustration. The three limits and the two contribution rates are held fixed while only the lined crate count moves. The control stops at 8 because that is the cloth rule. At three of the nine settings the largest allowed plain count lands on a half crate, and the panel shows it rather than rounding, so the edge can be walked smoothly; the peak at 6 lined crates is a plan made of whole crates.
How is the best plan found, and where does it sit?
The edges of that region are worth a second look. Contribution climbs steadily in one direction across the picture, and a quantity that climbs steadily across a flat-sided shape reaches its largest value at one of the shape's corners. So the corners are where to look. But which corners, exactly? Not the ones the eye picks off the drawing. A drawing at this scale can be off by half a crate and nobody would see it.
Here is how they are actually obtained. Each limit, held at its maximum, is a boundary lineThe line where a limit is used right up to the last unit. Stand on it and nothing is left; step past it and the limit has been broken.. There are five of them: boards, bench hours, cloth, and the two lines where each crate count sits at zero. Take every pair of those five, work out where the pair crosses, and test that crossing against all the rules. Ten pairs. One of them, the cloth line and the line where the lined count is zero, never crosses at all because the two are parallel. Four of the remaining nine give crossings that break some other rule and are thrown out. Five crossings survive, and they are the region's five corners: nothing and nothing, eleven and nothing, eight and six, four and eight, and nothing and eight.
Now put the contribution rate against each. Nothing and nothing earns Rs 0/-. Eleven plain and no lined earns Rs 3,300/-. Eight plain and six lined earns Rs 5,100/-. Four plain and eight lined earns Rs 4,800/-. No plain and eight lined earns Rs 3,600/-. Eight plain crates and six lined crates wins, and it wins outright by Rs 300/- a day rather than tying with anything. That is a comparison of five computed numbers, not an opinion, and anybody can redo it in a minute.
The five corners are worth Rs 0/-, Rs 3,300/-, Rs 5,100/-, Rs 4,800/- and Rs 3,600/- a day. Which is the answer, and how can that be known?
What does the winning plan use up, and what does it leave?
Take the answer apart. Eight plain and six lined uses eight boards for the plain crates and twelve for the lined, twenty of twenty. The same plan uses sixteen bench hours for the plain crates and six for the lined, twenty two of twenty two. And it uses six rolls of cloth out of eight, leaving two sitting on the shelf at the end of the day.
The two spare rolls are not waste and not an oversight. Slack is information, and it is the most practically useful fact on offer here. A limit that still has something left over at the answer is not the limit holding the answer back. Money spent relaxing it buys nothing at all. Offer the workshop cheaper cloth, faster cloth, a second cloth supplier, twice the cloth: the answer stays at eight and six and the day stays at Rs 5,100/-, because cloth was never what stopped it. Boards and bench hours are what stopped it, and those two are where any improvement has to come from.
The household version of this is familiar to everybody. A person says they would cook more if only they had a better knife, and the truth is that they have forty minutes and a better knife saves two of them. The knife is the cloth. The forty minutes is the bench hours. Almost every improvement effort that fails, fails because somebody relaxed a limit that had slack in it.
At the best plan two rolls of cloth are left over. What does the leftover say about buying more cloth?
What does one whole day look like, written out in full?
Everything above, gathered into one place. The three limits as arithmetic, the objective as arithmetic, the five corners with what each of them consumes, and the answer read straight off the table.
| Corner | Plain | Lined | Boards of 20 | Hours of 22 | Cloth of 8 | Contribution |
|---|---|---|---|---|---|---|
| A | 0 | 0 | 0 | 0 | 0 | Rs 0/- |
| B | 11 | 0 | 11 | 22 | 0 | Rs 3,300/- |
| C | 8 | 6 | 20 | 22 | 6 | Rs 5,100/- |
| D | 4 | 8 | 20 | 16 | 8 | Rs 4,800/- |
| E | 0 | 8 | 16 | 8 | 8 | Rs 3,600/- |
Read the columns as sentences and the whole problem is there. Boards used is the plain count plus twice the lined count, capped at twenty. Hours used is twice the plain count plus the lined count, capped at twenty two. Cloth used is the lined count, capped at eight. Contribution is Rs 300/- times plain plus Rs 450/- times lined, and it is the column being maximised. Row C is the largest entry in that last column, so row C is the answer.
| The day at 8 plain and 6 lined | Working | Amount |
|---|---|---|
| Contribution from plain crates | 8 crates at Rs 300/- | Rs 2,400/- |
| Contribution from lined crates | 6 crates at Rs 450/- | Rs 2,700/- |
| The day's contribution | the number being maximised | Rs 5,100/- |
| The standing board order | 20 boards at Rs 120/- | Rs 2,400/- |
| Rent and wages | fixed for the day | Rs 1,900/- |
| What the day is worth once both are paid | Rs 5,100/- less Rs 4,300/- | Rs 800/- |
What goes wrong when nobody writes the objective down?
The failure that never announces itself
The Amaltas workshop never writes an objective down. The workshop runs on a saying instead, one that every workshop everywhere has some version of: never let a bench stand idle. And since a plain crate keeps a bench busy for two hours against the lined crate's one, the plain crate is the one that honours the saying best. So the workshop makes plain crates until the benches are full, and that happens at eleven a day.
Now check that plan against the rules, carefully. The check is the part that makes the failure so durable. Eleven boards of twenty, so the board rule holds with nine to spare. Twenty two bench hours of twenty two, so the bench rule holds exactly. No cloth used at all, so the cloth rule holds with everything to spare. Nothing is broken. Nobody is doing anything wrong. Every bench is busy from open to close and the place looks like a model of efficiency.
And the day is worth Rs 3,300/-, a full Rs 1,800/- a day below the Rs 5,100/- the same workshop could have had without changing a single thing it has. Nothing on the shop floor reveals this. Full benches feel like the definition of a good day, so the saying keeps getting confirmed, and the gap never announces itself.
The habit that fixes it is small. The one number actually being made large is written down, and the saying that has been standing in for it is then checked against that number. Sometimes the two agree, and the saying is a fine shortcut. Here they do not, and Rs 1,800/- a day is what the disagreement costs, every day, quietly.
The workshop fills every bench with plain crates, eleven a day, and breaks no rule at all. So what is wrong with the plan?
What should be asked before accepting an answer that calls itself the best one?
How anybody actually uses this, in a meeting rather than on paper
Most readers meet optimisation results long before ever setting one up. A lender is shown the schedule that minimises a borrower's payments. An analyst is handed the production plan a piece of software says is optimal. A household is told which of two arrangements is better. In every one of those, somebody else did the writing down, and what is handed over is the last line of it.
Five questions, and an answer that arrives without them is a number rather than a plan.
First, what was being decided? If the quantities somebody was free to set cannot be named, the problem that was solved is not yet known. Second, what one number was being made large, and is it the number actually wanted? Contribution and profit differ here by Rs 4,300/- a day, and crates made and rupees earned point in different directions. Third, what rules were written down, and what stayed in somebody's head? An answer inherits every rule that was left out, and it inherits them silently. Fourth, what is fully used at the answer? The fully used rules are the ones worth spending money on, and the ones with slack are not. Fifth, what would have to change for the answer to move? An answer that survives a change of Rs 50/- in a rate is a different animal from one that flips.
The Amaltas workshop answers all five in a line each: two crate counts; the day's contribution; boards, bench hours, cloth and the two zero limits; boards and bench hours both fully used; and a change in either of those two supplies, or in either contribution rate, moves it.
An answer arrives saying the best plan is 8 plain and 6 lined. So what should be asked first?
What sits outside this subject. How a rule is written and read as a piece of arithmetic, what makes one rule sit differently from another, and what happens when a rule is left out entirely are each covered separately, and the three rules here are used without being dissected. The objective is the same, stated as Rs 300/- times plain plus Rs 450/- times lined and used as it stands. What an objective is, how it is built, and how it differs from a rule is a subject of its own, covered separately. The region of allowed plans is drawn above; its shape, its corners, and the ways it can be empty or run off the chart are covered separately. Deciding what share of a pool of holdings each one should take, weighing risk off against return, is a different subject entirely, covered separately under the name portfolio construction and investment management. None of it requires calculus.
Where did every number come from?
Not one figure below came from a record that anybody keeps. The Amaltas workshop was made up, and its limits were chosen small enough to count on paper. Everything that follows from them was worked out afresh, and the working is shown in full.
| What is stated | How it got that value |
|---|---|
| Twenty boards, twenty two bench hours and eight rolls of cloth a day | Chosen by hand for this material, small enough that a reader can test any plan against them |
| Rs 300/- a plain crate and Rs 450/- a lined crate | Chosen by hand, then held fixed everywhere below so no two blocks can disagree |
| The five corners and their five day values | Obtained by crossing the boundary lines two at a time and testing each crossing against every rule |
| Eighty four plans made of whole crates | Counted one lined crate row at a time, twelve then eleven and so on down to five |
| Rs 800/- once the Rs 4,300/- that does not move is paid | Subtraction, shown in full in the day's own table |
The Amaltas workshop, the plain crate and the lined crate are invented.
Educational material. Not advice on any investment, tax, budget or market position.
