Topological sort of a graph
Small nits from my side.


You are always using for (auto foo : bar). This involves a copy of foo. If you do not alter foo then you should use for (const auto&amp; foo : bar)
As far as i know it is more idiomatic to check for existense of an element in a set via count. So rather than Visited.find(n) != Visited.end() you can check Visited.count(n) or the in my opinion way better Visited.count(n) != 1
Your code assumes every node is unique. You might want to adopt to a more robust approach utilizing a struct node that holds the data and then wr on pointers to that node