Tutorials › Stochastic Processes › State Classification Workshop: Directed Graphs

Classification of States · Tutorial 149 of 994

State Classification Workshop: Directed Graphs

Learn to classify a finite Markov chain directly from its directed graph, including how to distinguish communication classes from closed classes and compute state periods.

Intermediate 10 min read

What You'll Learn

  • Translate positive transition probabilities into directed edges and paths.
  • Test accessibility by checking whether a directed path exists.
  • Find communication classes as strongly connected components.
  • Distinguish a communication class from a closed class.
  • Decide whether a finite chain is irreducible using its graph.
  • Compute state periods from lengths of return paths.

From Transition Probabilities to a Directed Graph

A finite Markov chain can be studied through the routes its transitions permit, without carrying every probability through each calculation. The graph records exactly which one-step moves have positive probability. Directed paths then encode accessibility, and groups of vertices that can all reach one another encode communication classes. The graph also records return-path lengths, which determine periods.

Let \((\Omega,\mathcal{F},\mathbb{P})\) be a probability space, and let \((X_n)_{n\ge0}\) be a discrete-time Markov chain with finite state space \(S\) and transition matrix \(P=(p_{ij})\). The matrix is row-stochastic: \(p_{ij}\ge0\) and \(\sum_{j\in S}p_{ij}=1\) for each \(i\in S\). Draw a directed edge \(i\to j\) exactly when \(p_{ij}>0\). A directed path of length \(n\) from \(i\) to \(j\) is a sequence \(i=i_0,i_1,\ldots,i_n=j\) such that each consecutive pair is an edge. A path of length zero from a state to itself is allowed.

Definition: State \(j\) is accessible from state \(i\), written \(i\to j\), if there is a directed path from \(i\) to \(j\). States \(i\) and \(j\) communicate, written \(i\leftrightarrow j\), if each is accessible from the other. The communication class of \(i\) is the set of states communicating with \(i\). A communication class is closed if no edge leads from a state in the class to a state outside it. The chain is irreducible if all states communicate with one another.

Accessibility concerns a possible route in the directed graph, not how likely that route is relative to other routes. A path with positive-probability edges has positive probability of being followed in its specified number of steps. This gives the basic connection between the graph and the chain.

Proposition: For states \(i,j\in S\) and an integer \(n\ge0\), \(p_{ij}^{(n)}>0\) if and only if there is a directed path of length \(n\) from \(i\) to \(j\). Consequently, \(j\) is accessible from \(i\) if and only if \(p_{ij}^{(n)}>0\) for some \(n\ge0\).

Proof. For \(n=0\), the transition matrix \(P^{(0)}\) is the identity matrix: \(p_{ij}^{(0)}\) is positive exactly when \(i=j\), which is exactly when there is a length-zero path from \(i\) to \(j\). Now suppose the claim holds for \(n\). By Chapman–Kolmogorov, \(p_{ij}^{(n+1)}=\sum_{k\in S}p_{ik}^{(n)}p_{kj}\). Every term is nonnegative, so this sum is positive exactly when at least one \(k\in S\) has both \(p_{ik}^{(n)}>0\) and \(p_{kj}>0\). By the induction hypothesis, the first condition means there is a length-\(n\) path from \(i\) to \(k\); the second means there is an edge from \(k\) to \(j\). Together they give a length-\((n+1)\) path. Conversely, the last edge of any length-\((n+1)\) path comes from some \(k\), and its first \(n\) edges give \(p_{ik}^{(n)}>0\); hence the corresponding term in the sum is positive. Induction proves the claim for all \(n\). Allowing any \(n\ge0\) gives the accessibility statement. \(\square\)

Communication Classes and Closed Classes

In graph language, a communication class is a strongly connected component: within it, every vertex can reach every other vertex by a directed path. These components partition the state space. To see why, communication is reflexive because of length-zero paths, symmetric by definition, and transitive because directed paths can be concatenated. Thus it is an equivalence relation, and its equivalence classes are exactly the communication classes.

Being a communication class does not imply being closed. A component is closed only if none of its vertices has an edge leaving the component. In a finite chain, the graph of communication classes has no directed cycles between distinct classes: a cycle among classes would make their states mutually accessible, so they would belong to the same class. In particular, at least one communication class is closed. Indeed, starting from any class and following edges to new classes cannot continue indefinitely without repeating a class; a repetition would create a cycle. Since there are finitely many classes, the process must reach one with no outgoing edge to a different class.

Worked Example: An Accessible State Outside the Class

Take \(S=\{1,2,3\}\) and transitions \(1\to2\) with probability \(1\), \(2\to1\) and \(2\to3\) with probability \(\tfrac12\) each, and \(3\to3\) with probability \(1\). The row sums are \(1\), \(\tfrac12+\tfrac12=1\), and \(1\), respectively, so these transitions define a row-stochastic matrix.

The graph has edges \(1\to2\), \(2\to1\), \(2\to3\), and \(3\to3\). States \(1\) and \(2\) communicate: each reaches the other in one step. State \(3\) cannot reach either \(1\) or \(2\), so it belongs to a separate communication class. The classes are therefore \(\{1,2\}\) and \(\{3\}\).

The class \(\{1,2\}\) is not closed because of the edge \(2\to3\). The class \(\{3\}\) is closed because its only outgoing edge stays at \(3\). The chain is not irreducible: for example, state \(3\) cannot access state \(1\). This example also shows why accessibility is not the same as communication: state \(3\) is accessible from \(1\), but \(1\) is not accessible from \(3\).

Periods from Return Paths

A return path at \(i\) is a directed path of positive length from \(i\) back to \(i\). Its length belongs to the return-time set \(\{n\ge1:p_{ii}^{(n)}>0\}\). If that set is nonempty, the period \(d(i)\) is the greatest common divisor of its elements. If there is no positive-length return path, use the convention \(d(i)=0\). For states in the same communication class that have positive-length returns, their periods agree.

Proposition: If \(i\leftrightarrow j\) and at least one of \(i,j\) has a positive-length return path, then both have positive-length return paths and \(d(i)=d(j)\).

Proof. If \(i=j\), the conclusion is immediate. Otherwise choose a path from \(i\) to \(j\) of length \(a\ge1\) and a path from \(j\) to \(i\) of length \(b\ge1\). Concatenating them gives positive-length return paths at both states, so both periods are defined by nonempty sets. Let \(n\) be any positive return length at \(j\). At \(i\), there is a return path of length \(a+b\), and another of length \(a+n+b\), formed by inserting the length-\(n\) return at \(j\). Therefore \(d(i)\) divides both lengths and hence divides their difference \(n\). Since this holds for every return length at \(j\), \(d(i)\) divides \(d(j)\). Reversing the roles of \(i\) and \(j\) shows that \(d(j)\) divides \(d(i)\), so the two positive integers are equal. \(\square\)

For a self-loop \(i\to i\), there is a return of length \(1\), so \(d(i)=1\). Without a self-loop, do not infer the period from the shortest return alone: the gcd must use all possible return lengths, or enough lengths to determine their gcd. For example, return lengths \(2\) and \(3\) already force period \(1\).

Worked Example: One Strongly Connected, Aperiodic Graph

Let \(S=\{1,2,3\}\) with transitions \(1\to2\) and \(1\to3\), each with probability \(\tfrac12\); \(2\to3\) with probability \(1\); and \(3\to1\) with probability \(1\). The row sums are \(\tfrac12+\tfrac12=1\), \(1\), and \(1\). Every state can reach every other: from \(1\) we can reach \(2\) or \(3\), from \(2\) we reach \(3\) and then \(1\), and from \(3\) we reach \(1\), then \(2\) or \(3\). Thus the chain is irreducible.

At state \(1\), there is a return path \(1\to3\to1\) of length \(2\), and a return path \(1\to2\to3\to1\) of length \(3\). Every common divisor of all return lengths must divide both \(2\) and \(3\), whose greatest common divisor is \(1\). Therefore \(d(1)=1\). Since all three states communicate, the period proposition gives \(d(2)=d(3)=1\) as well. The chain is aperiodic, meaning every state has period \(1\). This conclusion follows from return paths, not from the presence of a self-loop.

A Practical Graph-Classification Procedure

For a finite chain, the following sequence keeps the questions separate. First, include an edge exactly for each positive transition probability. Second, test accessibility by searching for directed paths. Third, group states that are mutually accessible; these are the communication classes. Fourth, check each class for outgoing edges to determine whether it is closed. The chain is irreducible precisely when there is one communication class containing the whole state space. Finally, for each state with a return path, find return-path lengths and take their gcd; communicating states share the same period.

Worked Example: A Transient Vertex and Two Closed Classes

Let \(S=\{0,1,2,3\}\). From \(0\), move to \(1\) or \(2\), each with probability \(\tfrac12\); from \(1\), move to \(1\) with probability \(1\); from \(2\), move to \(3\) with probability \(1\); and from \(3\), move to \(2\) with probability \(1\). The row sums are \(\tfrac12+\tfrac12=1\), \(1\), \(1\), and \(1\).

The edges are \(0\to1\), \(0\to2\), \(1\to1\), \(2\to3\), and \(3\to2\). State \(0\) reaches \(1,2,3\), but none of those states can reach \(0\). It forms the singleton communication class \(\{0\}\). States \(2\) and \(3\) reach one another, forming the class \(\{2,3\}\); state \(1\) forms \(\{1\}\). The class \(\{0\}\) is not closed because it has edges leaving it. The classes \(\{1\}\) and \(\{2,3\}\) are closed because all their outgoing edges remain within their respective classes. There are two closed classes, and the chain is not irreducible.

At state \(0\), there is no positive-length return path, so \(d(0)=0\) under the stated convention. State \(1\) has a self-loop, giving return length \(1\) and period \(1\). From state \(2\), returns occur after \(2,4,6,\ldots\) steps because the chain alternates between \(2\) and \(3\); their gcd is \(2\). State \(3\) has the same return lengths and period \(2\). Thus the graph identifies two closed classes with different periods, as well as a state that has no return path.

Common Pitfalls

A frequent error is to call every communication class closed. In the first example, \(\{1,2\}\) is a communication class, but the positive-probability edge \(2\to3\) leaves it, so it is not closed. The correction is to inspect every edge starting in the class; closure requires that each such edge end inside the class.

Another error is to define a state's period as its shortest return length. In the three-state irreducible example, state \(1\) has a return of length \(2\), but it also has a return of length \(3\). Their gcd is \(1\), not \(2\). Use the gcd of return lengths, not just the minimum. Finally, an absent edge means probability zero, not merely a transition that was omitted from a drawing by accident; the graph must include every positive-probability transition.

Graph classification captures which transitions are possible, but not their relative probabilities. Two chains with the same positive-edge graph have the same accessibility relations, communication classes, closed classes, irreducibility, and periods, even if their positive transition probabilities differ. Questions about hitting probabilities, expected times, or long-run frequencies require additional information and are not determined by the graph alone.

Check Your Understanding

For each question, use only the positive-probability edges specified and justify the classification.

  1. If a graph has paths \(a\to b\) and \(b\to a\), but also an edge from \(b\) to \(c\) with no path from \(c\) back to \(a\), what can you conclude about the class containing \(a,b\)?
  2. Explain why a directed path of length \(n\) from \(i\) to \(j\) implies \(p_{ij}^{(n)}>0\).
  3. A state has return paths of lengths \(4\) and \(6\), and every return length is even. What is its period?
  4. In the last example, which communication classes are closed, and which state has period \(0\) under the stated convention?
  5. Can a finite chain have more than one closed communication class and still be irreducible? Explain using the definitions.