# Math Help - How to calculate cycles of a length using an adjancy matrix?

1. ## How to calculate cycles of a length using an adjancy matrix?

I have an adjancy matrix, and I have to calculate the number of cycles of length 3 that is paths of length 3 that have the same start and end matrix: this is the matrix:
(0 1 1)
(1 1 1)
(0 1 0)

This is a past paper without answers and would really help me revise, thanks in advance !

2. Look at the powers of that matrix. Do you see that the square shows where you can go in two steps? What about the cube?

3. So if I take the cube of the matrix I get:
( 2 4 3 )
( 3 6 4 )
( 1 3 2 )
If I add these will I get the amount of cycles of length 3 ?

4. If A is an adjacency matrix, then the (i, j)th component of A^n is the number of paths of length n from i to j (see MathWorld). You need loops, so consider the diagonal elements.