DEV Community

Jota Feldmann
Jota Feldmann

Posted on

The Legend, the Problem, and "Shock! Shock!"

Who is Donald Knuth?

Donald Knuth is, without exaggeration, one of the most important figures in the history of computer science. He wrote The Art of Computer Programming — a multi-volume series that has sat on the desk of nearly every serious programmer for the past fifty years. He won the Turing Award, which is the Nobel Prize of computing. He invented TeX, the typesetting system that scientists around the world still use to write papers and format equations.

If you're a developer, you've used his work today without knowing it. That sorting algorithm you called in one line of code? The analysis explaining why it's fast or slow? The mathematical notation in the documentation? Knuth is in the foundation of all of it. He's 88 years old, still active, and considered by many to be the greatest living mind in the field.

The Problem — and Why It Matters

Imagine a three-dimensional grid of dots — think of it like a Rubik's cube, but instead of colored stickers, every dot is connected to exactly three neighbors by wires. Now the question: can you trace three separate routes through this grid so that each route visits every single dot exactly once and returns to where it started — and the three routes never share the same wire?

This kind of path — one that visits every point in a network exactly once — is called a Hamiltonian cycle. It shows up everywhere in practical problems: optimizing delivery routes, designing efficient circuits, scheduling tasks with complex dependencies, planning network infrastructure. The challenge isn't just solving it for one specific grid. It's finding a general recipe that works for any size.

Knuth solved it by hand for a small 3×3×3 grid. A collaborator used a computer to find solutions for grids up to size 16. But a universal construction — a formula that provably works for every odd size forever — had never been found. The number of possibilities grows so explosively that brute-force search is simply not an option, even on the fastest computers alive.

"Shock! Shock!"

Those are the first two words of a paper Knuth published this week.
Let that sink in. A man who has spent decades at the absolute frontier of mathematical thinking, who has seen computing go from punch cards to neural networks, who has written the books that define the field — chose to open a scientific paper with those words.

Why? Because Claude, Anthropic's AI model, found the general construction that no one else had.

It didn't happen in a flash of machine brilliance. It happened over 31 iterations that looked remarkably like real research: early attempts with simple formulas failed; brute-force search proved unworkable; a promising approach inspired by Gray codes (a technique for navigating ordered sequences) got partway there but stalled; decompositions by "slices" of the grid were tried; randomized simulations with controlled backtracking were explored.
On the 31st attempt, something clicked. Claude found a small set of simple directional rules — based on each dot's position in the grid — that generate all three complete cycles. It tested the construction for multiple grid sizes. It worked every time.
Then came the human part.

Claude found the recipe. Knuth wrote the proof — the rigorous mathematical argument for why the recipe works, why it will always work, with no exceptions. Without that step, it's a well-supported hypothesis. With it, it's mathematics.

This kind of problem — finding paths that visit every point in a network — is considered fundamentally hard in computer science. No general shortcut is known to exist.

What changed here isn't that AI "solved everything." It's that it managed to see a hidden structure inside an enormous space of possibilities, and delivered a construction with real mathematical logic — not just a lucky numerical result.

The division of labor that emerged naturally — AI explores, human proves — may be a powerful model for mathematical research going forward.

Knuth published the paper this week, you can read it at https://www-cs-faculty.stanford.edu/~knuth/papers/claude-cycles.pdf


AI Fair usage: Written with Claude, revised with Grammarly. Thinking is still mine.

Top comments (0)