[graphs] adding topological sorting (dfs)