Scippy

SCIP

Solving Constraint Integer Programs

pub_tree.h File Reference

Detailed Description

public methods for branch and bound tree

Author
Tobias Achterberg

Definition in file pub_tree.h.

#include "scip/def.h"
#include "scip/type_misc.h"
#include "scip/type_tree.h"
#include "scip/type_reopt.h"

Go to the source code of this file.

Functions

 SCIP_DECL_SORTPTRCOMP (SCIPnodeCompLowerbound)
 
void SCIPnodeGetParentBranchings (SCIP_NODE *node, SCIP_VAR **branchvars, SCIP_Real *branchbounds, SCIP_BOUNDTYPE *boundtypes, int *nbranchvars, int branchvarssize)
 
void SCIPnodeGetAncestorBranchings (SCIP_NODE *node, SCIP_VAR **branchvars, SCIP_Real *branchbounds, SCIP_BOUNDTYPE *boundtypes, int *nbranchvars, int branchvarssize)
 
void SCIPnodeGetAncestorBranchingsPart (SCIP_NODE *node, SCIP_NODE *parent, SCIP_VAR **branchvars, SCIP_Real *branchbounds, SCIP_BOUNDTYPE *boundtypes, int *nbranchvars, int branchvarssize)
 
SCIP_RETCODE SCIPnodePrintAncestorBranchings (SCIP_NODE *node, FILE *file)
 
void SCIPnodeGetAncestorBranchingPath (SCIP_NODE *node, SCIP_VAR **branchvars, SCIP_Real *branchbounds, SCIP_BOUNDTYPE *boundtypes, int *nbranchvars, int branchvarssize, int *nodeswitches, int *nnodes, int nodeswitchsize)
 
SCIP_Bool SCIPnodesSharePath (SCIP_NODE *node1, SCIP_NODE *node2)
 
SCIP_NODESCIPnodesGetCommonAncestor (SCIP_NODE *node1, SCIP_NODE *node2)
 
SCIP_NODETYPE SCIPnodeGetType (SCIP_NODE *node)
 
SCIP_Longint SCIPnodeGetNumber (SCIP_NODE *node)
 
int SCIPnodeGetDepth (SCIP_NODE *node)
 
SCIP_Real SCIPnodeGetLowerbound (SCIP_NODE *node)
 
SCIP_Real SCIPnodeGetEstimate (SCIP_NODE *node)
 
SCIP_REOPTTYPE SCIPnodeGetReopttype (SCIP_NODE *node)
 
unsigned int SCIPnodeGetReoptID (SCIP_NODE *node)
 
void SCIPnodeSetReopttype (SCIP_NODE *node, SCIP_REOPTTYPE type)
 
void SCIPnodeSetReoptID (SCIP_NODE *node, unsigned int id)
 
void SCIPnodeGetNDomchg (SCIP_NODE *node, int *nbranchings, int *nconsprop, int *nprop)
 
SCIP_DOMCHGSCIPnodeGetDomchg (SCIP_NODE *node)
 
SCIP_NODESCIPnodeGetParent (SCIP_NODE *node)
 
SCIP_Bool SCIPnodeIsActive (SCIP_NODE *node)
 
SCIP_Bool SCIPnodeIsPropagatedAgain (SCIP_NODE *node)
 

Function Documentation

SCIP_DECL_SORTPTRCOMP ( SCIPnodeCompLowerbound  )

node comparator for best lower bound

Definition at line 140 of file tree.c.

References NULL.

void SCIPnodeGetParentBranchings ( SCIP_NODE node,
SCIP_VAR **  branchvars,
SCIP_Real branchbounds,
SCIP_BOUNDTYPE boundtypes,
int *  nbranchvars,
int  branchvarssize 
)

returns the set of variable branchings that were performed in the parent node to create this node

Parameters
nodenode data
branchvarsarray of variables on which the branching has been performed in the parent node
branchboundsarray of bounds which the branching in the parent node set
boundtypesarray of boundtypes which the branching in the parent node set
nbranchvarsnumber of variables on which branching has been performed in the parent node if this is larger than the array size, arrays should be reallocated and method should be called again
branchvarssizeavailable slots in arrays

Definition at line 7297 of file tree.c.

References SCIP_DomChgBound::boundchgs, SCIP_Node::domchg, SCIP_DomChg::domchgbound, SCIP_DomChgBound::nboundchgs, SCIP_BoundChg::newbound, NULL, SCIP_BOUNDCHGTYPE_BRANCHING, SCIPnodeGetDepth(), and SCIP_BoundChg::var.

Referenced by SCIPnodeGetAncestorBranchingPath(), SCIPnodeGetAncestorBranchings(), and SCIPnodeGetAncestorBranchingsPart().

void SCIPnodeGetAncestorBranchings ( SCIP_NODE node,
SCIP_VAR **  branchvars,
SCIP_Real branchbounds,
SCIP_BOUNDTYPE boundtypes,
int *  nbranchvars,
int  branchvarssize 
)

returns the set of variable branchings that were performed in all ancestor nodes (nodes on the path to the root) to create this node

Parameters
nodenode data
branchvarsarray of variables on which the branchings has been performed in all ancestors
branchboundsarray of bounds which the branchings in all ancestors set
boundtypesarray of boundtypes which the branchings in all ancestors set
nbranchvarsnumber of variables on which branchings have been performed in all ancestors if this is larger than the array size, arrays should be reallocated and method should be called again
branchvarssizeavailable slots in arrays

Definition at line 7361 of file tree.c.

References NULL, SCIP_Node::parent, SCIPnodeGetDepth(), and SCIPnodeGetParentBranchings().

Referenced by saveGlobalCons().

void SCIPnodeGetAncestorBranchingsPart ( SCIP_NODE node,
SCIP_NODE parent,
SCIP_VAR **  branchvars,
SCIP_Real branchbounds,
SCIP_BOUNDTYPE boundtypes,
int *  nbranchvars,
int  branchvarssize 
)

returns the set of variable branchings that were performed between the given node and the given parent node.

Parameters
nodenode data
parentnode data of the last ancestor node
branchvarsarray of variables on which the branchings has been performed in all ancestors
branchboundsarray of bounds which the branchings in all ancestors set
boundtypesarray of boundtypes which the branchings in all ancestors set
nbranchvarsnumber of variables on which branchings have been performed in all ancestors if this is larger than the array size, arrays should be reallocated and method should be called again
branchvarssizeavailable slots in arrays

Definition at line 7398 of file tree.c.

References NULL, SCIP_Node::parent, and SCIPnodeGetParentBranchings().

Referenced by saveAncestorBranchings().

SCIP_RETCODE SCIPnodePrintAncestorBranchings ( SCIP_NODE node,
FILE *  file 
)
void SCIPnodeGetAncestorBranchingPath ( SCIP_NODE node,
SCIP_VAR **  branchvars,
SCIP_Real branchbounds,
SCIP_BOUNDTYPE boundtypes,
int *  nbranchvars,
int  branchvarssize,
int *  nodeswitches,
int *  nnodes,
int  nodeswitchsize 
)

returns the set of variable branchings that were performed in all ancestor nodes (nodes on the path to the root) to create this node sorted by the nodes, starting from the current node going up to the root

Parameters
nodenode data
branchvarsarray of variables on which the branchings has been performed in all ancestors
branchboundsarray of bounds which the branchings in all ancestors set
boundtypesarray of boundtypes which the branchings in all ancestors set
nbranchvarsnumber of variables on which branchings have been performed in all ancestors if this is larger than the array size, arrays should be reallocated and method should be called again
branchvarssizeavailable slots in arrays
nodeswitchesmarks, where in the arrays the branching decisions of the next node on the path start branchings performed at the parent of node always start at position 0. For single variable branching, nodeswitches[i] = i holds
nnodesnumber of nodes in the nodeswitch array
nodeswitchsizeavailable slots in node switch array

Definition at line 7658 of file tree.c.

References NULL, SCIP_Node::parent, SCIPnodeGetDepth(), and SCIPnodeGetParentBranchings().

Referenced by SCIPprintNodeRootPath().

SCIP_Bool SCIPnodesSharePath ( SCIP_NODE node1,
SCIP_NODE node2 
)

checks for two nodes whether they share the same root path, i.e., whether one is an ancestor of the other

Parameters
node1node data
node2node data

Definition at line 7707 of file tree.c.

References NULL, SCIP_Node::parent, and SCIPnodeGetDepth().

SCIP_NODE* SCIPnodesGetCommonAncestor ( SCIP_NODE node1,
SCIP_NODE node2 
)

finds the common ancestor node of two given nodes

Parameters
node1node data
node2node data

Definition at line 7731 of file tree.c.

References NULL, SCIP_Node::parent, and SCIPnodeGetDepth().

SCIP_NODETYPE SCIPnodeGetType ( SCIP_NODE node)

gets the type of the node

Parameters
nodenode

Definition at line 7006 of file tree.c.

References SCIP_Node::nodetype, and NULL.

Referenced by focusnodeCleanupVars(), focusnodeToDeadend(), focusnodeToFork(), focusnodeToJunction(), focusnodeToPseudofork(), forkAddLP(), nodeActivate(), nodeAssignParent(), nodeDeactivate(), nodeReleaseParent(), nodeToLeaf(), priceAndCutLoop(), propagateDomains(), pseudoforkAddLP(), SCIP_DECL_EVENTEXEC(), SCIP_DECL_NODESELCOMP(), SCIPchgChildPrio(), SCIPchgVarLbProbing(), SCIPchgVarObjProbing(), SCIPchgVarUbProbing(), SCIPchildChgNodeselPrio(), SCIPendStrongbranch(), SCIPfixVarProbing(), SCIPnodeAddBoundinfer(), SCIPnodeAddCons(), SCIPnodeAddHoleinfer(), SCIPnodeCaptureLPIState(), SCIPnodeCreateChild(), SCIPnodeFocus(), SCIPnodeFree(), SCIPnodepqBound(), SCIPnodepqClear(), SCIPnodePropagateImplics(), SCIPnodeReleaseLPIState(), SCIPprimalHeuristics(), SCIPstartDive(), SCIPtreeBacktrackProbing(), SCIPtreeEndProbing(), SCIPtreeInRepropagation(), SCIPtreeLoadLP(), SCIPtreeLoadLPState(), SCIPtreeLoadProbingLPState(), SCIPtreeMarkProbingNodeHasLP(), SCIPvisualCutoffNode(), SCIPvisualFoundConflict(), SCIPvisualFoundSolution(), SCIPvisualMarkedRepropagateNode(), SCIPvisualNewChild(), SCIPvisualRepropagatedNode(), SCIPvisualSolvedNode(), SCIPvisualUpdateChild(), solveNode(), solveNodeInitialLP(), solveNodeRelax(), subrootConstructLP(), treeAddChild(), treeBacktrackProbing(), treeCheckPath(), treeChildrenToSiblings(), treeCreateProbingNode(), treeFindSwitchForks(), treeRemoveChild(), treeRemoveSibling(), treeSwitchPath(), treeUpdatePathLPSize(), and updatePseudocost().

int SCIPnodeGetDepth ( SCIP_NODE node)

gets the depth of the node

Parameters
nodenode

Definition at line 7026 of file tree.c.

References SCIP_Node::depth, and NULL.

Referenced by addNode(), applyProbing(), compareNodes(), constructCompression(), focusnodeToDeadend(), focusnodeToFork(), focusnodeToJunction(), focusnodeToPseudofork(), generateCut(), generateSecantCut(), generateSecantCutNoCheck(), getLastSavedNode(), nodeActivate(), nodeAssignParent(), nodeDeactivate(), nodeReleaseParent(), nodeRepropagate(), nodeToLeaf(), priceAndCutLoop(), propagateDomains(), reoptCheckLocalRestart(), saveGlobalCons(), SCIP_DECL_BRANCHEXECEXT(), SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_BRANCHEXECPS(), SCIP_DECL_EVENTEXEC(), SCIP_DECL_NODESELCOMP(), SCIP_DECL_NODESELSELECT(), SCIPaddConsNode(), SCIPaddRowDive(), SCIPaddRowProbing(), SCIPanalyzeDeductionsProbing(), SCIPconflicthdlrExec(), SCIPconstructCurrentLP(), SCIPdelConsLocal(), SCIPdelConsNode(), SCIPnodeAddBoundinfer(), SCIPnodeAddCons(), SCIPnodeAddHoleinfer(), SCIPnodeCaptureLPIState(), SCIPnodeCutoff(), SCIPnodeFocus(), SCIPnodeFree(), SCIPnodeGetAncestorBranchingPath(), SCIPnodeGetAncestorBranchings(), SCIPnodeGetBdChgsAfterDual(), SCIPnodeGetConsProps(), SCIPnodeGetDualBoundchgs(), SCIPnodeGetParentBranchings(), SCIPnodepqBound(), SCIPnodePrintAncestorBranchings(), SCIPnodePropagateAgain(), SCIPnodePropagateImplics(), SCIPnodeReleaseLPIState(), SCIPnodesGetCommonAncestor(), SCIPnodesSharePath(), SCIPprimalHeuristics(), SCIPprintNodeRootPath(), SCIPreoptCheckCutoff(), SCIPreoptGetChildIDs(), SCIPreoptGetNAddedConss(), SCIPreoptGetNLeaves(), SCIPreoptGetNNodes(), SCIPreoptGetSolveLP(), SCIPreoptResetDualBndchgs(), SCIPsepastoreApplyCuts(), SCIPsolveCIP(), SCIPtreeCreateProbingNode(), SCIPtreeCutoff(), SCIPtreeEndProbing(), SCIPtreeGetProbingDepth(), SCIPtreeGetProbingRoot(), SCIPtreeLoadLP(), SCIPtreeLoadLPState(), SCIPtreeProbing(), SCIPvisualCutoffNode(), SCIPvisualNewChild(), SCIPvisualSolvedNode(), SCIPvisualUpdateChild(), solveNode(), solveNodeInitialLP(), solveNodeLP(), tightenBounds(), treeApplyPendingBdchgs(), treeBacktrackProbing(), treeCreateProbingNode(), updatePseudocost(), and updateVisits().

SCIP_Real SCIPnodeGetEstimate ( SCIP_NODE node)
SCIP_REOPTTYPE SCIPnodeGetReopttype ( SCIP_NODE node)

gets the reoptimization type of a node

gets the reoptimization type of this node

Parameters
nodenode *

Definition at line 7056 of file tree.c.

References NULL, and SCIP_Node::reopttype.

Referenced by getLastSavedNode(), and SCIPreoptGetSolveLP().

unsigned int SCIPnodeGetReoptID ( SCIP_NODE node)

gets the unique id to identify the node during reoptimization; id is 0 if the node is the root or not part of the reoptimization tree

gets the unique id to identify the node during reoptimization; the id is 0 if the node is the root or not part of the reoptimization tree

Parameters
nodenode

Definition at line 7087 of file tree.c.

References NULL, and SCIP_Node::reoptid.

Referenced by addNode(), Exec(), getLastSavedNode(), reoptCheckLocalRestart(), SCIP_DECL_BRANCHEXECEXT(), SCIP_DECL_BRANCHEXECLP(), SCIP_DECL_BRANCHEXECPS(), SCIPreoptGetChildIDs(), SCIPreoptGetLeaves(), SCIPreoptGetNAddedConss(), SCIPreoptGetNLeaves(), SCIPreoptGetNNodes(), SCIPreoptGetSolveLP(), SCIPreoptimizeNode(), and SCIPreoptResetDualBndchgs().

void SCIPnodeSetReopttype ( SCIP_NODE node,
SCIP_REOPTTYPE  reopttype 
)

sets the reoptimization type of the node

sets the reoptimization type of this node

Parameters
nodenode
reopttypereoptimization type

Definition at line 7066 of file tree.c.

References NULL, SCIP_Node::reopttype, SCIP_REOPTTYPE_FEASIBLE, SCIP_REOPTTYPE_INFSUBTREE, SCIP_REOPTTYPE_LEAF, SCIP_REOPTTYPE_LOGICORNODE, SCIP_REOPTTYPE_NONE, SCIP_REOPTTYPE_PRUNED, SCIP_REOPTTYPE_STRBRANCHED, and SCIP_REOPTTYPE_TRANSIT.

Referenced by addNode(), SCIPreoptApply(), SCIPreoptSplitRoot(), and shrinkNode().

void SCIPnodeSetReoptID ( SCIP_NODE node,
unsigned int  id 
)

sets a unique id to identify the node during reoptimization

set a unique id to identify the node during reoptimization

Parameters
nodenode
idunique id

Definition at line 7097 of file tree.c.

References NULL, and SCIP_Node::reoptid.

Referenced by addNode(), and SCIPreoptApply().

void SCIPnodeGetNDomchg ( SCIP_NODE node,
int *  nbranchings,
int *  nconsprop,
int *  nprop 
)

counts the number of bound changes due to branching, constraint propagation, and propagation

Parameters
nodenode
nbranchingspointer to store number of branchings (or NULL if not needed)
nconsproppointer to store number of constraint propagations (or NULL if not needed)
nproppointer to store number of propagations (or NULL if not needed)

Definition at line 7121 of file tree.c.

References SCIP_DomChgBound::boundchgs, SCIP_BoundChg::boundchgtype, SCIP_Node::domchg, SCIP_DomChg::domchgbound, SCIP_DomChgBound::nboundchgs, NULL, SCIP_Bool, SCIP_BOUNDCHGTYPE_BRANCHING, SCIP_BOUNDCHGTYPE_CONSINFER, and SCIP_BOUNDCHGTYPE_PROPINFER.

Referenced by getLastSavedNode(), SCIPnodeGetConsProps(), and updateConstraintPropagation().

SCIP_DOMCHG* SCIPnodeGetDomchg ( SCIP_NODE node)

gets the domain change information of the node, i.e., the information about the differences in the variables domains to the parent node

Parameters
nodenode

Definition at line 7111 of file tree.c.

References SCIP_Node::domchg, and NULL.

Referenced by SCIPendStrongbranch().

SCIP_NODE* SCIPnodeGetParent ( SCIP_NODE node)

gets the parent node of a node in the branch-and-bound tree, if any

Parameters
nodenode

Definition at line 7287 of file tree.c.

References NULL, and SCIP_Node::parent.

Referenced by compareNodes(), getLastSavedNode(), nodeGetUctScore(), and updateVisits().

SCIP_Bool SCIPnodeIsActive ( SCIP_NODE node)

returns whether node is in the path to the current node

Parameters
nodenode

Definition at line 7762 of file tree.c.

References SCIP_Node::active, and NULL.

Referenced by propagateDomains(), SCIPnodePropagateImplics(), and updatePseudocost().

SCIP_Bool SCIPnodeIsPropagatedAgain ( SCIP_NODE node)

returns whether the node is marked to be propagated again

Parameters
nodenode data

Definition at line 7772 of file tree.c.

References NULL, and SCIP_Node::reprop.

Referenced by updateLoopStatus().