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