Cloning a graph through bfs