src/work/marci/top_sort_test.cc
changeset 549 5531429143bc
child 552 83c22ca968d8
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/work/marci/top_sort_test.cc	Thu May 06 15:10:48 2004 +0000
     1.3 @@ -0,0 +1,25 @@
     1.4 +// -*- c++ -*-
     1.5 +#include <iostream>
     1.6 +#include <fstream>
     1.7 +#include <list>
     1.8 +
     1.9 +#include <hugo/dimacs.h>
    1.10 +#include <bfs_dfs_misc.h>
    1.11 +#include <list_graph.h>
    1.12 +
    1.13 +using namespace hugo;
    1.14 +
    1.15 +int main() {
    1.16 +  typedef ListGraph Graph;
    1.17 +  Graph g;
    1.18 +  readDimacs(std::cin, g);
    1.19 +  std::list<Graph::Node> l;
    1.20 +  topSort(g, l);
    1.21 +  std::cout << "Leaving order of dfs which is pretopological..." << std::endl;
    1.22 +  for(std::list<Graph::Node>::const_iterator i=l.begin(); i!=l.end(); ++i) {
    1.23 +    std::cout << *i << " ";
    1.24 +  }
    1.25 +  std::cout << std::endl;
    1.26 +
    1.27 +  return 0;
    1.28 +}