COIN-OR::LEMON - Graph Library

Changeset 656:9971eb8bfbe8 in lemon-0.x for src/work/jacint


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

max_flow.h bug correction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.