Dip
0.92.4
|
This class chooses a variable to branch on. More...
#include <OsiChooseVariable.hpp>
Public Member Functions | |
OsiChooseVariable () | |
Default Constructor. More... | |
OsiChooseVariable (const OsiSolverInterface *solver) | |
Constructor from solver (so we can set up arrays etc) More... | |
OsiChooseVariable (const OsiChooseVariable &) | |
Copy constructor. More... | |
OsiChooseVariable & | operator= (const OsiChooseVariable &rhs) |
Assignment operator. More... | |
virtual OsiChooseVariable * | clone () const |
Clone. More... | |
virtual | ~OsiChooseVariable () |
Destructor. More... | |
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 bool | feasibleSolution (const OsiBranchingInformation *info, const double *solution, int numberObjects, const OsiObject **objects) |
Returns true if solution looks feasible against given objects. More... | |
void | saveSolution (const OsiSolverInterface *solver) |
Saves a good solution. More... | |
void | clearGoodSolution () |
Clears out good solution after use. More... | |
virtual void | updateInformation (const OsiBranchingInformation *info, int branch, OsiHotInfo *hotInfo) |
Given a candidate fill in useful information e.g. estimates. 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... | |
double | goodObjectiveValue () const |
Objective value for feasible solution. More... | |
double | upChange () const |
Estimate of up change or change on chosen if n-way. More... | |
double | downChange () const |
Estimate of down change or max change on other possibilities if n-way. More... | |
const double * | goodSolution () const |
Good solution - deleted by finalize. More... | |
int | bestObjectIndex () const |
Index of chosen object. More... | |
void | setBestObjectIndex (int value) |
Set index of chosen object. More... | |
int | bestWhichWay () const |
Preferred way of chosen object. More... | |
void | setBestWhichWay (int value) |
Set preferred way of chosen object. More... | |
int | firstForcedObjectIndex () const |
Index of forced object. More... | |
void | setFirstForcedObjectIndex (int value) |
Set index of forced object. More... | |
int | firstForcedWhichWay () const |
Preferred way of forced object. More... | |
void | setFirstForcedWhichWay (int value) |
Set preferred way of forced object. More... | |
int | numberUnsatisfied () const |
Get the number of objects unsatisfied at this node - accurate on first pass. More... | |
int | numberStrong () const |
Number of objects to choose for strong branching. More... | |
void | setNumberStrong (int value) |
Set number of objects to choose for strong branching. More... | |
int | numberOnList () const |
Number left on strong list. More... | |
int | numberStrongDone () const |
Number of strong branches actually done. More... | |
int | numberStrongIterations () const |
Number of strong iterations actually done. More... | |
int | numberStrongFixed () const |
Number of strong branches which changed bounds. More... | |
const int * | candidates () const |
List of candidates. More... | |
bool | trustStrongForBound () const |
Trust results from strong branching for changing bounds. More... | |
void | setTrustStrongForBound (bool yesNo) |
Set trust results from strong branching for changing bounds. More... | |
bool | trustStrongForSolution () const |
Trust results from strong branching for valid solution. More... | |
void | setTrustStrongForSolution (bool yesNo) |
Set trust results from strong branching for valid solution. More... | |
void | setSolver (const OsiSolverInterface *solver) |
Set solver and redo arrays. More... | |
int | status () const |
Return status - -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() More... | |
void | setStatus (int value) |
Protected Attributes | |
double | goodObjectiveValue_ |
Objective value for feasible solution. More... | |
double | upChange_ |
Estimate of up change or change on chosen if n-way. More... | |
double | downChange_ |
Estimate of down change or max change on other possibilities if n-way. More... | |
double * | goodSolution_ |
Good solution - deleted by finalize. More... | |
int * | list_ |
List of candidates. More... | |
double * | useful_ |
Useful array (for sorting etc) More... | |
const OsiSolverInterface * | solver_ |
Pointer to solver. More... | |
int | status_ |
int | bestObjectIndex_ |
Index of chosen object. More... | |
int | bestWhichWay_ |
Preferred way of chosen object. More... | |
int | firstForcedObjectIndex_ |
Index of forced object. More... | |
int | firstForcedWhichWay_ |
Preferred way of forced object. More... | |
int | numberUnsatisfied_ |
The number of objects unsatisfied at this node. More... | |
int | numberStrong_ |
Number of objects to choose for strong branching. More... | |
int | numberOnList_ |
Number left on strong list. More... | |
int | numberStrongDone_ |
Number of strong branches actually done. More... | |
int | numberStrongIterations_ |
Number of strong iterations actually done. More... | |
int | numberStrongFixed_ |
Number of bound changes due to strong branching. More... | |
bool | trustStrongForBound_ |
List of unsatisfied objects - first numberOnList_ for strong branching Trust results from strong branching for changing bounds. More... | |
bool | trustStrongForSolution_ |
Trust results from strong branching for valid solution. More... | |
This class chooses a variable to branch on.
The base class just chooses the variable and direction without strong branching but it has information which would normally be used by strong branching e.g. to re-enter having fixed a variable but using same candidates for strong branching.
The flow is : a) initialize the process. This decides on strong branching list and stores indices of all infeasible objects b) do strong branching on list. If list is empty then just choose one candidate and return without strong branching. If not empty then go through list and return best. However we may find that the node is infeasible or that we can fix a variable. If so we return and it is up to user to call again (after fixing a variable).
Definition at line 33 of file OsiChooseVariable.hpp.
OsiChooseVariable::OsiChooseVariable | ( | ) |
Default Constructor.
OsiChooseVariable::OsiChooseVariable | ( | const OsiSolverInterface * | solver | ) |
Constructor from solver (so we can set up arrays etc)
OsiChooseVariable::OsiChooseVariable | ( | const OsiChooseVariable & | ) |
Copy constructor.
|
virtual |
Destructor.
OsiChooseVariable& OsiChooseVariable::operator= | ( | const OsiChooseVariable & | rhs | ) |
Assignment operator.
|
virtual |
Clone.
Reimplemented in OsiChooseStrongSubset, and OsiChooseStrong.
|
virtual |
Sets up strong list and clears all if initialize is true.
Returns number of infeasibilities. If returns -1 then has worked out node is infeasible!
Reimplemented in OsiChooseStrongSubset, and OsiChooseStrong.
|
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.
Reimplemented in OsiChooseStrongSubset, and OsiChooseStrong.
|
virtual |
Returns true if solution looks feasible against given objects.
void OsiChooseVariable::saveSolution | ( | const OsiSolverInterface * | solver | ) |
Saves a good solution.
void OsiChooseVariable::clearGoodSolution | ( | ) |
Clears out good solution after use.
|
virtual |
Given a candidate fill in useful information e.g. estimates.
|
virtual |
Given a branch fill in useful information e.g. estimates.
|
inline |
Objective value for feasible solution.
Definition at line 92 of file OsiChooseVariable.hpp.
|
inline |
Estimate of up change or change on chosen if n-way.
Definition at line 97 of file OsiChooseVariable.hpp.
References upChange_.
|
inline |
Estimate of down change or max change on other possibilities if n-way.
Definition at line 102 of file OsiChooseVariable.hpp.
References downChange_.
|
inline |
Good solution - deleted by finalize.
Definition at line 107 of file OsiChooseVariable.hpp.
References goodSolution_.
|
inline |
Index of chosen object.
Definition at line 112 of file OsiChooseVariable.hpp.
References bestObjectIndex_.
|
inline |
Set index of chosen object.
Definition at line 117 of file OsiChooseVariable.hpp.
References bestObjectIndex_.
|
inline |
Preferred way of chosen object.
Definition at line 122 of file OsiChooseVariable.hpp.
References bestWhichWay_.
|
inline |
Set preferred way of chosen object.
Definition at line 127 of file OsiChooseVariable.hpp.
References bestWhichWay_.
|
inline |
Index of forced object.
Definition at line 132 of file OsiChooseVariable.hpp.
References firstForcedObjectIndex_.
|
inline |
Set index of forced object.
Definition at line 137 of file OsiChooseVariable.hpp.
References firstForcedObjectIndex_.
|
inline |
Preferred way of forced object.
Definition at line 142 of file OsiChooseVariable.hpp.
References firstForcedWhichWay_.
|
inline |
Set preferred way of forced object.
Definition at line 147 of file OsiChooseVariable.hpp.
References firstForcedWhichWay_.
|
inline |
Get the number of objects unsatisfied at this node - accurate on first pass.
Definition at line 152 of file OsiChooseVariable.hpp.
References numberUnsatisfied_.
|
inline |
Number of objects to choose for strong branching.
Definition at line 157 of file OsiChooseVariable.hpp.
References numberStrong_.
|
inline |
Set number of objects to choose for strong branching.
Definition at line 162 of file OsiChooseVariable.hpp.
References numberStrong_.
|
inline |
Number left on strong list.
Definition at line 167 of file OsiChooseVariable.hpp.
References numberOnList_.
|
inline |
Number of strong branches actually done.
Definition at line 172 of file OsiChooseVariable.hpp.
References numberStrongDone_.
|
inline |
Number of strong iterations actually done.
Definition at line 177 of file OsiChooseVariable.hpp.
References numberStrongIterations_.
|
inline |
Number of strong branches which changed bounds.
Definition at line 182 of file OsiChooseVariable.hpp.
References numberStrongFixed_.
|
inline |
|
inline |
Trust results from strong branching for changing bounds.
Definition at line 192 of file OsiChooseVariable.hpp.
References trustStrongForBound_.
|
inline |
Set trust results from strong branching for changing bounds.
Definition at line 197 of file OsiChooseVariable.hpp.
References trustStrongForBound_.
|
inline |
Trust results from strong branching for valid solution.
Definition at line 202 of file OsiChooseVariable.hpp.
References trustStrongForSolution_.
|
inline |
Set trust results from strong branching for valid solution.
Definition at line 207 of file OsiChooseVariable.hpp.
References trustStrongForSolution_.
void OsiChooseVariable::setSolver | ( | const OsiSolverInterface * | solver | ) |
Set solver and redo arrays.
|
inline |
Return status - -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()
Definition at line 224 of file OsiChooseVariable.hpp.
References status_.
|
inline |
Definition at line 228 of file OsiChooseVariable.hpp.
References status_.
|
protected |
Objective value for feasible solution.
Definition at line 236 of file OsiChooseVariable.hpp.
|
protected |
Estimate of up change or change on chosen if n-way.
Definition at line 238 of file OsiChooseVariable.hpp.
Referenced by upChange().
|
protected |
Estimate of down change or max change on other possibilities if n-way.
Definition at line 240 of file OsiChooseVariable.hpp.
Referenced by downChange().
|
protected |
Good solution - deleted by finalize.
Definition at line 242 of file OsiChooseVariable.hpp.
Referenced by goodSolution().
|
protected |
List of candidates.
Definition at line 244 of file OsiChooseVariable.hpp.
Referenced by candidates().
|
protected |
Useful array (for sorting etc)
Definition at line 246 of file OsiChooseVariable.hpp.
|
protected |
Pointer to solver.
Definition at line 248 of file OsiChooseVariable.hpp.
|
protected |
Definition at line 257 of file OsiChooseVariable.hpp.
Referenced by setStatus(), and status().
|
protected |
Index of chosen object.
Definition at line 259 of file OsiChooseVariable.hpp.
Referenced by bestObjectIndex(), and setBestObjectIndex().
|
protected |
Preferred way of chosen object.
Definition at line 261 of file OsiChooseVariable.hpp.
Referenced by bestWhichWay(), and setBestWhichWay().
|
protected |
Index of forced object.
Definition at line 263 of file OsiChooseVariable.hpp.
Referenced by firstForcedObjectIndex(), and setFirstForcedObjectIndex().
|
protected |
Preferred way of forced object.
Definition at line 265 of file OsiChooseVariable.hpp.
Referenced by firstForcedWhichWay(), and setFirstForcedWhichWay().
|
protected |
The number of objects unsatisfied at this node.
Definition at line 267 of file OsiChooseVariable.hpp.
Referenced by numberUnsatisfied().
|
protected |
Number of objects to choose for strong branching.
Definition at line 269 of file OsiChooseVariable.hpp.
Referenced by numberStrong(), and setNumberStrong().
|
protected |
Number left on strong list.
Definition at line 271 of file OsiChooseVariable.hpp.
Referenced by numberOnList().
|
protected |
Number of strong branches actually done.
Definition at line 273 of file OsiChooseVariable.hpp.
Referenced by numberStrongDone().
|
protected |
Number of strong iterations actually done.
Definition at line 275 of file OsiChooseVariable.hpp.
Referenced by numberStrongIterations().
|
protected |
Number of bound changes due to strong branching.
Definition at line 277 of file OsiChooseVariable.hpp.
Referenced by numberStrongFixed().
|
protected |
List of unsatisfied objects - first numberOnList_ for strong branching Trust results from strong branching for changing bounds.
Definition at line 280 of file OsiChooseVariable.hpp.
Referenced by setTrustStrongForBound(), and trustStrongForBound().
|
protected |
Trust results from strong branching for valid solution.
Definition at line 282 of file OsiChooseVariable.hpp.
Referenced by setTrustStrongForSolution(), and trustStrongForSolution().