https://github.com/coding-minutes/graph-algorithms-for-competitive-coding/blob/b790df992692006ffa83f967138626214de91e7b/Graphs%20Java/src/BreadthFirstSearch/BfsShortestPath.java#L71 I ran into an Array index out of bound exception and the fix was to add `&& temp >=0` on this if condition.