This class chooses a variable to branch on. More...
#include <BonNWayChoose.hpp>
Public Member Functions | |
BonNWayChoose (BabSetupBase &b, const OsiSolverInterface *solver) | |
Constructor from solver (so we can set up arrays etc) More... | |
BonNWayChoose (const BonNWayChoose &) | |
Copy constructor. More... | |
BonNWayChoose & | operator= (const BonNWayChoose &rhs) |
Assignment operator. More... | |
virtual OsiChooseVariable * | clone () const |
Clone. More... | |
virtual | ~BonNWayChoose () |
Destructor. More... | |
double | compute_usefulness (int objectIndex, const OsiBranchingInformation *info) const |
Helper function for setupList and chooseVariable, compute usefullness of an nway object. More... | |
double | compute_usefulness (const OsiBranchingInformation *info, size_t n, const int *vars, const std::vector< double > &bounds, const std::vector< double > &unit_changes) 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 int | doStrongBranching (OsiSolverInterface *solver, OsiBranchingInformation *info, int iObject, double *saveLow, double *saveUp, double &score) |
This is a utility function which does strong branching on a list of objects and stores the results in OsiHotInfo.objects. More... | |
Static Public Member Functions | |
static void | registerOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions) |
Register class options. More... | |
Private Types | |
typedef std::vector < std::vector< double > > | full_mat |
Private Member Functions | |
BonNWayChoose () | |
Default Constructor, forbiden for some reason. More... | |
Private Attributes | |
int | br_depth_ |
depth of strong-branching. More... | |
Ipopt::Index | do_fixings_ |
Do we fix?*. More... | |
double | cutoff_multiplier_ |
Cutoff multiplier for infeasibles. More... | |
double | pseudocost_trust_value_ |
Trust value for the pseudo costs. More... | |
double | time_limit_ |
Global time limit for algorithm. More... | |
double | start_time_ |
Starting time of algorithm. More... | |
int | start_nway_ |
Start of nway objects in array. More... | |
int | log_ |
log level More... | |
full_mat | bounds_ |
full_mat | unit_changes_ |
std::vector< std::vector< int > > | num_ps_costs_ |
std::vector< int > | num_eval_ |
int | geo_means_ |
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 22 of file BonNWayChoose.hpp.
|
private |
Definition at line 110 of file BonNWayChoose.hpp.
Bonmin::BonNWayChoose::BonNWayChoose | ( | BabSetupBase & | b, |
const OsiSolverInterface * | solver | ||
) |
Constructor from solver (so we can set up arrays etc)
Set values of standard branching options.
Definition at line 19 of file BonNWayChoose.cpp.
Bonmin::BonNWayChoose::BonNWayChoose | ( | const BonNWayChoose & | rhs | ) |
Copy constructor.
Definition at line 50 of file BonNWayChoose.cpp.
|
virtual |
Destructor.
Definition at line 96 of file BonNWayChoose.cpp.
|
private |
Default Constructor, forbiden for some reason.
BonNWayChoose & Bonmin::BonNWayChoose::operator= | ( | const BonNWayChoose & | rhs | ) |
Assignment operator.
Definition at line 69 of file BonNWayChoose.cpp.
|
virtual |
Clone.
Definition at line 91 of file BonNWayChoose.cpp.
double Bonmin::BonNWayChoose::compute_usefulness | ( | int | objectIndex, |
const OsiBranchingInformation * | info | ||
) | const |
Helper function for setupList and chooseVariable, compute usefullness of an nway object.
Definition at line 142 of file BonNWayChoose.cpp.
double Bonmin::BonNWayChoose::compute_usefulness | ( | const OsiBranchingInformation * | info, |
size_t | n, | ||
const int * | vars, | ||
const std::vector< double > & | bounds, | ||
const std::vector< double > & | unit_changes | ||
) | const |
Definition at line 165 of file BonNWayChoose.cpp.
|
virtual |
Sets up strong list and clears all if initialize is true.
Returns number of infeasibilities.
Definition at line 194 of file BonNWayChoose.cpp.
|
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.
Definition at line 358 of file BonNWayChoose.cpp.
|
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 time
Definition at line 485 of file BonNWayChoose.cpp.
|
static |
Register class options.
Definition at line 101 of file BonNWayChoose.cpp.
|
private |
depth of strong-branching.
Definition at line 92 of file BonNWayChoose.hpp.
|
private |
Do we fix?*.
Definition at line 94 of file BonNWayChoose.hpp.
|
private |
Cutoff multiplier for infeasibles.
Definition at line 96 of file BonNWayChoose.hpp.
|
private |
Trust value for the pseudo costs.
Definition at line 98 of file BonNWayChoose.hpp.
|
private |
Global time limit for algorithm.
Definition at line 100 of file BonNWayChoose.hpp.
|
private |
Starting time of algorithm.
Definition at line 103 of file BonNWayChoose.hpp.
|
private |
Start of nway objects in array.
Definition at line 106 of file BonNWayChoose.hpp.
|
private |
log level
Definition at line 109 of file BonNWayChoose.hpp.
|
private |
Definition at line 112 of file BonNWayChoose.hpp.
|
private |
Definition at line 114 of file BonNWayChoose.hpp.
|
private |
Definition at line 116 of file BonNWayChoose.hpp.
|
private |
Definition at line 118 of file BonNWayChoose.hpp.
|
private |
Definition at line 120 of file BonNWayChoose.hpp.