For an unweighted graph the $\ell^{\text{th}}$ power of the [[Network Types#^daa3e3|Adjacency Matrix]] $A^\ell_{ij}$ gives the number of [[Network Types#^7075f3|Walks]], that have length $\ell$ and start at node $i$ and end at node $j$.
![[powers-of-adjacency-matrix.jpeg|center|500]]
**Explanation for $\ell=2$:**
- Every row $r_i$ of $A$ represents all walks of length $1$ coming from node $i$,
- Every column $c_j$ of $A$ represents all walks of length $1$ arriving at node $j$.
- When taking the inner product of such $r_i \cdot c_j$, the position-wise multiplications return $1$ only if the ending node coming from $i$ matches the starting node going to $j$.
- Since the inner product sums up all these $1$’s, each entry in $A^2_{ij}$ gives the number of walks of length $2$.