use ID-DFS instead of BFS