[Cbc] CbcCutGenerator with atSolution = true

Francois Margot fmargot at andrew.cmu.edu
Sat Apr 16 08:54:56 EDT 2011


Hi:

I am trying to understand how a CbcCutGenerator with atSolution = true
is used by Cbc. I am assuming (but that might be wrong) that such a
generator must be called each time Cbc believes to have found a feasible
solution. If the generator returns 0 cuts, the solution is indeed
feasible and Cbc can proceed as usual. If the generator returns a cut,
then the solution was not feasible and is rejected by Cbc, the cut is
added and normal operations continue.

If the above is indeed the intended behavior, then this is not what is
implemented in release 2.4.2. Looking at what happens to the variable
cutoff in CbcModel::setBestSolution(), one can see that the cutoff is
first updated to the value of the tentative solution (around line 11185:

      // This is not correct - that way cutoff can go up if maximization
      //double direction = solver_->getObjSense();
      //setCutoff(cutoff*direction);
      setCutoff(cutoff);
)

then the cut generator is called (around line 11227:

          generator_[i]->generateCuts(theseCuts,1,solver_,NULL);
)

and if it returns a global cut, then the solution is not copied.
However, the cutoff is nevertheless not changed back to the original
value. I looked at the diff between trunk revision 1450 and the current
version and nothing essential seems to have changed there.

All this is inside a block starting with

 if (!solverCharacteristics_->solutionAddsCuts()) {

Should I change that characteristic (but then how? And where?) of the
solver to get the behavior described above? Note that in
CbcModel::checkSolution(), cuts are generated only if
solverCharacteristics_->solutionAddsCuts() is true. Why would
setBestSolution() call the generator also when it is false? 

Francois
 




More information about the Cbc mailing list