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

Walks, trails, paths, circuits and cycles

20 practice questions 0 video lessons Theory + worked examples

Learn to name and describe routes through a graph in Year 12 VCE General Mathematics. A tram that loops back to its depot, a jogger who never runs the same stretch twice along the Yarra, and a tourist who visits each Great Ocean Road lookout just once are all following different kinds of route, and each kind has its own name.

You will learn exactly what makes a route a walk, a trail, a path, a circuit or a cycle, give the most specific name for a route, and find its length by counting edges. You will follow arrows in directed graphs and count the cycles in small graphs, ready to search for routes that use every edge, or visit every vertex, exactly once.

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

Theory

Routes through a graph have precise names. This Year 12 General Mathematics guide for students in Victoria explains walks, trails, paths, circuits and cycles, how to find the length of a walk, how walks work in a directed graph, and how to count the cycles in a small graph.

A walk is a sequence of edges joining one vertex to the next, written as a list of vertices such as \(A\)–\(B\)–\(C\). In a walk, vertices and edges may be repeated. The length of a walk is the number of edges it uses. A trail is a walk with no repeated edge (a vertex may repeat). A path is a walk with no repeated vertex, so it cannot repeat an edge either.

A circuit is a trail that starts and finishes at the same vertex. A cycle is a path that starts and finishes at the same vertex: only the start and finish vertex is repeated, and it has at least \(3\) edges. So every cycle is also a circuit, but a circuit that passes through some vertex twice is not a cycle. When asked to name a route, give its most specific name.

In a directed graph, a walk must follow the direction of the arrows. An edge that is a bridge can never be part of a cycle, because a cycle always offers a second way round.

Key idea. Ask two questions about a route. Is an edge repeated? If yes, it is only a walk. Is a vertex repeated? If no, it is a path (a cycle if it is closed). If a vertex repeats but no edge does, it is a trail (a circuit if it is closed).
A circuit that is not a cycleSquare A B C D and triangle C E F share vertex C; edge B E. The circuit A B C E F C D A is in red. A B C D E F
The red route \(A\)–\(B\)–\(C\)–\(E\)–\(F\)–\(C\)–\(D\)–\(A\) uses no edge twice and returns to \(A\), so it is a circuit of length \(7\). It visits \(C\) twice, so it is not a cycle.
A cycle and a bridgeSquare P Q R S (green) is a cycle of length 4. R T (red) is a bridge to triangle T U V. P Q R S T U V
The green square \(P\)–\(Q\)–\(R\)–\(S\)–\(P\) is a cycle of length \(4\). The red edge \(RT\) is a bridge: no cycle can use it.

The length of a walk counts its edges, which is one less than the number of vertices in its list:

\[\text{length of a walk} = \text{number of edges} = (\text{vertices listed}) - 1\]
length=vertices listed−1

A cycle of length \(n\) passes through exactly \(n\) different vertices:

\[\text{cycle of length } n: \quad n \text{ edges}, \ n \text{ vertices}, \quad n \ge 3\]
n≥3

How to name a route:

NameRepeated edge?Repeated vertex?Starts and finishes at the same vertex?
walkallowedallowedeither
trailnoallowedeither
pathnonono
circuitnoallowedyes
cyclenoonly the start and finishyes
Counting cycles. A cycle is the same cycle whichever vertex it starts at and whichever direction it goes, so \(A\)–\(B\)–\(C\)–\(A\) and \(B\)–\(A\)–\(C\)–\(B\) count once.

How to name a route

  1. Check it is a walk. Every consecutive pair of vertices must be joined by an edge (following the arrows in a digraph).
  2. Look for a repeated edge. If an edge is used twice, the route is only a walk.
  3. Look for a repeated vertex (ignore the finish if it equals the start). None: it is a path, or a cycle if it is closed. Some: it is a trail, or a circuit if it is closed.
  4. Give the length by counting the edges.

How to count the cycles in a small graph

  1. Sort the cycles by length: \(3\), then \(4\), and so on up to the number of vertices.
  2. For each length, list the cycles in an organised way, writing each with its vertices in order.
  3. Cross out repeats (the same cycle from a different start or in reverse).
Example 1 β€” The most specific name
For the graph shown, give the most specific name for each route: walk, trail, path, circuit or cycle. (i) \(A\)–\(B\)–\(E\)–\(F\)–\(A\) (ii) \(A\)–\(B\)–\(C\)–\(D\)–\(E\)–\(B\)–\(A\) (iii) \(F\)–\(A\)–\(B\)–\(E\)–\(D\)–\(C\)–\(B\) (iv) \(C\)–\(D\)–\(E\)–\(F\)
Solution

Check for a repeated edge first, then a repeated vertex, then whether the route is closed.

Example 1 graphRectangle A C D F split by the edge B E: edges AB, BC, CD, DE, EF, FA and BE. A B C D E F
\(A\text{–}B\text{–}E\text{–}F\text{–}A\)\(:\)\(\text{cycle}\)
\(A\text{–}B\text{–}C\text{–}D\text{–}E\text{–}B\text{–}A\)\(:\)\(\text{walk}\)
\(F\text{–}A\text{–}B\text{–}E\text{–}D\text{–}C\text{–}B\)\(:\)\(\text{trail}\)
\(C\text{–}D\text{–}E\text{–}F\)\(:\)\(\text{path}\)
cycle, walk, trail, path

(i) Only \(A\) repeats, as the start and finish: a cycle. (ii) Edge \(AB\) is used twice: only a walk. (iii) \(B\) is visited twice but no edge repeats, and it finishes at a different vertex: a trail. (iv) No vertex repeats and it is not closed: a path.

Example 2 β€” Length, circuit or cycle
For the graph shown: (i) Is \(A\)–\(B\)–\(C\)–\(E\)–\(F\)–\(C\)–\(D\)–\(A\) a circuit or a cycle? What is its length? (ii) Is \(A\)–\(B\)–\(E\)–\(F\)–\(C\)–\(D\)–\(A\) a circuit or a cycle? What is its length? (iii) What is the length of the longest cycle in the graph?
Solution

Look for a repeated vertex (other than the start and finish), then count the edges.

Example 2 graphSquare A B C D and triangle C E F share vertex C; edge B E. A B C D E F
\(\text{(i) repeated}\)\(:\)\(C \text{ twice, no edge repeated}\)
\(\text{length}\)\(=\)\(8 - 1\)
\(\)\(=\)\(7\)
\(\text{(ii) repeated}\)\(:\)\(\text{only } A \text{ (start and finish)}\)
\(\text{length}\)\(=\)\(7 - 1\)
\(\)\(=\)\(6\)
7,6

(i) No edge is used twice and the route returns to \(A\), but it passes through \(C\) twice: a circuit, not a cycle, of length \(7\). (ii) No vertex repeats except \(A\) at the start and finish: a cycle of length \(6\) (every cycle is also a circuit, but "cycle" is the most specific name). (iii) The graph has \(6\) vertices and the cycle in (ii) passes through all of them, so the longest cycle has length \(6\).

Example 3 β€” Walks in a digraph
The directed graph shows one-way walking paths between five features, \(A\) to \(E\), of a botanic garden in Ballarat. (i) Write down the path from \(A\) to \(E\) with the fewest arcs, and its length. (ii) Write down the path from \(E\) to \(A\) with the fewest arcs, and its length. (iii) Why is \(B\)–\(C\)–\(E\) not a walk?
Solution

Follow the arrows only.

One-way walking paths in a botanic gardenArcs A to B, A to C, B to D, C to B, D to E, E to C and D to A. A B C D E
\(A\text{–}B\text{–}D\text{–}E\)\(:\)\(\text{length } 3\)
\(E\text{–}C\text{–}B\text{–}D\text{–}A\)\(:\)\(\text{length } 4\)
3,4

(i) \(A\)–\(B\)–\(D\)–\(E\), length \(3\). (ii) From \(E\) the only arc goes to \(C\), then \(C \to B\), \(B \to D\), \(D \to A\): \(E\)–\(C\)–\(B\)–\(D\)–\(A\), length \(4\). Going back takes longer because the arrows only allow one way round. (iii) The arc between \(B\) and \(C\) points from \(C\) to \(B\), so you cannot travel \(B \to C\).

Example 4 β€” Counting cycles
For the graph shown, count the cycles of length \(3\), \(4\) and \(5\). Count each cycle once, whichever vertex it starts at and whichever way it goes.
Solution

List the cycles by length, in an organised order.

Example 4 graphSquare A B C D with diagonal A C and a roof vertex E joined to C and D. A B C D E
\(\text{length } 3\)\(:\)\(A\text{–}B\text{–}C\text{–}A,\ A\text{–}C\text{–}D\text{–}A,\ C\text{–}D\text{–}E\text{–}C\)
\(\text{length } 4\)\(:\)\(A\text{–}B\text{–}C\text{–}D\text{–}A,\ A\text{–}C\text{–}E\text{–}D\text{–}A\)
\(\text{length } 5\)\(:\)\(A\text{–}B\text{–}C\text{–}E\text{–}D\text{–}A\)
3,2,1

There are \(3\) cycles of length \(3\), \(2\) of length \(4\) and \(1\) of length \(5\) (the longest, through every vertex): \(6\) cycles in all.

Common pitfalls

Trail or path? A trail must not repeat an edge; a path must not repeat a vertex. Watch out for calling a route a path when it passes through the same vertex twice.
Circuit or cycle? Both are closed. If any vertex other than the start is visited twice, it is a circuit but not a cycle.
Length counts edges, not vertices. \(A\)–\(B\)–\(C\)–\(A\) lists \(4\) letters but has length \(3\).

Frequently asked questions

What is the difference between a walk, a trail and a path?

A walk is any route along edges, and it may repeat vertices and edges. A trail is a walk with no repeated edge. A path is a walk with no repeated vertex, so it cannot repeat an edge either.

What is the difference between a circuit and a cycle?

Both start and finish at the same vertex. A circuit is a closed trail, so it may pass through a vertex more than once. A cycle is a closed path, so only the start and finish vertex repeats. Every cycle is a circuit.

What is the length of a walk?

The length of a walk is the number of edges it uses. It is one less than the number of vertices written in the route, counting repeats.

What is the shortest possible cycle?

In a simple graph a cycle needs at least 3 edges, so the shortest cycle is a triangle of length 3.

Can a bridge be part of a cycle?

No. If an edge were on a cycle, the rest of the cycle would give another way between its ends, so removing it could not disconnect the graph.

How do walks work in a directed graph?

A walk in a digraph must follow the direction of every arrow. A route that goes against an arrow is not a walk, even if the two vertices are joined.