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

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 VCE General Mathematics. 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 Wodonga to Warrnambool.

You will learn what Eulerian trails and Eulerian circuits are and use the degrees of the vertices to decide which one a graph has, if any. You will write trails, find where they must start, avoid crossing bridges too early, 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 students in Victoria shows how the degrees of the vertices decide which of these a graph has, 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.

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 a trail that does not return to its start can be odd. So a graph with exactly two odd vertices has Eulerian trails, but each one must start at one odd vertex and finish at the other, and there is no Eulerian circuit.

The idea began with the bridges of KΓΆnigsberg: seven bridges joined four parts of a city, and the locals asked whether a walk could cross every bridge exactly once. Euler showed it could not, because all four land masses had odd degree. While building a route, avoid crossing a bridge of the graph still to be travelled (an edge whose removal would cut you off from unused edges) unless there is no other choice.

Key idea. For a connected graph: every vertex even \(\Rightarrow\) an Eulerian circuit (starting anywhere). Exactly two odd vertices \(\Rightarrow\) an Eulerian trail from one odd vertex to the other, but no circuit. 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 has an Eulerian circuit, such as \(C\text{–}A\text{–}B\text{–}C\text{–}D\text{–}E\text{–}C\).
A graph with an Eulerian trail but no Eulerian circuitDiamond 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 there is an Eulerian trail but no Eulerian circuit. 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 withEulerian circuit?Eulerian trail?
0 odd verticesyes, from any vertexyes (the circuit)
2 odd verticesnoyes, from one odd vertex to the other
4, 6, ... odd verticesnono

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

\[\text{Eulerian: distance} = \text{total of all edge weights}\]
distance=∑weights
\[\text{two odd vertices, 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 an Eulerian circuit, \(2\) gives an Eulerian trail (but no circuit), 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 do not cross a bridge of the edges still unused unless you have to.
  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 has an Eulerian circuit. If it does, write one 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 has an Eulerian circuit. One 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 has an Eulerian trail but no Eulerian circuit. 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 has an Eulerian trail but no Eulerian circuit. A trail must start at one odd vertex and finish at the other, for example \(P\text{–}Q\text{–}R\text{–}P\text{–}S\text{–}R\text{–}T\text{–}S\).

Example 3 β€” Returning to the depot
A street sweeper leaves its depot \(R\) in Wodonga 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 sweeper 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

There are two odd vertices, \(A\) and \(D\), so there is no Eulerian circuit: the sweeper 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 the Dandenong Ranges. (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)\)
Eulerian trail after adding AD

(ii) The new track makes \(A\) and \(D\) even, leaving only \(C\) and \(F\) odd. The graph now has an Eulerian trail, 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. When there are two odd vertices, a trail that starts at an even vertex will get stuck. Watch out for starting anywhere other 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.

When does a graph have an Eulerian trail but no Eulerian circuit?

When the graph is connected and exactly two vertices have odd degree. Every Eulerian trail then starts at one of the odd vertices and finishes at the other.

What were the bridges of Konigsberg?

Seven bridges joined four parts of the city of Konigsberg. Euler showed that no walk could cross every bridge exactly once, because all four parts had an odd number of bridges, and that started graph theory.

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.