Bonmin
1.8.8
|
This class chooses a variable to branch on. More...
#include <BonChooseVariable.hpp>
Classes | |
class | Messages |
Public Types | |
enum | DoStrongReturnStatuses { provenInfeasible = -1, doneNoFixing, doneCanFix, interuptedCanFix, maxTime } |
enum | chooseVariableReturnStatuses { infeasibleNode = -1, hasCandidate, feasibleNode, canFixAndStrongBranch, canFixAndBranch, canFixNoCandidate } |
Return statuses for chooseVariable. More... | |
Public Member Functions | |
BonChooseVariable (BabSetupBase &b, const OsiSolverInterface *solver) | |
Constructor from solver (so we can set up arrays etc) More... | |
BonChooseVariable (const BonChooseVariable &) | |
Copy constructor. More... | |
BonChooseVariable & | operator= (const BonChooseVariable &rhs) |
Assignment operator. More... | |
virtual OsiChooseVariable * | clone () const |
Clone. More... | |
virtual | ~BonChooseVariable () |
Destructor. More... | |
double | maxminCrit (const OsiBranchingInformation *info) const |
Helper functions for setupList and chooseVariable. More... | |
void | computeMultipliers (double &upMult, double &downMult) const |
double | computeUsefulness (const double MAXMIN_CRITERION, const double upMult, const double dowMult, const double value, const OsiObject *object, int i, double &value2) const |
virtual int | setupList (OsiBranchingInformation *info, bool initialize) |
Sets up strong list and clears all if initialize is true. More... | |
virtual int | chooseVariable (OsiSolverInterface *solver, OsiBranchingInformation *info, bool fixVariables) |
Choose a variable Returns - -1 Node is infeasible 0 Normal termination - we have a candidate 1 All looks satisfied - no candidate 2 We can change the bound on a variable - but we also have a strong branching candidate 3 We can change the bound on a variable - but we have a non-strong branching candidate 4 We can change the bound on a variable - no other candidates We can pick up branch from bestObjectIndex() and bestWhichWay() We can pick up a forced branch (can change bound) from firstForcedObjectIndex() and firstForcedWhichWay() If we have a solution then we can pick up from goodObjectiveValue() and goodSolution() If fixVariables is true then 2,3,4 are all really same as problem changed. More... | |
virtual void | updateInformation (const OsiBranchingInformation *info, int branch, OsiHotInfo *hotInfo) |
This is a utility function which does strong branching on a list of objects and stores the results in OsiHotInfo.objects. More... | |
virtual void | updateInformation (int whichObject, int branch, double changeInObjective, double changeInValue, int status) |
Given a branch fill in useful information e.g. estimates. More... | |
void | setCbcModel (CbcModel *cbc_model) |
Method for setting CbcModel, which is used to get statusOfSearch. More... | |
void | setOnlyPseudoWhenTrusted (bool only_pseudo_when_trusted) |
const OsiPseudoCosts & | pseudoCosts () const |
Access to pseudo costs storage. More... | |
OsiPseudoCosts & | pseudoCosts () |
Access to pseudo costs storage. More... | |
Static Public Member Functions | |
static void | registerOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions) |
Protected Types | |
enum | StrongStatus { NotDone =-1, Feasible, Infeasible, NotFinished } |
Statuses for strong branching candidates. More... | |
Protected Member Functions | |
virtual int | doStrongBranching (OsiSolverInterface *solver, OsiBranchingInformation *info, int numberToDo, int returnCriterion) |
This is a utility function which does strong branching on a list of objects and stores the results in OsiHotInfo.objects. More... | |
int | determineStatus (OsiSolverInterface *solver) const |
Determine status of strong branching solution. More... | |
bool | isRootNode (const OsiBranchingInformation *info) const |
detecting if this is root node More... | |
Protected Attributes | |
Ipopt::SmartPtr < Ipopt::Journalist > | jnlst_ |
Holding on the a pointer to the journalist. More... | |
int | bb_log_level_ |
verbosity level More... | |
vector< HotInfo > | results_ |
Stores strong branching results. More... | |
CbcModel * | cbc_model_ |
CbcModel, used to get status of search. More... | |
bool | only_pseudo_when_trusted_ |
Flag indicating whether we don't want to mix strong branching and pseudo costs during the decision which variable to branch on. More... | |
int | number_not_trusted_ |
Number of variables put into the list because there were not trusted. More... | |
CoinMessageHandler * | handler_ |
Message handler. More... | |
Messages | messages_ |
Messages. More... | |
Algoirithmic options | |
double | maxmin_crit_no_sol_ |
maxmin weight in branching decision when no solution has been found yet More... | |
double | maxmin_crit_have_sol_ |
maxmin weight in branching decision when no solution has been found yet More... | |
double | setup_pseudo_frac_ |
fraction of branching candidates that are not trusted yet More... | |
int | numberBeforeTrustedList_ |
number of times a branch has to happen so that it is trusted in setupList More... | |
int | numberStrongRoot_ |
number of strong branching points at root node More... | |
int | numberStrongBackup_ |
backup of numberStrong_ before Root node solve More... | |
int | numberLookAhead_ |
number of look-ahead strong-branching steps More... | |
int | minNumberStrongBranch_ |
Always strong branch that many first candidate in the list regardless of numberTrusted. More... | |
OsiPseudoCosts | pseudoCosts_ |
Stores the pseudo costs. More... | |
int | trustStrongForPseudoCosts_ |
Wether or not to trust strong branching results for updating pseudo costs. More... | |
Static Protected Attributes | |
static const std::string | CNAME |
Stores the class name for throwing errors. More... | |
Private Member Functions | |
BonChooseVariable () | |
Default Constructor, forbiden for some reason. More... | |
Private Attributes | |
double | time_limit_ |
Global time limit for algorithm. More... | |
double | start_time_ |
Starting time of algorithm. More... | |
Message handling. | |
enum | Messages_Types { PS_COST_HISTORY = 0, PS_COST_MULT, PS_COST_ESTIMATES, CANDIDATE_LIST, CANDIDATE_LIST2, CANDIDATE_LIST3, SB_START, SB_HEADER, SB_RES, BRANCH_VAR, CHOSEN_VAR, UPDATE_PS_COST, BON_CHOOSE_MESSAGES_DUMMY_END } |
void | passInMessageHandler (CoinMessageHandler *handler) |
CoinMessageHandler & | message (Messages_Types type) const |
This class chooses a variable to branch on.
This is the base class for the branching rules in Bonmin (inherits from OsiChooseVariable). This class implements a simple strong branching algorithm where the changes in the objective value induced by branching on a specific object are estimated with the pure virtual function fill_changes.
Definition at line 81 of file BonChooseVariable.hpp.
|
protected |
Statuses for strong branching candidates.
Enumerator | |
---|---|
NotDone | |
Feasible |
Child is proven feasible. |
Infeasible |
Child is proven infeasible. |
NotFinished |
Child is not finished. |
Definition at line 109 of file BonChooseVariable.hpp.
Enumerator | |
---|---|
PS_COST_HISTORY | |
PS_COST_MULT | |
PS_COST_ESTIMATES | |
CANDIDATE_LIST | |
CANDIDATE_LIST2 | |
CANDIDATE_LIST3 | |
SB_START | |
SB_HEADER | |
SB_RES | |
BRANCH_VAR | |
CHOSEN_VAR | |
UPDATE_PS_COST | |
BON_CHOOSE_MESSAGES_DUMMY_END |
Definition at line 117 of file BonChooseVariable.hpp.
Definition at line 153 of file BonChooseVariable.hpp.
Return statuses for chooseVariable.
Definition at line 161 of file BonChooseVariable.hpp.
Bonmin::BonChooseVariable::BonChooseVariable | ( | BabSetupBase & | b, |
const OsiSolverInterface * | solver | ||
) |
Constructor from solver (so we can set up arrays etc)
Bonmin::BonChooseVariable::BonChooseVariable | ( | const BonChooseVariable & | ) |
Copy constructor.
|
virtual |
Destructor.
|
private |
Default Constructor, forbiden for some reason.
|
protectedvirtual |
This is a utility function which does strong branching on a list of objects and stores the results in OsiHotInfo.objects.
On entry the object sequence is stored in the OsiHotInfo object and maybe more. It returns - -1 - one branch was infeasible both ways 0 - all inspected - nothing can be fixed 1 - all inspected - some can be fixed (returnCriterion==0) 2 - may be returning early - one can be fixed (last one done) (returnCriterion==1) 3 - returning because max time
|
inline |
Definition at line 139 of file BonChooseVariable.hpp.
References handler_.
|
inline |
Definition at line 146 of file BonChooseVariable.hpp.
BonChooseVariable& Bonmin::BonChooseVariable::operator= | ( | const BonChooseVariable & | rhs | ) |
Assignment operator.
|
virtual |
Clone.
|
static |
double Bonmin::BonChooseVariable::maxminCrit | ( | const OsiBranchingInformation * | info | ) | const |
Helper functions for setupList and chooseVariable.
void Bonmin::BonChooseVariable::computeMultipliers | ( | double & | upMult, |
double & | downMult | ||
) | const |
double Bonmin::BonChooseVariable::computeUsefulness | ( | const double | MAXMIN_CRITERION, |
const double | upMult, | ||
const double | dowMult, | ||
const double | value, | ||
const OsiObject * | object, | ||
int | i, | ||
double & | value2 | ||
) | const |
|
virtual |
Sets up strong list and clears all if initialize is true.
Returns number of infeasibilities.
|
virtual |
Choose a variable Returns - -1 Node is infeasible 0 Normal termination - we have a candidate 1 All looks satisfied - no candidate 2 We can change the bound on a variable - but we also have a strong branching candidate 3 We can change the bound on a variable - but we have a non-strong branching candidate 4 We can change the bound on a variable - no other candidates We can pick up branch from bestObjectIndex() and bestWhichWay() We can pick up a forced branch (can change bound) from firstForcedObjectIndex() and firstForcedWhichWay() If we have a solution then we can pick up from goodObjectiveValue() and goodSolution() If fixVariables is true then 2,3,4 are all really same as problem changed.
|
virtual |
This is a utility function which does strong branching on a list of objects and stores the results in OsiHotInfo.objects.
On entry the object sequence is stored in the OsiHotInfo object and maybe more. It returns - -1 - one branch was infeasible both ways 0 - all inspected - nothing can be fixed 1 - all inspected - some can be fixed (returnCriterion==0) 2 - may be returning early - one can be fixed (last one done) (returnCriterion==1) 3 - returning because max timeGiven a candidate fill in useful information e.g. estimates
|
virtual |
Given a branch fill in useful information e.g. estimates.
|
inline |
Method for setting CbcModel, which is used to get statusOfSearch.
Definition at line 237 of file BonChooseVariable.hpp.
References cbc_model_.
|
inline |
Definition at line 242 of file BonChooseVariable.hpp.
References only_pseudo_when_trusted_.
|
inline |
Access to pseudo costs storage.
Definition at line 249 of file BonChooseVariable.hpp.
References pseudoCosts_.
|
inline |
Access to pseudo costs storage.
Definition at line 253 of file BonChooseVariable.hpp.
References pseudoCosts_.
|
inlineprotected |
Determine status of strong branching solution.
Definition at line 267 of file BonChooseVariable.hpp.
|
protected |
detecting if this is root node
|
protected |
Holding on the a pointer to the journalist.
Definition at line 258 of file BonChooseVariable.hpp.
|
protected |
verbosity level
Definition at line 261 of file BonChooseVariable.hpp.
Stores strong branching results.
Definition at line 264 of file BonChooseVariable.hpp.
|
private |
Global time limit for algorithm.
Definition at line 282 of file BonChooseVariable.hpp.
|
private |
Starting time of algorithm.
Definition at line 285 of file BonChooseVariable.hpp.
|
protected |
CbcModel, used to get status of search.
Definition at line 288 of file BonChooseVariable.hpp.
Referenced by setCbcModel().
|
protected |
Flag indicating whether we don't want to mix strong branching and pseudo costs during the decision which variable to branch on.
Definition at line 293 of file BonChooseVariable.hpp.
Referenced by setOnlyPseudoWhenTrusted().
|
protected |
Number of variables put into the list because there were not trusted.
Definition at line 297 of file BonChooseVariable.hpp.
|
protected |
Message handler.
Definition at line 300 of file BonChooseVariable.hpp.
Referenced by message(), and passInMessageHandler().
|
protected |
|
protected |
maxmin weight in branching decision when no solution has been found yet
Definition at line 309 of file BonChooseVariable.hpp.
|
protected |
maxmin weight in branching decision when no solution has been found yet
Definition at line 312 of file BonChooseVariable.hpp.
|
protected |
fraction of branching candidates that are not trusted yet
Definition at line 314 of file BonChooseVariable.hpp.
|
protected |
number of times a branch has to happen so that it is trusted in setupList
Definition at line 317 of file BonChooseVariable.hpp.
|
protected |
number of strong branching points at root node
Definition at line 319 of file BonChooseVariable.hpp.
|
protected |
backup of numberStrong_ before Root node solve
Definition at line 321 of file BonChooseVariable.hpp.
|
protected |
number of look-ahead strong-branching steps
Definition at line 323 of file BonChooseVariable.hpp.
|
protected |
Always strong branch that many first candidate in the list regardless of numberTrusted.
Definition at line 329 of file BonChooseVariable.hpp.
|
protected |
Stores the pseudo costs.
Definition at line 331 of file BonChooseVariable.hpp.
Referenced by pseudoCosts().
|
protected |
Wether or not to trust strong branching results for updating pseudo costs.
Definition at line 333 of file BonChooseVariable.hpp.
|
staticprotected |
Stores the class name for throwing errors.
Definition at line 341 of file BonChooseVariable.hpp.