The key to counting length-L walks on G x = G × G -and thus to evaluating k (L) (G, G )-lies in its |V x | × |V x | adjacency matrix A x whose entry (i, j) is one if vertices v x,i , v x,j ∈ V x are joined by an edge and zero otherwise. The number of walks of length L from vertex v x,i to vertex v x,j is given by element (i, j) of A L x . Summing over all possible starting and end vertices of walks: