Tutorials › Graph Theory (Undergraduate) › Simple Random Walks on Regular Graphs

Expanders and Random Walks on Graphs · Tutorial 660 of 799

Simple Random Walks on Regular Graphs

Learn to build the transition matrix of a regular graph and use it to calculate and verify short-step random-walk distributions.

Advanced 9 min read

What You'll Learn

  • State the assumptions needed to define a simple random walk on a regular graph.
  • Construct its transition matrix using the adjacency matrix and the degree.
  • Calculate a distribution after one or more steps using row-vector multiplication.
  • Interpret a matrix-power entry as a transition probability and a walk count.
  • Check short-step distributions by enumerating the possible walks.

Choosing a Neighbor at Each Step

A random walk turns the local structure of a graph into a rule for moving through it. At each step, the walker chooses one of the current vertex’s neighbors uniformly. On a regular graph, every vertex has the same number of choices, so the transition probabilities have a particularly simple matrix form. This lets us calculate the distribution of the walker’s position after a prescribed number of steps.

Definition: Let \(G=(V,E)\) be a finite, connected, simple \(d\)-regular graph with \(d\ge 1\). The simple random walk on \(G\) is a sequence of random vertices \(X_0,X_1,\ldots\) such that, given the walk’s current vertex \(X_t=u\), the next vertex is chosen uniformly from the \(d\) neighbors of \(u\). Its transition matrix, with rows and columns indexed by \(V\), is $$ P_{uv}=\begin{cases} 1/d,&uv\in E,\\ 0,&uv\notin E. \end{cases} $$ The row index is the current vertex and the column index is the next vertex.

Graphs here are finite and simple, so there are no loops or multiple edges. The condition \(d\ge 1\) matters: a connected graph with one vertex has degree zero, and the rule “choose a neighbor uniformly” does not define a next step there. We do not add a rule for that exceptional graph.

A walk of length \(t\) is a sequence \(v_0,v_1,\ldots,v_t\) with consecutive vertices adjacent; vertices may repeat. A random walk follows such a walk, with the choice of each next vertex made according to the transition rule. In particular, a trajectory need not be a path, since it may revisit a vertex.

For every vertex \(u\), exactly \(d\) entries in row \(u\) of \(P\) equal \(1/d\), and the other entries are zero. Thus every row sums to \(d(1/d)=1\). The matrix has nonnegative entries and each row is a probability distribution. A matrix with these properties is called row-stochastic.

Distributions and Matrix Powers

Write a probability distribution on \(V\) as a row vector \(\mu\), where \(\mu_u=\Pr(X_0=u)\). The distribution after one step is \(\mu P\): its coordinate at \(v\) is the sum, over all possible starting vertices \(u\), of the probability of starting at \(u\) and then moving to \(v\). Repeating the same rule gives \(\mu P^t\) after \(t\) steps. In particular, if the walk starts at a fixed vertex \(x\), its initial distribution is the row vector with a \(1\) at \(x\) and zeros elsewhere.

Proposition: For any vertices \(u,v\) and integer \(t\ge 0\), \((P^t)_{uv}\) is the probability that a simple random walk starting at \(u\) is at \(v\) after \(t\) steps. Moreover, it is the number of length-\(t\) walks from \(u\) to \(v\), divided by \(d^t\). For \(t=0\), \(P^0\) is the identity matrix, and a length-zero walk stays at its starting vertex.

Proof. We prove both statements by induction on \(t\). At \(t=0\), there is one length-zero walk from \(u\) to \(u\), none from \(u\) to any other vertex, and \((P^0)_{uv}\) is \(1\) when \(u=v\) and \(0\) otherwise. The claimed probability and count formulas therefore hold.

Now suppose the statements hold for \(t\). Matrix multiplication gives \((P^{t+1})_{uv}=\sum_{w\in V}(P^t)_{uw}P_{wv}\). For each \(w\), the factor \((P^t)_{uw}\) is the probability of being at \(w\) after \(t\) steps, and \(P_{wv}\) is the probability of moving from \(w\) to \(v\) on the next step. The events specifying the position \(w\) at time \(t\) are disjoint and cover all possibilities, so this sum is the probability of being at \(v\) after \(t+1\) steps. For the count statement, each length-\((t+1)\) walk from \(u\) to \(v\) has a unique penultimate vertex \(w\). If \(wv\notin E\), it contributes no walk; if \(wv\in E\), each length-\(t\) walk from \(u\) to \(w\) extends by the edge \(wv\). By the induction hypothesis, the number of such walks is \(d^t(P^t)_{uw}\). Hence the total number is \(\sum_{w:wv\in E}d^t(P^t)_{uw}=d^{t+1}\sum_{w\in V}(P^t)_{uw}P_{wv}=d^{t+1}(P^{t+1})_{uv}\), because \(P_{wv}=1/d\) on an edge and is zero otherwise. Dividing by \(d^{t+1}\) proves the formula. \(\square\)

There is also a direct interpretation for a particular trajectory \(v_0,v_1,\ldots,v_t\): when each consecutive pair is an edge, its probability, starting at \(v_0\), is \((1/d)^t\). The endpoint probability is the sum of these probabilities over all length-\(t\) walks with that endpoint. This sum is important when different trajectories reach the same vertex.

Calculating Short-Step Distributions

Worked Example: Two Steps on a 4-Cycle

Let \(G=(V,E)\) have \(V=\{1,2,3,4\}\) and \(E=\{12,23,34,41\}\). This is a connected 2-regular graph. Starting at vertex \(1\), find the distribution after two steps.

Each step from \(1\) goes to \(2\) or \(4\), each with probability \(1/2\). From \(2\), the next step goes to \(1\) or \(3\), each with probability \(1/2\); from \(4\), it goes to \(1\) or \(3\), each with probability \(1/2\). The four length-two walks, each of probability \((1/2)(1/2)=1/4\), are \(1,2,1\), \(1,2,3\), \(1,4,1\), and \(1,4,3\). Therefore \(\Pr(X_2=1)=1/4+1/4=1/2\), \(\Pr(X_2=3)=1/4+1/4=1/2\), and \(\Pr(X_2=2)=\Pr(X_2=4)=0\).

The transition matrix in the vertex order \(1,2,3,4\) is \[ P=\frac12\begin{pmatrix} 0&1&0&1\\ 1&0&1&0\\ 0&1&0&1\\ 1&0&1&0 \end{pmatrix}. \] For example, row \(1\) of \(P^2\) is one half of row \(2\) of \(P\) plus one half of row \(4\) of \(P\), so it is \((1/2,0,1/2,0)\), agreeing with the walk enumeration.

Check: the probabilities sum to \(1/2+1/2+0+0=1\). The four enumerated walks each have probability \(1/4\), so their total probability is \(4(1/4)=1\).

Worked Example: A Non-Vertex Starting Distribution on a Triangle

Let \(G=(V,E)\) have \(V=\{1,2,3\}\) and \(E=\{12,23,31\}\). This connected 2-regular graph has transition matrix \[ P=\frac12\begin{pmatrix} 0&1&1\\ 1&0&1\\ 1&1&0 \end{pmatrix}. \] Suppose \(\Pr(X_0=1)=1/2\), \(\Pr(X_0=2)=1/2\), and \(\Pr(X_0=3)=0\), so \(\mu=(1/2,1/2,0)\).

After one step, \(\mu P=(1/4,1/4,1/2)\). In detail, the probability at vertex \(1\) is \((1/2)(0)+(1/2)(1/2)+0(1/2)=1/4\); at vertex \(2\) it is \((1/2)(1/2)+(1/2)(0)+0(1/2)=1/4\); and at vertex \(3\) it is \((1/2)(1/2)+(1/2)(1/2)+0(0)=1/2\).

After a second step, multiply the new row vector by \(P\). The probability at \(1\) is \((1/4)(0)+(1/4)(1/2)+(1/2)(1/2)=3/8\). The probability at \(2\) is \((1/4)(1/2)+(1/4)(0)+(1/2)(1/2)=3/8\). The probability at \(3\) is \((1/4)(1/2)+(1/4)(1/2)+(1/2)(0)=1/4\). Thus \(\mu P^2=(3/8,3/8,1/4)\).

Check: \(3/8+3/8+1/4=6/8+2/8=1\). The nonzero starting probabilities were both included: the final distribution is a weighted sum of the distributions arising from starting at \(1\) and starting at \(2\).

Worked Example: Two Steps on the Complete Graph \(K_4\)

Let \(G=(V,E)\), where \(V=\{1,2,3,4\}\) and \(E=\{12,13,14,23,24,34\}\). This is the complete graph on four vertices, so it is connected and 3-regular. Starting at \(1\), calculate the two-step distribution.

On the first step the walker chooses \(2\), \(3\), or \(4\), each with probability \(1/3\). To return to \(1\) on the second step, the walker can have gone through any one of those three vertices. Each of the three walks \(1,2,1\), \(1,3,1\), and \(1,4,1\) has probability \((1/3)(1/3)=1/9\), giving \(\Pr(X_2=1)=3(1/9)=1/3\).

For endpoint \(2\), the intermediate vertex can be \(3\) or \(4\). The walks \(1,3,2\) and \(1,4,2\) each have probability \(1/9\), giving \(\Pr(X_2=2)=2/9\). For endpoint \(3\), the intermediate vertex can be \(2\) or \(4\), so \(\Pr(X_2=3)=2(1/9)=2/9\). For endpoint \(4\), the intermediate vertex can be \(2\) or \(3\), so \(\Pr(X_2=4)=2(1/9)=2/9\).

Check: the resulting probabilities sum to \(1/3+2/9+2/9+2/9=3/9+6/9=1\). Independently, there are \(3\) choices for the first step and \(3\) for the second, so there are \(3\cdot3=9\) length-two walks starting at \(1\). Three return to \(1\); two end at each of the other three vertices. The counts \(3+2+2+2=9\) agree with the probabilities.

Why the Matrix View Is Useful

The transition matrix records all one-step moves at once. Matrix multiplication then combines those moves across time, while the proposition explains what each entry means. This is useful even when a graph has many vertices: instead of listing every possible trajectory, one can compute a row of \(P^t\), or multiply an initial distribution by \(P\) repeatedly.

The regularity assumption is what makes every allowed move have probability \(1/d\). It also makes the probability of any particular length-\(t\) walk equal to \(d^{-t}\), regardless of which vertices the walk visits. If degrees differ, the next-step probability from \(u\) to a neighbor is \(1/\deg(u)\), and different trajectories of the same length need not have equal probabilities. The regular-graph formula \(P=\mathbf{A}(G)/d\) should not be used in that setting.

Common mistake: counting endpoints instead of trajectories. On the 4-cycle above, a two-step walk from \(1\) returns to \(1\) in two different ways. Assigning probability \(1/4\) to the endpoint because there is one endpoint vertex would miss one of those walks. The correct calculation sums the probabilities of both trajectories, giving \(1/4+1/4=1/2\). Conversely, one must not count a trajectory more than once: each walk is specified by its complete vertex sequence, and its probability is the product of the step probabilities along that sequence.

For a fixed starting vertex, every row of \(P^t\) is a probability distribution: its entries are nonnegative, and its sum is \(1\). This also follows from the interpretation in the proposition, since after exactly \(t\) steps the walk must be at one of the vertices of \(V\). When doing a calculation, checking that the entries sum to \(1\) is a quick way to detect arithmetic or matrix-multiplication errors.

Check Your Understanding

For each calculation, keep the row convention: current vertex first, next vertex second.

  1. For the graph \(V=\{1,2,3,4\}\), \(E=\{12,23,34,41\}\), write its transition matrix and find the one-step distribution starting at \(3\).
  2. In \(K_4\), starting at vertex \(1\), how many length-two walks end at vertex \(4\), and what is the probability of that event?
  3. Explain why the probability of any specified length-\(t\) walk on a \(d\)-regular graph is \(d^{-t}\).
  4. For a fixed starting vertex, why must the entries in the corresponding row of \(P^t\) sum to \(1\)?
  5. Why does the formula \(P=\mathbf{A}(G)/d\) require the graph to be regular?