Avoid recursion in BFS

.. to avoid a stack overflow for large graphs