12.3: Paths and Cycles
( \newcommand{\kernel}{\mathrm{null}\,}\)
Recall the definition of a walk. As we saw in Example 12.2.1, the vertices and edges in a walk do not need to be distinct.
There are many circumstances under which we might not want to allow edges or vertices to be re-visited. Efficiency is one possible reason for this. We have a special name for a walk that does not allow vertices to be re-visited.
Definition: Path
A walk in which no vertex appears more than once is called a path.
Notation
For
Notice that if an edge were to appear more than once in a walk, then both of its endvertices would also have to appear more than once, so a path does not allow vertices or edges to be re-visited.
Example
In the graph

Proposition
Suppose that
- Proof
-
Since
and are in the same connected component of a graph, there is a walk.Towards a contradiction, suppose that we have a
walk of minimum length that is not a path. By the definition of a path, this means that some vertex appears more than once in the walk, so the walk looks like:and
. Observe that the following is also a walk:Since consecutive vertices were adjacent in the first sequence, they are also adjacent in the second sequence, so the second sequence is a walk. The length of the first walk is
, and the length of the second walk is . Since , the second walk is strictly shorter than the first walk. In particular, the first walk was not a walk of minimum length. This contradiction serves to prove that every walk of minimum length is a path.
This allows us to prove another interesting fact that will be useful later.
Proposition
Deleting an edge from a connected graph can never result in a graph that has more than two connected components.
- Proof
-
Let
be a connected graph, and let be an arbitrary edge of . If is connected, then it has only one connected component, so it satisfies our desired conclusion. Thus, we assume in the remainder of the proof that is not connected.Let
denote the connected component of that contains the vertex , and let denote the connected component of that contains the vertex . We aim to show that and are the only connected components of .Let
be an arbitrary vertex of , and suppose that is a vertex that is not in . Since is connected, there is a walk in , and therefore by Proposition 12.3.1 there is a path in . Since is not in , this path must use the edge , so must start with this edge since only occurs at the start of the path. Therefore, by removing the vertex from the start of this path, we obtain a path that does not use the vertex . This path cannot use the edge , so must still be a path in . Therefore is a vertex in .Since
was arbitrary, this shows that every vertex of must be in one or the other of the connected components and , so there are at most two connected components of . Since was an arbitrary edge of and was an arbitrary connected graph, this shows that deleting any edge of a connected graph can never result in a graph with more than two connected components.
A cycle is like a path, except that it starts and ends at the same vertex. The structures that we will call cycles in this course, are sometimes referred to as circuits.
Definition: Cycle
A walk of length at least
Notation
For
The requirement that the walk have length at least
Example
In the graph from Example 12.3.1,
Here are drawings of some small paths and cycles:

We end this section with a proposition whose proof will be left as an exercise.
Proposition
Suppose that
Exercise
1) In the graph

(a) Find a path of length
(b) Find a cycle of length
(c) Find a walk of length
2) Prove that in a graph, any walk that starts and ends with the same vertex and has the smallest possible non-zero length, must be a cycle.
3) Prove Proposition 12.3.3.
4) Prove by induction that if every vertex of a connected graph on
5) Let


