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