Discrete Mathsfor Engineers

Structures, proofs, and intuition

EN | PT

Graph Theory → Foundations

Part 5 of 11 — Walk

Series: Foundations Part 5 of 11
1 2 3 4 5 6 7 8 9 10 11

Formal definition

Let \(G = (V, A_G)\) be a graph (or digraph), where \(V\) is the set of vertices and \(A_G \subseteq V \times V\) is the set of edges (or arcs).

A walk in \(G\) is any sequence of vertices \((s_0, s_1, \ldots, s_k)\) such that each consecutive pair is an edge of the graph:

\[ (s_i, s_{i+1}) \in A_G,\quad 0 \le i < k. \]

We say that this walk has length \(k\), starts at \(s_0\), and ends at \(s_k\). Note that a walk may repeat vertices and edges.

Intuition

Think of a walk as “following arrows/edges” step by step: at each move you go from \(s_i\) to \(s_{i+1}\) using an edge that exists in the graph.


A B C D E
Highlighted walk: A → C → D.

Example

If \((A,C)\in A_G\) and \((C,D)\in A_G\), then \((A,C,D)\) is a walk of length \(2\).