title: Directed graph: checking for cycle in adjacency matrix
body: <p>There is an alternative method respect to the DFS algorithm to check if there are cycles in a directed graph represented with an adjacency matrix?</p>
  
  <p>I found piecemeal information on the properties of matrices.
  Maybe I can multiply matrix A by itself n times, and check if there is non-zero diagonal in each resulting matrix.</p>
  
  <p>While this approach may be right, how can I extract explicitly the list of vertices representing a cycle?
  And what about the complexity of this hypothetical algorithm?</p>
  
  <p>Thanks in advance for your help.</p>