1. The problem
A room is 5 m long, 4 m wide and 3 m high. An ant sits in one bottom corner and wants to reach the opposite top corner, crawling only on the walls, floor and ceiling. What is the shortest route?
Along the edges is 5 + 4 + 3 = 12 m. Across the floor diagonally and then straight up is √(5² + 4²) + 3 = 9.40 m. Can it do better?
2. The answer
3. Working it out
A path that crosses two faces lies flat when you unfold those faces into one rectangle, and on a flat sheet the shortest path is a straight line. The ant must cross one edge between the start face and the end face; there are three essentially different choices, giving three rectangles:
Expanding the squares, all three share l² + w² + h² and differ only in the cross term: 2wh, 2lh or 2lw. The smallest cross term leaves out the largest side — so pair up the two smaller sides.
Dudeney's spider and fly (1903)
Henry Dudeney's famous version: a room 30 ft long, 12 ft wide and 12 ft high. A spider is on one end wall, in the middle, 1 ft below the ceiling; a fly is on the opposite end wall, in the middle, 1 ft above the floor. The obvious route (up, along the ceiling, down) is 1 + 30 + 11 = 42 ft. The shortest route crosses five of the six faces and is exactly 40 ft: on the right unfolding it is the hypotenuse of a 32 × 24 right triangle.
4. Unfold your own box
The three unfolded nets. The ant's straight path is drawn on each; the shortest is in blue.
5. Fine print
- Flying straight through the air (the space diagonal) is shorter still: √(l² + w² + h²).
- The unfolding trick is used for routing cables and pipes along walls, and for finding the shortest belt or hose path around a machine housing.
- For points that are not at corners (Dudeney's case), paths over three, four or five faces can win, so all unfoldings must be checked.