Loading [MathJax]/jax/output/HTML-CSS/jax.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

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 n0, a graph on n+1 vertices whose only edges are those used in a path of length n (which is a walk of length n that is also a path) is denoted by Pn. (Notice that P0K1 and P1K2.)

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 12.3.1

In the graph

clipboard_edb7270687d0dc73c8115c27e894fd21b.png

(a,f,c,h) is a path of length 3. However, (a,f,c,h,d,f) is not a path, even though no edges are repeated, since the vertex f appears twice. Both are walks.

Proposition 12.3.1

Suppose that u and v are in the same connected component of a graph. Then any uv walk of minimum length is a path. In particular, if there is a uv walk, then there is a uv path.

Proof

Since u and v are in the same connected component of a graph, there is a uv walk.

Towards a contradiction, suppose that we have a uv walk of minimum length that is not a path. By the definition of a path, this means that some vertex x appears more than once in the walk, so the walk looks like:

(u=u1,...,ui=x,...,uj=x,...,uk=v),

and j>i. Observe that the following is also a uv walk:

(u=u1,...,ui=x,uj+1,uj+2,...,uk=v).

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 k1, and the length of the second walk is k1(ji). Since j>i, the second walk is strictly shorter than the first walk. In particular, the first walk was not a uv walk of minimum length. This contradiction serves to prove that every uv walk of minimum length is a path.

This allows us to prove another interesting fact that will be useful later.

Proposition 12.3.2

Deleting an edge from a connected graph can never result in a graph that has more than two connected components.

Proof

Let G be a connected graph, and let uv be an arbitrary edge of G. If G{uv} 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 G{uv} is not connected.

Let Gu denote the connected component of G{uv} that contains the vertex u, and let Gv denote the connected component of G{uv} that contains the vertex v. We aim to show that Gu and Gv are the only connected components of G{uv}.

Let x be an arbitrary vertex of G, and suppose that x is a vertex that is not in Gu. Since G is connected, there is a ux walk in G, and therefore by Proposition 12.3.1 there is a ux path in G. Since x is not in Gu, this ux path must use the edge uv, so must start with this edge since u only occurs at the start of the path. Therefore, by removing the vertex u from the start of this path, we obtain a vx path that does not use the vertex u. This path cannot use the edge uv, so must still be a path in G{uv}. Therefore x is a vertex in Gv.

Since x was arbitrary, this shows that every vertex of G must be in one or the other of the connected components Gu and Gv, so there are at most two connected components of G{uv}. Since uv was an arbitrary edge of G and G 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 1 in which no vertex appears more than once, except that the first vertex is the same as the last, is called a cycle.

Notation

For n3, a graph on n vertices whose only edges are those used in a cycle of length n (which is a walk of length n that is also a cycle) is denoted by Cn.

The requirement that the walk have length at least 1 only serves to make it clear that a walk of just one vertex is not considered a cycle. In fact, a cycle in a simple graph must have length at least 3.

Example 12.3.2

In the graph from Example 12.3.1, (a,e,f,a) is a cycle of length 3, and (b,g,d,h,c,f,b) is a cycle of length 6.

Here are drawings of some small paths and cycles:

clipboard_ea501d80f22da06bc918ea61e6a90363c.png

We end this section with a proposition whose proof will be left as an exercise.

Proposition 12.3.3

Suppose that G is a connected graph. If G has a cycle in which u and v appear as consecutive vertices (so uv is an edge of G) then G{uv} is connected.

Exercise 12.3.1

1) In the graph

clipboard_ed28261d07020096cc0ed35c4b9e4e9f9.png

(a) Find a path of length 3.

(b) Find a cycle of length 3.

(c) Find a walk of length 3 that is neither a path nor a cycle. Explain why your answer is correct.

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 n2 vertices has valency 1 or 2, then the graph is isomorphic to Pn or Cn.

5) Let G be a (simple) graph on n vertices. Suppose that G has the following property: whenever uv, dG(u)+dG(v)n1. Prove that G is connected.


This page titled 12.3: Paths and Cycles is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Joy Morris.

  • Was this article helpful?

Support Center

How can we help?