Scippy

GCG

Branch-and-Price & Column Generation for Everyone

cons_masterbranch.c 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
Erik Muehmer

Definition in file cons_masterbranch.c.

#include <assert.h>
#include <string.h>
#include "gcg/gcg.h"
#include "gcg/branch_generic.h"
#include "gcg/cons_masterbranch.h"
#include "gcg/cons_origbranch.h"
#include "gcg/relax_gcg.h"
#include "gcg/pricer_gcg.h"
#include "gcg/pub_colpool.h"
#include "gcg/gcgvarhistory.h"
#include "gcg/event_mastersepacut.h"
#include "gcg/mastersepacut.h"

Go to the source code of this file.

Data Structures

struct  SCIP_ConsData
 
struct  SCIP_ConshdlrData
 
struct  SCIP_EventhdlrData
 

Macros

#define CONSHDLR_NAME   "masterbranch"
 
#define CONSHDLR_DESC   "store branching decision at nodes of the tree constraint handler"
 
#define CONSHDLR_ENFOPRIORITY   0
 
#define CONSHDLR_CHECKPRIORITY   2000000
 
#define CONSHDLR_PROPFREQ   1
 
#define CONSHDLR_EAGERFREQ   100
 
#define CONSHDLR_DELAYPROP   FALSE
 
#define CONSHDLR_NEEDSCONS   TRUE
 
#define CONSHDLR_PROPTIMING   SCIP_PROPTIMING_ALWAYS
 
#define EVENTHDLR_NAME   "origvarbound"
 
#define EVENTHDLR_DESC   "event handler for bound changes on original variables"
 

Functions

static SCIP_RETCODE addMissedVariables (GCG *gcg, GCG_EXTENDEDMASTERCONSDATA *mastersepacut)
 
static SCIP_RETCODE removeStoredCutsFromActiveCuts (GCG *gcg, SCIP_CONSDATA *consdata, SCIP_CONSHDLRDATA *conshdlrdata)
 
static SCIP_RETCODE addStoredCutsToActiveCuts (GCG *gcg, SCIP_CONSDATA *consdata, SCIP_CONSHDLRDATA *conshdlrdata)
 
static SCIP_RETCODE initializeAddedCuts (GCG *gcg, SCIP_CONSDATA *consdata, SCIP_CONSHDLRDATA *conshdlrdata)
 
static SCIP_RETCODE initializeConsdata (GCG *gcg, SCIP_CONS *cons)
 
static SCIP_RETCODE addPendingBndChg (SCIP *scip, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_Real oldbound, SCIP_Real newbound)
 
static SCIP_Bool checkAggregatedGlobalBounds (SCIP *scip, SCIP_VAR *bndvar, SCIP_BOUNDTYPE bndtype, SCIP_Real bound)
 
static SCIP_RETCODE applyGlobalBndchgsToPricingprobs (GCG *gcg, SCIP_CONSHDLRDATA *conshdlrdata)
 
static SCIP_RETCODE applyGlobalBndchgsToPricedMastervars (GCG *gcg, SCIP_CONSHDLRDATA *conshdlrdata, int *propcount)
 
static SCIP_RETCODE resetPricingVarBound (GCG *gcg, SCIP_VAR *pricingvar, SCIP_CONSDATA *consdata, int i, int blocknr)
 
static SCIP_RETCODE tightenPricingVarBound (GCG *gcg, SCIP_VAR *pricingvar, SCIP_CONSDATA *consdata, int i, int blocknr)
 
static SCIP_Bool checkAggregatedLocalBounds (SCIP *scip, SCIP_VAR **bndvars, SCIP_Real *bounds, int nbndvars, SCIP_VAR *bndvar, SCIP_BOUNDTYPE bndtype, SCIP_VAR *pricingvar)
 
static SCIP_RETCODE applyLocalBndchgsToPricingprobs (GCG *gcg, SCIP_CONS *cons)
 
static SCIP_RETCODE undoLocalBndchgsToPricingprobs (GCG *gcg, SCIP_CONS *cons)
 
static SCIP_RETCODE ensureCollectedBndvarsSize (SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, int blocknr, int minsize)
 
static SCIP_RETCODE ensureLinkingvarIndxsSize (SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, int minsize)
 
static SCIP_RETCODE applyLocalBndchgsToPricedMastervars (GCG *gcg, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_CONS *cons, int *propcount)
 
static SCIP_RETCODE applyLocalBndchgsToCopiedMastervars (GCG *gcg, SCIP_CONS *cons, int *propcount)
 
static SCIP_RETCODE forwardUpdateSeenHistory (GCG *gcg, SCIP_CONSDATA *consdata)
 
static SCIP_DECL_CONSFREE (consFreeMasterbranch)
 
static SCIP_DECL_CONSINIT (consInitMasterbranch)
 
static SCIP_DECL_CONSINITSOL (consInitsolMasterbranch)
 
static SCIP_DECL_CONSEXITSOL (consExitSolMasterbranch)
 
static SCIP_DECL_CONSEXIT (consExitMasterbranch)
 
static SCIP_DECL_CONSACTIVE (consActiveMasterbranch)
 
static SCIP_DECL_CONSDEACTIVE (consDeactiveMasterbranch)
 
static SCIP_DECL_CONSDELETE (consDeleteMasterbranch)
 
static SCIP_DECL_CONSPROP (consPropMasterbranch)
 
static SCIP_DECL_CONSENFOLP (consEnfolpMasterbranch)
 
static SCIP_DECL_CONSENFOPS (consEnfopsMasterbranch)
 
static SCIP_DECL_CONSCHECK (consCheckMasterbranch)
 
static SCIP_DECL_CONSLOCK (consLockMasterbranch)
 
static SCIP_DECL_EVENTINITSOL (eventInitsolOrigvarbound)
 
static SCIP_DECL_EVENTFREE (eventFreeOrigvarbound)
 
static SCIP_DECL_EVENTEXEC (eventExecOrigvarbound)
 
SCIP_RETCODE GCGincludeConshdlrMasterbranch (GCG *gcg)
 
SCIP_RETCODE GCGcreateConsMasterbranch (GCG *gcg, SCIP_CONS **cons, const char *name, SCIP_NODE *node, SCIP_CONS *parentcons, GCG_BRANCHRULE *branchrule, GCG_BRANCHDATA *branchdata, SCIP_CONS **origbranchconss, int norigbranchconss, int maxorigbranchconss)
 
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_BRANCHDATA * GCGconsMasterbranchGetBranchdata (SCIP_CONS *cons)
 
void GCGconsMasterbranchSetBranchdata (SCIP_CONS *cons, GCG_BRANCHDATA *branchdata)
 
GCG_BRANCHRULE * GCGconsMasterbranchGetBranchrule (SCIP_CONS *cons)
 
SCIP_RETCODE GCGconsMasterbranchAddCopiedVarBndchg (GCG *gcg, 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 (GCG *gcg, SCIP_CONS *cons)
 
SCIP_CONS * GCGconsMasterbranchGetActiveCons (GCG *gcg)
 
void GCGconsMasterbranchGetStack (GCG *gcg, SCIP_CONS ***stack, int *nstackelements)
 
int GCGconsMasterbranchGetNStackelements (GCG *gcg)
 
SCIP_RETCODE GCGconsMasterbranchAddRootCons (GCG *gcg)
 
SCIP_RETCODE GCGconsMasterbranchActiveCutRemoved (GCG *gcg, int removedidx)
 
SCIP_Bool GCGcurrentNodeIsGeneric (GCG *gcg)
 
void GCGconsMasterbranchCheckConsistency (GCG *gcg)
 

Macro Definition Documentation

◆ CONSHDLR_NAME

#define CONSHDLR_NAME   "masterbranch"

Definition at line 58 of file cons_masterbranch.c.

◆ CONSHDLR_DESC

#define CONSHDLR_DESC   "store branching decision at nodes of the tree constraint handler"

Definition at line 59 of file cons_masterbranch.c.

◆ CONSHDLR_ENFOPRIORITY

#define CONSHDLR_ENFOPRIORITY   0

priority of the constraint handler for constraint enforcing

Definition at line 60 of file cons_masterbranch.c.

◆ CONSHDLR_CHECKPRIORITY

#define CONSHDLR_CHECKPRIORITY   2000000

priority of the constraint handler for checking feasibility

Definition at line 61 of file cons_masterbranch.c.

◆ CONSHDLR_PROPFREQ

#define CONSHDLR_PROPFREQ   1

frequency for propagating domains; zero means only preprocessing propagation

Definition at line 62 of file cons_masterbranch.c.

◆ CONSHDLR_EAGERFREQ

#define CONSHDLR_EAGERFREQ   100

frequency for using all instead of only the useful constraints in separation, propagation and enforcement, -1 for no eager evaluations, 0 for first only

Definition at line 64 of file cons_masterbranch.c.

◆ CONSHDLR_DELAYPROP

#define CONSHDLR_DELAYPROP   FALSE

should propagation method be delayed, if other propagators found reductions?

Definition at line 65 of file cons_masterbranch.c.

◆ CONSHDLR_NEEDSCONS

#define CONSHDLR_NEEDSCONS   TRUE

should the constraint handler be skipped, if no constraints are available?

Definition at line 66 of file cons_masterbranch.c.

◆ CONSHDLR_PROPTIMING

#define CONSHDLR_PROPTIMING   SCIP_PROPTIMING_ALWAYS

Definition at line 67 of file cons_masterbranch.c.

◆ EVENTHDLR_NAME

#define EVENTHDLR_NAME   "origvarbound"

Definition at line 69 of file cons_masterbranch.c.

◆ EVENTHDLR_DESC

#define EVENTHDLR_DESC   "event handler for bound changes on original variables"

Definition at line 70 of file cons_masterbranch.c.

Function Documentation

◆ addMissedVariables()

◆ removeStoredCutsFromActiveCuts()

static SCIP_RETCODE removeStoredCutsFromActiveCuts ( GCG *  gcg,
SCIP_CONSDATA *  consdata,
SCIP_CONSHDLRDATA *  conshdlrdata 
)
static

remove the mastersepacuts generated and applied at this node from activecuts

Parameters
gcgGCG data structure
consdatadata of current constraint
conshdlrdatamasterbranch constraint handler data

Definition at line 253 of file cons_masterbranch.c.

References SCIP_ConsData::firstnewcut, GCGshrinkActiveMastersepacuts(), NULL, SCIP_CALL, and SCIP_OKAY.

Referenced by SCIP_DECL_CONSDEACTIVE().

◆ addStoredCutsToActiveCuts()

static SCIP_RETCODE addStoredCutsToActiveCuts ( GCG *  gcg,
SCIP_CONSDATA *  consdata,
SCIP_CONSHDLRDATA *  conshdlrdata 
)
static

◆ initializeAddedCuts()

static SCIP_RETCODE initializeAddedCuts ( GCG *  gcg,
SCIP_CONSDATA *  consdata,
SCIP_CONSHDLRDATA *  conshdlrdata 
)
static

◆ initializeConsdata()

static SCIP_RETCODE initializeConsdata ( GCG *  gcg,
SCIP_CONS *  cons 
)
static

initialize the consdata data structure

Parameters
gcgGCG data structure
consconstraint for which the consdata is created

Definition at line 385 of file cons_masterbranch.c.

References SCIP_ConsData::addedcutsinit, SCIP_ConsData::childconss, CONSHDLR_NAME, SCIP_ConsData::firstnewcut, GCGconsOrigbranchGetActiveCons(), GCGconsOrigbranchGetNChildconss(), GCGconsOrigbranchGetNode(), GCGconsOrigbranchGetParentcons(), GCGconsOrigbranchSetMastercons(), GCGgetMasterprob(), GCGgetNActiveMastersepacuts(), GCGisMaster(), initializeAddedCuts(), SCIP_ConsData::localbndtypes, SCIP_ConsData::localbndvars, SCIP_ConsData::localnewbnds, SCIP_ConsData::localoldbnds, SCIP_ConsData::maxlocalbndchgs, SCIP_ConsData::maxlocalbndchgstreated, SCIP_ConsData::nbranchingchgs, SCIP_ConsData::nchildconss, SCIP_ConsData::needprop, SCIP_ConsData::nlocalbndchgs, SCIP_ConsData::nlocalbndchgstreated, SCIP_ConsData::node, SCIP_ConshdlrData::nstack, NULL, SCIP_ConsData::origcons, SCIP_ConsData::parentcons, SCIP_BOUNDCHGTYPE_BRANCHING, SCIP_CALL, SCIP_NODETYPE_FOCUSNODE, SCIP_OKAY, SCIP_Real, SCIPallocBlockMemoryArray, SCIPboundchgGetBoundchgtype(), SCIPboundchgGetBoundtype(), SCIPboundchgGetNewbound(), SCIPboundchgGetVar(), SCIPcalcMemGrowSize(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPdebugMessage, SCIPdomchgGetBoundchg(), SCIPdomchgGetNBoundchgs(), SCIPfindConshdlr(), SCIPgetCurrentNode(), SCIPgetRootNode(), SCIPisEQ(), SCIPnodeGetDepth(), SCIPnodeGetDomchg(), SCIPnodeGetNumber(), SCIPnodeGetType(), SCIPreallocBlockMemoryArray, SCIP_ConshdlrData::stack, and TRUE.

Referenced by SCIP_DECL_CONSACTIVE().

◆ addPendingBndChg()

static SCIP_RETCODE addPendingBndChg ( SCIP *  scip,
SCIP_VAR *  var,
SCIP_BOUNDTYPE  boundtype,
SCIP_Real  oldbound,
SCIP_Real  newbound 
)
static

add a global bound change on the original problem to the pending bound changes array

Parameters
scipSCIP data structure
varvariable on which the bound change is applied (corresponding master variable copy or pricing variable)
boundtypetype of the bound (lower or upper)
oldboundprevious bound value
newboundnew bound value

Definition at line 608 of file cons_masterbranch.c.

References CONSHDLR_NAME, FALSE, SCIP_ConshdlrData::maxpendingbnds, SCIP_ConshdlrData::npendingbnds, NULL, SCIP_ConshdlrData::pendingbndsactivated, SCIP_ConshdlrData::pendingbndtypes, SCIP_ConshdlrData::pendingnewbnds, SCIP_ConshdlrData::pendingvarmaplb, SCIP_ConshdlrData::pendingvarmapub, SCIP_ConshdlrData::pendingvars, SCIP_BOUNDTYPE_LOWER, SCIP_CALL, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPcalcMemGrowSize(), SCIPconshdlrGetData(), SCIPerrorMessage, SCIPfindConshdlr(), SCIPhashmapGetImageInt(), SCIPhashmapInsertInt(), and SCIPreallocBlockMemoryArray.

Referenced by SCIP_DECL_EVENTEXEC().

◆ checkAggregatedGlobalBounds()

static SCIP_Bool checkAggregatedGlobalBounds ( SCIP *  scip,
SCIP_VAR *  bndvar,
SCIP_BOUNDTYPE  bndtype,
SCIP_Real  bound 
)
static

For a given global bound change on a pricing variable, check if the global bounds on all corresponding original variables are still the same

Returns
TRUE if the variable is in a relevant block AND all variables identical to it have the same bounds
Parameters
scipSCIP data structure
bndvarpricing variable whose new global bound is to be checked
bndtypetype of the new global bound
boundnew global bound

Definition at line 673 of file cons_masterbranch.c.

References FALSE, GCGpricingVarGetNOrigvars(), GCGpricingVarGetOrigvars(), GCGvarIsPricing(), SCIP_Bool, SCIP_BOUNDTYPE_UPPER, SCIP_Real, SCIPisEQ(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPwarningMessage(), and TRUE.

Referenced by applyGlobalBndchgsToPricingprobs().

◆ applyGlobalBndchgsToPricingprobs()

◆ applyGlobalBndchgsToPricedMastervars()

◆ resetPricingVarBound()

static SCIP_RETCODE resetPricingVarBound ( GCG *  gcg,
SCIP_VAR *  pricingvar,
SCIP_CONSDATA *  consdata,
int  i,
int  blocknr 
)
static

reset bound changes on pricing variables (called when a node is deactivated)

Parameters
gcgGCG data structure
pricingvarvariable on which the bound change should be performed
consdataconstraint data structure
iindex of the information in the constraint data structure
blocknrnumber of the pricing problem

Definition at line 932 of file cons_masterbranch.c.

References GCGgetMasterprob(), GCGgetNIdenticalBlocks(), GCGgetNPricingprobs(), GCGgetPricingprob(), SCIP_ConsData::localbndtypes, SCIP_ConsData::localbndvars, SCIP_ConsData::localnewbnds, SCIP_ConsData::localoldbnds, SCIP_ConsData::nactivated, SCIP_ConsData::name, NULL, SCIP_BOUNDTYPE_LOWER, SCIP_CALL, SCIP_OKAY, SCIPchgVarLb(), SCIPchgVarUb(), SCIPdebugMessage, SCIPisEQ(), SCIPisGE(), SCIPisGT(), SCIPisLE(), SCIPisLT(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), and SCIPvarGetUbLocal().

Referenced by undoLocalBndchgsToPricingprobs().

◆ tightenPricingVarBound()

static SCIP_RETCODE tightenPricingVarBound ( GCG *  gcg,
SCIP_VAR *  pricingvar,
SCIP_CONSDATA *  consdata,
int  i,
int  blocknr 
)
static

perform bound changes on pricing variables (called when a node is activated)

Parameters
gcgGCG data structure
pricingvarvariable on which the bound change should be performed
consdataconstraint data structure
iindex of the information in the constraint data structure
blocknrnumber of the pricing problem

Definition at line 1015 of file cons_masterbranch.c.

References GCGgetMasterprob(), GCGgetNPricingprobs(), GCGgetPricingprob(), SCIP_ConsData::localbndtypes, SCIP_ConsData::localbndvars, SCIP_ConsData::localnewbnds, SCIP_ConsData::localoldbnds, SCIP_ConsData::nactivated, NULL, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_OKAY, SCIPchgVarLb(), SCIPchgVarUb(), SCIPdebugMessage, SCIPisGT(), SCIPisLT(), SCIPvarGetLbLocal(), SCIPvarGetName(), and SCIPvarGetUbLocal().

Referenced by applyLocalBndchgsToPricingprobs().

◆ checkAggregatedLocalBounds()

static SCIP_Bool checkAggregatedLocalBounds ( SCIP *  scip,
SCIP_VAR **  bndvars,
SCIP_Real *  bounds,
int  nbndvars,
SCIP_VAR *  bndvar,
SCIP_BOUNDTYPE  bndtype,
SCIP_VAR *  pricingvar 
)
static

For a given local bound change on an original variable, check if the bounds on the variables identical to it are the same

Note
If the variable is represented by another one, we check only the representative; otherwise, we check all variables identical to it
Returns
TRUE if the variable is in a relevant block AND all variables identical to it have the same bounds
Parameters
scipSCIP data structure
bndvarsall variables whose local bounds were changed
boundscorresponding new local bounds
nbndvarsnumber of all variables whose local bounds were changed
bndvaroriginal variable whose local bound was changed and which is to be checked
bndtypetype of the new local bound
pricingvarpricing variable corresponding to the original variable

Definition at line 1076 of file cons_masterbranch.c.

References FALSE, GCGoriginalVarGetPricingVar(), GCGpricingVarGetNOrigvars(), GCGpricingVarGetOrigvars(), GCGvarGetBlock(), GCGvarIsOriginal(), GCGvarIsPricing(), SCIP_Bool, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_INVALID, SCIP_Real, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPisEQ(), SCIPvarGetName(), SCIPwarningMessage(), and TRUE.

Referenced by applyLocalBndchgsToPricingprobs().

◆ applyLocalBndchgsToPricingprobs()

◆ undoLocalBndchgsToPricingprobs()

◆ ensureCollectedBndvarsSize()

◆ ensureLinkingvarIndxsSize()

static SCIP_RETCODE ensureLinkingvarIndxsSize ( SCIP *  scip,
SCIP_CONSHDLRDATA *  conshdlrdata,
int  minsize 
)
static

◆ applyLocalBndchgsToPricedMastervars()

static SCIP_RETCODE applyLocalBndchgsToPricedMastervars ( GCG *  gcg,
SCIP_CONSHDLRDATA *  conshdlrdata,
SCIP_CONS *  cons,
int *  propcount 
)
static

apply local bound changes on the original variables on newly generated master variables

Parameters
gcgGCG data structure
conshdlrdataconstraint handler data
conscurrent masterbranch constraint
propcountnumber of applied bound changes

Definition at line 1376 of file cons_masterbranch.c.

References BMSclearMemoryArray, SCIP_ConshdlrData::collectedbndvars, SCIP_ConshdlrData::collectedlbnds, SCIP_ConshdlrData::collectedubnds, SCIP_ConshdlrData::enforceproper, ensureCollectedBndvarsSize(), ensureLinkingvarIndxsSize(), GCGgetMasterprob(), GCGgetNPricingprobs(), GCGgetOrigprob(), GCGisLinkingVarInBlock(), GCGisMaster(), GCGmasterGetNPricedvars(), GCGmasterGetPricedvars(), GCGmasterVarGetOrigvalmap(), GCGoriginalVarIsLinking(), GCGvarGetBlock(), GCGvarIsMaster(), GCGvarIsOriginal(), SCIP_ConshdlrData::linkingvaridxs, SCIP_ConsData::localbndtypes, SCIP_ConsData::localbndvars, SCIP_ConsData::localnewbnds, SCIP_ConshdlrData::maxblocknum, SCIP_ConsData::nbranchingchgs, SCIP_ConshdlrData::ncollectedbndvars, SCIP_ConsData::nlocalbndchgs, SCIP_ConsData::npropvars, NULL, SCIP_ConsData::parentcons, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPallocBlockMemoryArray, SCIPblkmem(), SCIPchgVarUb(), SCIPconsGetData(), SCIPdebugMessage, SCIPgetNVars(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPhashmapGetImageInt(), SCIPhashmapGetImageReal(), SCIPhashmapInsertInt(), SCIPisFeasGT(), SCIPisFeasLT(), SCIPisFeasZero(), SCIPvarGetName(), and SCIPvarGetUbLocal().

Referenced by SCIP_DECL_CONSPROP().

◆ applyLocalBndchgsToCopiedMastervars()

static SCIP_RETCODE applyLocalBndchgsToCopiedMastervars ( GCG *  gcg,
SCIP_CONS *  cons,
int *  propcount 
)
static

apply local bound changes on original variables that have been directly copied to the master problem

Parameters
gcgGCG data structure
conscurrent masterbranch constraint
propcountnumber of applied bound changes

Definition at line 1629 of file cons_masterbranch.c.

References GCGgetMasterprob(), GCGoriginalVarGetMastervars(), GCGoriginalVarGetNMastervars(), GCGvarGetBlock(), GCGvarIsOriginal(), SCIP_ConsData::localbndtypes, SCIP_ConsData::localbndvars, SCIP_ConsData::localnewbnds, SCIP_ConsData::nlocalbndchgs, NULL, SCIP_BOUNDTYPE_LOWER, SCIP_CALL, SCIP_OKAY, SCIPchgVarLb(), SCIPchgVarUb(), SCIPconsGetData(), SCIPdebugMessage, SCIPisGT(), SCIPisLT(), SCIPvarGetLbLocal(), SCIPvarGetName(), and SCIPvarGetUbLocal().

Referenced by SCIP_DECL_CONSPROP().

◆ forwardUpdateSeenHistory()

static SCIP_RETCODE forwardUpdateSeenHistory ( GCG *  gcg,
SCIP_CONSDATA *  consdata 
)
static

◆ SCIP_DECL_CONSFREE()

static SCIP_DECL_CONSFREE ( consFreeMasterbranch  )
static

destructor of constraint handler to free constraint handler data (called when SCIP is exiting)

Definition at line 1730 of file cons_masterbranch.c.

References CONSHDLR_NAME, NULL, SCIP_OKAY, SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPfreeMemory, and SCIP_ConshdlrData::stack.

◆ SCIP_DECL_CONSINIT()

◆ SCIP_DECL_CONSINITSOL()

static SCIP_DECL_CONSINITSOL ( consInitsolMasterbranch  )
static

solving process initialization method of constraint handler (called when branch and bound process is about to begin)

Definition at line 1797 of file cons_masterbranch.c.

References CONSHDLR_NAME, SCIP_ConshdlrData::gcg, GCGconsOrigbranchGetActiveCons(), GCGconsOrigbranchSetMastercons(), GCGcreateConsMasterbranch(), SCIP_ConshdlrData::nstack, NULL, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetData(), SCIPconshdlrGetName(), and SCIP_ConshdlrData::stack.

◆ SCIP_DECL_CONSEXITSOL()

◆ SCIP_DECL_CONSEXIT()

◆ SCIP_DECL_CONSACTIVE()

◆ SCIP_DECL_CONSDEACTIVE()

◆ SCIP_DECL_CONSDELETE()

◆ SCIP_DECL_CONSPROP()

◆ SCIP_DECL_CONSENFOLP()

static SCIP_DECL_CONSENFOLP ( consEnfolpMasterbranch  )
static

enforcement method for LP solutions

Definition at line 2354 of file cons_masterbranch.c.

References SCIP_FEASIBLE, and SCIP_OKAY.

◆ SCIP_DECL_CONSENFOPS()

static SCIP_DECL_CONSENFOPS ( consEnfopsMasterbranch  )
static

enforcement method for pseudo solutions

Definition at line 2363 of file cons_masterbranch.c.

References SCIP_FEASIBLE, and SCIP_OKAY.

◆ SCIP_DECL_CONSCHECK()

static SCIP_DECL_CONSCHECK ( consCheckMasterbranch  )
static

check method for solutions

Definition at line 2372 of file cons_masterbranch.c.

References SCIP_FEASIBLE, and SCIP_OKAY.

◆ SCIP_DECL_CONSLOCK()

static SCIP_DECL_CONSLOCK ( consLockMasterbranch  )
static

variable lock method

Definition at line 2381 of file cons_masterbranch.c.

References SCIP_OKAY.

◆ SCIP_DECL_EVENTINITSOL()

static SCIP_DECL_EVENTINITSOL ( eventInitsolOrigvarbound  )
static

solving process initialization method of event handler (called when branch and bound process is about to begin)

Definition at line 2393 of file cons_masterbranch.c.

References NULL, SCIP_CALL, SCIP_EVENTTYPE_BOUNDCHANGED, SCIP_EVENTTYPE_GBDCHANGED, SCIP_OKAY, SCIPcatchVarEvent(), SCIPgetNVars(), and SCIPgetVars().

◆ SCIP_DECL_EVENTFREE()

static SCIP_DECL_EVENTFREE ( eventFreeOrigvarbound  )
static

eventhdlr destructor

Definition at line 2413 of file cons_masterbranch.c.

References NULL, SCIP_OKAY, SCIPeventhdlrGetData(), and SCIPfreeBlockMemory.

◆ SCIP_DECL_EVENTEXEC()

◆ GCGincludeConshdlrMasterbranch()

◆ GCGcreateConsMasterbranch()

SCIP_RETCODE GCGcreateConsMasterbranch ( GCG *  gcg,
SCIP_CONS **  cons,
const char *  name,
SCIP_NODE *  node,
SCIP_CONS *  parentcons,
GCG_BRANCHRULE *  branchrule,
GCG_BRANCHDATA *  branchdata,
SCIP_CONS **  origbranchconss,
int  norigbranchconss,
int  maxorigbranchconss 
)

creates and captures a masterbranch constraint

Parameters
gcgGCG 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
maxorigbranchconsscapacity of origbranchconss

Definition at line 2670 of file cons_masterbranch.c.

References SCIP_ConsData::addedcuts, SCIP_ConsData::addedcutsinit, SCIP_ConsData::branchdata, SCIP_ConsData::branchrule, SCIP_ConsData::childconss, CONSHDLR_NAME, SCIP_ConsData::copiedvarbnds, SCIP_ConsData::copiedvarbndtypes, SCIP_ConsData::copiedvars, FALSE, SCIP_ConsData::firstnewcut, GCGgetCurrentVarhistoryReference(), GCGgetMasterprob(), GCGgetOrigprob(), GCGstashLimitSettings(), GCGvarhistoryCopyReference(), SCIP_ConsData::knownvarhistory, SCIP_ConsData::localbndtypes, SCIP_ConsData::localbndvars, SCIP_ConsData::localnewbnds, SCIP_ConsData::localoldbnds, SCIP_ConsData::maxchildconss, SCIP_ConsData::maxcopiedvarbnds, SCIP_ConsData::maxlocalbndchgs, SCIP_ConsData::maxlocalbndchgstreated, SCIP_ConsData::maxorigbranchconss, SCIP_ConsData::nactivated, SCIP_ConsData::naddedcuts, SCIP_ConsData::name, SCIP_ConsData::nbranchingchgs, SCIP_ConsData::nchildconss, SCIP_ConsData::ncopiedvarbnds, SCIP_ConsData::needprop, SCIP_ConsData::nlocalbndchgs, SCIP_ConsData::nlocalbndchgstreated, SCIP_ConsData::node, SCIP_ConsData::nodestoredcuts, SCIP_ConsData::norigbranchconss, SCIP_ConsData::npropvars, NULL, SCIP_ConsData::origbranchconss, SCIP_ConsData::origcons, SCIP_ConsData::parentcons, SCIP_ConsData::probingtmpcons, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_SOLVING, SCIPallocBlockMemory, SCIPallocBlockMemoryArray, SCIPcalcMemGrowSize(), SCIPconsGetData(), SCIPcreateCons(), SCIPdebugMessage, SCIPduplicateBlockMemoryArray, SCIPfindConshdlr(), SCIPgetStage(), SCIPinProbing(), SCIPnodeGetDepth(), SCIPreallocBlockMemoryArray, and TRUE.

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

◆ GCGconsMasterbranchGetName()

char * GCGconsMasterbranchGetName ( SCIP_CONS *  cons)

returns the name of the constraint

Parameters
consmasterbranch constraint for which the data is requested

Definition at line 2800 of file cons_masterbranch.c.

References SCIP_ConsData::name, NULL, and SCIPconsGetData().

Referenced by createOrigbranchConstraint().

◆ GCGconsMasterbranchGetNode()

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 2813 of file cons_masterbranch.c.

References SCIP_ConsData::node, NULL, and SCIPconsGetData().

Referenced by applyOriginalBranching(), createBranchNodesInOrigprob(), GCGcurrentNodeIsGeneric(), SCIP_DECL_EVENTEXEC(), and SCIP_DECL_NODESELSELECT().

◆ GCGconsMasterbranchGetParentcons()

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 2828 of file cons_masterbranch.c.

References NULL, SCIP_ConsData::parentcons, and SCIPconsGetData().

Referenced by initBranch(), pruneChildNodeByDominanceGeneric(), and SCIP_DECL_EVENTEXEC().

◆ GCGconsMasterbranchGetNChildconss()

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 2843 of file cons_masterbranch.c.

References SCIP_ConsData::nchildconss, NULL, and SCIPconsGetData().

Referenced by checkchildconsS(), and createBranchNodesInOrigprob().

◆ GCGconsMasterbranchGetChildcons()

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 2858 of file cons_masterbranch.c.

References SCIP_ConsData::childconss, SCIP_ConsData::nchildconss, NULL, and SCIPconsGetData().

Referenced by checkchildconsS(), and createBranchNodesInOrigprob().

◆ GCGconsMasterbranchGetOrigcons()

SCIP_CONS * GCGconsMasterbranchGetOrigcons ( SCIP_CONS *  cons)

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 2877 of file cons_masterbranch.c.

References NULL, SCIP_ConsData::origcons, and SCIPconsGetData().

Referenced by GCGconsOrigbranchCheckConsistency(), and SCIP_DECL_CONSDELETE().

◆ GCGconsMasterbranchSetOrigcons()

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 2892 of file cons_masterbranch.c.

References NULL, SCIP_ConsData::origcons, and SCIPconsGetData().

Referenced by createOrigbranchConstraint(), and SCIP_DECL_CONSDELETE().

◆ GCGconsMasterbranchGetBranchdata()

GCG_BRANCHDATA * GCGconsMasterbranchGetBranchdata ( SCIP_CONS *  cons)

returns the branching data for a given masterbranch constraint

Parameters
consconstraint pointer

Definition at line 2907 of file cons_masterbranch.c.

References SCIP_ConsData::branchdata, NULL, and SCIPconsGetData().

Referenced by applyOriginalBranching(), checkchildconsS(), createOrigbranchConstraint(), initBranch(), pruneChildNodeByDominanceGeneric(), and SCIP_DECL_EVENTEXEC().

◆ GCGconsMasterbranchSetBranchdata()

void GCGconsMasterbranchSetBranchdata ( SCIP_CONS *  cons,
GCG_BRANCHDATA *  branchdata 
)

sets the branching data for a given masterbranch constraint

Parameters
consmasterbranch constraint for which the branching data is requested
branchdatabranching data

Definition at line 2919 of file cons_masterbranch.c.

References SCIP_ConsData::branchdata, NULL, and SCIPconsGetData().

Referenced by SCIP_DECL_CONSDELETE().

◆ GCGconsMasterbranchGetBranchrule()

GCG_BRANCHRULE * GCGconsMasterbranchGetBranchrule ( SCIP_CONS *  cons)

returns the branching rule of the constraint

Parameters
consmasterbranch constraint for which the data is requested

Definition at line 2933 of file cons_masterbranch.c.

References SCIP_ConsData::branchrule, NULL, and SCIPconsGetData().

Referenced by checkchildconsS(), createBranchNodesInOrigprob(), createOrigbranchConstraint(), GCGcurrentNodeIsGeneric(), initBranch(), ObjPricerGcg::pricingLoop(), pruneChildNodeByDominanceGeneric(), and SCIP_DECL_EVENTEXEC().

◆ GCGconsMasterbranchAddCopiedVarBndchg()

SCIP_RETCODE GCGconsMasterbranchAddCopiedVarBndchg ( GCG *  gcg,
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
gcgGCG 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 2946 of file cons_masterbranch.c.

References SCIP_ConsData::copiedvarbnds, SCIP_ConsData::copiedvarbndtypes, SCIP_ConsData::copiedvars, GCGgetMasterprob(), GCGisMaster(), SCIP_ConsData::maxcopiedvarbnds, SCIP_ConsData::ncopiedvarbnds, SCIP_ConsData::node, NULL, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMessage, SCIPreallocBlockMemoryArray, and SCIPrepropagateNode().

Referenced by applyOriginalBranching().

◆ GCGconsMasterbranchGetOrigbranchConss()

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 2993 of file cons_masterbranch.c.

References NULL, SCIP_ConsData::origbranchconss, and SCIPconsGetData().

Referenced by createOrigbranchConstraint().

◆ GCGconsMasterbranchGetNOrigbranchConss()

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 3006 of file cons_masterbranch.c.

References SCIP_ConsData::norigbranchconss, NULL, and SCIPconsGetData().

Referenced by createOrigbranchConstraint().

◆ GCGconsMasterbranchReleaseOrigbranchConss()

SCIP_RETCODE GCGconsMasterbranchReleaseOrigbranchConss ( GCG *  gcg,
SCIP_CONS *  cons 
)

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

Parameters
gcgGCG instance
consmasterbranch constraint for which the data is freed

Definition at line 3021 of file cons_masterbranch.c.

References GCGgetMasterprob(), GCGgetOrigprob(), GCGisMaster(), GCGisOriginal(), SCIP_ConsData::maxorigbranchconss, SCIP_ConsData::norigbranchconss, NULL, SCIP_ConsData::origbranchconss, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPfreeBlockMemoryArray, and SCIPreleaseCons().

Referenced by createOrigbranchConstraint(), and SCIP_DECL_CONSDELETE().

◆ GCGconsMasterbranchGetActiveCons()

◆ GCGconsMasterbranchGetStack()

void GCGconsMasterbranchGetStack ( GCG *  gcg,
SCIP_CONS ***  stack,
int *  nstackelements 
)

returns the stack and the number of elements on it

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

Definition at line 3086 of file cons_masterbranch.c.

References CONSHDLR_NAME, GCGgetMasterprob(), SCIP_ConshdlrData::nstack, NULL, SCIPconshdlrGetData(), SCIPfindConshdlr(), and SCIP_ConshdlrData::stack.

◆ GCGconsMasterbranchGetNStackelements()

int GCGconsMasterbranchGetNStackelements ( GCG *  gcg)

returns the number of elements on the stack

Parameters
gcgGCG data structure

Definition at line 3110 of file cons_masterbranch.c.

References CONSHDLR_NAME, GCGgetMasterprob(), SCIP_ConshdlrData::nstack, NULL, SCIPconshdlrGetData(), SCIPfindConshdlr(), and SCIP_ConshdlrData::stack.

◆ GCGconsMasterbranchAddRootCons()

SCIP_RETCODE GCGconsMasterbranchAddRootCons ( GCG *  gcg)

◆ GCGconsMasterbranchActiveCutRemoved()

SCIP_RETCODE GCGconsMasterbranchActiveCutRemoved ( GCG *  gcg,
int  removedidx 
)

adjusts the firstnewcut bookkeeping of all active masterbranch nodes after a master separator cut has been removed from the active cuts at the given position

Parameters
gcgGCG data structure
removedidxposition the removed cut had in the active cuts

Definition at line 3161 of file cons_masterbranch.c.

References CONSHDLR_NAME, SCIP_ConsData::firstnewcut, GCGgetMasterprob(), SCIP_ConshdlrData::nstack, NULL, SCIP_OKAY, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPfindConshdlr(), and SCIP_ConshdlrData::stack.

Referenced by eventRowDeletedFromLP().

◆ GCGcurrentNodeIsGeneric()

SCIP_Bool GCGcurrentNodeIsGeneric ( GCG *  gcg)

◆ GCGconsMasterbranchCheckConsistency()

void GCGconsMasterbranchCheckConsistency ( GCG *  gcg)