lemon/cycle_canceling.h
changeset 1073 73c892335e74
parent 1053 1c978b5bcc65
parent 1070 ee9bac10f58e
child 1080 c5cd8960df74
equal deleted inserted replaced
15:4834e3340ae6 17:0d7749bef72d
   668       for (int i = 0; i != _root; ++i) {
   668       for (int i = 0; i != _root; ++i) {
   669         _sum_supply += _supply[i];
   669         _sum_supply += _supply[i];
   670       }
   670       }
   671       if (_sum_supply > 0) return INFEASIBLE;
   671       if (_sum_supply > 0) return INFEASIBLE;
   672 
   672 
       
   673       // Check lower and upper bounds
       
   674       LEMON_DEBUG(checkBoundMaps(),
       
   675           "Upper bounds must be greater or equal to the lower bounds");
       
   676 
   673 
   677 
   674       // Initialize vectors
   678       // Initialize vectors
   675       for (int i = 0; i != _res_node_num; ++i) {
   679       for (int i = 0; i != _res_node_num; ++i) {
   676         _pi[i] = 0;
   680         _pi[i] = 0;
   677       }
   681       }
   776           _cost[ra] = 0;
   780           _cost[ra] = 0;
   777         }
   781         }
   778       }
   782       }
   779 
   783 
   780       return OPTIMAL;
   784       return OPTIMAL;
       
   785     }
       
   786     
       
   787     // Check if the upper bound is greater or equal to the lower bound
       
   788     // on each arc.
       
   789     bool checkBoundMaps() {
       
   790       for (int j = 0; j != _res_arc_num; ++j) {
       
   791         if (_upper[j] < _lower[j]) return false;
       
   792       }
       
   793       return true;
   781     }
   794     }
   782 
   795 
   783     // Build a StaticDigraph structure containing the current
   796     // Build a StaticDigraph structure containing the current
   784     // residual network
   797     // residual network
   785     void buildResidualNetwork() {
   798     void buildResidualNetwork() {