Graph theory · Definition

Path in a graph

discrete mathematicsgraphs

Before you start you need to know

It formalises going from one vertex to another along edges, the basis of connectedness and distances.

Definition

A path of length \(k\) is a sequence of vertices \(v_0,\dots,v_k\) such that each consecutive pair is joined by an edge of \(E\).

\[\{v_{i-1},v_i\}\in E,\qquad i=1,\dots,k\]

The length of a path is the number of edges it uses, one fewer than the number of vertices listed. A single vertex is a path of length \(0\). If vertices and edges may repeat the sequence is called a walk; if no vertex repeats, a simple path. Several textbooks use «path» for the general walk and «simple path» for the one with no repeated vertex.

Since edges have no direction, traversing a path backwards gives another path: if one can go from \(u\) to \(v\), one can go from \(v\) to \(u\). This symmetry is what lets us split the vertices into separate pieces when studying connectedness.

Paths are counted with the adjacency matrix \(A\): the \((i,j)\) entry of \(A^k\) is the number of walks of length \(k\) from \(i\) to \(j\). That is why the diagonal of \(A^2\) holds the degrees. The distance between two vertices is the length of the shortest path joining them, found by exploring the graph level by level.

A typical mistake is confusing length with the number of vertices, or assuming the shortest path is unique. Paths are the tool used to define connectedness and, when they return to their starting point, cycles.

Think about it

How many vertices does a simple path of length 7 have?

It has 8 vertices: one more than the edges, all distinct.

Exercises 10

References

  • Kenneth H. Rosen, Discrete Mathematics and Its Applications, 8th edition, McGraw-Hill, 2019. §10.4
  • Susanna S. Epp, Discrete Mathematics with Applications, 5th edition, Cengage, 2019. §10.2
  • Ralph P. Grimaldi, Discrete and Combinatorial Mathematics: An Applied Introduction, 5th edition, Pearson, 2003. §11.2