Cbc  2.9.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
CbcNode Class Reference

Information required while the node is live. More...

#include <CbcNode.hpp>

+ Inheritance diagram for CbcNode:
+ Collaboration diagram for CbcNode:

Public Member Functions

 CbcNode ()
 Default Constructor. More...
 
 CbcNode (CbcModel *model, CbcNode *lastNode)
 Construct and increment parent reference count. More...
 
 CbcNode (const CbcNode &)
 Copy constructor. More...
 
CbcNodeoperator= (const CbcNode &rhs)
 Assignment operator. More...
 
 ~CbcNode ()
 Destructor. More...
 
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. More...
 
int chooseBranch (CbcModel *model, CbcNode *lastNode, int numberPassesLeft)
 Create a branching object for the node. More...
 
int chooseDynamicBranch (CbcModel *model, CbcNode *lastNode, OsiSolverBranch *&branches, int numberPassesLeft)
 Create a branching object for the node - when dynamic pseudo costs. More...
 
int chooseOsiBranch (CbcModel *model, CbcNode *lastNode, OsiBranchingInformation *usefulInfo, int branchState)
 Create a branching object for the node. More...
 
int chooseClpBranch (CbcModel *model, CbcNode *lastNode)
 Create a branching object for the node. More...
 
int analyze (CbcModel *model, double *results)
 
void decrementCuts (int change=1)
 Decrement active cut counts. More...
 
void decrementParentCuts (CbcModel *model, int change=1)
 Decrement all active cut counts in chain starting at parent. More...
 
void nullNodeInfo ()
 Nulls out node info. More...
 
void initializeInfo ()
 Initialize reference counts in attached CbcNodeInfo. More...
 
int branch (OsiSolverInterface *solver)
 Does next branch and updates state. More...
 
double checkIsCutoff (double cutoff)
 Double checks in case node can change its mind! Returns objective value Can change objective etc. More...
 
CbcNodeInfonodeInfo () const
 
double objectiveValue () const
 
void setObjectiveValue (double value)
 
int numberBranches () const
 Number of arms defined for the attached OsiBranchingObject. More...
 
int way () const
 
int depth () const
 Depth in branch-and-cut search tree. More...
 
void setDepth (int value)
 Set depth in branch-and-cut search tree. More...
 
int numberUnsatisfied () const
 Get the number of objects unsatisfied at this node. More...
 
void setNumberUnsatisfied (int value)
 Set the number of objects unsatisfied at this node. More...
 
double sumInfeasibilities () const
 Get sum of "infeasibilities" reported by each object. More...
 
void setSumInfeasibilities (double value)
 Set sum of "infeasibilities" reported by each object. More...
 
double guessedObjectiveValue () const
 
void setGuessedObjectiveValue (double value)
 
const OsiBranchingObjectbranchingObject () const
 Branching object for this node. More...
 
OsiBranchingObjectmodifiableBranchingObject () const
 Modifiable branching object for this node. More...
 
void setBranchingObject (OsiBranchingObject *branchingObject)
 Set branching object for this node (takes ownership) More...
 
int nodeNumber () const
 The node number. More...
 
void setNodeNumber (int node)
 
bool onTree () const
 Returns true if on tree. More...
 
void setOnTree (bool yesNo)
 Sets true if on tree. More...
 
bool active () const
 Returns true if active. More...
 
void setActive (bool yesNo)
 Sets true if active. More...
 
int getState () const
 Get state (really for debug) More...
 
void setState (int value)
 Set state (really for debug) More...
 
void print () const
 Print. More...
 
void checkInfo () const
 Debug. More...
 
- Public Member Functions inherited from CoinTreeNode
virtual ~CoinTreeNode ()
 
int getDepth () const
 
int getFractionality () const
 
double getQuality () const
 
double getTrueLB () const
 
BitVector128 getPreferred () const
 
void setDepth (int d)
 
void setFractionality (int f)
 
void setQuality (double q)
 
void setTrueLB (double tlb)
 
void setPreferred (BitVector128 p)
 

Private Attributes

CbcNodeInfonodeInfo_
 Information to make basis and bounds. More...
 
double objectiveValue_
 Objective value. More...
 
double guessedObjectiveValue_
 Guessed satisfied Objective value. More...
 
double sumInfeasibilities_
 Sum of "infeasibilities" reported by each object. More...
 
OsiBranchingObjectbranch_
 Branching object for this node. More...
 
int depth_
 Depth of the node in the search tree. More...
 
int numberUnsatisfied_
 The number of objects unsatisfied at this node. More...
 
int nodeNumber_
 The node number. More...
 
int state_
 State 1 - on tree 2 - active. More...
 

Additional Inherited Members

- Protected Member Functions inherited from CoinTreeNode
 CoinTreeNode ()
 
 CoinTreeNode (int d, int f=-1, double q=-COIN_DBL_MAX, double tlb=-COIN_DBL_MAX, BitVector128 p=BitVector128())
 
 CoinTreeNode (const CoinTreeNode &x)
 
CoinTreeNodeoperator= (const CoinTreeNode &x)
 

Detailed Description

Information required while the node is live.

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 49 of file CbcNode.hpp.

Constructor & Destructor Documentation

CbcNode::CbcNode ( )

Default Constructor.

CbcNode::CbcNode ( CbcModel model,
CbcNode lastNode 
)

Construct and increment parent reference count.

CbcNode::CbcNode ( const CbcNode )

Copy constructor.

CbcNode::~CbcNode ( )

Destructor.

Member Function Documentation

CbcNode& CbcNode::operator= ( const CbcNode rhs)

Assignment operator.

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.)

int CbcNode::chooseBranch ( CbcModel model,
CbcNode lastNode,
int  numberPassesLeft 
)

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:

  • 0: A branching object has been installed
  • -1: A monotone object was discovered
  • -2: An infeasible object was discovered
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:

  • 0: A branching object has been installed
  • -1: A monotone object was discovered
  • -2: An infeasible object was discovered
  • >0: Number of quich branching objects (and branches will be non NULL)
int CbcNode::chooseOsiBranch ( CbcModel model,
CbcNode lastNode,
OsiBranchingInformation usefulInfo,
int  branchState 
)

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:

  • 0: A branching object has been installed
  • -1: A monotone object was discovered
  • -2: An infeasible object was discovered

Branch state:

  • -1: start
  • -1: A monotone object was discovered
  • -2: An infeasible object was discovered
int CbcNode::chooseClpBranch ( CbcModel model,
CbcNode lastNode 
)

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. It then solves a series of problems and a CbcGeneral branch object is installed.

If evaluation determines that an object is infeasible, the routine returns immediately.

Return value:

  • 0: A branching object has been installed
  • -2: An infeasible object was discovered
int CbcNode::analyze ( CbcModel model,
double *  results 
)
void CbcNode::decrementCuts ( int  change = 1)

Decrement active cut counts.

void CbcNode::decrementParentCuts ( CbcModel model,
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 OsiBranchingObject.

See Also
CbcNodeInfo::initializeInfo(int).
int CbcNode::branch ( OsiSolverInterface solver)

Does next branch and updates state.

double CbcNode::checkIsCutoff ( double  cutoff)

Double checks in case node can change its mind! Returns objective value Can change objective etc.

CbcNodeInfo* CbcNode::nodeInfo ( ) const
inline

Definition at line 216 of file CbcNode.hpp.

double CbcNode::objectiveValue ( ) const
inline

Definition at line 221 of file CbcNode.hpp.

void CbcNode::setObjectiveValue ( double  value)
inline

Definition at line 224 of file CbcNode.hpp.

int CbcNode::numberBranches ( ) const
inline

Number of arms defined for the attached OsiBranchingObject.

Definition at line 228 of file CbcNode.hpp.

int CbcNode::way ( ) const
int CbcNode::depth ( ) const
inline

Depth in branch-and-cut search tree.

Definition at line 243 of file CbcNode.hpp.

void CbcNode::setDepth ( int  value)
inline

Set depth in branch-and-cut search tree.

Definition at line 247 of file CbcNode.hpp.

int CbcNode::numberUnsatisfied ( ) const
inline

Get the number of objects unsatisfied at this node.

Definition at line 251 of file CbcNode.hpp.

void CbcNode::setNumberUnsatisfied ( int  value)
inline

Set the number of objects unsatisfied at this node.

Definition at line 255 of file CbcNode.hpp.

double CbcNode::sumInfeasibilities ( ) const
inline

Get sum of "infeasibilities" reported by each object.

Definition at line 259 of file CbcNode.hpp.

void CbcNode::setSumInfeasibilities ( double  value)
inline

Set sum of "infeasibilities" reported by each object.

Definition at line 263 of file CbcNode.hpp.

double CbcNode::guessedObjectiveValue ( ) const
inline

Definition at line 267 of file CbcNode.hpp.

void CbcNode::setGuessedObjectiveValue ( double  value)
inline

Definition at line 270 of file CbcNode.hpp.

const OsiBranchingObject* CbcNode::branchingObject ( ) const
inline

Branching object for this node.

Definition at line 274 of file CbcNode.hpp.

OsiBranchingObject* CbcNode::modifiableBranchingObject ( ) const
inline

Modifiable branching object for this node.

Definition at line 278 of file CbcNode.hpp.

void CbcNode::setBranchingObject ( OsiBranchingObject branchingObject)
inline

Set branching object for this node (takes ownership)

Definition at line 282 of file CbcNode.hpp.

int CbcNode::nodeNumber ( ) const
inline

The node number.

Definition at line 286 of file CbcNode.hpp.

void CbcNode::setNodeNumber ( int  node)
inline

Definition at line 289 of file CbcNode.hpp.

bool CbcNode::onTree ( ) const
inline

Returns true if on tree.

Definition at line 293 of file CbcNode.hpp.

void CbcNode::setOnTree ( bool  yesNo)
inline

Sets true if on tree.

Definition at line 297 of file CbcNode.hpp.

bool CbcNode::active ( ) const
inline

Returns true if active.

Definition at line 302 of file CbcNode.hpp.

void CbcNode::setActive ( bool  yesNo)
inline

Sets true if active.

Definition at line 306 of file CbcNode.hpp.

int CbcNode::getState ( ) const
inline

Get state (really for debug)

Definition at line 311 of file CbcNode.hpp.

void CbcNode::setState ( int  value)
inline

Set state (really for debug)

Definition at line 314 of file CbcNode.hpp.

void CbcNode::print ( ) const

Print.

void CbcNode::checkInfo ( ) const
inline

Debug.

Definition at line 319 of file CbcNode.hpp.

Member Data Documentation

CbcNodeInfo* CbcNode::nodeInfo_
private

Information to make basis and bounds.

Definition at line 327 of file CbcNode.hpp.

double CbcNode::objectiveValue_
private

Objective value.

Definition at line 329 of file CbcNode.hpp.

double CbcNode::guessedObjectiveValue_
private

Guessed satisfied Objective value.

Definition at line 331 of file CbcNode.hpp.

double CbcNode::sumInfeasibilities_
private

Sum of "infeasibilities" reported by each object.

Definition at line 333 of file CbcNode.hpp.

OsiBranchingObject* CbcNode::branch_
private

Branching object for this node.

Definition at line 335 of file CbcNode.hpp.

int CbcNode::depth_
private

Depth of the node in the search tree.

Definition at line 337 of file CbcNode.hpp.

int CbcNode::numberUnsatisfied_
private

The number of objects unsatisfied at this node.

Definition at line 339 of file CbcNode.hpp.

int CbcNode::nodeNumber_
private

The node number.

Definition at line 341 of file CbcNode.hpp.

int CbcNode::state_
private

State 1 - on tree 2 - active.

Definition at line 346 of file CbcNode.hpp.


The documentation for this class was generated from the following file: