← Back to blog

The Landscape

The first optimization problem I ever worked on was the eight queens problem. You have a chessboard, eight queens, and one rule: no queen can threaten any other. No shared rows, columns, or diagonals.

It sounds manageable, but the search space is enormous. There are over four billion ways to place eight queens on a board, and only 92 of them work. You can't check every possibility. You need a strategy.

One of the 92 valid solutions to the eight queens problem

The approach that fascinated me most was thinking of the problem as a landscape. Each possible arrangement of queens corresponds to a point, and each point has an elevation based on how good the arrangement is. Better solutions sit higher. Your job is to find the highest peak.

The natural strategy is to follow the slope upward. Look around, take a step in whatever direction improves things most, repeat. This is basically what gradient descent does, and it works beautifully on smooth, well-behaved landscapes with a single peak.

But most interesting landscapes aren't smooth and well-behaved. They have ridges and valleys and plateaus. They have lots of peaks, most of them not the tallest. And the problem is brutal in its simplicity: when your algorithm reaches a peak and everything slopes downward in every direction, it stops. It has no way of knowing whether it's standing on the tallest hill in the landscape or just a bump with mountains hidden beyond the horizon.

This is the local optimum problem. And the thing that hooked me wasn't just the math. It was the feeling of it. The idea that you could be somewhere that looks and feels like the best possible place, and be wrong, and have no way of knowing.

Getting Unstuck

There are remarkably clever solutions to this.

My favorite is simulated annealing. It borrows its name from metallurgy, the process of heating metal and then slowly cooling it so the atoms can settle into a strong crystalline structure. Cool it too fast and you get something brittle and disordered. The atoms get trapped in whatever local arrangement they happen to be in. Cool it slowly, and they find their way to something much better.

The algorithm works the same way. You start at a high "temperature," which in practice means you're willing to accept worse solutions. You make random moves, and even if they take you downhill, you sometimes go anyway. This sounds counterproductive, but it's the whole insight. By tolerating worse outcomes early on, you escape peaks that aren't the tallest. You wander through valleys, cross ridges, explore regions of the landscape you'd never reach if you only ever climbed.

Then you slowly cool down. You become more selective. You still explore, but you're less willing to accept big steps downward. By the time the temperature is low, you've covered a lot of ground, and you're settling into what is, hopefully, somewhere near the real peak.

I find this genuinely beautiful. The core insight is that to find the best solution, you have to be willing to make things worse first. The descent isn't failure. It's how you avoid getting trapped.

Simulated annealing animation showing a search that starts with wild jumps and gradually settles toward the global optimum
Source: Wikimedia Commons

How Much Should You Search?

This connects to a broader question that shows up all over optimization theory: when should you explore and when should you exploit?

The multi-armed bandit problem frames it as a row of slot machines with different payoffs. You don't know which is best. Every pull is a choice: stick with the one that's been working, or try something new. Too much exploitation and you never find the best option. Too much exploration and you waste pulls on machines that don't pay. The right balance depends on how many pulls you have left. Which is really just asking: how much time do you have?

The secretary problem sharpens this further. You're interviewing candidates one at a time, and you have to decide on the spot, no going back. The mathematically optimal strategy: reject the first 37% unconditionally. Just observe. Then accept the first candidate who's better than everyone you've seen so far. It gives you roughly a 37% chance of landing the absolute best candidate, which is provably the best you can do.

These results are satisfying. They have a precision to them that feels like real answers. And I've genuinely tried to think about life decisions through these frameworks. When to keep searching for the right job, the right city, the right project. How much time should be exploration versus commitment. Whether the 37% rule applies to apartment hunting.

It never quite works.

Where the Frameworks Stop Helping

The formal solutions are clean because they make clean assumptions. The secretary problem assumes you know how many candidates exist, that they arrive in random order, that you can rank them on a single scale, and that "best" means one thing. Multi-armed bandits assume the payoffs don't change over time.

Life doesn't hold still like that. The landscape shifts while you're searching. Options you passed on aren't waiting for you. And sometimes you can't even rank what you've seen, because the thing you're optimizing for is something you can only name in retrospect.

But what really breaks the metaphor is something more personal.

I've been at points where I could feel that I was at a local optimum. Things were good. Stable. By every measure I knew how to take, I should have been satisfied. But there was this sense that the peak I was standing on wasn't the highest one. That something better existed, but getting there would mean leaving behind the certainty of where I was for something I couldn't see or guarantee.

And the topology of it is what made it hard. To reach a higher peak, you often have to go down first. Sometimes far. You have to make things genuinely worse before they can get better, and you don't know how deep the valley goes or how long you'll be walking through it.

In those moments, the thing that actually moved me wasn't a temperature schedule or the 37% rule. It was something more like a gut feeling. An intuition that this isn't it, even though I couldn't articulate what "it" would look like or prove that it existed.

Is Your Gut an Optimizer?

So what is that? What's actually happening when you "just know" you haven't peaked?

One possibility is that intuition is just a really sophisticated optimization algorithm, one that evolution has been tuning for a long time, processing more information than conscious thought can handle and surfacing its conclusions as feelings. There's evidence for this. Research on expert decision-making shows that people with deep domain experience develop pattern recognition that operates faster than deliberate analysis. Chess grandmasters feel which moves are right before they calculate. Experienced firefighters sense danger before they can explain why. It's not mystical. It's compressed experience.

Maybe our sense of being at a local versus global optimum is something like that. A background process running on a lifetime of data, delivering its output as a feeling rather than an argument.

But I'm not sure that covers all of it. Because sometimes the feeling isn't pattern recognition at all. It's something more like direction. A sense of alignment or misalignment that doesn't seem to come from experience so much as from somewhere deeper. I don't know what to make of that, and I'm not interested in forcing it into the optimization framework just because it's the framework I started with.

What the Landscape Can't Capture

There's something else that nags at me about the whole metaphor.

Optimization landscapes assume a fixed terrain with a fixed scoring function. You're a point on the surface trying to find the peak. But what if the search itself changes the landscape? What if going through a valley, experiencing the difficulty and uncertainty of that descent, actually changes what the peaks look like when you arrive?

People who've been through hard transitions often describe it this way. The struggle wasn't just the cost of reaching somewhere better. It was part of what made "better" possible. The scoring function changed because of the journey.

This feels more honest to me than any of the formal solutions. Because in life, you're not a fixed algorithm traversing a fixed landscape. You're something that transforms in the process. The person who arrives at the new peak isn't the person who left the old one. And the peak itself might only be a peak because of the path you took to get there.

Maybe that's why the elegant math never quite satisfies when it comes to the decisions that actually matter. We've built beautiful frameworks for navigating landscapes we can't see. And when it counts, most of us navigate by feel.


If you've thought about this, or if you think I'm off on something, I'd like to hear from you. You can reach me via email or LinkedIn.