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). | |
BonNWayChoose (const BonNWayChoose &) | |
Copy constructor. | |
BonNWayChoose & | operator= (const BonNWayChoose &rhs) |
Assignment operator. | |
virtual OsiChooseVariable * | clone () const |
Clone. | |
virtual | ~BonNWayChoose () |
Destructor. | |
double | compute_usefulness (int objectIndex, const OsiBranchingInformation *info) const |
Helper function for setupList and chooseVariable, compute usefullness of an nway object. | |
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. | |
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. | |
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. | |
Static Public Member Functions | |
static void | registerOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions) |
Register class options. | |
Private Types | |
typedef std::vector < std::vector< double > > | full_mat |
Private Member Functions | |
BonNWayChoose () | |
Default Constructor, forbiden for some reason. | |
Private Attributes | |
int | br_depth_ |
depth of strong-branching. | |
Ipopt::Index | do_fixings_ |
Do we fix?*. | |
double | cutoff_multiplier_ |
Cutoff multiplier for infeasibles. | |
double | pseudocost_trust_value_ |
Trust value for the pseudo costs. | |
double | time_limit_ |
Global time limit for algorithm. | |
double | start_time_ |
Starting time of algorithm. | |
int | start_nway_ |
Start of nway objects in array. | |
int | log_ |
log level | |
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.
typedef std::vector< std::vector<double> > Bonmin::BonNWayChoose::full_mat [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.
Bonmin::BonNWayChoose::~BonNWayChoose | ( | ) | [virtual] |
Destructor.
Definition at line 96 of file BonNWayChoose.cpp.
Bonmin::BonNWayChoose::BonNWayChoose | ( | ) | [private] |
Default Constructor, forbiden for some reason.
BonNWayChoose & Bonmin::BonNWayChoose::operator= | ( | const BonNWayChoose & | rhs | ) |
Assignment operator.
Definition at line 69 of file BonNWayChoose.cpp.
OsiChooseVariable * Bonmin::BonNWayChoose::clone | ( | ) | const [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.
int Bonmin::BonNWayChoose::setupList | ( | OsiBranchingInformation * | info, | |
bool | initialize | |||
) | [virtual] |
Sets up strong list and clears all if initialize is true.
Returns number of infeasibilities.
Definition at line 194 of file BonNWayChoose.cpp.
int Bonmin::BonNWayChoose::chooseVariable | ( | OsiSolverInterface * | solver, | |
OsiBranchingInformation * | info, | |||
bool | fixVariables | |||
) | [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.
int Bonmin::BonNWayChoose::doStrongBranching | ( | OsiSolverInterface * | solver, | |
OsiBranchingInformation * | info, | |||
int | iObject, | |||
double * | saveLow, | |||
double * | saveUp, | |||
double & | score | |||
) | [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.
void Bonmin::BonNWayChoose::registerOptions | ( | Ipopt::SmartPtr< Bonmin::RegisteredOptions > | roptions | ) | [static] |
Register class options.
Definition at line 101 of file BonNWayChoose.cpp.
int Bonmin::BonNWayChoose::br_depth_ [private] |
depth of strong-branching.
Definition at line 92 of file BonNWayChoose.hpp.
Ipopt::Index Bonmin::BonNWayChoose::do_fixings_ [private] |
Do we fix?*.
Definition at line 94 of file BonNWayChoose.hpp.
double Bonmin::BonNWayChoose::cutoff_multiplier_ [private] |
Cutoff multiplier for infeasibles.
Definition at line 96 of file BonNWayChoose.hpp.
double Bonmin::BonNWayChoose::pseudocost_trust_value_ [private] |
Trust value for the pseudo costs.
Definition at line 98 of file BonNWayChoose.hpp.
double Bonmin::BonNWayChoose::time_limit_ [private] |
Global time limit for algorithm.
Definition at line 100 of file BonNWayChoose.hpp.
double Bonmin::BonNWayChoose::start_time_ [private] |
Starting time of algorithm.
Definition at line 103 of file BonNWayChoose.hpp.
int Bonmin::BonNWayChoose::start_nway_ [private] |
Start of nway objects in array.
Definition at line 106 of file BonNWayChoose.hpp.
int Bonmin::BonNWayChoose::log_ [private] |
log level
Definition at line 109 of file BonNWayChoose.hpp.
full_mat Bonmin::BonNWayChoose::bounds_ [private] |
Definition at line 112 of file BonNWayChoose.hpp.
full_mat Bonmin::BonNWayChoose::unit_changes_ [private] |
Definition at line 114 of file BonNWayChoose.hpp.
std::vector< std::vector<int> > Bonmin::BonNWayChoose::num_ps_costs_ [private] |
Definition at line 116 of file BonNWayChoose.hpp.
std::vector<int> Bonmin::BonNWayChoose::num_eval_ [private] |
Definition at line 118 of file BonNWayChoose.hpp.
int Bonmin::BonNWayChoose::geo_means_ [private] |
Definition at line 120 of file BonNWayChoose.hpp.