First note that my book uses the convention that for an adjacency matrix, say we have row i and column j where i = j, then the entry is twice the number of loops incident on i. In other words, if there is a loop on a vertex we put 2 as the matrix entry instead of 1.

Now my book says "If A is the adjacency matrix of a simple graph, the ijth entry of A^n is equal to the number of paths of length n from vertex i to vertex j. n = 1,2,3..."

So what if the graph i have contains loops? (ie, it is not a simple graph). Then I wouldn't be able to use what my book says above. However I have experimented and if I follow the another convention where if there is a loop on a vertex I still put 1 (ie, count it as one edge instead of 2) then even if the graph contains loops, the ijth entry of A^n is equal to the number of paths of length n from vertex i to vertex j.

Can someone confirm what I'm doing is right?

Many thanks!

2. However I have experimented and if I follow the another convention where if there is a loop on a vertex I still put 1 (ie, count it as one edge instead of 2) then even if the graph contains loops, the ijth entry of A^n is equal to the number of paths of length n from vertex i to vertex j.
Yes, I believe this is correct.

3. Thanks emakarov!