Mora Munoz Partners

All on the Line · Mathematics

The Cost of Perfect Optimization

From the Traveling Salesman Problem to financial markets, why perfect optimization becomes irrational at scale.

← All essays
Theme

Optimization

Published

25 February 2026

Reading time

6 minutes

Also on
SubstackLinkedInMedium
The Cost of Perfect Optimization, All on the Line essay card

The Seduction of the Optimal Route

A few weeks ago, while listening to an episode of EconTalk, I found myself fixated on a deceptively simple question: how does a delivery company decide the order in which thousands of packages are delivered every day? On the surface, it sounds like a straightforward logistical challenge. You have a map, a list of addresses, and a fleet of drivers. Arrange the stops in the most efficient sequence, minimize distance and fuel consumption, respect delivery windows, and move on. In a world saturated with computing power, it feels almost embarrassing to imagine that such a problem could resist perfect optimization. We have satellites orbiting the planet and smartphones more powerful than the computers that guided the Apollo missions. Surely we can compute the optimal delivery route.

That intuition collapses under the weight of combinatorics. The classic mathematical version of this problem is known as the Traveling Salesman Problem: given a set of cities, what is the shortest possible route that visits each city exactly once and returns to the starting point? With ten cities, there are 3,628,800 possible routes. With twenty cities, the number of possible routes exceeds 2.4 quintillion. Add just one more city and the number multiplies again. By the time you reach fifty stops, the number of potential permutations is so large that writing it out in full would require more digits than atoms in the observable universe.

This can feel like an exaggeration, but it is simple arithmetic of factorial growth. The number of possible routes grows factorially, which is even faster than exponential growth. Take the set of 10 cities, for example. The possible routes are calculated as 10 factorial, or 10!, which translates into the following multiplication: 10 × 9 × 8 × 7 × … × 1 = 3,628,800. And each additional city multiplies the solution space dramatically. Eleven cities yield nearly 40 million possibilities. Twelve exceed 479 million. Thirteen surpass 6 billion. The curve does not rise smoothly; it accelerates violently.

Now imagine a global logistics company such as UPS or FedEx, managing tens of thousands of daily routes, each subject not only to distance minimization but to traffic patterns, fuel prices, driver hour regulations, priority packages, and weather variability. The theoretical space of all possible system-wide routing configurations becomes astronomically large. Even if a supercomputer evaluated billions of possibilities per second, it would not meaningfully dent the total number of combinations. The dream of computing the single perfectly optimal solution dissolves into computational reality.

When Possibility Explodes

The difficulty here is not a lack of competence or skill; it is structural complexity. Some problems are classified as “NP-hard,” a technical term that describes tasks for which the time required to compute the exact optimal solution grows exponentially with the size of the input. The Traveling Salesman Problem belongs to this class. Each additional stop does not add a small incremental burden; it multiplies the total number of possible solutions. Growth becomes explosive.

To put scale into perspective, suppose a routing algorithm could evaluate one trillion possible routes per second. That figure already exceeds the capability of most real-world systems. Imagine evaluating all possible routes for just thirty cities, or 30! ≈ 2.65 × 1032. Even at 1 trillion per second (about 1012), it would take about 8.4 × 1012 years. The universe is about 13.8 billion years old (about 1.38 × 1010 years). So it would take roughly 600 times the age of the universe. That constraint is embedded in the structure of the problem itself.

What logistics firms do instead is approximate. They use heuristics, intelligent shortcuts that produce solutions close to optimal without exploring every possible permutation. They sacrifice theoretical perfection for computational feasibility. The result is not the mathematically optimal route, but one that satisfies the constraints at a fraction of the computational cost. In practice, these near-optimal solutions may be within a few percentage points of the theoretical minimum distance, yet require only a fraction of the computational cost.

That trade-off introduces a profound insight: in sufficiently large systems, the marginal gain from additional optimization effort declines rapidly, while the marginal cost of achieving that incremental precision explodes. The pursuit of perfect optimization becomes economically irrational long before it becomes mathematically achievable.

The Economics of “Good Enough”

The idea that “good enough” can outperform “perfect” can unsettle people who equate precision with superiority. Yet in large-scale systems, the economics of optimization follow a curve of diminishing returns. Moving from a naïve solution to a reasonably efficient one can generate substantial gains. Moving from 95 percent optimal to 99.9 percent optimal may demand orders of magnitude more computational power, engineering time, and infrastructure investment, while producing marginal operational improvement.

Consider again a logistics network. If refining an algorithm reduces total daily mileage by 10 percent, the savings in fuel, labor, and maintenance are significant. If the next refinement reduces mileage by an additional 0.2 percent but requires a doubling of computing resources and development complexity, the economic calculus changes. The incremental savings may not justify the incremental cost. Optimization itself must be optimized.

This logic extends beyond routing. Financial markets, for example, are often modeled as if they gravitate toward equilibrium prices that perfectly reflect all available information. In reality, the computational problem of aggregating dispersed information across millions of participants is enormous. Prices approximate efficiency not because perfection is achieved, but because the cost of eliminating the last sliver of inefficiency exceeds the benefit of doing so. Arbitrage capital, transaction costs, and latency impose real limits on how much mispricing can be exploited before it disappears. The system settles into a near-optimal state that is stable enough to function.

In organizational design, the same dynamic appears. A company can refine processes endlessly, adjusting reporting structures, workflows, and approval chains in pursuit of maximal efficiency. Beyond a certain point, the friction introduced by further optimization outweighs the gains. Bureaucratic complexity increases. Decision latency grows. The system becomes brittle rather than resilient. What began as refinement becomes rigidity.

The Limits of Control

The desire for perfect optimization often masks a deeper impulse: the desire for total control. If we could compute every possibility, evaluate every trade-off, and eliminate every inefficiency, we might believe that uncertainty itself could be subdued. Large systems resist that fantasy.

In credit risk, which I know intimately, models can incorporate thousands of variables: income stability, credit utilization patterns, macroeconomic indicators, behavioral data. Adding more variables can improve predictive accuracy, but only up to a point. Beyond that, additional complexity risks overfitting, capturing noise rather than signal. The model becomes exquisitely tuned to past data yet fragile in the face of new conditions. What appears to be optimization may simply be the amplification of noise.

The same is true in algorithmic trading, supply chain management, and machine learning systems that power companies like Amazon and Google. Engineers constantly balance model sophistication against computational cost, latency, and robustness. A model that is marginally more accurate but significantly slower can degrade user experience and overall system performance. The objective function is multidimensional. Latency, reliability, and cost coexist with predictive precision. Perfecting one dimension can weaken another.

The insight that emerges is subtle but powerful: in complex systems, optimization must account for the cost of optimization itself. Compute cycles are not free. Human attention is not infinite. Capital allocation is constrained. When the cost curve of refinement rises faster than the benefit curve of improvement, rational actors stop short of perfection.

Humility at Scale

The illusion of perfect optimization dissolves under the arithmetic of large systems. This does not imply that optimization is futile. On the contrary, thoughtful approximation has created some of the most efficient networks in human history. UPS reportedly saves millions of gallons of fuel annually through route optimization software, even without solving the underlying combinatorial problem exactly. The gains are real. They are simply bounded.

What changes at scale is our relationship to precision. In small systems, exact solutions may be tractable and meaningful. In massive, interconnected systems, exactitude becomes a mirage. We operate within bands of efficiency, not at singular points of perfection. We accept that 95 percent optimal may be indistinguishable in economic outcome from 99.9 percent optimal once the full cost of achieving that last increment is accounted for.

There is humility in recognizing that the ultimate optimization point may be both computationally unreachable and economically irrelevant. The world’s largest delivery networks, financial markets, and digital platforms function not because they have solved every equation to completion, but because they have learned where precision stops paying. In systems vast enough to defy exhaustive calculation, wisdom lies in knowing when approximation is the optimal strategy.

— Carlos E. Mora

I wake up, I build, I repeat. No guarantees.

I work like it’s all on the line, because it is.

Family is the only true legacy.

Your name is your currency, and it must be earned daily.

The practice

The arithmetic in these essays is the arithmetic the practice runs on a mandate.

Discuss a mandate →