×   Home   Blog   Newsletter   Privacy   Contact Us   About

Fly on a Hexagonal Prism

There is a classic high school geometry problem about a fly sitting at one vertex of a unit cube. The question asks, if the fly wanted to crawl (and not fly), to the opposite vertex of the cube (furthest away), what is the shortest distance it could make it in?
What is the shortest distance to get the opposite vertex?
Of course the fly could walk around the edges of the cube to give what is called the Manhattan Distance (or sometimes called the TaxiCab distance), and this gives an answer of three units.
However, on a flat 2D Euclidean plane, the shortest distance between two points is a straight line, so if we opened up the cube to make net, and squashed it flat, the fly can travel on the diagonal line directly between the two locations. This is the hypotenuse of a right triangle, and we can use Pythagoras to calculate the distance to be √5 ≈ 2.24 units (which is shorter than the three units from before).

Hexagonal Prism

Let’s move up the Scovile scale and consider that our fly is now sitting at one vertex of a regular hexagonal prism. Each side of the prism is one unit, and the height of the prism is also one unit. What is the shortest path now?
There are multiple ways to unwrap a hexagonal prism and draw a straight line on the flat net created. Without loss of generality, the path could cross three of the square faces, two of the square faces, one of the square faces, or none of the square faces (If it crosses any more than three, it is symmetric going the other direction). To cross zero faces, it needs to walk only on square edges.
Let's examine these four ways …

Three Faces

This is pretty simple. The fly walks around the three square faces in a flat spiral. Using Pythagoras we can calculate the length of this walk.

Two Faces

Here we can use Pythagoras on the red right triangle.
From the cosine rule:
And from simple geometry:
Substituting in:

One Face

Here from Pythagoras:

Zero Faces

To travel without crossing a square face, the fly needs to crawl directly across one hexagonal end, then up the edge opposite to the vertex. The hexagon is simply made up of equilateral triangles, so the distance across it is two units.
(We can immediately tell this is not the shortest solution as it is not a straight line on the flat plane).


The shortest path for the fly to crawl on a hexagonal unit prism is the path that crosses just one square face.
For a non-intuitive similar problem, check out this article about the shortest way to string lights around a Christmas tree between two points above each other, goes both up and down the tree to get there!