Skip to content

Commit 88488b2

Browse files
committed
Allowing branching on linking variables even when doing fractional branching to accpount for some cases where cut generation fails
1 parent 1945f94 commit 88488b2

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

src/MibSBranchStrategyPseudo.cpp

+13-2
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,28 @@ MibSBranchStrategyPseudo::createCandBranchObjects(int numPassesLeft, double ub)
158158
}
159159
}
160160

161-
// Check for fractional lower level variables variables
161+
// Check for fractional lower level variables
162162
if(branchPar == MibSBranchingStrategyLower){
163163
for (i = 0; i < numCols; ++i) {
164164
if (fabs(floor(solution[i] + 0.5) - solution[i]) > etol &&
165-
varType[i] == MibSVarLower){
165+
varType[i] == MibSVarLower && colType[i] == 'C'){
166166
fractionalLowerVar = true;
167167
break;
168168
}
169169
}
170170
}
171171

172+
// Check for fractional variables overall
173+
if(branchPar == MibSBranchingStrategyFractional){
174+
for (i = 0; i < numCols; ++i) {
175+
if (fabs(floor(solution[i] + 0.5) - solution[i]) > etol &&
176+
colType[i] != 'C'){
177+
branchPar = MibSBranchingStrategyLinking;
178+
break;
179+
}
180+
}
181+
}
182+
172183
for (i = 0; i < numCols; ++i) {
173184
if(colType[i] == 'C'){
174185
candidate[i] = false;

src/MibSCutGenerator.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,7 @@ MibSCutGenerator::solveModelIC(double *uselessIneqs, double *ray, double *rhs,
12451245
}
12461246
}
12471247

1248-
assert(alphaUb >= 0);
1248+
//assert(alphaUb >= 0);
12491249

12501250
if(isUnbounded == false){
12511251
alpha = alphaUb;
@@ -6062,17 +6062,17 @@ MibSCutGenerator::generateConstraints(BcpsConstraintPool &conPool)
60626062
if (localModel_->MibSPar_->entry(MibSParams::bilevelFreeSetTypeISIC) ==
60636063
MibSBilevelFreeSetTypeISICWithLLOptSol && haveSecondLevelSol &&
60646064
relaxedObjVal <= localModel_->bS_->objVal_ + localModel_->etol_){
6065-
localModel_->counterFracISICFail_++;
6065+
localModel_->counterLIntISICFail_++;
60666066
}else if ((localModel_->MibSPar_->entry(MibSParams::bilevelFreeSetTypeISIC) ==
60676067
MibSBilevelFreeSetTypeISICWithLLOptSol && haveSecondLevelSol) ||
60686068
localModel_->MibSPar_->entry(MibSParams::bilevelFreeSetTypeISIC) ==
60696069
MibSBilevelFreeSetTypeISICWithNewLLSol){
60706070
cutType = MibSIntersectionCutImprovingSolution;
60716071
returnVal = intersectionCuts(conPool, bS->optLowerSolutionOrd_, cutType);
60726072
if (returnVal){
6073-
localModel_->counterFracISIC_++;
6073+
localModel_->counterLIntISIC_++;
60746074
}else{
6075-
localModel_->counterFracISICFail_++;
6075+
localModel_->counterLIntISICFail_++;
60766076
}
60776077
numCuts += returnVal;
60786078
}
@@ -6127,17 +6127,17 @@ MibSCutGenerator::generateConstraints(BcpsConstraintPool &conPool)
61276127
if (localModel_->MibSPar_->entry(MibSParams::bilevelFreeSetTypeISIC) ==
61286128
MibSBilevelFreeSetTypeISICWithLLOptSol && haveSecondLevelSol &&
61296129
relaxedObjVal <= localModel_->bS_->objVal_ + localModel_->etol_){
6130-
localModel_->counterFracISICFail_++;
6130+
localModel_->counterYIntISICFail_++;
61316131
}else if ((localModel_->MibSPar_->entry(MibSParams::bilevelFreeSetTypeISIC) ==
61326132
MibSBilevelFreeSetTypeISICWithLLOptSol && haveSecondLevelSol) ||
61336133
localModel_->MibSPar_->entry(MibSParams::bilevelFreeSetTypeISIC) ==
61346134
MibSBilevelFreeSetTypeISICWithNewLLSol){
61356135
cutType = MibSIntersectionCutImprovingSolution;
61366136
returnVal = intersectionCuts(conPool, bS->optLowerSolutionOrd_, cutType);
61376137
if (returnVal){
6138-
localModel_->counterFracISIC_++;
6138+
localModel_->counterYIntISIC_++;
61396139
}else{
6140-
localModel_->counterFracISICFail_++;
6140+
localModel_->counterYIntISICFail_++;
61416141
}
61426142
numCuts += returnVal;
61436143
}

0 commit comments

Comments
 (0)