src/work/marci/top_sort_test.cc
changeset 549 5531429143bc
child 552 83c22ca968d8
equal deleted inserted replaced
-1:000000000000 0:9fb2c88fbb6d
       
     1 // -*- c++ -*-
       
     2 #include <iostream>
       
     3 #include <fstream>
       
     4 #include <list>
       
     5 
       
     6 #include <hugo/dimacs.h>
       
     7 #include <bfs_dfs_misc.h>
       
     8 #include <list_graph.h>
       
     9 
       
    10 using namespace hugo;
       
    11 
       
    12 int main() {
       
    13   typedef ListGraph Graph;
       
    14   Graph g;
       
    15   readDimacs(std::cin, g);
       
    16   std::list<Graph::Node> l;
       
    17   topSort(g, l);
       
    18   std::cout << "Leaving order of dfs which is pretopological..." << std::endl;
       
    19   for(std::list<Graph::Node>::const_iterator i=l.begin(); i!=l.end(); ++i) {
       
    20     std::cout << *i << " ";
       
    21   }
       
    22   std::cout << std::endl;
       
    23 
       
    24   return 0;
       
    25 }