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