Cut Generator for aggressive BT; i.e., an aggressive probing. More...
#include <CouenneAggrProbing.hpp>
Public Member Functions | |
CouenneAggrProbing (CouenneSetup *couenne, const Ipopt::SmartPtr< Ipopt::OptionsList > options) | |
Constructor. More... | |
CouenneAggrProbing (const CouenneAggrProbing &rhs) | |
Copy constructor. More... | |
~CouenneAggrProbing () | |
Destructor. More... | |
CouenneAggrProbing * | clone () const |
Clone method (necessary for the abstract CglCutGenerator class) More... | |
void | generateCuts (const OsiSolverInterface &solver, OsiCuts &cuts, const CglTreeInfo=CglTreeInfo()) const |
The main CglCutGenerator; not implemented yet. More... | |
double | probeVariable (int index, bool probeLower) |
Probe one variable (try to tigthen the lower or the upper bound, depending on the value of the second argument), so that we can generate the corresponding column cut. More... | |
double | probeVariable2 (int index, bool lower) |
Alternative probing algorithm. More... | |
void | setMaxTime (double value) |
Set/get maximum time to probe one variable. More... | |
double | getMaxTime () const |
void | setMaxFailedSteps (int value) |
Set/get maximum number of failed steps. More... | |
int | getMaxFailedSteps () const |
void | setMaxNodes (int value) |
Set/get maximum number of nodes to probe one variable. More... | |
int | getMaxNodes () const |
void | setRestoreCutoff (bool value) |
Set/get restoreCutoff parameter (should we restore the initial cutoff value after each probing run?) More... | |
bool | getRestoreCutoff () const |
Static Public Member Functions | |
static void | registerOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions) |
Add list of options to be read from file. More... | |
Protected Attributes | |
CouenneSetup * | couenne_ |
Pointer to the CouenneProblem representation. More... | |
int | numCols_ |
Number of columns (want to have this handy) More... | |
double | maxTime_ |
Maximum time to probe one variable. More... | |
int | maxFailedSteps_ |
Maximum number of failed iterations. More... | |
int | maxNodes_ |
Maximum number of nodes in probing. More... | |
bool | restoreCutoff_ |
Restore initial cutoff (value and solution)? More... | |
double | initCutoff_ |
Initial cutoff. More... | |
Cut Generator for aggressive BT; i.e., an aggressive probing.
This probing strategy is very expensive and was initially developed to be run in parallel; hence, the user can choose to probe just a particular variable, without adding this cut generator to the list of cut generators normally employed by Couenne. However, it can also be used in the standard way; in that case, it chooses automatically the variables to probe (in a very naive way, for the moment). TODO: Implement some way to automatically choose the variables TODO: Implement the generateCuts method, for use in Branch-and-Bound
Definition at line 37 of file CouenneAggrProbing.hpp.
CouenneAggrProbing::CouenneAggrProbing | ( | CouenneSetup * | couenne, |
const Ipopt::SmartPtr< Ipopt::OptionsList > | options | ||
) |
Constructor.
Definition at line 26 of file CouenneAggrProbing.cpp.
CouenneAggrProbing::CouenneAggrProbing | ( | const CouenneAggrProbing & | rhs | ) |
Copy constructor.
Definition at line 39 of file CouenneAggrProbing.cpp.
CouenneAggrProbing::~CouenneAggrProbing | ( | ) |
Destructor.
Definition at line 49 of file CouenneAggrProbing.cpp.
|
inline |
Clone method (necessary for the abstract CglCutGenerator class)
Definition at line 52 of file CouenneAggrProbing.hpp.
|
inline |
The main CglCutGenerator; not implemented yet.
Definition at line 56 of file CouenneAggrProbing.hpp.
double CouenneAggrProbing::probeVariable | ( | int | index, |
bool | probeLower | ||
) |
Probe one variable (try to tigthen the lower or the upper bound, depending on the value of the second argument), so that we can generate the corresponding column cut.
This runs the main algorithm. It returns the new bound (equal to the initial one if we could not tigthen)
First store, then disable all heuristics.
Setup Branch-and-Bound limits
Now do Branch-and-Bound and see if probing succeeded
Problem is infeasible; therefore, probing was successful.
Problem is not infeasible; we failed
Set the bound that we want to try
Setup Branch-and-Bound limits
Now do Branch-and-Bound and see if probing succeeded
Is the search in the current interval complete?
Try again in a smaller interval
There is no smaller interval that we can try; bail out
We fully explored the current interval, and there is no feasible solution, or there is a solution and we have already updated the cutoff. So, we can eliminate the current interval. We also double the size of the search interval.
Make sure we increase by at least one if it is an integer variable
Restore initial bounds (we do not want to modify the CouenneSetup object: the caller will do that, if needed)
Restore parameters and heuristics
Restore cutoff
We are done; return best bound found.
Definition at line 88 of file CouenneAggrProbing.cpp.
double CouenneAggrProbing::probeVariable2 | ( | int | index, |
bool | lower | ||
) |
Alternative probing algorithm.
This one does not work yet! Do not use, will probably segfault.
Modify the CouenneSetup object to use our options. We store the initial values of all parameters that we modify, so that we can restore them when we are done.
First store, then disable all heuristics - we do not need upper bounds, plus they probably use a NLP object which we do not know how to modify
Now, store and modify objective function in the CouenneProblem object
Restore parameters
Definition at line 403 of file CouenneAggrProbing.cpp.
|
static |
Add list of options to be read from file.
Definition at line 52 of file CouenneAggrProbing.cpp.
void CouenneAggrProbing::setMaxTime | ( | double | value | ) |
Set/get maximum time to probe one variable.
Definition at line 60 of file CouenneAggrProbing.cpp.
double CouenneAggrProbing::getMaxTime | ( | ) | const |
Definition at line 56 of file CouenneAggrProbing.cpp.
Set/get maximum number of failed steps.
Definition at line 68 of file CouenneAggrProbing.cpp.
int CouenneAggrProbing::getMaxFailedSteps | ( | ) | const |
Definition at line 64 of file CouenneAggrProbing.cpp.
Set/get maximum number of nodes to probe one variable.
Definition at line 76 of file CouenneAggrProbing.cpp.
int CouenneAggrProbing::getMaxNodes | ( | ) | const |
Definition at line 72 of file CouenneAggrProbing.cpp.
void CouenneAggrProbing::setRestoreCutoff | ( | bool | value | ) |
Set/get restoreCutoff parameter (should we restore the initial cutoff value after each probing run?)
Definition at line 84 of file CouenneAggrProbing.cpp.
bool CouenneAggrProbing::getRestoreCutoff | ( | ) | const |
Definition at line 80 of file CouenneAggrProbing.cpp.
|
protected |
Pointer to the CouenneProblem representation.
Definition at line 98 of file CouenneAggrProbing.hpp.
|
protected |
Number of columns (want to have this handy)
Definition at line 101 of file CouenneAggrProbing.hpp.
|
protected |
Maximum time to probe one variable.
Definition at line 104 of file CouenneAggrProbing.hpp.
|
protected |
Maximum number of failed iterations.
Definition at line 107 of file CouenneAggrProbing.hpp.
|
protected |
Maximum number of nodes in probing.
Definition at line 110 of file CouenneAggrProbing.hpp.
|
protected |
Restore initial cutoff (value and solution)?
Definition at line 113 of file CouenneAggrProbing.hpp.
|
protected |
Initial cutoff.
Definition at line 116 of file CouenneAggrProbing.hpp.