COIN-OR::LEMON - Graph Library

Changeset 376:5c12f3515452 in lemon-0.x


Ignore:
Timestamp:
04/22/04 18:07:17 (16 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@506
Message:

preflow mods

Location:
src/work
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/work/jacint/preflowproba.h

    r374 r376  
    4141*/
    4242
    43 #ifndef HUGO_PREFLOW_H
    44 #define HUGO_PREFLOW_H
     43#ifndef HUGO_PREFLOW_PROBA_H
     44#define HUGO_PREFLOW_PROBA_H
    4545
    4646#define H0 20
     
    5656            typename CapMap=typename Graph::EdgeMap<T>,
    5757            typename FlowMap=typename Graph::EdgeMap<T> >
    58   class Preflow {
     58  class PreflowProba {
    5959   
    6060    typedef typename Graph::Node Node;
     
    7979 
    8080  public:
    81     Preflow(Graph& _G, Node _s, Node _t, CapMap& _capacity,
     81    PreflowProba(Graph& _G, Node _s, Node _t, CapMap& _capacity,
    8282            FlowMap& _flow, bool _constzero, bool _res ) :
    8383      G(_G), s(_s), t(_t), capacity(_capacity), flow(_flow), constzero(_constzero), res(_res) {}
     
    683683} //namespace hugo
    684684
    685 #endif //PREFLOW_H
    686 
    687 
    688 
    689 
     685#endif //PREFLOW_PROBA_H
     686
     687
     688
     689
  • src/work/marci/edmonds_karp_demo.cc

    r333 r376  
    1010//#include <graph_wrapper.h>
    1111#include <preflow.h>
     12#include <preflowproba.h>
    1213#include <for_each_macros.h>
    1314
     
    7172  Graph::EdgeMap<int> flow(G); //0 flow
    7273  Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
    73     pre_flow_test(G, s, t, cap, flow);
     74    pre_flow_test(G, s, t, cap, flow, true);
     75  PreflowProba<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
     76    pre_flow_proba(G, s, t, cap, flow, true, true);
    7477  MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
    7578    max_flow_test(G, s, t, cap, flow);
     
    7982    ts.reset();
    8083    pre_flow_test.run();
     84    std::cout << "elapsed time: " << ts << std::endl;
     85    std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl;
     86  }
     87
     88  {
     89    std::cout << "wrapped preflow ..." << std::endl;
     90    FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0);
     91    ts.reset();
     92    pre_flow_proba.run();
    8193    std::cout << "elapsed time: " << ts << std::endl;
    8294    std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl;
  • src/work/marci/graph_wrapper.h

    r371 r376  
    696696    Node bNode(OutEdgeIt e) const {
    697697      return ((e.forward) ? graph->bNode(e.out) : graph->bNode(e.in)); }
     698
     699    Node aNode(InEdgeIt e) const {
     700      return ((e.forward) ? graph->aNode(e.in) : graph->aNode(e.out)); }
     701    Node bNode(InEdgeIt e) const {
     702      return ((e.forward) ? graph->bNode(e.in) : graph->bNode(e.out)); }
    698703
    699704//    int nodeNum() const { return graph->nodeNum(); }
  • src/work/marci/makefile

    r368 r376  
    77INCLUDEDIRS ?= -I../../include -I.. -I../{marci,jacint,alpar,klao,akos,athos} -I$(BOOSTROOT)
    88LEDAINCLUDE ?= -I$(LEDAROOT)/incl
    9 CXXFLAGS = -g -O -W -Wall $(INCLUDEDIRS) -ansi -pedantic -ftemplate-depth-30
     9CXXFLAGS = -g -O3 -W -Wall $(INCLUDEDIRS) -ansi -pedantic -ftemplate-depth-30
    1010
    1111LEDABINARIES = leda_graph_demo leda_bfs_dfs max_bipartite_matching_demo
     
    4242        $(CXX3) -Wall -O -L$(LEDAROOT) -o leda_bfs_dfs leda_bfs_dfs.o -lG -lL -lm
    4343
    44 edmonds_karp_demo:
    45         $(CXX3) $(CXXFLAGS) -o edmonds_karp_demo edmonds_karp_demo.cc
     44#edmonds_karp_demo:
     45#       $(CXX3) $(CXXFLAGS) -o edmonds_karp_demo edmonds_karp_demo.cc
    4646#       $(CXX3) $(CXXFLAGS) -pg -o edmonds_karp_demo_prof edmonds_karp_demo.cc
    4747
Note: See TracChangeset for help on using the changeset viewer.