#include <CbcNode.hpp>
Collaboration diagram for CbcNode:
Public Member Functions | |
CbcNode () | |
Default Constructor. | |
CbcNode (CbcModel *model, CbcNode *lastNode) | |
Construct and increment parent reference count. | |
CbcNode (const CbcNode &) | |
Copy constructor. | |
CbcNode & | operator= (const CbcNode &rhs) |
Assignment operator. | |
~CbcNode () | |
Destructor. | |
void | createInfo (CbcModel *model, CbcNode *lastNode, const CoinWarmStartBasis *lastws, const double *lastLower, const double *lastUpper, int numberOldActiveCuts, int numberNewCuts) |
Create a description of the subproblem at this node. | |
int | chooseBranch (CbcModel *model, CbcNode *lastNode, int numberPassesLeft) |
Create a branching object for the node. | |
int | chooseDynamicBranch (CbcModel *model, CbcNode *lastNode, OsiSolverBranch *&branches, int numberPassesLeft) |
Create a branching object for the node - when dynamic pseudo costs. | |
int | analyze (CbcModel *model, double *results) |
void | decrementCuts (int change=1) |
Decrement active cut counts. | |
void | decrementParentCuts (int change=1) |
Decrement all active cut counts in chain starting at parent. | |
void | nullNodeInfo () |
Nulls out node info. | |
void | initializeInfo () |
Initialize reference counts in attached CbcNodeInfo. | |
int | branch () |
Does next branch and updates state. | |
CbcNodeInfo * | nodeInfo () const |
double | objectiveValue () const |
void | setObjectiveValue (double value) |
int | numberBranches () const |
Number of arms defined for the attached CbcBranchingObject. | |
int | variable () const |
Branching `variable' associated with the attached CbcBranchingObject. | |
int | way () const |
int | depth () const |
Depth in branch-and-cut search tree. | |
int | numberUnsatisfied () const |
Get the number of objects unsatisfied at this node. | |
double | guessedObjectiveValue () const |
void | setGuessedObjectiveValue (double value) |
const CbcBranchingObject * | branchingObject () const |
Branching object for this node. | |
CbcBranchingObject * | modifiableBranchingObject () const |
Modifiable branching object for this node. | |
Private Attributes | |
CbcNodeInfo * | nodeInfo_ |
Information to make basis and bounds. | |
double | objectiveValue_ |
double | guessedObjectiveValue_ |
CbcBranchingObject * | branch_ |
Branching object for this node. | |
int | depth_ |
Depth of the node in the search tree. | |
int | numberUnsatisfied_ |
The number of objects unsatisfied at this node. |
When a subproblem is initially created, it is represented by an CbcNode object and an attached CbcNodeInfo object.
The CbcNode contains information (depth, branching instructions), that's needed while the subproblem remains `live', i.e., while the subproblem is not fathomed and there are branch arms still be be evaluated. The CbcNode is deleted when the last branch arm has been evaluated.
The CbcNodeInfo object contains the information needed to maintain the search tree and recreate the subproblem for the node. It remains in existence until there are no nodes remaining in the subtree rooted at this node.
Definition at line 388 of file CbcNode.hpp.
CbcNode::CbcNode | ( | ) |
Default Constructor.
Construct and increment parent reference count.
CbcNode::CbcNode | ( | const CbcNode & | ) |
Copy constructor.
CbcNode::~CbcNode | ( | ) |
Destructor.
void CbcNode::createInfo | ( | CbcModel * | model, | |
CbcNode * | lastNode, | |||
const CoinWarmStartBasis * | lastws, | |||
const double * | lastLower, | |||
const double * | lastUpper, | |||
int | numberOldActiveCuts, | |||
int | numberNewCuts | |||
) |
Create a description of the subproblem at this node.
The CbcNodeInfo structure holds the information (basis & variable bounds) required to recreate the subproblem for this node. It also links the node to its parent (via the parent's CbcNodeInfo object).
If lastNode == NULL, a CbcFullNodeInfo object will be created. All parameters except model
are unused.
If lastNode != NULL, a CbcPartialNodeInfo object will be created. Basis and bounds information will be stored in the form of differences between the parent subproblem and this subproblem. (More precisely, lastws
, lastUpper
, lastLower
, numberOldActiveCuts
, and numberNewCuts
are used.)
Create a branching object for the node.
The routine scans the object list of the model and selects a set of unsatisfied objects as candidates for branching. The candidates are evaluated, and an appropriate branch object is installed.
The numberPassesLeft is decremented to stop fixing one variable each time and going on and on (e.g. for stock cutting, air crew scheduling)
If evaluation determines that an object is monotone or infeasible, the routine returns immediately. In the case of a monotone object, the branch object has already been called to modify the model.
Return value:
int CbcNode::chooseDynamicBranch | ( | CbcModel * | model, | |
CbcNode * | lastNode, | |||
OsiSolverBranch *& | branches, | |||
int | numberPassesLeft | |||
) |
Create a branching object for the node - when dynamic pseudo costs.
The routine scans the object list of the model and selects a set of unsatisfied objects as candidates for branching. The candidates are evaluated, and an appropriate branch object is installed. This version gives preference in evaluation to variables which have not been evaluated many times. It also uses numberStrong to say give up if last few tries have not changed incumbent. See Achterberg, Koch and Martin.
The numberPassesLeft is decremented to stop fixing one variable each time and going on and on (e.g. for stock cutting, air crew scheduling)
If evaluation determines that an object is monotone or infeasible, the routine returns immediately. In the case of a monotone object, the branch object has already been called to modify the model.
Return value:
int CbcNode::analyze | ( | CbcModel * | model, | |
double * | results | |||
) |
void CbcNode::decrementCuts | ( | int | change = 1 |
) |
Decrement active cut counts.
void CbcNode::decrementParentCuts | ( | int | change = 1 |
) |
Decrement all active cut counts in chain starting at parent.
void CbcNode::nullNodeInfo | ( | ) |
Nulls out node info.
void CbcNode::initializeInfo | ( | ) |
Initialize reference counts in attached CbcNodeInfo.
This is a convenience routine, which will initialize the reference counts in the attached CbcNodeInfo object based on the attached CbcBranchingObject.
int CbcNode::branch | ( | ) |
Does next branch and updates state.
CbcNodeInfo* CbcNode::nodeInfo | ( | ) | const [inline] |
double CbcNode::objectiveValue | ( | ) | const [inline] |
void CbcNode::setObjectiveValue | ( | double | value | ) | [inline] |
int CbcNode::numberBranches | ( | ) | const [inline] |
Number of arms defined for the attached CbcBranchingObject.
Definition at line 513 of file CbcNode.hpp.
References branch_, and CbcBranchingObject::numberBranches().
int CbcNode::variable | ( | ) | const [inline] |
Branching `variable' associated with the attached CbcBranchingObject.
Check CbcBranchingObject::variable() for a longer explanation of `variable'.
Definition at line 524 of file CbcNode.hpp.
References branch_, and CbcBranchingObject::variable().
int CbcNode::way | ( | ) | const [inline] |
int CbcNode::depth | ( | ) | const [inline] |
int CbcNode::numberUnsatisfied | ( | ) | const [inline] |
Get the number of objects unsatisfied at this node.
Definition at line 539 of file CbcNode.hpp.
References numberUnsatisfied_.
double CbcNode::guessedObjectiveValue | ( | ) | const [inline] |
void CbcNode::setGuessedObjectiveValue | ( | double | value | ) | [inline] |
const CbcBranchingObject* CbcNode::branchingObject | ( | ) | const [inline] |
CbcBranchingObject* CbcNode::modifiableBranchingObject | ( | ) | const [inline] |
CbcNodeInfo* CbcNode::nodeInfo_ [private] |
Information to make basis and bounds.
Definition at line 552 of file CbcNode.hpp.
Referenced by nodeInfo().
double CbcNode::objectiveValue_ [private] |
Definition at line 559 of file CbcNode.hpp.
Referenced by objectiveValue(), and setObjectiveValue().
double CbcNode::guessedObjectiveValue_ [private] |
Definition at line 561 of file CbcNode.hpp.
Referenced by guessedObjectiveValue(), and setGuessedObjectiveValue().
CbcBranchingObject* CbcNode::branch_ [private] |
Branching object for this node.
Definition at line 563 of file CbcNode.hpp.
Referenced by branchingObject(), numberBranches(), variable(), and way().
int CbcNode::depth_ [private] |
Depth of the node in the search tree.
Definition at line 565 of file CbcNode.hpp.
Referenced by depth().
int CbcNode::numberUnsatisfied_ [private] |
The number of objects unsatisfied at this node.
Definition at line 567 of file CbcNode.hpp.
Referenced by numberUnsatisfied().