
The Forgotten Algorithm
In 1944, with the war finally turning, the Royal Air Force ran into a problem simple enough for a child to state — and hard enough that they never solved it before the war ended.
Squadrons were being broken up. Tens of thousands of trained people — pilots, navigators, fitters, radio operators — had to be moved into new roles. One question, repeated thousands of times over: who does what?
The work fell largely to the women of the WAAF — the Air Force's clerks and record-keepers. No computers. Everything known about each person lived on paper — service records, trade classifications, much of it months out of date — pulled, sorted and carried between desks by hand. Rooms of women fitting people to postings, one folder at a time.
And even with perfect records, they'd have been stuck. Because the question is a trap.
A trap dressed as a triviality
The best person for one job is usually the best for several others too. Give them to one posting and you've quietly made the rest worse. You can't decide one at a time — every choice ripples through all the others. To do it properly, you have to weigh every person against every role at once and find the single best arrangement of the whole.
With a handful of people, fine. With tens of thousands, the number of possible arrangements is larger than anything anyone could ever check. By hand, it's impossible.
So they did their best by feel, and the war ended before anyone cracked it. The problem was real enough to kick off a decade of research — it got a name, "the assignment problem," in 1952, and a working solution in 1955.
But none of that was necessary. The answer already existed. It had simply been forgotten.
Invented by accident, a century too early
A hundred years earlier, the German mathematician Carl Gustav Jacobi had already solved it — and not because he cared about jobs or postings. He was deep in the differential equations of classical mechanics. Somewhere between 1829 and 1836, working out how to bound the complexity of a system of equations, he hit a sub-problem — pair n things to n things in the cheapest possible way — and, almost in passing, invented a method to solve it.
He built, in the 1830s, a piece of optimization that wouldn't be "needed" for another century — as a side-tool for celestial mechanics. Then he died, in 1851, before it could matter to anyone. His method was published after his death, in Latin, in a volume almost no one read. And there it sat — the answer to a problem armies and companies would keep slamming into — for over a hundred years.
Which means the women in those 1944 record offices were grinding through, by hand, year after year, a problem that had already been solved — and shelved, in a language almost none of them could read.
Found, lost, found, lost
So the world re-derived it from scratch. In Budapest, two mathematicians — Dénes Kőnig and Jenő Egerváry — built the graph theory that cracked the same problem again, in 1916 and 1931. Forgotten again. Until an American, Harold Kuhn, assembled it into a practical procedure in 1955 and named it "the Hungarian method," honouring Kőnig and Egerváry — with no idea Jacobi had beaten them all by a century. Nobody knew until 2005, when the French mathematician François Ollivier went back to Jacobi's Latin papers, translated them, and realised the tool buried inside was, in essence, the very same method.
A solved problem, lost and found across three centuries.
So what was the answer?
Picture the problem as a grid: every person down one side, every job across the top, and in each square a number — how good, or how costly, that pairing would be.
The obvious move is greedy: find the single best square, lock it in, cross out its row and column, repeat. It feels right. It's exactly the trap — the best square for one person steals the best option from three others.
The breakthrough — found, and re-found, by everyone in this story — was to work the whole grid at once:
- Jacobi found you could systematically subtract values across the grid to expose which pairings were effectively "free," then reduce the whole thing until the single best complete arrangement fell out.
- Kőnig and Egerváry recast it as a picture: two rows of dots — people on one side, roles on the other — joined by lines. Their theorems proved exactly when you can connect everyone at once with the best possible set of lines.
- Kuhn turned it into a clean, repeatable recipe: subtract the smallest number in each row, then each column; cover all the resulting zeros with as few lines as possible; if you can't yet pick a complete set of pairings from those zeros, nudge the grid and repeat. When you can — you're done, and it's provably the best arrangement, reached in a handful of passes instead of checking the impossibly many.
Not a better way to rank. A way to optimise the whole pairing at once. The counter-intuitive heart of it: the best person often shouldn't get the role they're best at, because the system does better if they go elsewhere. Ranking can't see that. Matching can.
Which makes today a little absurd
That idea quietly runs the modern world — airline crews, logistics, ride-hailing dispatch. A neighbouring branch, stable matching, places doctors in hospitals and kidneys in patients, and won the Nobel Prize in 2012. Matching, done right, is one of the most decorated ideas in applied mathematics.
And yet most of today's "AI matching" does the one thing a century of theory says not to: it ranks. Take one side, score it against the other with a language model, return a sorted list. It looks like matching. It's search with extra steps.
Why do we keep defaulting to it? Because ranking is intuitive, search is the paradigm we grew up in, and language models make ranking trivial — so everyone reaches for it. And it has the exact failure the RAF would have recognised: rank everyone against the same yardstick and everyone chases the same top few. The "best" drown in attention, everyone else is invisible, and the system matches badly — even though every individual score was "correct."
Real matching is different in kind. It treats both sides as choosers. It respects capacity — a slot fills, a person takes one job. It optimises the whole, not the best-of-each. None of that falls out of a bigger model or a cleverer prompt. It's a different problem — with a very old, very forgotten answer.
Are you matching, or just ranking?
The remarkable thing isn't that matching is hard. It's that we keep solving it and forgetting. Jacobi in Latin. The Hungarians in graph theory. Kuhn in 1955. A Nobel in 2012. And here we are again, bolting language models onto search and calling it matching.
So if you build anything that pairs two sides — people to jobs, buyers to sellers, anyone to anything — the real question isn't which model you use. It's the one the RAF couldn't answer in 1944, and the one Jacobi had quietly answered a century before:
Are you matching? Or are you just ranking?
Tim Brandin has spent the last eight years building the matching kind — it's most of what he thinks about at tr8s.