BFS, DFS, min cut