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