title: Find how many connected groups of nodes in a given adjacency matrix
body: <p>I have a list of lists, each list is a node and contains the edges to other nodes. e.g
  <code>[[1, 1, 0], [1, 1, 0], [0, 0, 1]]</code> </p>
  
  <p>The node has a <code>1</code> when it refers to its own position, as well as when it has an edge to another node, and a <code>0</code> when no edge exists.</p>
  
  <p>This means that <code>node 0</code> (<code>[1, 1, 0]</code>) is connected to <code>node 1</code>, and <code>node 2</code> (<code>[0,0,1]</code>) is not connected to any other nodes. Therefore this list of lists can be thought of as an adjacency matrix:</p>
  
  <p><code>1 1 0 &lt;- node 0
   1 1 0 &lt;- node 1
   0 0 1 &lt;- node 2</code></p>
  
  <p>Adding on to this, whether a node is connected with another is transitive, meaning that if <code>node 1</code> is connected to <code>node 2</code> and <code>node 2</code> is connected to <code>node 3</code>, nodes <code>1</code> and <code>3</code> are also connected (by transitivity).</p>
  
  <p>Taking all this into account, I want to be able to know how many connected groups there are given a matrix. What algorithm should I use, recursive DFS? Can someone provide any hints or pseudocode as to how this problem can be approached?</p>