I understand how BFS can give the shortest path in a graph but I am not able to code the entire thing. The part where I am stuck is when I pop a node from the queue and see that its the target node, how do I trace back the complete path of nodes that led to the target? In simple BFS we only have a queue but I think in this case we need some other data structure as well to keep track of path? What would be the efficient way to do that? Thank you!