COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
05/06/04 17:24:42 (17 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@725
Message:

top-sort, for fezso's sake

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/marci/top_sort_test.cc

    r549 r552  
    77#include <bfs_dfs_misc.h>
    88#include <list_graph.h>
     9#include <graph_wrapper.h>
    910
    1011using namespace hugo;
     
    1314  typedef ListGraph Graph;
    1415  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 << " ";
     16  readDimacs(std::cin, g);
     17  {
     18    std::list<Graph::Node> l;
     19    topSort(g, l);
     20    std::cout << "Leaving order of dfs which is pretopological..." << std::endl;
     21    for(std::list<Graph::Node>::const_iterator i=l.begin(); i!=l.end(); ++i) {
     22      std::cout << *i << " ";
     23    }
     24    std::cout << std::endl;
    2125  }
    22   std::cout << std::endl;
     26 
     27  {
     28    typedef RevGraphWrapper<Graph> GW;
     29    GW gw(g);
     30    std::list<GW::Node> l;
     31    topSort(gw, l);
     32    std::cout << "Same in the revered oriented graph..." << std::endl;
     33    for(std::list<GW::Node>::const_iterator i=l.begin(); i!=l.end(); ++i) {
     34      std::cout << *i << " ";
     35    }
     36    std::cout << std::endl;
     37  }
    2338
    2439  return 0;
Note: See TracChangeset for help on using the changeset viewer.