title: How to get the path between 2 nodes using Breadth-First Search?
body: <p>I am trying to find a <strong>path between two nodes in a graph</strong>, where the edges are <strong>unweighted</strong>.</p>
  
  <p>I am using a <em>Breadth First Search</em>, which stops when it finds the target, in order to find the existence of a path, but I am not sure how to get the path itself.</p>
  
  <p>I tried looking at the list of visited nodes, but this did not seem to help.
  I saw someone answer this question using prolog, but I am a C++ programmer.</p>
  
  <p>I also looked at <code>Dijkstras algorithm</code>, but this seems like over kill, since a simple Breadth-first Search has got me almost the whole way.</p>
  
  <p><strong>How to get the path between 2 nodes using Breadth-First Search?</strong></p>