title: Using bfs (igraph, R) to sample from my large graph
body: <p>I have a large graph and would like to "chunk it up" using a breadth-first search approach.  That is, I will randomly pick a starting vertex, and then perform a BFS until I am left with a graph with (for example) 100 vertices.  This is a process I plan to repeat a number of times, so that eventually, I have a number of different sub-graphs of my large graph.  At the moment, here is how I am coding this up in <em>R</em> (this is just an example, my graph is not a ring).  </p>
  
  <pre><code>y &lt;- make_ring(1000)
  bfsy &lt;- bfs(y, root=1, "all", order=TRUE)
  suby &lt;- bfsy$order[1:100]
  newgraph = induced.subgraph(y, suby)
  </code></pre>
  
  <p>Obviously, this is not efficient, since I perform the whole BFS and I only need 100 vertices.  Any hints on how to code this better?  And, any hints on how I might randomize this process even more by randomizing queue order at each new stage (this is my next problem to tackle, ha)? Referrals to textbooks/papers area always appreciated.     </p>