Don't Be Mad At Optimization, Be Mad At *Their* Objective

February 08 2024

The Premise

This is a short defense of a subject that I usually only talk about on the technical part of this website: optimization.

Nowadays, optimization seems to be blamed for everything from failures in the supply chain to the over-fitting of machine learning models. But, I think the fury is mis-placed because when people bring up the topic of optimization, we don't have a common understanding of what it is.

By the end of this post, I hope to have convinced you that being mad at optimization because of an optimized product is a lot like being mad at Material Science because of an epidemic of plastic waste; It's not the fault of the field itself, but the fault of how people use it.

What even is optimization?

To focus the discussion, I will define optimization as: the selection of the best possible decision from a list of options.

There are a few things in this definition that should make your brow furrow:

  • What does "best" mean?
  • How do you know what decisions are "possible"?

These two questions are great to ask! And they have likely launched thousands of academic careers and hundreds of business ventures. Let's try to dig into each of these questions a bit.

What does "best" mean?

The fact that optimization is concerned with the "best" decision, indicates that there is some method of measuring the quality of decisions. The mathematical term for this metric is usually called the "objective function" or cost function.

This objective function is literally telling you how well you're doing with respect to your objective. Think of it as a score in a game.

Now, the objective function can be anything. In stock portfolio optimization, it can be the amount of money you expect to gain with respect to a certain stock decision. In the vehicle routing optimization, it can be the amount of time it takes for a vehicle to go from its starting point to its ending point. And in the optimization of a goods supply chain, it can be the amount of fuel that is used to transport the expected number of goods to their destination.

Critically, the "scoring" is something that you must choose before you can begin optimizing. And, you are free to swap out the scoring method for another one that you prefer.

To make this example more concrete, let's look at a historical example where scoring systems changed a game: the creation of the 3-point line in basketball. The 3-point shot was famously introduced by the American Basketball League in 1961 .

This change was made during it's competition with other rival basketball leagues and was meant to make the ABL's basketball games more exciting. Previously, many games featured rapid play where scores were made on the fast break and in the paint, but the changing of the scoring system rewarded different decisions.

The introduction of 3-pointers meant that a longer-range, slower style of play could also win the game. And the beautiful, long-range shots that you could see in only the ABL's games made them look different than any other competitors' league.

So, changing the scoring system (objective function) gave the ABL the benefit that they intended. But it also generated unintended consequences.

Returning to our basketball example, the decision to incorporate 3-pointers has also changed how basketball players are trained and how basketball games are played. The changes have been so significant that I've even seen some people argue that the 3-point shot has ruined basketball.

I won't wade into that debate, but I will say that these unintended consequences can be serious depending on what decisions we are making using optimization. In basketball, the consequences may be that teams aggressively pursue a certain style of play. In global supply chains, the consequences of our objective function might mean that our supply chain is extremely fragile and thus will break down if there is a disruption (say, because of a global pandemic).

In short: Sometimes we blame "optimization" for problems, when we should be blaming the objective function that we (or another mad hatter) chose.

But, of course, the objective function isn't the only thing that we need to consider when we're optimizing. We also need to consider the decisions that are "possible".

How do you know what decisions are "possible"?

The second question is a bit more subtle and it is where I think the most legitimate debate can be made about optimization.

Who knows what decisions are possible?

There are some fields where you have a good case for saying that "the possibilities are completely known." For example, in stock portfolio management you can only buy or sell a stock\(^{[1]}\). In vehicle routing, you can only choose to send vehicles on paved streets in a given area.

But there are other fields where the possibilities are either too numerous to count or are not known at all. In basketball, there are an infinite number of slightly different ways to move the ball as a team. In global supply chains, the number of containers that you choose to put onto a single ship has a limited number of options, but when you consider the hundreds of thousands of ships that are moving around the world, the number of options quickly becomes unmanageable.

In the case where the number of options is too numerous to count (or to put in a commercial optimization solver), decision-makers choose to solve the problem approximately. There is an entire field studying approximation algorithms which seek an answer that is "close enough" to the true solution to the problem. "Close enough" is usually defined by the decision-maker and is a trade-off between the quality of the solution and the time it takes to find it.

Thus, the sad truth is that the "possible decisions" (just like the objective function) are chosen by the decision-maker before optimizing. And thus it is also susceptible to the same problems as the objective function.

So, what should I do?

If optimization can be misused in so many ways, then you may wonder what you should do when you see it misbehaving in the wild. As we've established, optimization is a tool that can be misused or properly used by people. So, you should interrogate the people that are using it!

The interrogation doesn't need to be like anything you've seen in spy movies. It can be as simple as getting curious about the objective function and the possible decisions that the decision-maker has chosen. You can ask questions like:

  • What is the feasible set (of decisions) in your optimization problem?
  • Are there any approximations that you used in your problem?
  • Is your optimization robust to noise? Or unexpected events?

These questions can help you better understand what hidden biases and assumptions are embedded in the optimization problem. And, if you're convincing enough, you can get them to tweak the problem to better suit the situation. Happy optimizing! :)

\(^{[1]}\) I know this is a gross over-simplification; I know that derivatives exists, and that the timing at which a stock is sold also matters a bunch. I apologize for the generalization.