Skip to content

Commit

Permalink
skip IDIC if the generation prob. has all zero sol
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxies committed Dec 1, 2023
1 parent 964056b commit d9af580
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/MibSCutGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ MibSCutGenerator::findLowerLevelSolImprovingSolutionIC(double *uselessIneqs,
const double *optSol = nSolver->getColSolution();
CoinDisjointCopyN(optSol, lCols, lowerLevelSol);
CoinDisjointCopyN(optSol + lCols, numBinCols, uselessIneqs);
nSolver->writeLp("tmpp.lp");
// nSolver->writeLp("tmpp.lp");
foundSolution = true;
}
}
Expand Down Expand Up @@ -1279,6 +1279,7 @@ MibSCutGenerator::findLowerLevelSolImprovingDirectionIC(double *uselessIneqs, do
OsiSolverInterface *oSolver = localModel_->solver();
double infinity(oSolver->getInfinity());
bool getA2G2Matrix(false), getG2Matrix(false);
bool solErr(true);
int i;
int rowIndex(0), colIndex(0), cntInt(0);
double rhs(0.0), value(0.0);
Expand Down Expand Up @@ -1524,8 +1525,17 @@ MibSCutGenerator::findLowerLevelSolImprovingDirectionIC(double *uselessIneqs, do
else if(nSolver->isProvenOptimal()){
const double *optSol = nSolver->getColSolution();
CoinDisjointCopyN(optSol, lCols, lowerLevelSol);
CoinDisjointCopyN(optSol + lCols, numContCols, uselessIneqs);
// YX: numerical issue; skip if the lowerLevelSol found is all zero
for(i = 0; i < lCols; i++){
if(fabs(lowerLevelSol[i]) > 0){
solErr = false;
break;
}
}
if(!solErr){
CoinDisjointCopyN(optSol + lCols, numContCols, uselessIneqs);
foundSolution = true;
}
}
delete [] lCoeffsTimesLpSol;
return foundSolution;
Expand Down

0 comments on commit d9af580

Please sign in to comment.