-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding parameters to allow more fine-grained control of cut generation #145
Changes from 1 commit
e2bca52
806e2b9
3289751
6c1cc80
64a332d
40cb405
8518b88
0b5f6a4
fd90955
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5870,11 +5870,11 @@ MibSCutGenerator::generateConstraints(BcpsConstraintPool &conPool) | |
int useBendersBinaryCut | ||
= localModel_->MibSPar_->entry(MibSParams::useBendersBinaryCut); | ||
|
||
int useFractionalCuts = | ||
localModel_->MibSPar_->entry(MibSParams::useFractionalCuts); | ||
int IDICGenStrategy = | ||
localModel_->MibSPar_->entry(MibSParams::IDICGenStrategy); | ||
|
||
int useFractionalCutsRootOnly = | ||
localModel_->MibSPar_->entry(MibSParams::useFractionalCutsRootOnly); | ||
int ISICGenStrategy = | ||
localModel_->MibSPar_->entry(MibSParams::ISICGenStrategy); | ||
|
||
double relaxedObjVal = localModel_->bS_->getLowerObj( | ||
localModel_->solver()->getColSolution(), | ||
|
@@ -6012,14 +6012,25 @@ MibSCutGenerator::generateConstraints(BcpsConstraintPool &conPool) | |
numCuts += bendersInterdictionMultipleCuts(conPool); | ||
} | ||
} | ||
if (useImprovingSolutionIC == PARAM_ON && ((haveSecondLevelSol && | ||
relaxedObjVal > localModel_->bS_->objVal_ + localModel_->etol_) || | ||
localModel_->MibSPar_->entry(MibSParams::bilevelFreeSetTypeISIC) == 1)){ | ||
if (useImprovingSolutionIC == PARAM_ON && | ||
((haveSecondLevelSol && | ||
relaxedObjVal > localModel_->bS_->objVal_ + localModel_->etol_) || | ||
(localModel_->MibSPar_->entry(MibSParams::bilevelFreeSetTypeISIC) == | ||
MibSBilevelFreeSetTypeISICWithNewLLSol && | ||
ISICGenStrategy == MibSIDICGenStrategyLInt))){ | ||
cutType = MibSIntersectionCutImprovingSolution; | ||
numCuts += intersectionCuts(conPool, bS->optLowerSolutionOrd_, cutType); | ||
} | ||
|
||
if (useFractionalCuts && useImprovingDirectionIC == PARAM_ON){ | ||
if (useImprovingDirectionIC == PARAM_ON && | ||
((haveSecondLevelSol && | ||
relaxedObjVal > localModel_->bS_->objVal_ + localModel_->etol_) || | ||
(localModel_->MibSPar_->entry(MibSParams::bilevelFreeSetTypeISIC) == | ||
MibSBilevelFreeSetTypeISICWithNewLLSol && | ||
(ISICGenStrategy == MibSIDICGenStrategyLInt || | ||
ISICGenStrategy == MibSIDICGenStrategyAlways || | ||
(ISICGenStrategy == MibSIDICGenStrategyAlwaysRoot && | ||
localModel_->activeNode_->getDepth() == 0))))){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't make sense out of this straightforwardly. Here the code should decide whether to undertake the generation of an IDIC, but is checking for the bilevel free set type for ISIC and whether an improving solution is available or not. Moreover, I might be wrong but I guess here |
||
cutType = MibSIntersectionCutImprovingDirection; | ||
numCuts += intersectionCuts(conPool, bS->optLowerSolutionOrd_, cutType); | ||
} | ||
|
@@ -6044,17 +6055,43 @@ MibSCutGenerator::generateConstraints(BcpsConstraintPool &conPool) | |
//and should always be false (see BlisTreeNode.cpp) | ||
return (false); | ||
|
||
}else if (bS->isLowerIntegral_ && | ||
(useFractionalCuts || | ||
(useFractionalCutsRootOnly && | ||
localModel_->activeNode_->getDepth() == 0))){ | ||
if (useImprovingDirectionIC == PARAM_ON){ | ||
}else if (bS->isLowerIntegral_){ | ||
if (useImprovingDirectionIC == PARAM_ON && | ||
(IDICGenStrategy == MibSIDICGenStrategyAlways || | ||
IDICGenStrategy == MibSIDICGenStrategyYInt || | ||
(IDICGenStrategy == MibSIDICGenStrategyAlwaysRoot && | ||
localModel_->activeNode_->getDepth() == 0))){ | ||
cutType = MibSIntersectionCutImprovingDirection; | ||
numCuts += intersectionCuts(conPool, bS->optLowerSolutionOrd_, cutType); | ||
} | ||
if (useImprovingSolutionIC == PARAM_ON && | ||
((haveSecondLevelSol && | ||
relaxedObjVal > localModel_->bS_->objVal_ + localModel_->etol_) || | ||
(localModel_->MibSPar_->entry(MibSParams::bilevelFreeSetTypeISIC) == | ||
MibSBilevelFreeSetTypeISICWithNewLLSol && | ||
(ISICGenStrategy == MibSIDICGenStrategyYInt || | ||
ISICGenStrategy == MibSIDICGenStrategyAlways || | ||
(ISICGenStrategy == MibSIDICGenStrategyAlwaysRoot && | ||
localModel_->activeNode_->getDepth() == 0))))){ | ||
cutType = MibSIntersectionCutImprovingSolution; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly as above, I guess |
||
numCuts += intersectionCuts(conPool, bS->optLowerSolutionOrd_, cutType); | ||
} | ||
}else{ | ||
if (useImprovingDirectionIC == PARAM_ON && | ||
(IDICGenStrategy == MibSIDICGenStrategyAlways || | ||
(IDICGenStrategy == MibSIDICGenStrategyAlwaysRoot && | ||
localModel_->activeNode_->getDepth() == 0))){ | ||
cutType = MibSIntersectionCutImprovingDirection; | ||
numCuts += intersectionCuts(conPool, bS->optLowerSolutionOrd_, cutType); | ||
} | ||
if (useImprovingSolutionIC == PARAM_ON && ((haveSecondLevelSol && | ||
if (useImprovingSolutionIC == PARAM_ON && | ||
((haveSecondLevelSol && | ||
relaxedObjVal > localModel_->bS_->objVal_ + localModel_->etol_) || | ||
localModel_->MibSPar_->entry(MibSParams::bilevelFreeSetTypeISIC) == 1)){ | ||
(localModel_->MibSPar_->entry(MibSParams::bilevelFreeSetTypeISIC) == | ||
MibSBilevelFreeSetTypeISICWithNewLLSol && | ||
(ISICGenStrategy == MibSIDICGenStrategyAlways || | ||
(ISICGenStrategy == MibSIDICGenStrategyAlwaysRoot && | ||
localModel_->activeNode_->getDepth() == 0))))){ | ||
cutType = MibSIntersectionCutImprovingSolution; | ||
numCuts += intersectionCuts(conPool, bS->optLowerSolutionOrd_, cutType); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a typo, shouldn't this be commented out?