Iterative graph BFS implementation