title: Reach all nodes in a graph datastructure
body: <p>Say, I am having a graph object with list of vertices and edges respectively. G={V,E}</p>
  
  <p><code>G={[3, 4, 1, 2, 5, 6],[3-&gt;4, 1-&gt;2, 1-&gt;5, 5-&gt;4, 5-&gt;6]}</code></p>
  
  <p>Assuming the graph is <code>unweighted and undirected</code> I am in the need to find whether all the <code>Vertices are interconnected with eachother</code> i.e. no individual nodes or interconnected nodes are isolated.</p>
  
  <pre><code>1 -- 2
  
  |
  
  5 -- 4 -- 3
  
  | 
  
  6
  </code></pre>
  
  <p>Is it related to traversing the graph using DFS or BFS ? Please help me through this, Thanks.</p>