Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
dfd4943
fix typo checkFeasiblity
yuxies May 17, 2022
d158991
add slTargetGap to param
yuxies May 17, 2022
8e9a1fe
add gap to feasibility check and intersection cut
yuxies May 19, 2022
94878a4
fix bugs in the last commit...
yuxies May 19, 2022
07db86e
add pessimistic related vars and params
yuxies Jun 11, 2022
632da92
mv mat coeff setup func to Model from CutGenerator
yuxies Jun 12, 2022
6e36c9b
add pessimistic MILP and related procedure
yuxies Jun 13, 2022
46a8f24
modify pessimistic functions in MibSBilevel
yuxies Jun 15, 2022
f8ce72f
add pess UB function
yuxies Jun 16, 2022
d909bc9
change gap expressions using fabs()
yuxies Jun 16, 2022
96c5662
update pess feasibility check (UB related)
yuxies Jun 16, 2022
f45078b
fix a bug in checkBilevelFeas; still has seg fault
yuxies Jun 23, 2022
aa59b5f
update pessimistic case functions
yuxies Jun 23, 2022
e98920c
rm getLowerMatrices() and related lines; replaced by setCoeffMatrices…
yuxies Jun 23, 2022
57197e1
a index bug in getAlphaWatermelonIC()?
yuxies Jun 24, 2022
5f69bf0
minor format changes
yuxies Jul 12, 2022
821cd57
update pess MILP/UB model setup and procedure
yuxies Sep 15, 2022
5c00ef1
update pes conditions when NOT upperIntegral
yuxies Sep 15, 2022
96e3161
add pessimistic related counter and output
yuxies Sep 15, 2022
ff75bed
fix pes bugs and update UB conds in cut generator
yuxies Sep 21, 2022
91fe7ee
debug writeLp off
yuxies Sep 21, 2022
5be09a8
add gap to benders cuts; use vfLowerSolutionOrd_ to separate optimal …
yuxies Sep 28, 2022
8a3d7e1
fix coeff matrix comp in interdiction
yuxies Sep 28, 2022
1a3cd48
update bound on Benders cuts
yuxies Nov 3, 2022
aab0d71
fix bug in pes feasiblity check
yuxies Nov 4, 2022
6cda486
fix obj coeff indices
yuxies Feb 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
635 changes: 568 additions & 67 deletions src/MibSBilevel.cpp

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions src/MibSBilevel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class MibSBilevel {
bool isContainedInLinkingPool_;
MibSLinkingPoolTag tagInSeenLinkingPool_;

// YX: this variable is not used anywhere other than MibSBilevel;
// (commented off in MibSTreeNode)
// looks like it is replaced by pool tag and can be removed;
MibSLPSolStatus LPSolStatus_;

/** Optimal value of LL objective **/
Expand All @@ -68,11 +71,13 @@ class MibSBilevel {
double *lowerSolutionOrd_;
//double *optLowerSolution_;
double *optUpperSolutionOrd_;// result of solving (UB)
double *optLowerSolutionOrd_;
double *optLowerSolutionOrd_; // YX: optimal lower (heuristic) solutions
double *vfLowerSolutionOrd_; // YX: SL-MILP solutions; needed for gap > 0

MibSModel *model_;
MibSHeuristic *heuristic_;
OsiSolverInterface * lSolver_;
OsiSolverInterface * pSolver_; // YX: pessimistic case
OsiSolverInterface * UBSolver_;
CoinWarmStart * ws_;

Expand All @@ -91,9 +96,11 @@ class MibSBilevel {
//optLowerSolution_ = 0;
optUpperSolutionOrd_ = 0;
optLowerSolutionOrd_ = 0;
vfLowerSolutionOrd_ = 0; // YX: SL-MILP solutions; for gap > 0
model_ = 0;
heuristic_= 0;
lSolver_ = 0;
pSolver_ = 0; // YX: pessimistic case
UBSolver_ = 0;
ws_ = 0;
}
Expand All @@ -104,17 +111,21 @@ class MibSBilevel {

MibSSolType createBilevel(CoinPackedVector *sol,
MibSModel *mibs=0);
MibSSolType checkBilevelFeasiblity(bool isRoot);
MibSSolType checkBilevelFeasibility(bool isRoot);
void gutsOfDestructor();

private:

int findIndex(int index, int size, int * indices);
OsiSolverInterface * setUpUBModel(OsiSolverInterface * solver, double objValLL,
bool newOsi, const double *sol = NULL);
OsiSolverInterface * setUpPesModel(double objValLL, bool newOsi,
const double *sol = NULL); // YX: pessimistic case
OsiSolverInterface * setUpModel(OsiSolverInterface * solver,
bool newOsi, const double *sol = NULL);
int findIndex(int index, int size, int * indices); // YX: not used?
double getLowerObj(const double * sol, double objSense);
double getRiskFuncVal(double *lowerSol); // YX: pessimistic case
double getUpperObj(double *lowerSol, double *upperSol = NULL); // YX: pessimistic case
int binarySearch(int index,int start, int stop, int * indexArray);
CoinWarmStart * getWarmStart() {return ws_;}
void setWarmStart(CoinWarmStart * ws) {ws_ = ws;}
Expand Down
4 changes: 3 additions & 1 deletion src/MibSConstants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ enum MibSLPSolStatus{
//#############################################################################

enum MibSLinkingPoolTag{
MibSLinkingPoolTagIsNotSet = -4,
MibSLinkingPoolTagIsNotSet = -6,
MibSLinkingPoolTagLowerIsInfeasible,
MibSLinkingPoolTagLowerIsFeasible,
MibSLinkingPoolTagPesIsInfeasible, // YX: pessimistic case
MibSLinkingPoolTagPesIsFeasible, // YX: pessimistic case
MibSLinkingPoolTagUBIsSolved
};

Expand Down
Loading