Eulerian and Hamiltonian Paths - TCE Mathematics Applications (Tasmania)
“Identify and find Eulerian trails and circuits and Hamiltonian paths and cycles in networks.”
You must use the vocabulary of walks, trails and paths, then decide from the vertex degrees whether a network has an Eulerian trail or circuit (using every edge once) and whether it has a Hamiltonian path or cycle (visiting every vertex once).
What this dot point is asking
Two famous network problems ask very different things. One is about covering every edge, the other about covering every vertex. Telling them apart, and knowing the test for each, is the heart of this dot point.
A walk is any sequence of connected edges. A trail is a walk that repeats no edge. A path is a walk that repeats no vertex. A walk or trail that starts and ends at the same vertex is called closed.
Eulerian trails and circuits
An Eulerian trail uses every edge of the network exactly once. If it also starts and finishes at the same vertex, it is an Eulerian circuit. The test depends entirely on counting odd-degree vertices.
A connected graph has an Eulerian circuit if and only if every vertex has even degree. It has an Eulerian trail (open, with different start and end) if and only if exactly two vertices have odd degree, and the trail must begin at one odd vertex and end at the other.
A network has vertices with degrees 2, 2, 3, 3, 4.
Count odd-degree vertices
Two vertices have odd degree (the two 3s); the rest are even.
Conclude
Exactly two odd vertices means an Eulerian trail exists but not a circuit. The trail must start at one odd-degree vertex and finish at the other, tracing every edge exactly once along the way.
This is the mathematics behind a postal or street-sweeping route, where every road (edge) must be covered once. If more than two vertices are odd, no single trail can cover all edges without repeating one.
Hamiltonian paths and cycles
A Hamiltonian path visits every vertex exactly once. If it returns to its starting vertex, it is a Hamiltonian cycle. This models a delivery run that must call at every town (vertex) once, regardless of which roads are used.
Eulerian is about edges: traverse every edge once. Hamiltonian is about vertices: visit every vertex once. There is a simple degree test for Eulerian travel, but no simple general test for Hamiltonian travel, so you find Hamiltonian routes by inspection and trial.
A network connects towns A, B, C, D in a square with edges A-B, B-C, C-D, D-A, plus the diagonal A-C.
Search for a route visiting each town once and returning
Try A to B to C to D to A. This visits all four towns exactly once and returns to the start.
Conclude
A to B to C to D to A is a Hamiltonian cycle. The diagonal A-C is simply not used; a Hamiltonian route need not use every edge, only visit every vertex.
If the task is to cover every connection (roads to plough, pipes to inspect), think Eulerian and count odd vertices. If the task is to visit every location (towns to deliver to), think Hamiltonian and search for a route. Reading which is required prevents using the wrong test.
No edge or vertex repeats
Remember that an Eulerian trail may repeat vertices but never edges, while a Hamiltonian path may skip edges but never repeats a vertex. These are opposite restrictions, which is why a route can be one without being the other.
Students often apply the odd-degree rule to a Hamiltonian question, but the degree test only governs Eulerian travel. A graph where every vertex is even can still fail to have a Hamiltonian cycle, and a graph with odd vertices can still have one. Use the degree count only for Eulerian problems.
Why the degree test works
Every time an Eulerian trail passes through a vertex, it uses one edge to arrive and one edge to leave, accounting for edges in pairs. So any vertex that is neither the start nor the finish must have an even degree. In a closed trail (circuit) the start and finish coincide, so that vertex is also entered and left in pairs, forcing every vertex to be even. In an open trail the two endpoints are the only vertices that can be odd, which is exactly why an Eulerian trail needs precisely zero or two odd vertices. Counting odd-degree vertices therefore settles the question completely: zero gives a circuit, two gives an open trail, and four or more means no single trail can cover every edge.
A street network has vertices with degrees .
Count the odd vertices
The two vertices of degree are odd; the rest are even, so there are exactly two odd-degree vertices.
Conclude
With exactly two odd vertices there is an open Eulerian trail but no Eulerian circuit. A street sweeper could cover every road once, but only by starting at one of the two odd-degree corners and finishing at the other.
A complete answer names whether the task is Eulerian (edges) or Hamiltonian (vertices), applies the odd-degree count for Eulerian cases (zero odd for a circuit, two odd for an open trail), and for Hamiltonian cases states a specific route that visits every vertex once, noting whether it is a path or a cycle.
Exam-style questions
Questions in the style of TASC exam questions on this dot point, each with a worked answer. They are written by ExamExplained unless tagged "Past paper"; the year shows the paper a question is modelled on.
Practice5 marksFigure 8 represents footpaths at a wildlife sanctuary, with distances in metres. a) Find a trail starting at A (the mammals) that uses all of the footpaths once and returns to A. Write your answer as a sequence of letters. b) What is the term given to this kind of trail? c) How can you tell that such a trail is possible, before actually finding it? d) Find the length of the shortest closed Hamiltonian Path, starting and finishing at C (the reptiles).Show worked answer →
a) (2 marks) Trace a route that travels every edge exactly once and ends back at A, writing the vertices in order (for example A B D G E C A, depending on the diagram). Each footpath must be used once and only once.
b) (1 mark) It is an Eulerian circuit (Eulerian trail that starts and finishes at the same vertex).
c) (1 mark) An Eulerian circuit exists if and only if the network is connected and every vertex has an even degree (an even number of edges meeting at it). Checking that there are no odd-degree vertices confirms a circuit is possible before finding it.
d) (1 mark) A Hamiltonian path visits every vertex exactly once. Find the closed route from C through all vertices and back to C with the smallest total of the edge distances, and report that minimum length in metres.
Practice2 marksA garden is modelled as a network of paths (edges) and locations (vertices). a) A mathematician wishes to make a Hamiltonian circuit around the garden. What do they mean? b) What would be meant by an Eulerian circuit of the garden, and how could you tell from the network whether one is possible?Show worked answer →
a) (1 mark) A Hamiltonian circuit is a closed route that visits every vertex (location in the garden) exactly once and returns to the start. It need not use every edge.
b) (1 mark) An Eulerian circuit is a closed route that travels along every edge (path) exactly once and returns to the start. It is possible only if the network is connected and every vertex has even degree. Count the edges at each vertex: if any vertex has odd degree, no Eulerian circuit exists; if all are even, one exists.