Skip to content

Commit

Permalink
Fixing some obvious bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
tkralphs committed Oct 30, 2024
1 parent e2bca52 commit 806e2b9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/MibSBilevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ MibSBilevel::checkBilevelFeasibility(bool isRoot)
}else{
startTimeVF = model_->broker_->subTreeTimer().getTime();
lSolver->branchAndBound();
lSolver->writeLp("water");
//lSolver->writeLp("water");
model_->timerVF_ += model_->broker_->subTreeTimer().getTime() - startTimeVF;
}

Expand Down
34 changes: 15 additions & 19 deletions src/MibSCutGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ MibSCutGenerator::findLowerLevelSolImprovingSolutionIC(double *uselessIneqs,
double infinity(oSolver->getInfinity());
int i, j;
int index(0), cntInt(0);
double lObjVal(0.0), value(0.0);
double lObjVal(0.0);
int uCols(localModel_->getUpperDim());
int lCols(localModel_->getLowerDim());
int lRows(localModel_->getLowerRowNum());
Expand Down Expand Up @@ -6012,34 +6012,30 @@ MibSCutGenerator::generateConstraints(BcpsConstraintPool &conPool)
numCuts += bendersInterdictionMultipleCuts(conPool);
}
}
if (useImprovingSolutionIC == PARAM_ON &&
((haveSecondLevelSol &&
relaxedObjVal > localModel_->bS_->objVal_ + localModel_->etol_) ||
(localModel_->MibSPar_->entry(MibSParams::bilevelFreeSetTypeISIC) ==
MibSBilevelFreeSetTypeISICWithNewLLSol &&
ISICGenStrategy == MibSIDICGenStrategyLInt))){
if (useImprovingDirectionIC == PARAM_ON &&
(IDICGenStrategy == MibSIDICGenStrategyLInt ||
IDICGenStrategy == MibSIDICGenStrategyAlways ||
(IDICGenStrategy == MibSIDICGenStrategyAlwaysRoot &&
localModel_->activeNode_->getDepth() == 0))){
cutType = MibSIntersectionCutImprovingSolution;
numCuts += intersectionCuts(conPool, bS->optLowerSolutionOrd_, cutType);
}

if (useImprovingDirectionIC == PARAM_ON &&
if (useImprovingSolutionIC == PARAM_ON &&
((haveSecondLevelSol &&
relaxedObjVal > localModel_->bS_->objVal_ + localModel_->etol_) ||
(localModel_->MibSPar_->entry(MibSParams::bilevelFreeSetTypeISIC) ==
MibSBilevelFreeSetTypeISICWithNewLLSol &&
(ISICGenStrategy == MibSIDICGenStrategyLInt ||
ISICGenStrategy == MibSIDICGenStrategyAlways ||
(ISICGenStrategy == MibSIDICGenStrategyAlwaysRoot &&
(ISICGenStrategy == MibSISICGenStrategyLInt ||
ISICGenStrategy == MibSISICGenStrategyAlways ||
(ISICGenStrategy == MibSISICGenStrategyAlwaysRoot &&
localModel_->activeNode_->getDepth() == 0))))){
cutType = MibSIntersectionCutImprovingDirection;
numCuts += intersectionCuts(conPool, bS->optLowerSolutionOrd_, cutType);
}

if (useHypercubeIC == PARAM_ON && haveSecondLevelSol){
cutType = MibSIntersectionCutHypercube;
numCuts += intersectionCuts(conPool, bS->optLowerSolutionOrd_, cutType);
}

if (localModel_->allUpperBin_){
//problem with binary UL variables and integer LL variables
if (useGeneralizedNoGoodCut == PARAM_ON){
Expand All @@ -6057,8 +6053,8 @@ MibSCutGenerator::generateConstraints(BcpsConstraintPool &conPool)

}else if (bS->isLowerIntegral_){
if (useImprovingDirectionIC == PARAM_ON &&
(IDICGenStrategy == MibSIDICGenStrategyAlways ||
IDICGenStrategy == MibSIDICGenStrategyYInt ||
(IDICGenStrategy == MibSIDICGenStrategyYInt ||
IDICGenStrategy == MibSIDICGenStrategyAlways ||
(IDICGenStrategy == MibSIDICGenStrategyAlwaysRoot &&
localModel_->activeNode_->getDepth() == 0))){
cutType = MibSIntersectionCutImprovingDirection;
Expand All @@ -6069,9 +6065,9 @@ MibSCutGenerator::generateConstraints(BcpsConstraintPool &conPool)
relaxedObjVal > localModel_->bS_->objVal_ + localModel_->etol_) ||
(localModel_->MibSPar_->entry(MibSParams::bilevelFreeSetTypeISIC) ==
MibSBilevelFreeSetTypeISICWithNewLLSol &&
(ISICGenStrategy == MibSIDICGenStrategyYInt ||
ISICGenStrategy == MibSIDICGenStrategyAlways ||
(ISICGenStrategy == MibSIDICGenStrategyAlwaysRoot &&
(ISICGenStrategy == MibSISICGenStrategyYInt ||
ISICGenStrategy == MibSISICGenStrategyAlways ||
(ISICGenStrategy == MibSISICGenStrategyAlwaysRoot &&
localModel_->activeNode_->getDepth() == 0))))){
cutType = MibSIntersectionCutImprovingSolution;
numCuts += intersectionCuts(conPool, bS->optLowerSolutionOrd_, cutType);
Expand Down

0 comments on commit 806e2b9

Please sign in to comment.