dfs mod, graph