Resources For Teachers For Tutors For Students & Parents AI New Books Pricing
Year 12 General (Unit 3 & 4) Graphs and networks

Eulerian trails and circuits

20 practice questions 0 video lessons Theory + worked examples

Find out when a route can cover every road exactly once in Year 12 General Mathematics for Queensland (QCAA). Postal workers, street sweepers and council garbage trucks all want to travel each street without doubling back. Leonhard Euler cracked this puzzle in 1736 with the bridges of Königsberg, and his idea still plans collection runs in towns from Cairns to the Gold Coast.

You will learn what Eulerian trails and circuits are and use the degrees of the vertices to decide whether a graph is Eulerian, semi-Eulerian or neither. You will write trails, find where they must start, and work out the shortest total distance when part of a route has to be repeated. Next, Hamiltonian paths switch the focus from edges to vertices.

Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

An Eulerian trail uses every edge of a graph exactly once, and an Eulerian circuit also returns to its start. This Year 12 General Mathematics guide for Queensland students shows how the degrees of the vertices decide whether a graph is Eulerian or semi-Eulerian, and how to solve practical problems where every road or track must be covered.

An Eulerian trail is a trail that uses every edge of a graph exactly once. Vertices may be visited more than once, but no edge is repeated or missed. An Eulerian circuit is an Eulerian trail that finishes at the vertex where it started.

A connected graph that has an Eulerian circuit is an Eulerian graph. A connected graph that has an Eulerian trail but no Eulerian circuit is a semi-Eulerian graph. Its Eulerian trails must start at one vertex of odd degree and finish at the other.

The degrees decide everything. Each time a trail passes through a vertex it uses two edges there (one in, one out), so a vertex in the middle of the trail needs even degree. Only the start and finish of an open trail can be odd.

Key idea. For a connected graph: every vertex even \(\Rightarrow\) Eulerian (a circuit exists, starting anywhere). Exactly two odd vertices \(\Rightarrow\) semi-Eulerian (a trail from one odd vertex to the other). More than two odd vertices \(\Rightarrow\) no Eulerian trail at all.
An Eulerian graphTwo triangles A B C and C D E sharing vertex C. Every vertex has even degree. A B C D E
Degrees \(A{:}\ 2,\ B{:}\ 2,\ C{:}\ 4,\ D{:}\ 2,\ E{:}\ 2\): all even, so the graph is Eulerian. One circuit is \(C\text{-}A\text{-}B\text{-}C\text{-}D\text{-}E\text{-}C\).
A semi-Eulerian graphDiamond A B C D with the edge A C across the middle. A and C have degree 3 and are shaded. A B C D
Only \(A\) and \(C\) (shaded) have odd degree, so the graph is semi-Eulerian. A trail must run from \(A\) to \(C\), such as \(A\text{-}B\text{-}C\text{-}D\text{-}A\text{-}C\).

The number of odd vertices is always even, because the degrees add to twice the number of edges:

\[\text{sum of degrees} = 2 \times \text{number of edges}\]
∑deg=2e

The conditions for a connected graph:

Connected graph withTypeEulerian trail?
0 odd verticesEuleriana circuit, from any vertex
2 odd verticessemi-Eulerianan open trail from one odd vertex to the other
4, 6, ... odd verticesneithernone

In a practical problem where every road must be travelled once:

\[\text{Eulerian: distance} = \text{total of all edge weights}\]
distance=∑weights
\[\text{semi-Eulerian, back to start: distance} = \text{total of all weights} + \text{shortest path between the odd vertices}\]
distance=∑weights+shortest repeat

How to decide and find an Eulerian trail or circuit

  1. Check the graph is connected. If some edges cannot be reached, no single trail can use them all.
  2. Find every degree and count the odd vertices: \(0\) gives a circuit, \(2\) gives an open trail, more gives neither.
  3. Build the route. Start at any vertex (circuit) or at one odd vertex (trail). Cross out each edge as you use it, and avoid using an edge that would cut you off from edges not yet used.
  4. Check. The route should list one more vertex than there are edges, and every edge should be crossed out exactly once.
Example 1 — Is there an Eulerian circuit?
Decide whether the graph shown is Eulerian. If it is, write an Eulerian circuit starting at \(A\).
Solution

Find every degree first.

Example 1 graphHexagon A B C D E F with the triangle B D F drawn inside. A B C D E F
\(\text{degrees}\)\(:\)\(A{:}\ 2,\ B{:}\ 4,\ C{:}\ 2,\ D{:}\ 4,\ E{:}\ 2,\ F{:}\ 4\)
\(\text{odd vertices}\)\(:\)\(\text{none}\)
\(\text{edges}\)\(=\)\(9\)
Eulerian circuit

The graph is connected and every degree is even, so it is Eulerian. One circuit is \(A\text{-}B\text{-}C\text{-}D\text{-}B\text{-}F\text{-}D\text{-}E\text{-}F\text{-}A\). It lists \(10\) vertices for \(9\) edges, and uses each edge once.

Example 2 — Where must the trail start?
Show that the graph is semi-Eulerian, state where an Eulerian trail must start and finish, and write one.
Solution

Count the odd vertices.

Example 2 graphSquare P Q R S with diagonal P R and a top vertex T joined to S and R. P and S are shaded (odd). P Q R S T
\(\text{degrees}\)\(:\)\(P{:}\ 3,\ Q{:}\ 2,\ R{:}\ 4,\ S{:}\ 3,\ T{:}\ 2\)
\(\text{odd vertices}\)\(:\)\(P,\ S\)
trail from P to S

The graph is connected with exactly two odd vertices, \(P\) and \(S\), so it is semi-Eulerian. A trail must start at one and finish at the other, for example \(P\text{-}Q\text{-}R\text{-}P\text{-}S\text{-}R\text{-}T\text{-}S\). There is no Eulerian circuit.

Example 3 — Returning to the depot
A garbage truck leaves its depot \(R\) in Ipswich and must drive along every street shown at least once, then return to \(R\). Distances are in km. Find the shortest total distance.
Solution

Every street is driven once (total of all weights). Then the truck must repeat a route between the two odd vertices.

Streets in a garbage run (km)Depot R. Streets RA 1.2, RD 1.5, AB 2.0, AD 3.0, BC 1.6, CD 1.8 km. A and D are shaded (odd). R A B C D 1.2 1.5 2.0 3.0 1.6 1.8
\(\text{total of streets}\)\(=\)\(1.2 + 1.5 + 2.0 + 3.0 + 1.6 + 1.8\)
\(\)\(=\)\(11.1\ \text{km}\)
\(\text{odd vertices}\)\(:\)\(A\ (3),\ D\ (3)\)
\(A\text{-}D\)\(:\)\(3.0\ \text{km}\)
\(A\text{-}R\text{-}D\)\(:\)\(1.2 + 1.5 = 2.7\ \text{km}\)
\(A\text{-}B\text{-}C\text{-}D\)\(:\)\(2.0 + 1.6 + 1.8 = 5.4\ \text{km}\)
\(\text{total distance}\)\(=\)\(11.1 + 2.7\)
\(\)\(=\)\(13.8\ \text{km}\)
13.8km

The graph is semi-Eulerian (odd vertices \(A\) and \(D\)), so the truck cannot cover every street once and get back to \(R\). It repeats the shortest path between \(A\) and \(D\), which is \(A\text{-}R\text{-}D\), not the direct street. The shortest total is 13.8 km.

Example 4 — Adding one track
Walking tracks join six lookouts in Lamington National Park. (i) Can a guide walk every track exactly once? (ii) A new track is to be built from \(A\) to \(D\). Explain why the guide could then walk every track exactly once, and give a possible route.
Solution

(i) Count the odd vertices.

Walking tracks between six lookoutsHexagon A B C D E F with extra tracks A C and D F. A, C, D and F are shaded (odd). A B C D E F
\(\text{degrees}\)\(:\)\(A{:}\ 3,\ B{:}\ 2,\ C{:}\ 3,\ D{:}\ 3,\ E{:}\ 2,\ F{:}\ 3\)
\(\text{odd vertices}\)\(:\)\(A,\ C,\ D,\ F\ (4)\)

(i) No. There are four odd vertices, so there is no Eulerian trail.

With the new track A DThe same tracks plus a new track A D (dashed green). Only C and F are now odd. A B C D E F
\(\deg(A)\)\(=\)\(3 + 1 = 4\)
\(\deg(D)\)\(=\)\(3 + 1 = 4\)
\(\text{odd vertices}\)\(:\)\(C,\ F\ (2)\)
semi-Eulerian after adding AD

(ii) The new track makes \(A\) and \(D\) even, leaving only \(C\) and \(F\) odd. The graph becomes semi-Eulerian, so the guide can walk every track once, from \(C\) to \(F\): for example \(C\text{-}A\text{-}B\text{-}C\text{-}D\text{-}A\text{-}F\text{-}D\text{-}E\text{-}F\).

Common pitfalls

Connected first. A graph in two separate pieces has no Eulerian trail, even if every vertex is even. Watch out for checking degrees only.
Start at an odd vertex. In a semi-Eulerian graph, a trail that starts at an even vertex will get stuck. Watch out for starting anywhere else than one of the two odd vertices.
The repeat is the shortest path, not the direct edge. To return to the start, add the shortest path between the two odd vertices. That may go through other vertices, as in Example 3.

Frequently asked questions

What is an Eulerian trail?

An Eulerian trail is a route through a graph that uses every edge exactly once. It may pass through a vertex more than once. If it finishes where it started, it is an Eulerian circuit.

How do you know if a graph has an Eulerian circuit?

The graph must be connected and every vertex must have even degree. Then an Eulerian circuit exists, and it can start at any vertex.

What is a semi-Eulerian graph?

It is a connected graph with an Eulerian trail but no Eulerian circuit. This happens exactly when the graph has two vertices of odd degree. The trail starts at one of them and ends at the other.

Can a graph have exactly one odd vertex?

No. The degrees always add to twice the number of edges, which is even, so the number of odd vertices is always even: 0, 2, 4 and so on.

What is the difference between Eulerian and Hamiltonian?

Eulerian is about edges: use every edge exactly once. Hamiltonian is about vertices: visit every vertex exactly once. Eulerian questions are decided by the degrees; Hamiltonian ones are found by trial and error.