Optimization: You Do It All The Time.
Most people I’ve talked to about it view optimization as math wizardry. The software systems are black boxes that spit out answers they don’t know whether to trust. It doesn’t have to be like this.
In fact, it’s easy to visualize how optimization finds the answer that cannot be improved upon. I’d like to help demystify optimization. (I’ve taken some numbers from a great introductory example. If you recognize them, please send a link to the person who created it so I can give her/him credit.)
You’d be surprised to find out you optimize all the time. What does a person do when faced with an optimization problem? They solve it. Here’s an example:
You bought a machine that can make plastic beer mugs and plastic champagne glasses. You make $25 profit on a case of beer mugs and $20 profit on a case champagne glasses. You want to know how many cases of beer mugs and champagne glasses to make to maximize your profit.
You start out with no limits, no constraints, you can make as much as you want. Since you make more profit on beer mugs than champagne glasses, you turn into a plastic beer mug manufacturer, make beer mugs all day and all night as fast as possible. You make $25 profit per case and the money just rolls in. You maximized your profit. It was that simple.
Suddenly a constraint hits you. You want a life, so decide to limit your work to 8-hours per day. All else being equal, that doesn’t change anything, you still make beer mugs, but only 8 hours per day, not all day and all night.
The machine needs more time to mold beer mugs than champagne glasses, but there are more champagne glasses than beer mugs per case and it all evens out to 15 cases per hour either way (the same production rate). That doesn’t change anything because in 8 hours, it’s going to be 120 cases (15 x 8) no matter what you make. Making beer mugs exclusively is more profitable because there’s $5 more profit per case, and that maximizes profit: $3,000 per day (120 cases at $25 per case). That is a straight-forward profit maximizing optimization strategy.
All of a sudden, the plastic resin market, your raw material, becomes limited and you can buy only up to 1,800 lbs. per day. Well, if there were no difference in weight between a case of beer mugs and champagne glasses, nothing would change. But it turns out beer mugs are heftier; they weigh 20 lbs. per case while the svelt champagne glasses weigh a mere 12 lbs. per case. Now what? You were making 120 cases of beer mugs, but that required 2,400 lbs. (120 at 20 lbs. per case). That’s 600 lbs. more than you can buy now. 1,800 lbs. of plastic will make only 90 cases of beer mugs (1,800 divided by 20), and sure you get a shorter day, 6 hours (90 divided by 15 cases per hr.), but you make only $2,250 per day. That’s $750 less and that ain’t chicken scratch. Suddenly, things are getting a little more complicated.
Naturally you check the profit if you make only champagne glasses. 120 cases of champagne glasses use only 1,440 lbs. (120 x 12) of plastic. That’s 360 lbs. less than what you can buy, so do it. 120 cases make you $2,400 per day (120 x $20) which is $150 more than making just beer mugs. You become a champagne glass manufacturer overnight and work 8 hours per day.
Something is eating at you: You know the more hours you run the more profit you make and the more plastic you buy the more profit you make. Problem is you run out of time before using up all your plastic if you make champagne glasses, but you use up all your plastic before running out of time making only beer mugs. Both options leave resources under-utilized: time or unpurchased plastic. You wonder if there is a combination of beer mugs and champagne glasses that lets you run longer than 6 hours and needs more than 1,440 lbs. of plastic. It will be less than 90 cases of beer mugs because that uses all the plastic and less than 120 cases of champagne glasses because that takes 8 hours. If you can find it, you make more profit. You start trying combinations, you search for the optimal solution.
First you make beer mugs 1 hour, 15 cases, and champagne glasses 7 hours, 105 cases. 15 cases of beer mugs use 300 lbs. and 105 cases of champagne glasses use 1,260 lbs. of plastic. Combined that’s 1,560 lbs., less than 1,800 so it can be done. You make $375 profit on the beer mugs (15 at $25 per case) and $2,100 profit on the champagne glasses (105 at $20 per case). Your profit is $2,475. That’s $75 more than making just champagne glasses so you’re doing better but you still didn’t buy 240 lbs. plastic that you could have because you ran out of time.
You try another combination: you try to split your time evenly making each: 60 cases of beer mugs and 60 cases of champagne glasses. First day you find out that won’t work, but you started the day making beer mugs because they’re more profitable, then made champagne glasses. After only 50 cases of champagne glasses you used up all 1,800 lbs. of plastic and had to call it quits, coming up 10 cases short of your goal and finishing the day after 7 hours 20 minutes. You use the remaining 40 minutes to figure out what happened. The beer mugs used 1,200 lbs. (60 x 20) which left only 600 lbs. That was enough for only 50 more cases (600 divided by 12). But how much profit? $1,500 (60 at $25 per case) on the beer mugs and $1,000 (50 at $20 per case) on the champagne glasses. You made $2,500. That’s $25 more than your first combination, and $100 better than making just champagne glasses. But, still, you had to stop 40 minutes early because you used up all the plastic. Could you have made more with a different combination?
You are making more profit, but what is the most profit you can make? Now you’ve got the math down pat so you don’t have to try it out, you can do it on a spreadsheet. You are going to find out what combination of beer mugs and champagne glasses maximizes profit. You try every combination from 0 to 120 cases. When done, you find the most profit you can make is $2,625 if you make a combination of 45 cases of beer mugs and 75 cases of champagne glasses per day. Interestingly, it turns out that this uses exactly 1,800 lbs. of plastic and takes exactly 8 hours. No other combination came up with more profit. So, you do it and sure enough make $2,625 per day, use 1,800 lbs. of plastic and work 8 hours
To get a feel for it, one day you decide to see what happens if you make one more case of beer mugs and less champagne glasses. You make 46 cases instead of 45. That used an 20 lbs. of plastic so you could only make 73 cases of champagne glasses (24 lbs. less – no partial cases). At the end of the day you had 4 lbs. of plastic left (24-20) and quit work 4 minutes early because you could make only 119 cases. But you made less profit, $15 less: $25 more profit for the case of beer mugs, but $40 less on the 2 cases of champagne glasses.
The next day you made one more case of champagne glasses, 76 instead of 75. That used an addition 12 lbs. of plastic for champagne glasses which meant you were only able to make 44 cases of beer mugs, not 45. At the end of the day you had 8 lbs. of plastic left (20-12) but worked all 8 hours (120 cases). But, again, you made less profit, $5 less: $20 more profit for the case of champagne glasses, but $25 less for the case of beer mugs.
You have a friend that is in operations management and so you ask her if she would check it out, just out of curiosity. You ask her what combination of beer mugs and champagne glasses gives the maximum profit, and does it use all the plastic you can buy and take 8 hours work per day. She boots up her computer, enters your cost, resource, and constraint data into an optimization program and runs it. A second later she says, “The answer is exactly 45 cases of beer mugs and 75 cases of champagne glasses and you’ll make $2,625 profit per day, use exactly 1800 lbs. of plastic and work exactly 8 hours.” “Are you sure,” you say. She replies, “I’m sure, no other combination will make more profit: 45 and 75 is the optimal combination, makes the maximum profit and no other combination can do better.”
Linear optimization is a method of getting that optimal answer faster. If you enjoyed this article and would like to understand the method intuitively, skipping all the hifalutin math, understand what optimization routines are doing and how they find optimal solutions, “like” this article and I’ll write it up. Thanks. .
Brandon, as always you bring insightful understanding with a hint of humour. I hope the plastic you're using in the example was fully recyclable ;)............