72#define EVENTHDLR_NAME "event_shadowtree"
73#define EVENTHDLR_DESC "event handler for maintaining the unmodified branch-and-bound tree"
74#define NODEMAP_MAX_INITIAL_SIZE 10000
75#define NODEMAP_MAX_INITIAL_SIZE_2LOG 14
84struct SCIP_EventhdlrData
187 int maxnbranchingdecisions;
188 int nbranchingdecisions;
210 shadowtree = eventhdlrdata->shadowtree;
216 if ( eventshadownode ==
NULL )
227 maxnbranchingdecisions = 1;
231 for (
c = 0;
c < nchildren; ++
c)
233 nbranchingdecisions = 0;
235 childnode = children[
c];
240 for (
i = 0;
i < nboundchgs; ++
i)
250 if ( nbranchingdecisions >= maxnbranchingdecisions )
252 assert( nbranchingdecisions == maxnbranchingdecisions );
253 assert( maxnbranchingdecisions > 0 );
257 assert( nbranchingdecisions < maxnbranchingdecisions );
260 update = &branchingdecisions[nbranchingdecisions++];
268 eventshadownode->
children[
c] = childshadownode;
271 childshadownode->
parent = eventshadownode;
277 if ( nbranchingdecisions <= 0 )
282 for (
i = 0;
i < nbranchingdecisions; ++
i)
308 if ( nboundchgs <= 0 )
310 assert( nboundchgs == 0 );
321 for (
i = 0;
i < nboundchgs; ++
i)
363 shadowtree = eventhdlrdata->shadowtree;
369 if ( deletedshadownode ==
NULL )
385 childshadownode = deletedshadownode->
children[
c];
391 assert( childshadownode->npropagations >= 0 );
392 assert( (childshadownode->npropagations > 0) != (childshadownode->propagations ==
NULL) );
395 assert( childshadownode->nbranchingdecisions >= 0 );
396 assert( (childshadownode->nbranchingdecisions > 0) != (childshadownode->branchingdecisions ==
NULL) );
400 assert( childshadownode->nchildren < 0 );
437 SCIP_CALL( eventExecNodeBranched(
scip, eventhdlr, event, eventdata) );
440 SCIP_CALL( eventExecNodeDeleted(
scip, eventhdlr, event, eventdata) );
471 for (
i = 0;
i < nentries; ++
i)
474 if ( shadownode ==
NULL )
516 if ( eventhdlrdata->shadowtree !=
NULL )
532 int initialnodemapsize;
549 if ( !eventhdlrdata->active )
553 shadowtree = eventhdlrdata->shadowtree;
565 hashGetKeyShadowNode, hashKeyEqShadowNode, hashKeyValShadowNode,
NULL) );
603 if ( !eventhdlrdata->active )
613 eventhdlrdata->shadowtree =
NULL;
635 return eventhdlrdata->shadowtree;
656 SCIP_CALL(
SCIPcheckStage(
scip,
"SCIPactivateShadowTree",
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
659 eventhdlrdata->active =
TRUE;
675 eventhdlrdata =
NULL;
680 eventhdlrdata->scip =
scip;
684 eventhdlrdata->active =
FALSE;
687 eventhdlrdata->shadowtree =
NULL;
693 *eventhdlrptr = eventhdlr;
static GRAPHNODE ** active
#define SCIPcheckStage(scip, method, init, problem, transforming, transformed, initpresolve, presolving, exitpresolve, presolved, initsolve, solving, solved, exitsolve, freetrans, freescip)
#define SCIP_STRINGEQ(name, reference, retcode)
SCIP_RETCODE SCIPactivateShadowTree(SCIP *scip, SCIP_EVENTHDLR *eventhdlr)
SCIP_SHADOWTREE * SCIPgetShadowTree(SCIP_EVENTHDLR *eventhdlr)
SCIP_SHADOWNODE * SCIPshadowTreeGetShadowNode(SCIP_SHADOWTREE *shadowtree, SCIP_NODE *node)
SCIP_SHADOWNODE * SCIPshadowTreeGetShadowNodeFromNodeNumber(SCIP_SHADOWTREE *shadowtree, SCIP_Longint nodeid)
SCIP_Real SCIPgetShadowTreeEventHandlerExecutionTime(SCIP *scip, SCIP_EVENTHDLR *eventhdlr)
#define NODEMAP_MAX_INITIAL_SIZE_2LOG
#define NODEMAP_MAX_INITIAL_SIZE
static SCIP_RETCODE freeShadowTree(SCIP *scip, SCIP_SHADOWTREE *shadowtree)
SCIP_RETCODE SCIPincludeEventHdlrShadowTree(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr)
struct SCIP_ShadowBoundUpdate SCIP_SHADOWBOUNDUPDATE
struct SCIP_ShadowTree SCIP_SHADOWTREE
struct SCIP_ShadowNode SCIP_SHADOWNODE
SCIP_Bool SCIPisTransformed(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
int SCIPgetNIntVars(SCIP *scip)
int SCIPgetNBinVars(SCIP *scip)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
int SCIPhashtableGetNEntries(SCIP_HASHTABLE *hashtable)
void * SCIPhashtableGetEntry(SCIP_HASHTABLE *hashtable, int entryidx)
SCIP_RETCODE SCIPhashtableCreate(SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
SCIP_RETCODE SCIPhashtableRemove(SCIP_HASHTABLE *hashtable, void *element)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
SCIP_RETCODE SCIPsetEventhdlrFree(SCIP *scip, SCIP_EVENTHDLR *eventhdlr,)
SCIP_RETCODE SCIPsetEventhdlrInitsol(SCIP *scip, SCIP_EVENTHDLR *eventhdlr,)
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
SCIP_RETCODE SCIPsetEventhdlrExitsol(SCIP *scip, SCIP_EVENTHDLR *eventhdlr,)
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
SCIP_EVENTHDLRDATA * SCIPeventhdlrGetData(SCIP_EVENTHDLR *eventhdlr)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_NODE * SCIPeventGetNode(SCIP_EVENT *event)
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPreallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_NODETYPE SCIPnodeGetType(SCIP_NODE *node)
SCIP_DOMCHG * SCIPnodeGetDomchg(SCIP_NODE *node)
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
SCIP_Bool SCIPinProbing(SCIP *scip)
SCIP_RETCODE SCIPcreateClock(SCIP *scip, SCIP_CLOCK **clck)
SCIP_RETCODE SCIPstopClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPfreeClock(SCIP *scip, SCIP_CLOCK **clck)
SCIP_Real SCIPgetClockTime(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPstartClock(SCIP *scip, SCIP_CLOCK *clck)
SCIP_RETCODE SCIPgetChildren(SCIP *scip, SCIP_NODE ***children, int *nchildren)
SCIP_NODE * SCIPgetFocusNode(SCIP *scip)
SCIP_BOUNDTYPE SCIPboundchgGetBoundtype(SCIP_BOUNDCHG *boundchg)
SCIP_VAR * SCIPboundchgGetVar(SCIP_BOUNDCHG *boundchg)
SCIP_BOUNDCHG * SCIPdomchgGetBoundchg(SCIP_DOMCHG *domchg, int pos)
SCIP_BOUNDCHGTYPE SCIPboundchgGetBoundchgtype(SCIP_BOUNDCHG *boundchg)
SCIP_Real SCIPboundchgGetNewbound(SCIP_BOUNDCHG *boundchg)
int SCIPdomchgGetNBoundchgs(SCIP_DOMCHG *domchg)
assert(minobj< SCIPgetCutoffbound(scip))
memory allocation routines
public methods for managing constraints
public methods for message output
public methods for problem variables
public methods for branching rule plugins and branching
public methods for conflict handler plugins and conflict analysis
public methods for constraint handler plugins and constraints
public methods for problem copies
public methods for cuts and aggregation rows
public methods for the LP relaxation, rows and columns
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for global and local (sub)problems
public methods for the probing mode
public methods for solutions
public methods for SCIP variables
SCIP_BOUNDTYPE boundchgtype
struct SCIP_ShadowNode ** children
SCIP_SHADOWBOUNDUPDATE * branchingdecisions
SCIP_SHADOWBOUNDUPDATE * propagations
struct SCIP_ShadowNode * parent
datastructures for block memory pools and memory buffers
SCIP main data structure.
data structures for branch and bound tree
datastructures for problem variables
methods for handling symmetries
struct SCIP_Clock SCIP_CLOCK
struct SCIP_Eventhdlr SCIP_EVENTHDLR
#define SCIP_DECL_EVENTINITSOL(x)
struct SCIP_EventhdlrData SCIP_EVENTHDLRDATA
#define SCIP_DECL_EVENTEXEC(x)
#define SCIP_EVENTTYPE_NODEBRANCHED
#define SCIP_DECL_EVENTFREE(x)
#define SCIP_DECL_EVENTEXITSOL(x)
#define SCIP_EVENTTYPE_NODEDELETE
#define SCIP_DECL_HASHKEYEQ(x)
#define SCIP_DECL_HASHGETKEY(x)
#define SCIP_DECL_HASHKEYVAL(x)
enum SCIP_Retcode SCIP_RETCODE
struct SCIP_Node SCIP_NODE
@ SCIP_NODETYPE_PROBINGNODE
@ SCIP_NODETYPE_FOCUSNODE
type definitions for problem variables
union SCIP_DomChg SCIP_DOMCHG
struct SCIP_BoundChg SCIP_BOUNDCHG
@ SCIP_BOUNDCHGTYPE_BRANCHING