Minotaur 0.4.1
Docs for developers
Public Member Functions | List of all members
Minotaur::Node Class Reference

#include <Node.h>

Public Member Functions

 Node ()
 Default constructor.
 
 Node (NodePtr parentNode, BranchPtr branch)
 
virtual ~Node ()
 Default destructor.
 
void addChild (NodePtr childNode)
 Add a child node.
 
void addCutToPool (CutPtr cut, RelaxationPtr rel)
 Add cut to the cut-pool of this node.
 
void addPMod (ModificationPtr m)
 
void addRMod (ModificationPtr m)
 
void applyCutsByIndex (RelaxationPtr rel)
 
void applyPMods (ProblemPtr p)
 
void applyRMods (RelaxationPtr rel)
 
void applyRModsTrans (RelaxationPtr rel)
 
void applyMods (RelaxationPtr rel, ProblemPtr p)
 
NodePtrIterator childrenBegin ()
 Access the children by iterating over the vector.
 
NodePtrIterator childrenEnd ()
 Last child.
 
BranchPtr getBranch () const
 
CutList getCutPool ()
 Return the cut-pool of this node.
 
UInt getDepth () const
 Return the depth of the node in the tree.
 
UInt getId () const
 Return the ID of this node.
 
UIntVector getLastStrongBranched ()
 Return the vector of last strong branching information of candidates.
 
double getLb () const
 Return the lower bound of the relaxation obtained at this node.
 
size_t getNumChildren ()
 Number of children of this node.
 
NodePtr getParent () const
 Return a pointer to the parent node.
 
DoubleVector getPCDown ()
 
UIntVector getBrCands () const
 
DoubleVector getPCUp () const
 
NodeStatus getStatus () const
 Get the status of this node.
 
double getTbScore () const
 Get the tie-breaking score.
 
double setVioVal (double v)
 
double getVioVal ()
 
UIntVector getTimesDown () const
 
UIntVector getTimesUp () const
 
WarmStartPtr getWarmStart ()
 Get the warm start information.
 
void makeChildOf (const Node *parent)
 
ModificationConstIterator modsBegin () const
 
ModificationConstIterator modsrBegin () const
 
ModificationConstIterator modsEnd () const
 End of modifications applied at this node.
 
ModificationConstIterator modsrEnd () const
 
ModificationRConstIterator modsRBegin () const
 Reverse iterators.
 
ModificationRConstIterator modsREnd () const
 Reverse iterators.
 
void removeChild (NodePtrIterator childNodeIter)
 
void removeChildren ()
 Disassociate all children from this node.
 
void removeParent ()
 Remove the pointer to the parent node. Used when deleting a node.
 
void removeWarmStart ()
 Remove warm start information associated with this node.
 
void setBrCands (UIntVector brCands)
 Set the branching candidate information for this node.
 
void setDepth (UInt depth)
 Set the depth of the node in the tree.
 
void setId (UInt id)
 
void setLastStrongBranched (UIntVector lstStrnBrnchd)
 Set the vector of last strong branched information of candidates.
 
void setLb (double value)
 Set a lower bound for the relaxation at this node.
 
void setPCDown (DoubleVector pcDown)
 Set the down pseudocosts for this node.
 
void setPCUp (DoubleVector pcUp)
 Set the up pseudocosts for this node.
 
void setStatus (NodeStatus status)
 Set the status of this node.
 
void setTbScore (double d)
 Get the tie-breaking score.
 
void setTimesDown (UIntVector timesDown)
 Set the times down for this node.
 
void setTimesUp (UIntVector timesUp)
 Set the times up for this node.
 
void setWarmStart (WarmStartPtr ws)
 Set warm start information.
 
void undoPMods (ProblemPtr p)
 
void undoRMods (RelaxationPtr r)
 
void undoRModsTrans (RelaxationPtr r)
 
void undoMods (RelaxationPtr rel, ProblemPtr p)
 
void updateBrCands (UInt index)
 
void updateLastStrBranched (UInt index, double value)
 
void updatePCDown (UInt index, double value)
 
void updatePCUp (UInt index, double value)
 
void updateTimesDown (UInt index, double value)
 
void updateTimesUp (UInt index, double value)
 
void write (std::ostream &o) const
 Write the node.
 

Detailed Description

A Node is a node in the search tree or the branch-and-bound tree. Associated with a node is a parent node from which the node is derived by adding branching constraints. Similarly a node may have one or more children each obtained by adding some branching constraints. Associated with each node is an array (or vector) of modifications that were applied to the parent in order to get the node. For instance, a modification could be change of one or more bounds on the variables.

At each node, one can find a solution that is feasible to the original instance or show that the relaxation at the node is infeasible or obtain some other information. One can, at each node, solve a relaxation, tighten it, preprocess it, run heuristics.

A node that has been evaluated and does not need any further processing and does not need to be branched upon is called a pruned node. A node that has not been processed yet is called an active node. A node that has been processed (is ready for branching or has been pruned) is called a fathomed node. A node whose all successors have been fathomed or deleted can be deleted. Since we store at each node, the modification that generated it from its parent, we can not delete nodes that have active successors.

A Child of the current node can be obtained by applying a branch to the node. All immediate child nodes are saved in a vector.

Constructor & Destructor Documentation

◆ Node()

Node::Node ( NodePtr  parentNode,
BranchPtr  branch 
)

Construct a node from a parent node by applying all the modifications stored in the given branch.

Member Function Documentation

◆ addPMod()

void Minotaur::Node::addPMod ( ModificationPtr  m)
inline

At each node one can make several modifications to the problem. Each such modification must be stored. This includes all the modifications that were used to create this node from its parent (while branching).

◆ addRMod()

void Minotaur::Node::addRMod ( ModificationPtr  m)
inline

At each node one can make several modifications to the relaxation. Each such modification must be stored. This includes all the modifications that were used to create this node from its parent (while branching).

◆ applyCutsByIndex()

void Node::applyCutsByIndex ( RelaxationPtr  rel)

Apply the cuts generated at the ancestors of this node at this node to the relaxation. First, each cut is translated appropriately so that it becomes applicable for this relaxation.

◆ applyMods()

void Node::applyMods ( RelaxationPtr  rel,
ProblemPtr  p 
)

Apply the modifications to problem and relaxation.

◆ applyPMods()

void Node::applyPMods ( ProblemPtr  p)

Apply the modifications including the branching that were made at this node to the problem.

◆ applyRMods()

void Node::applyRMods ( RelaxationPtr  rel)

Apply the modifications including the branching that were made at this node to the problem.

◆ applyRModsTrans()

void Node::applyRModsTrans ( RelaxationPtr  rel)

Apply the modifications including the branching that were made at this node to the problem. First, each modification is translated appropriately so that it becomes applicable for this relaxation.

◆ getBranch()

BranchPtr Minotaur::Node::getBranch ( ) const
inline

Return the pointer to the branch that was used to create this node from its parent.

◆ getBrCands()

UIntVector Minotaur::Node::getBrCands ( ) const
inline

Return the vector of indices of the variables branched till this node. in the parental chain (direct ancestors only).

◆ getPCDown()

DoubleVector Minotaur::Node::getPCDown ( )
inline

Return the vector of pseudocosts of down-branchings upto this node in the parental chain (direct ancestors only).

◆ getPCUp()

DoubleVector Minotaur::Node::getPCUp ( ) const
inline

Return the vector of pseudocosts of up-branchings upto this node in the parental chain (direct ancestors only).

◆ getTimesDown()

UIntVector Minotaur::Node::getTimesDown ( ) const
inline

Return the vector of number of down-branchings of a variable upto this in the parental chain (direct ancestors only).

◆ getTimesUp()

UIntVector Minotaur::Node::getTimesUp ( ) const
inline

Return the vector of number of up-branchings of a variable upto this node in the parental chain (direct ancestors only).

◆ makeChildOf()

void Minotaur::Node::makeChildOf ( const Node parent)
Todo:
Dont know what this is meant for.

◆ modsBegin()

ModificationConstIterator Minotaur::Node::modsBegin ( ) const
inline

Get the first modification that was applied at this node to the problem (and not the relaxation). Remember that the vector starts with modifications that were used to branch.

◆ removeChild()

void Node::removeChild ( NodePtrIterator  childNodeIter)

Remove a child node from the list of children. If the node is fathomed and if this list is empty, we can delete this node.

◆ setId()

void Node::setId ( UInt  id)

Set the ID of this node. ID of a node is unique for the given tree. The treemanager must ensure this.

◆ undoMods()

void Node::undoMods ( RelaxationPtr  rel,
ProblemPtr  p 
)

Undo the modifications including the branching that were made at this node to the problem and the relaxation.

◆ undoPMods()

void Node::undoPMods ( ProblemPtr  p)

Undo the modifications including the branching that were made at this node to the problem.

◆ undoRMods()

void Node::undoRMods ( RelaxationPtr  r)

Undo the modifications including the branching that were made at this node to the problem.

◆ undoRModsTrans()

void Node::undoRModsTrans ( RelaxationPtr  r)

Undo the modifications including the branching that were made at this node to the problem. First, each modification is translated appropriately so that it becomes applicable for this relaxation.

◆ updateBrCands()

void Node::updateBrCands ( UInt  index)

Update the branching candidate vector at this node.

◆ updateLastStrBranched()

void Node::updateLastStrBranched ( UInt  index,
double  value 
)

Update the last strong branched statistic at this node.

◆ updatePCDown()

void Node::updatePCDown ( UInt  index,
double  value 
)

Update the down-branching pseudocosts at this node.

◆ updatePCUp()

void Node::updatePCUp ( UInt  index,
double  value 
)

Update the up-branching pseudocosts at this node.

◆ updateTimesDown()

void Node::updateTimesDown ( UInt  index,
double  value 
)

Update the down-branching count of candidates at this node.

◆ updateTimesUp()

void Node::updateTimesUp ( UInt  index,
double  value 
)

Update the up-branching count of candidates at this node.


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

Minotaur source code documented by Doxygen 1.9.4 on Thu Apr 24 2025