cons_masterbranch.h File Reference

Detailed Description

constraint handler for storing the branching decisions at each node of the tree

Author
Gerald Gamrath
Martin Bergner
Christian Puchert
Marcel Schmickerath

Definition in file cons_masterbranch.h.

#include "scip/scip.h"
#include "type_branchgcg.h"

Go to the source code of this file.

Functions

SCIP_RETCODE SCIPincludeConshdlrMasterbranch (SCIP *scip)
 
SCIP_RETCODE GCGcreateConsMasterbranch (SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_NODE *node, SCIP_CONS *parentcons, SCIP_BRANCHRULE *branchrule, GCG_BRANCHDATA *branchdata, SCIP_CONS **origbranchconss, int norigbranchconss)
 
char * GCGconsMasterbranchGetName (SCIP_CONS *cons)
 
SCIP_NODE * GCGconsMasterbranchGetNode (SCIP_CONS *cons)
 
SCIP_CONS * GCGconsMasterbranchGetParentcons (SCIP_CONS *cons)
 
int GCGconsMasterbranchGetNChildconss (SCIP_CONS *cons)
 
SCIP_CONS * GCGconsMasterbranchGetChildcons (SCIP_CONS *cons, int childnr)
 
SCIP_CONS * GCGconsMasterbranchGetOrigcons (SCIP_CONS *cons)
 
void GCGconsMasterbranchSetOrigcons (SCIP_CONS *cons, SCIP_CONS *origcons)
 
GCG_BRANCHDATAGCGconsMasterbranchGetBranchdata (SCIP_CONS *cons)
 
SCIP_BRANCHRULE * GCGconsMasterbranchGetBranchrule (SCIP_CONS *cons)
 
SCIP_RETCODE GCGconsMasterbranchAddCopiedVarBndchg (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, GCG_BOUNDTYPE boundtype, SCIP_Real newbound)
 
SCIP_CONS ** GCGconsMasterbranchGetOrigbranchConss (SCIP_CONS *cons)
 
int GCGconsMasterbranchGetNOrigbranchConss (SCIP_CONS *cons)
 
SCIP_RETCODE GCGconsMasterbranchReleaseOrigbranchConss (SCIP *masterscip, SCIP *origscip, SCIP_CONS *cons)
 
SCIP_CONS * GCGconsMasterbranchGetActiveCons (SCIP *scip)
 
void GCGconsMasterbranchGetStack (SCIP *scip, SCIP_CONS ***stack, int *nstackelements)
 
int GCGconsMasterbranchGetNStackelements (SCIP *scip)
 
SCIP_RETCODE GCGconsMasterbranchAddRootCons (SCIP *scip)
 
SCIP_Bool GCGcurrentNodeIsGeneric (SCIP *scip)
 
void GCGconsMasterbranchCheckConsistency (SCIP *scip)
 

Function Documentation

SCIP_RETCODE GCGconsMasterbranchAddCopiedVarBndchg ( SCIP *  scip,
SCIP_CONS *  cons,
SCIP_VAR *  var,
GCG_BOUNDTYPE  boundtype,
SCIP_Real  newbound 
)

adds a bound change on an original variable that was directly copied to the master problem

Parameters
scipSCIP data structure
consmasterbranch constraint to which the bound change is added
varvariable on which the bound change was performed
boundtypebound type of the bound change
newboundnew bound of the variable after the bound change

Definition at line 2337 of file cons_masterbranch.c.

References GCGconsMasterbranchGetOrigbranchConss(), and GCGisMaster().

Referenced by applyOriginalBranching(), and GCGconsMasterbranchGetBranchrule().

SCIP_RETCODE GCGconsMasterbranchAddRootCons ( SCIP *  scip)

adds initial constraint to root node

Parameters
scipSCIP data structure

Definition at line 2508 of file cons_masterbranch.c.

References CONSHDLR_NAME, and GCGcurrentNodeIsGeneric().

Referenced by GCGconsMasterbranchGetNStackelements(), SCIP_DECL_PRICERFARKAS(), and SCIP_DECL_PRICERREDCOST().

void GCGconsMasterbranchCheckConsistency ( SCIP *  scip)

checks the consistency of the masterbranch constraints in the problem

Parameters
scipSCIP data structure

Definition at line 2559 of file cons_masterbranch.c.

References CONSHDLR_NAME, GCGconsOrigbranchGetMastercons(), and GCGconsOrigbranchGetParentcons().

Referenced by GCGcurrentNodeIsGeneric(), and SCIP_DECL_NODESELSELECT().

GCG_BRANCHDATA* GCGconsMasterbranchGetBranchdata ( SCIP_CONS *  cons)
SCIP_BRANCHRULE* GCGconsMasterbranchGetBranchrule ( SCIP_CONS *  cons)
SCIP_CONS* GCGconsMasterbranchGetChildcons ( SCIP_CONS *  cons,
int  childnr 
)

returns a masterbranch constraint of a child of the node at which the given masterbranch constraint is sticking

Parameters
consconstraint pointer
childnrindex of the child node

Definition at line 2262 of file cons_masterbranch.c.

References GCGconsMasterbranchGetOrigcons().

Referenced by checkchildconsS(), createBranchNodesInOrigprob(), and GCGconsMasterbranchGetNChildconss().

char* GCGconsMasterbranchGetName ( SCIP_CONS *  cons)

returns the name of the constraint

Parameters
consmasterbranch constraint for which the data is requested

Definition at line 2204 of file cons_masterbranch.c.

References GCGconsMasterbranchGetNode().

Referenced by createOrigbranchConstraint(), and GCGcreateConsMasterbranch().

int GCGconsMasterbranchGetNChildconss ( SCIP_CONS *  cons)

returns the number of masterbranch constraints of the children of the node at which the given masterbranch constraint is sticking

Parameters
consconstraint pointer

Definition at line 2247 of file cons_masterbranch.c.

References GCGconsMasterbranchGetChildcons().

Referenced by checkchildconsS(), createBranchNodesInOrigprob(), and GCGconsMasterbranchGetParentcons().

SCIP_NODE* GCGconsMasterbranchGetNode ( SCIP_CONS *  cons)

returns the node in the B&B tree at which the given masterbranch constraint is sticking

Parameters
consconstraint pointer

Definition at line 2217 of file cons_masterbranch.c.

References GCGconsMasterbranchGetParentcons().

Referenced by createBranchNodesInOrigprob(), GCGconsMasterbranchGetName(), GCGcurrentNodeIsGeneric(), and SCIP_DECL_NODESELSELECT().

int GCGconsMasterbranchGetNOrigbranchConss ( SCIP_CONS *  cons)

returns the number of constraints in the original problem that enforce the branching decision

Parameters
consmasterbranch constraint for which the data is requested

Definition at line 2394 of file cons_masterbranch.c.

References GCGconsMasterbranchReleaseOrigbranchConss().

Referenced by createOrigbranchConstraint(), and GCGconsMasterbranchGetOrigbranchConss().

int GCGconsMasterbranchGetNStackelements ( SCIP *  scip)

returns the number of elements on the stack

Parameters
scipSCIP data structure

Definition at line 2489 of file cons_masterbranch.c.

References CONSHDLR_NAME, and GCGconsMasterbranchAddRootCons().

Referenced by GCGconsMasterbranchGetStack().

SCIP_CONS** GCGconsMasterbranchGetOrigbranchConss ( SCIP_CONS *  cons)

returns the constraints in the original problem that enforce the branching decision

Parameters
consmasterbranch constraint for which the data is requested

Definition at line 2381 of file cons_masterbranch.c.

References GCGconsMasterbranchGetNOrigbranchConss().

Referenced by createOrigbranchConstraint(), and GCGconsMasterbranchAddCopiedVarBndchg().

SCIP_CONS* GCGconsMasterbranchGetOrigcons ( SCIP_CONS *  cons)

returns the origbranch constraint of the node in the original program corresponding to the node which the given masterbranch constraint is sticking

returns the origbranch constraint of the node in the original program corresponding to the node at which the given masterbranch constraint is sticking

Parameters
consconstraint pointer

Definition at line 2281 of file cons_masterbranch.c.

References GCGconsMasterbranchSetOrigcons().

Referenced by GCGconsMasterbranchGetChildcons(), GCGconsOrigbranchCheckConsistency(), and SCIP_DECL_CONSDELETE().

SCIP_CONS* GCGconsMasterbranchGetParentcons ( SCIP_CONS *  cons)

returns the masterbranch constraint of the B&B father of the node at which the given masterbranch constraint is sticking

Parameters
consconstraint pointer

Definition at line 2232 of file cons_masterbranch.c.

References GCGconsMasterbranchGetNChildconss().

Referenced by GCGbranchGenericInitbranch(), GCGconsMasterbranchGetNode(), pruneChildNodeByDominanceGeneric(), and SCIP_DECL_EVENTEXEC().

void GCGconsMasterbranchGetStack ( SCIP *  scip,
SCIP_CONS ***  stack,
int *  nstackelements 
)

returns the stack and the number of elements on it

Parameters
scipSCIP data structure
stackreturn value: pointer to the stack
nstackelementsreturn value: pointer to int, for number of elements on the stack

Definition at line 2467 of file cons_masterbranch.c.

References CONSHDLR_NAME, and GCGconsMasterbranchGetNStackelements().

Referenced by GCGconsMasterbranchGetActiveCons().

SCIP_RETCODE GCGconsMasterbranchReleaseOrigbranchConss ( SCIP *  masterscip,
SCIP *  origscip,
SCIP_CONS *  cons 
)

releases the constraints in the original problem that enforce the branching decision and frees the array holding the constraints

Parameters
masterscipmaster problem SCIP instance
origsciporiginal SCIP instance
consmasterbranch constraint for which the data is freed

Definition at line 2409 of file cons_masterbranch.c.

References GCGconsMasterbranchGetActiveCons(), GCGisMaster(), and GCGisOriginal().

Referenced by createOrigbranchConstraint(), GCGconsMasterbranchGetNOrigbranchConss(), and SCIP_DECL_CONSDELETE().

void GCGconsMasterbranchSetOrigcons ( SCIP_CONS *  cons,
SCIP_CONS *  origcons 
)

sets the origbranch constraint of the node in the master program corresponding to the node at which the given masterbranchbranch constraint is sticking

Parameters
consconstraint pointer
origconsoriginal branching constraint

Definition at line 2296 of file cons_masterbranch.c.

References GCGconsMasterbranchGetBranchdata(), and SCIP_ConsData::origcons.

Referenced by createOrigbranchConstraint(), GCGconsMasterbranchGetOrigcons(), and SCIP_DECL_CONSDELETE().

SCIP_RETCODE GCGcreateConsMasterbranch ( SCIP *  scip,
SCIP_CONS **  cons,
const char *  name,
SCIP_NODE *  node,
SCIP_CONS *  parentcons,
SCIP_BRANCHRULE *  branchrule,
GCG_BRANCHDATA branchdata,
SCIP_CONS **  origbranchconss,
int  norigbranchconss 
)

creates and captures a masterbranch constraint

Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of the constraint
nodenode at which the constraint should be created
parentconsparent constraint
branchrulepointer to the branching rule
branchdatabranching data
origbranchconssoriginal constraints enforcing the branching decision
norigbranchconssnumber of original constraints

Definition at line 2099 of file cons_masterbranch.c.

References SCIP_ConsData::branchdata, SCIP_ConsData::branchrule, CONSHDLR_NAME, GCGconsMasterbranchGetName(), GCGmasterGetOrigprob(), SCIP_ConsData::name, SCIP_ConsData::node, SCIP_ConsData::norigbranchconss, SCIP_ConsData::origbranchconss, and SCIP_ConsData::parentcons.

Referenced by branchDirectlyOnMastervar(), branchVar(), createChildNodesGeneric(), createChildNodesRyanfoster(), GCGrelaxNewProbingnodeMaster(), SCIP_DECL_CONSINITSOL(), and SCIPincludeConshdlrMasterbranch().

SCIP_Bool GCGcurrentNodeIsGeneric ( SCIP *  scip)
SCIP_RETCODE SCIPincludeConshdlrMasterbranch ( SCIP *  scip)