Path Between 2 nodes using BFS
<p>I have written a function that calculates if a destination vertex is reachable from the source vertex using BFS. Now i need to keep track of the path that I am using to reach to the vertex. I guess it shall be a small tweak where we can add the node to my path arraylist. Someone please help me out.  </p>

<pre><code>public Boolean isReachable(Node destination) {
    ArrayList&lt;Node&gt; visited = new ArrayList&lt;&gt;();
    LinkedList&lt;Node&gt; queue = new LinkedList&lt;&gt;();
    ArrayList&lt;Node&gt; path = new ArrayList&lt;&gt;();
    queue.add(this);

    while (queue.size() != 0) {
        Node source = queue.poll();

        for (Node node : source.adjacentNodes) {
            if (node.equals(destination))
                return true;

            if (!visited.contains(node)) {
                visited.add(node);
                queue.add(node);
            }

        }
    }
    return false;
}
</code></pre>