(done) new dfs & topsort algo provides solution for one detour