COIN-OR::LEMON - Graph Library

Changeset 656:9971eb8bfbe8 in lemon-0.x


Ignore:
Timestamp:
05/21/04 14:40:39 (16 years ago)
Author:
marci
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@859
Message:

max_flow.h bug correction

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/hugo/graph_wrapper.h

    r655 r656  
    13811381    const FlowMap* flow;
    13821382  public:
     1383    void setGraph(const Graph& _graph) { graph=&_graph; }
     1384    void setCapacity(const CapacityMap& _capacity) { capacity=&_capacity; }
     1385    void setFlow(const FlowMap& _flow) { flow=&_flow; }
    13831386    ForwardFilter(const Graph& _graph,
    13841387                  const CapacityMap& _capacity, const FlowMap& _flow) :
     
    13961399    const FlowMap* flow;
    13971400  public:
     1401    void setGraph(const Graph& _graph) { graph=&_graph; }
     1402    void setCapacity(const CapacityMap& _capacity) { capacity=&_capacity; }
     1403    void setFlow(const FlowMap& _flow) { flow=&_flow; }
    13981404    BackwardFilter(const Graph& _graph,
    13991405                   const CapacityMap& _capacity, const FlowMap& _flow) :
     
    14251431    ForwardFilter<Graph, Number, CapacityMap, FlowMap> forward_filter;
    14261432    BackwardFilter<Graph, Number, CapacityMap, FlowMap> backward_filter;
     1433//     ResGraphWrapper() : Parent(),
     1434//                      capacity(0), flow(0) { }
     1435//     void setCapacityMap(const CapacityMap& _capacity) {
     1436//       capacity=&_capacity;
     1437//     }
     1438//     void setFlowMap(FlowMap& _flow) {
     1439//       flow=&_flow;
     1440//     }
    14271441  public:
    14281442    ResGraphWrapper(Graph& _graph, const CapacityMap& _capacity,
  • src/work/jacint/max_flow.h

    r653 r656  
    123123      AFTER_NOTHING,
    124124      AFTER_AUGMENTING,
     125      AFTER_FAST_AUGMENTING,
    125126      AFTER_PRE_FLOW_PHASE_1,     
    126127      AFTER_PRE_FLOW_PHASE_2
     
    266267      NodeIt v;
    267268      switch (status) {
    268         case AFTER_PRE_FLOW_PHASE_1:
     269      case AFTER_PRE_FLOW_PHASE_1:
    269270        for(g->first(v); g->valid(v); g->next(v)) {
    270271          if (level[v] < n) {
     
    275276        }
    276277        break;
    277         case AFTER_PRE_FLOW_PHASE_2:
    278         case AFTER_NOTHING:
     278      case AFTER_PRE_FLOW_PHASE_2:
     279      case AFTER_NOTHING:
    279280        minMinCut(M);
    280281        break;
    281         case AFTER_AUGMENTING:
     282      case AFTER_AUGMENTING:
    282283        for(g->first(v); g->valid(v); g->next(v)) {
    283284          if (level[v]) {
     285            M.set(v, true);
     286          } else {
     287            M.set(v, false);
     288          }
     289        }
     290        break;
     291      case AFTER_FAST_AUGMENTING:
     292        for(g->first(v); g->valid(v); g->next(v)) {
     293          if (level[v]==number_of_augmentations) {
    284294            M.set(v, true);
    285295          } else {
     
    945955    bool _augment=false;
    946956
    947     if (status!=AFTER_AUGMENTING) {
    948       FOR_EACH_LOC(typename Graph::NodeIt, e, *g) level.set(e, 3*n);
    949       number_of_augmentations=3*n+1;
     957    if (status!=AFTER_FAST_AUGMENTING) {
     958      FOR_EACH_LOC(typename Graph::NodeIt, e, *g) level.set(e, 0);
     959      number_of_augmentations=1;
    950960    } else {
    951961      ++number_of_augmentations;
     
    9921002    }
    9931003
    994     status=AFTER_AUGMENTING;
     1004    status=AFTER_FAST_AUGMENTING;
    9951005    return _augment;
    9961006  }
Note: See TracChangeset for help on using the changeset viewer.