73#define EVENTHDLR_NAME "event_shadowtree"
74#define EVENTHDLR_DESC "event handler for maintaining the unmodified branch-and-bound tree"
75#define NODEMAP_MAX_INITIAL_SIZE 10000
76#define NODEMAP_MAX_INITIAL_SIZE_2LOG 14
85struct SCIP_EventhdlrData
188 int maxnbranchingdecisions;
189 int nbranchingdecisions;
211 shadowtree = eventhdlrdata->shadowtree;
217 if ( eventshadownode ==
NULL )
228 maxnbranchingdecisions = 1;
232 for (
c = 0;
c < nchildren; ++
c)
234 nbranchingdecisions = 0;
236 childnode = children[
c];
241 for (
i = 0;
i < nboundchgs; ++
i)
251 if ( nbranchingdecisions >= maxnbranchingdecisions )
253 assert( nbranchingdecisions == maxnbranchingdecisions );
254 assert( maxnbranchingdecisions > 0 );
258 assert( nbranchingdecisions < maxnbranchingdecisions );
261 update = &branchingdecisions[nbranchingdecisions++];
269 eventshadownode->
children[
c] = childshadownode;
272 childshadownode->
parent = eventshadownode;
278 if ( nbranchingdecisions <= 0 )
283 for (
i = 0;
i < nbranchingdecisions; ++
i)
309 if ( nboundchgs <= 0 )
311 assert( nboundchgs == 0 );
322 for (
i = 0;
i < nboundchgs; ++
i)
364 shadowtree = eventhdlrdata->shadowtree;
370 if ( deletedshadownode ==
NULL )
386 childshadownode = deletedshadownode->
children[
c];
392 assert( childshadownode->npropagations >= 0 );
393 assert( (childshadownode->npropagations > 0) != (childshadownode->propagations ==
NULL) );
396 assert( childshadownode->nbranchingdecisions >= 0 );
397 assert( (childshadownode->nbranchingdecisions > 0) != (childshadownode->branchingdecisions ==
NULL) );
401 assert( childshadownode->nchildren < 0 );
438 SCIP_CALL( eventExecNodeBranched(
scip, eventhdlr, event, eventdata) );
441 SCIP_CALL( eventExecNodeDeleted(
scip, eventhdlr, event, eventdata) );
472 for (
i = 0;
i < nentries; ++
i)
475 if ( shadownode ==
NULL )
517 if ( eventhdlrdata->shadowtree !=
NULL )
533 int initialnodemapsize;
550 if ( !eventhdlrdata->active )
554 shadowtree = eventhdlrdata->shadowtree;
566 hashGetKeyShadowNode, hashKeyEqShadowNode, hashKeyValShadowNode,
NULL) );
604 if ( !eventhdlrdata->active )
614 eventhdlrdata->shadowtree =
NULL;
634 return eventhdlrdata->shadowtree;
653 SCIP_CALL(
SCIPcheckStage(
scip,
"SCIPactivateShadowTree",
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
656 eventhdlrdata->active =
TRUE;
672 eventhdlrdata =
NULL;
677 eventhdlrdata->scip =
scip;
681 eventhdlrdata->active =
FALSE;
684 eventhdlrdata->shadowtree =
NULL;
690 *eventhdlrptr = eventhdlr;
SCIP_RETCODE SCIPcheckStage(SCIP *scip, const char *method, SCIP_Bool init, SCIP_Bool problem, SCIP_Bool transforming, SCIP_Bool transformed, SCIP_Bool initpresolve, SCIP_Bool presolving, SCIP_Bool exitpresolve, SCIP_Bool presolved, SCIP_Bool initsolve, SCIP_Bool solving, SCIP_Bool solved, SCIP_Bool exitsolve, SCIP_Bool freetrans, SCIP_Bool freescip)
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)
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
#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
@ SCIP_NODETYPE_PROBINGNODE
@ SCIP_NODETYPE_FOCUSNODE
type definitions for problem variables
@ SCIP_BOUNDCHGTYPE_BRANCHING