lemon/capacity_scaling.h
changeset 1071 879fcb781086
parent 1053 1c978b5bcc65
parent 1070 ee9bac10f58e
child 1076 97d978243703
equal deleted inserted replaced
22:f6b3c11c1ab4 24:1187ef3dccd0
   737       for (int i = 0; i != _root; ++i) {
   737       for (int i = 0; i != _root; ++i) {
   738         _sum_supply += _supply[i];
   738         _sum_supply += _supply[i];
   739       }
   739       }
   740       if (_sum_supply > 0) return INFEASIBLE;
   740       if (_sum_supply > 0) return INFEASIBLE;
   741 
   741 
       
   742       // Check lower and upper bounds
       
   743       LEMON_DEBUG(checkBoundMaps(),
       
   744           "Upper bounds must be greater or equal to the lower bounds");
       
   745 
       
   746 
   742       // Initialize vectors
   747       // Initialize vectors
   743       for (int i = 0; i != _root; ++i) {
   748       for (int i = 0; i != _root; ++i) {
   744         _pi[i] = 0;
   749         _pi[i] = 0;
   745         _excess[i] = _supply[i];
   750         _excess[i] = _supply[i];
   746       }
   751       }
   829         // Without scaling
   834         // Without scaling
   830         _delta = 1;
   835         _delta = 1;
   831       }
   836       }
   832 
   837 
   833       return OPTIMAL;
   838       return OPTIMAL;
       
   839     }
       
   840     
       
   841     // Check if the upper bound is greater or equal to the lower bound
       
   842     // on each arc.
       
   843     bool checkBoundMaps() {
       
   844       for (int j = 0; j != _res_arc_num; ++j) {
       
   845         if (_upper[j] < _lower[j]) return false;
       
   846       }
       
   847       return true;
   834     }
   848     }
   835 
   849 
   836     ProblemType start() {
   850     ProblemType start() {
   837       // Execute the algorithm
   851       // Execute the algorithm
   838       ProblemType pt;
   852       ProblemType pt;