Try impl bfs.