The Mind-Blowing Math Trick That Makes Route Planning 100x Faster (And It’s Not AI)

You’re staring at a map of 50 delivery stops. The algorithm is spinning. Your CPU is screaming. And you’re about to install yet another neural network to solve the Traveling Salesman Problem. Stop.

What if the fastest way to plan a route was to sort the addresses along a fractal curve? Yes, a fractal. And a Rolodex.

We’ve been sold a story that solving hard problems requires hordes of GPUs and PhDs. But the truth is… the most elegant solution is often the simplest.

The best route planner isn’t a brain – it’s a sorting algorithm.

Here’s the trick: spacefilling curves map points in a 2D (or multi-dimensional) space onto a 1D line. The Hilbert curve, the Morton order – these mathematical constructs wriggle through space, visiting every point in a region without crossing itself. When you sort your destinations by their position along the curve, you get a route that’s shockingly close to optimal. The Traveling Salesman Problem becomes a sorting problem. O(n log n). Done.

And the Rolodex? In the 1970s, a mathematician named John Bartholdi showed that Meals on Wheels volunteers could plan their routes by writing each client’s address on an index card, sorting the cards in the order of a spacefilling curve, and flipping through the Rolodex. No computer. No AI. Just a fractal and a filing system.

We don’t need more intelligence – we need better geometry.

This is a slap in the face to the AI hype machine. While everyone is chasing bigger models, the real-world logistics problem of routing meals, deliveries, or even school buses can be solved with a 19th-century office tool and a 19th-century mathematical curiosity. The paradox is breathtaking: we use an infinite, continuous, abstract curve to solve a finite, discrete, concrete problem. The Rolodex, a physical symbol of analog bureaucracy, becomes a fractal oracle.

I saw this firsthand when a friend managing a small food delivery startup was drowning in route optimization software. He spent weeks tuning a genetic algorithm. I showed him the Hilbert curve trick. He implemented it in an afternoon. His routes are 95% as good as the optimal, and his server costs dropped to near zero.

Sometimes the answer isn’t a smarter AI. It’s a smarter perspective.

Next time you’re overwhelmed by a routing problem, remember: sort your points. Walk the curve. Done. The most efficient breakthrough might just be hiding in plain sight – in a drawer, next to a Rolodex.

FAQ

Q: Does this really work for real-world problems?

A: Yes, it's been used for decades in logistics like Meals on Wheels, where routes are planned in O(n log n) time. The trade-off is a small approximation error – but for most practical purposes, the route is nearly optimal.

Q: How can I apply this to my own routing?

A: You can implement a spacefilling curve (like Hilbert or Morton order) in any programming language. Sort your coordinates by the curve's index, then visit them in that order. It's that simple.

Q: Isn't this just a simple heuristic that's not optimal?

A: Exactly – it's a heuristic. But it's a remarkably good one that runs in near-linear time. For problems where you need a quick, good-enough solution without heavy computation, it's often the best choice. The contrarian view: optimality is overrated when speed matters.

📎 Source: View Source