title: Finding BFS Parent-Relation Array
body: <p>I'm a student, currently covering DFS and BFS for graphs. While doing a online lab for the course, I came across the question </p>
  
  <p>"After completion of BFS starting from vertex 5, the parent relation (array) is [ _  ,  _  ,  _  ,  _  ,  _  ,  _  ]"</p>
  
  <p>The graph in question being written as: </p>
  
  <p>U 6<br>
  0 4<br>
  5 4<br>
  4 2<br>
  2 3<br>
  3 0<br>
  3 4</p>
  
  <p>The answer given (which I eventually found through guess-and-check), was: <br>
  [4, None, 4, 4, 5, None]</p>
  
  <p>I may be misunderstanding some fundamentals of graph traversals, but after spending over half an hour searching, I still cannot find a reason for this answer, so any help would be greatly appreciated.</p>