In 1952, Claude Shannon built a mechanical mouse that could solve any maze. This simulation allows you to see how it worked, step-by-step. More details below.

Ready

In 1949, Betty Shannon gave her husband Claude a Meccano set for Christmas. It sparked a string of mechanical curiosities. The most celebrated was Theseus: a maze-navigating mouse, built around 1952.

The hardware

Theseus was a metal mouse on a magnet, steered around a 5×5 grid of removable walls by a motorized arm underneath. The intelligence wasn’t in the mouse, but in the floor. Each of the 25 squares had a relay storing two bits: a direction, N, S, E, or W. The relay circuitry behind the maze drove the arm, read the copper whiskers on the mouse’s nose to detect walls, and updated the relays. Think of it as RAM and CPU: the 25 floor relays are memory; the relay logic is the processor; the mouse is the cursor.

The original Theseus is on display at the MIT Museum in Cambridge, Massachusetts.

How it worked

Shannon described the algorithm in a 1951 letter to Edmund C. Berkeley. The rules fit on a single page:

Shannon's 1951 handwritten notes on the maze-solving mouse algorithm
Shannon's rough notes from 1951, in a letter to Edmund C. Berkeley. Source: cyberneticzoo.com

The Exploration strategy is essentially a “turn left, then explore clockwise” traversal through the maze. The square’s relay stores the last direction the mouse exited the square, updated on every move. When the goal is reached, every relay on the path already points one step closer to the goal. At that point the machine switches to the Goal strategy. This is equivalent to depth-first search, formalized for maze-solving by Trémaux’s algorithm in 1882.

The Goal strategy is simple: At each cell, read the stored direction and go.

The simulation doesn’t cover maze changes or re-dropping the mouse mid-run, but you can see that strategy in the notes and the whole thing in action in the video below.