I am interested in finding linear recurrences for the number of n-step paths between two fixed vertices in a finite graph. The question is motivated by the same problem that led to this question.

For concreteness' sake, let's consider the graph $G$ on 16 vertices given by the adjacency matrix $$ M=\left( \begin{array}{cccccccccccccccc} 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 \\ 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 & 1 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 1 \\ \end{array} \right). $$

```
M={{1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0}, {0, 1, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 1, 0}, {0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0,
0, 0, 0, 0}, {0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0}, {0,
0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0}, {1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0,
0, 0, 0}, {0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0}, {0, 0,
0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0}, {1, 1, 0, 0, 0, 0, 0, 0,
1, 1, 0, 0, 0, 0, 0, 0}, {1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0,
0, 0}, {1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0,
0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0}, {1, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0,
0}, {1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1}};
```

This directed graph has constant out-degree 4, some self-loops, und looks like this:

From counting paths in the graph directly, or computing powers of $M$, one finds that the numbers of $n$-step paths from $1$ to $1$ are given by

```
n #paths paths
-------------------------
1 1 1-->1
2 2 1-->1-->1, 1-->10--->1
3 6 1-->1-->1-->1, 1-->1-->10-->1, 1-->10-->1-->1, 1-->10-->10-->1, 1-->9-->12-->1, 1-->2-->14-->1
4 24
5 100
6 408
7 1640
8 6560
9 26224
10 104864
... ...
```

Experimentally, we find that the number of $n$-step paths, $a_n$, satisfy the linear recurrence $$ a_n = 6\,a_{n-1} -10\,a_{n-2} + 8\,a_{n-3},\quad n>3, $$ e.g., for $n=4$, $$ 24 = 6\times 6 - 10\times 2 + 8\times 1 = 36-20+8=24. $$

Looking back from the end of an $n$-step path beginning and ending in $1$ it is clear that the number of such paths equals the sum of $(n-1)$-step paths beginning in $1$ and ending in any of the predecessors of $1$, that is in ${1,6,10,11,12,13,14,16}$, but from there things seem to get messy.

Similar recurrences, some of length 3, can be found for the number of $n$-step paths between any two vertices in this graph.

I believe that a simple random walk on this graph (with the sinks $7$ and $16$ removed) with uniform transition probabilities is an aperiodic irreducible Markov chain, and so counting the number of paths of terminating in a specific vertex would allow to compute the stationary distribution without solving an eigenvalue problem.

Questions:1) Are linear recurrences between number of $n$-step paths a general feature of finite graphs or are their specific to this example?

2) What determines the order of the recursion?

3) How can one compute the coefficients in the recurrence? Is it easier or harder than (or incomparable to) solving the eigenvalue problem of $M$?