// -*- c++ -*- #include #include #include #include #include #include #include using namespace hugo; int main() { typedef ListGraph Graph; Graph g; readDimacs(std::cin, g); { std::list l; topSort(g, l); std::cout << "Leaving order of dfs which is pretopological..." << std::endl; for(std::list::const_iterator i=l.begin(); i!=l.end(); ++i) { std::cout << *i << " "; } std::cout << std::endl; } { typedef RevGraphWrapper GW; GW gw(g); std::list l; topSort(gw, l); std::cout << "Same in the revered oriented graph..." << std::endl; for(std::list::const_iterator i=l.begin(); i!=l.end(); ++i) { std::cout << *i << " "; } std::cout << std::endl; } return 0; }