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 authored and tkralphs committed Mar 4, 2024
1 parent d4e9534 commit 1f3834b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/MibSCutGenerator.cpp
Original file line number Diff line number Diff line change
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 1f3834b

Please sign in to comment.