finished bfs for functional digraph
for functional digraph, finished dfs, bfs, bipartite