Take the twenty corners of a dodecahedron and the thirty edges between them. Can you walk along the edges, visit every corner exactly once, and end where you began? The question sounds like the bridge puzzle of Königsberg, but its rule is about vertices instead of edges, and that small change gives a very different problem. This page builds one complete tour, shows why a pentagon closed too early is a dead end, and explains why counting odd degrees settles nothing here.
Key terms
Icosian game
Definition The Icosian game is a puzzle invented by the mathematician William Rowan Hamilton in 1857, with a name that comes from the Greek word for twenty. It is played on the dodecahedral graph, whose vertices and edges are the corners and edges of a regular dodecahedron. The player must find a route that moves only along edges, visits each of the vertices exactly once, and then returns along one more edge to the starting vertex. The route may start at any vertex and may leave edges unused, but it may not jump between two vertices that no edge joins, and the start is the only vertex it reaches twice. The answer is that such routes exist. A computer search through all possibilities finds exactly of them, counting two routes as the same when they use the same edges, so that the starting vertex and the direction of travel do not matter.
In plain words Visit every corner of the dodecahedron once, walking only along its edges, and come back to where you started. Unlike the bridge puzzle, you do not have to use every edge.
Example Draw the graph with an outer ring of ten vertices and ten inner vertices . Every outer vertex is joined to its two neighbors on the ring and, by a spoke, to the inner vertex . Every inner vertex is joined to and , with labels counted around so that after comes again. One tour is
It runs around the outer ring from to , steps in to and moves through the inner vertices with odd labels to , steps out to and along the ring to , steps in to , moves through the inner vertices with even labels to , and returns to along a spoke. Every two consecutive vertices are joined by an edge, including and , since counts back around to . The vertices before the return are all different, so this is a solution, and it uses of the edges.
Hamiltonian cycle
Definition Let a graph have vertices. A Hamiltonian cycle is a list that contains every vertex exactly once, such that and are joined by an edge for and is joined by an edge to . As a route, it visits every vertex once and returns to the start, which is the only vertex reached twice. The same cycle can be listed from any starting vertex and in either direction. It uses different edges, and every vertex meets exactly two of them, one for arriving and one for leaving. That condition is necessary but not sufficient, because a set of edges with exactly two at every vertex can split into several separate cycles. A graph that has a Hamiltonian cycle is called Hamiltonian. No simple rule like Euler’s count of odd vertices is known that decides for every graph whether it is Hamiltonian, and no efficient method that works for all graphs is known. Necessary conditions, such as two chosen edges at every vertex, together with careful search are the usual tools.
In plain words Visit every dot exactly once along the lines and return to where you started. At every dot the route uses exactly two lines, one in and one out.
Example Every vertex of the dodecahedral graph has degree , so a Hamiltonian cycle uses two of the three edges at each vertex and leaves exactly one unused. In the tour above the unused edges are , , , and the six spokes from to , and each vertex is an end of exactly one of them. The same condition shows how a search can go wrong. The five vertices form a pentagon, a cycle of five edges. If a partial tour includes all five of its edges, each of those five vertices already has its two tour edges, so no tour edge can join them to the other vertices, and the chosen edges can never become one cycle through all . A search should reject that choice as soon as it closes the pentagon.
Dodecahedral graph
Definition A regular dodecahedron is a solid with faces, each a regular pentagon, with three faces meeting at each of its corners. The dodecahedral graph has the corners as vertices and the edges of the solid as edges. Every vertex has degree , and the degrees add up to , twice the number of edges. In the ring drawing used on this page the vertices are and , labels are counted modulo , which means that after comes again, and the edges are
for , ten edges of each kind, forming the outer ring, the spokes and the inner edges. The inner edges join the even labels in one five-cycle and the odd labels in another. In the drawing the two inner five-cycles cross each other, but a crossing of two drawn lines is not a vertex, and a route may only turn at a vertex. The graph can also be drawn with no crossings at all, for example as the view into the solid through one of its faces. Its shortest cycles have five edges, and there are exactly of them, the boundaries of the faces.
In plain words Twenty dots, each joined to three others, in the pattern of the corners and edges of a dodecahedron. The ring drawing puts ten dots on an outer circle and ten inside, so that every vertex has a short name and a route can be checked step by step.
Example The vertex is joined to , and , and the vertex is joined to , and , since counts around to . The edges can be counted in two ways. There are vertices with edge ends each, ends in all, so there are edges. There are also faces with sides each, sides in all, and each edge borders exactly two faces, which again gives . In the ring drawing the faces are the two inner five-cycles and the ten pentagons , one for each .
Graph traversal
Definition A graph traversal is a walk that moves through a graph along its edges in order to cover it, following a rule that says what must be covered and what may be repeated. An Eulerian path must use every edge exactly once and may pass through vertices again. A Hamiltonian cycle must visit every vertex exactly once before returning to its start and may leave edges unused. The two rules ask different questions with different answers. Euler’s theorem decides the first by counting odd vertices and checking that the graph is connected, while for the second no such count works. In computer science the term also names systematic procedures, such as depth-first search and breadth-first search, that visit every vertex that can be reached from a starting vertex.
In plain words Before searching for a route, read the rule. Covering every line and covering every dot are different goals, and a fact about one of them does not answer the other.
Example Small graphs show that neither question answers the other. In the complete graph on the four vertices , where every two vertices are joined by an edge, each vertex has degree . Its four odd vertices rule out an Eulerian path, yet is a Hamiltonian cycle. The bowtie is made of two triangles, and , that share the vertex . Its degrees are , all even, and it is connected, so is an Eulerian circuit. But it has no Hamiltonian cycle, because every route from the first triangle to the second passes through , so a cycle through and would reach on the way out and again on the way back. The dodecahedral graph has odd vertices, so no walk uses each of its edges exactly once, and still it has a Hamiltonian cycle.
Check yourself
- The eight corners of a cube can be named by the strings of three binary digits, which are their coordinates when the cube has side , one corner at the origin and its edges along the coordinate axes. Two corners are joined by an edge of the cube exactly when their names differ in one digit. Find a Hamiltonian cycle of this cube graph. Is there also a walk that uses each of its edges exactly once?
Show the answer
One Hamiltonian cycle is
Each step changes exactly one digit, so every two consecutive corners are joined by an edge, and the eight names before the return are all different. The cycle uses of the edges. Every corner has degree , one edge for each digit that can be changed, so all eight corners are odd vertices. That is more than two, so by Euler’s theorem no walk uses each edge exactly once. Like the dodecahedral graph, the cube graph has a Hamiltonian cycle but no Eulerian path.
- Add a new vertex to the dodecahedral graph, joined by a single edge to . Does the new graph of vertices have a Hamiltonian cycle? What changes if is joined to both and ?
Show the answer
With one edge at there is no Hamiltonian cycle. A Hamiltonian cycle needs two edges at every vertex, one to arrive and one to leave, and has only one. The reason is not that the degree of is odd. Every vertex of the dodecahedral graph has odd degree as well, and that graph has a Hamiltonian cycle.
With edges to both and there is one. Any Hamiltonian cycle must use both edges at , so it contains the steps . The tour found above begins with the edge from to , so replace that step by the detour through . The route that starts and then continues exactly as before, through and back to , visits all vertices once and returns to its start.
- Change the number to in the ring drawing. Take outer vertices in a ring, spokes , and inner edges , with labels now counted modulo . This is the Petersen graph, with vertices and edges, and like the dodecahedral graph it has degree at every vertex. Show that it has no Hamiltonian cycle.
Show the answer
The spokes are the only edges between outer and inner vertices. A Hamiltonian cycle visits both kinds, and to return to its start it must cross between them an even number of times, so it uses either or of the spokes. The inner edges form the five-cycle . A path through all five vertices of a five-cycle uses four of its edges and leaves out the one that joins the path’s two ends.
Suppose the cycle uses spokes. Then it consists of a path through all five outer vertices, a spoke, a path through all five inner vertices, and the other spoke. The outer path ends at two neighbors on the ring, say and , so the spokes lead to and , and the inner path runs between those two. Its ends would have to be joined by an inner edge, but an inner edge joins only to and , never to .
Suppose the cycle uses spokes. Turning the labels around the ring maps the graph onto itself, so we may take the unused spoke to be . Then must use both of its ring edges, and . The vertex now has its two cycle edges, and its spoke, so is unused, and in the same way is unused. On the inside, must use and . Then has and its spoke, so is unused, and has and its spoke, so is unused. The only edges left for are its spoke and . The chosen edges therefore include the closed loop through only five vertices, so they cannot form a single cycle through all ten.
Either way a Hamiltonian cycle is impossible, and a computer search confirms that the Petersen graph has none, while the dodecahedral graph has . Every vertex has degree in both graphs, so the degrees alone cannot tell the two apart.