Evaluate powers of a square matrix
The connection matrix \(N\) records the number of direct connections between two vertices. The entry in row 1, column 2 matches the entry in row 2, column 1
\[N = \begin{bmatrix} 0 & 2 \\ 2 & 0 \end{bmatrix}\]
The entries of \(N^2\) count two-step routes between the vertices