COIN-OR::LEMON - Graph Library

Changeset 194:a1680b3c516c in lemon-0.x


Ignore:
Timestamp:
03/17/04 16:09:48 (16 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@271
Message:

.

Location:
src/work
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/work/edmonds_karp.h

    r193 r194  
    533533  public:
    534534    typedef typename Graph::Node Node;
     535    typedef typename Graph::NodeIt NodeIt;
    535536    typedef typename Graph::Edge Edge;
    536537    typedef typename Graph::EdgeIt EdgeIt;
     
    564565      for(NodeIt s=G->template first<NodeIt>(); G->valid(s); G->next(s)) {
    565566        Number f=0;
    566         for(OutEdgeIt e=G->template first<OutEdgeIt>(); G->valid(e); G->next(e))
     567        for(OutEdgeIt e=G->template first<OutEdgeIt>(s); G->valid(e); G->next(e))
    567568          f+=flow->get(e);
    568569        if (f<1) {
     
    587588            free.set(w, res_graph.free(e));
    588589          }
    589           if (TMap(res_graph.head(e))) {
     590          if (T->get(res_graph.head(e))) {
    590591            n=res_graph.head(e);
    591592            _augment=true;
     
    599600      if (_augment) {
    600601        //Node n=t;
    601         Number augment_value=free.get(t);
     602        Number augment_value=free.get(n);
    602603        while (res_graph.valid(pred.get(n))) {
    603604          AugEdge e=pred.get(n);
     
    806807      }
    807808    }
    808     template<typename MutableGraph> void run() {
    809       //int num_of_augmentations=0;
    810       //while (augmentOnShortestPath()) {
    811         while (augmentOnBlockingFlow<MutableGraph>()) {
    812         //std::cout << ++num_of_augmentations << " ";
    813         //std::cout<<std::endl;
    814       }
    815     }
     809//     template<typename MutableGraph> void run() {
     810//       //int num_of_augmentations=0;
     811//       //while (augmentOnShortestPath()) {
     812//      while (augmentOnBlockingFlow<MutableGraph>()) {
     813//      //std::cout << ++num_of_augmentations << " ";
     814//      //std::cout<<std::endl;
     815//       }
     816//     }
    816817    Number flowValue() {
    817818      Number a=0;
    818       OutEdgeIt e;
    819       for(G->/*getF*/first(e, s); G->valid(e); G->next(e)) {
     819      EdgeIt e;
     820      for(G->/*getF*/first(e); G->valid(e); G->next(e)) {
    820821        a+=flow->get(e);
    821822      }
  • src/work/marci/makefile

    r189 r194  
    1010
    1111
    12 BINARIES = edmonds_karp_demo preflow_demo_leda lg_vs_sg leda_graph_demo leda_bfs_dfs
     12BINARIES = edmonds_karp_demo preflow_demo_leda lg_vs_sg leda_graph_demo leda_bfs_dfs max_bipartite_matching_demo
    1313#preflow_demo_boost edmonds_karp_demo_boost preflow_demo_jacint preflow_demo_athos edmonds_karp_demo_alpar
    1414
     
    2828leda_graph_demo: leda_graph_demo.o
    2929        $(CXX3) -Wall -O -L$(LEDAROOT) -o leda_graph_demo leda_graph_demo.o -lG -lL -lm
     30
     31max_bipartite_matching_demo.o:
     32        $(CXX3) -Wall -O -I.. -I../alpar -I$(LEDAROOT)/incl -I. -c max_bipartite_matching_demo.cc
     33
     34max_bipartite_matching_demo: max_bipartite_matching_demo.o
     35        $(CXX3) -Wall -O -L$(LEDAROOT) -o max_bipartite_matching_demo max_bipartite_matching_demo.o -lG -lL -lm
    3036
    3137leda_bfs_dfs.o:
  • src/work/marci/max_bipartite_matching_demo.cc

    r192 r194  
    5050  typedef Graph::InEdgeIt InEdgeIt;
    5151
    52   Node s, t;
     52  //Node s, t;
    5353  //Graph::EdgeMap<int> cap(G);
    5454  //readDimacsMaxFlow(std::cin, G, s, t, cap);
     
    6666    G.addEdge(s_nodes[random(20)], t_nodes[random(20)]);
    6767  }
    68   Graph::NodeMap<bool> s_map; //false
    69   Graph::NodeMap<bool> t_map; //false
     68  Graph::NodeMap<bool> s_map(G); //false
     69  Graph::NodeMap<bool> t_map(G); //false
    7070 
    7171  for(int i=0; i<20; ++i) {
     
    7777    std::cout << "on-the-fly max bipartite matching demo on wrapped leda graph..." << std::endl;
    7878    Graph::EdgeMap<int> flow(G); //0 flow
    79     Graph::EdgeMap<int> capacity(G, 1);
     79    Graph::EdgeMap<int> cap(G, 1);
    8080
    8181    Timer ts;
Note: See TracChangeset for help on using the changeset viewer.