40 #define CONFLICTSTORE_DUALSIZE 100 41 #define CONFLICTSTORE_MINSIZE 2000 42 #define CONFLICTSTORE_MAXSIZE 60000 43 #define CONFLICTSTORE_SIZE 10000 44 #define CONFLICTSTORE_SORTFREQ 20 47 #define EVENTHDLR_NAME "ConflictStore" 48 #define EVENTHDLR_DESC "Solution event handler for conflict store." 55 assert(eventhdlr !=
NULL);
57 assert(event !=
NULL);
75 assert(eventhdlr !=
NULL);
80 if( !cleanboundexceeding )
95 assert(eventhdlr !=
NULL);
100 if( !cleanboundexceeding )
116 assert(cons1 !=
NULL);
117 assert(cons2 !=
NULL);
124 #ifdef SCIP_DISABLED_CODE 140 if( nvars1 >= nvars2 )
158 assert(conflictstore !=
NULL);
179 else if( nvars/2 <= 5000 )
215 assert(conflictstore !=
NULL);
246 for( i = conflictstore->
nconflicts; i < newsize; i++ )
271 assert(conflictstore !=
NULL);
278 conflictstore->
storesize +=
MIN(set->conf_maxconss, (
int)(increase));
301 assert(conflictstore !=
NULL);
302 assert(pos >= 0 && pos < conflictstore->nconflicts);
305 conflict = conflictstore->
conflicts[pos];
306 assert(conflict !=
NULL);
311 #ifdef SCIP_PRINT_DETAILS 318 assert(transprob !=
NULL);
359 assert(conflictstore !=
NULL);
363 assert(dualray !=
NULL);
370 #ifdef SCIP_PRINT_DETAILS 377 assert(transprob !=
NULL);
411 assert(conflictstore !=
NULL);
453 assert(conflictstore !=
NULL);
454 assert(blkmem !=
NULL);
456 assert(stat !=
NULL);
457 assert(transprob !=
NULL);
504 for( i = 1; i < 0.1 * conflictstore->
nconflicts; i++ )
521 if( set->conf_maxstoresize == -1 )
531 SCIPsetDebugMsg(
set,
"clean-up #%lld: removed %d/%d conflicts, %d depending on cutoff bound\n",
550 assert(conflictstore !=
NULL);
551 assert(cons !=
NULL);
579 assert(conflictstore !=
NULL);
583 (*conflictstore)->conflicts =
NULL;
584 (*conflictstore)->primalbounds =
NULL;
585 (*conflictstore)->dualrayconfs =
NULL;
586 (*conflictstore)->origconfs =
NULL;
587 (*conflictstore)->nnzdualrays = 0;
588 (*conflictstore)->conflictsize = 0;
589 (*conflictstore)->origconflictsize = 0;
590 (*conflictstore)->nconflicts = 0;
591 (*conflictstore)->ndualrayconfs = 0;
592 (*conflictstore)->norigconfs = 0;
593 (*conflictstore)->ncbconflicts = 0;
594 (*conflictstore)->nconflictsfound = 0;
595 (*conflictstore)->initstoresize = -1;
596 (*conflictstore)->storesize = -1;
597 (*conflictstore)->maxstoresize = -1;
598 (*conflictstore)->ncleanups = 0;
599 (*conflictstore)->lastnodenum = -1;
603 if( (*conflictstore)->eventhdlr ==
NULL )
606 NULL,
NULL, eventInitsolConflictstore, eventExitsolConflictstore,
NULL, eventExecConflictstore,
NULL) );
609 assert((*conflictstore)->eventhdlr !=
NULL);
623 assert(conflictstore !=
NULL);
624 assert(*conflictstore !=
NULL);
649 assert(conflictstore !=
NULL);
651 SCIPsetDebugMsg(
set,
"cleaning conflict store: %d origconfs, %d conflicts, %d dual rays\n",
657 for( i = 0; i < conflictstore->
norigconfs; i++ )
668 for( i = conflictstore->
nconflicts-1; i >= 0; i--)
705 assert(conflictstore !=
NULL);
790 assert(conflictstore !=
NULL);
791 assert(blkmem !=
NULL);
793 assert(stat !=
NULL);
796 assert(cons !=
NULL);
834 assert(tree !=
NULL);
854 #ifdef SCIP_PRINT_DETAILS 856 SCIPsetDebugMsg(
set,
" -> conflict type: %d, cutoff involved = %u\n", conftype, cutoffinvolved);
879 assert(conflictstore !=
NULL);
881 assert(stat !=
NULL);
882 assert(blkmem !=
NULL);
883 assert(transprob !=
NULL);
888 if( set->conf_maxstoresize == 0 )
892 if( !set->conf_cleanbnddepend )
897 improvement = (1 -
set->conf_minimprove);
899 improvement = (1 +
set->conf_minimprove);
927 SCIPsetDebugMsg(
set,
"-> removed %d/%d conflicts, %d depending on cutoff bound\n", ndelconfs,
928 conflictstore->
nconflicts+ndelconfs, ndelconfs);
938 assert(conflictstore !=
NULL);
948 assert(conflictstore !=
NULL);
961 assert(conflictstore !=
NULL);
976 assert(conflictstore !=
NULL);
979 if( conflictstore->
nconflicts > conflictsize )
986 for( i = 0; i < conflictstore->
nconflicts; i++ )
991 assert(conflict !=
NULL);
998 if( *nconflicts > conflictsize )
1002 conflicts[*nconflicts] = conflict;
1024 assert(conflictstore !=
NULL);
1025 assert(
set !=
NULL);
1034 for( i = 0; i < conflictstore->
norigconfs; i++ )
1043 if( transcons !=
NULL )
1066 assert(conflictstore !=
NULL);
1079 assert(conflictstore !=
NULL);
SCIP_RETCODE SCIPclearConflictStore(SCIP *scip, SCIP_EVENT *event)
SCIP_RETCODE SCIPconsDelete(SCIP_CONS *cons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_REOPT *reopt)
SCIP_RETCODE SCIPsetIncludeEventhdlr(SCIP_SET *set, SCIP_EVENTHDLR *eventhdlr)
SCIP_Bool SCIPsetIsInfinity(SCIP_SET *set, SCIP_Real val)
#define BMSfreeBlockMemoryArrayNull(mem, ptr, num)
internal methods for managing events
static SCIP_DECL_SORTPTRCOMP(compareConss)
#define CONFLICTSTORE_SORTFREQ
SCIP_RETCODE SCIPeventhdlrCreate(SCIP_EVENTHDLR **eventhdlr, const char *name, const char *desc, SCIP_DECL_EVENTCOPY((*eventcopy)), SCIP_DECL_EVENTFREE((*eventfree)), SCIP_DECL_EVENTINIT((*eventinit)), SCIP_DECL_EVENTEXIT((*eventexit)), SCIP_DECL_EVENTINITSOL((*eventinitsol)), SCIP_DECL_EVENTEXITSOL((*eventexitsol)), SCIP_DECL_EVENTDELETE((*eventdelete)), SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
SCIP_STAGE SCIPgetStage(SCIP *scip)
int SCIPprobGetNConss(SCIP_PROB *prob)
internal methods for branch and bound tree
static SCIP_DECL_EVENTEXITSOL(eventExitsolConflictstore)
int SCIPconflictstoreGetNConflictsInStore(SCIP_CONFLICTSTORE *conflictstore)
SCIP_RETCODE SCIPconflictstoreTransform(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_REOPT *reopt)
#define CONFLICTSTORE_MINSIZE
SCIP_RETCODE SCIPconflictstoreCleanNewIncumbent(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_PROB *transprob, SCIP_REOPT *reopt, SCIP_Real cutoffbound)
SCIP_Bool SCIPsetIsPositive(SCIP_SET *set, SCIP_Real val)
SCIP_EVENTHDLR * SCIPsetFindEventhdlr(SCIP_SET *set, const char *name)
static SCIP_RETCODE cleanDeletedConflicts(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_REOPT *reopt, int *ndelconfs)
SCIP_Real SCIPsetInfinity(SCIP_SET *set)
SCIP_RETCODE SCIPconflictstoreAddDualraycons(SCIP_CONFLICTSTORE *conflictstore, SCIP_CONS *dualraycons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_REOPT *reopt)
int SCIPprobGetNVars(SCIP_PROB *prob)
void SCIPconsMarkConflict(SCIP_CONS *cons)
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
static SCIP_RETCODE conflictstoreEnsureMem(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set, BMS_BLKMEM *blkmem, int num)
int SCIPconflictstoreGetNDualrays(SCIP_CONFLICTSTORE *conflictstore)
enum SCIP_Retcode SCIP_RETCODE
int SCIPsetCalcMemGrowSize(SCIP_SET *set, int num)
SCIP_NODE * SCIPtreeGetFocusNode(SCIP_TREE *tree)
SCIP_CONS * SCIPconsGetTransformed(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
SCIP_RETCODE SCIPconflictstoreClean(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_REOPT *reopt)
SCIP_RETCODE SCIPconflictstoreCreate(SCIP_CONFLICTSTORE **conflictstore, SCIP_SET *set)
SCIP_Bool SCIPconsIsOriginal(SCIP_CONS *cons)
SCIP_Bool SCIPsetIsGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
static SCIP_DECL_EVENTEXEC(eventExecConflictstore)
SCIP_CONS ** dualrayconfs
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
static SCIP_RETCODE delPosDualray(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, BMS_BLKMEM *blkmem, SCIP_REOPT *reopt, int pos, SCIP_Bool deleteconflict)
SCIP_Real SCIPconsGetAge(SCIP_CONS *cons)
internal methods for storing and manipulating the main problem
SCIP_RETCODE SCIPgetConsNVars(SCIP *scip, SCIP_CONS *cons, int *nvars, SCIP_Bool *success)
static SCIP_RETCODE conflictstoreAddOrigConflict(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_CONS *cons)
SCIP_RETCODE SCIPconflictstoreFree(SCIP_CONFLICTSTORE **conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_REOPT *reopt)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
internal miscellaneous methods
#define CONFLICTSTORE_DUALSIZE
void SCIPsortPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
internal methods for global SCIP settings
internal methods for storing conflicts
int SCIPconflictstoreGetInitPoolSize(SCIP_CONFLICTSTORE *conflictstore)
SCIP_Real SCIPconflictstoreGetAvgNnzDualray(SCIP_CONFLICTSTORE *conflictstore)
#define CONFLICTSTORE_MAXSIZE
static SCIP_RETCODE initConflictstore(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set, SCIP_PROB *transprob)
static SCIP_RETCODE delPosConflict(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, BMS_BLKMEM *blkmem, SCIP_REOPT *reopt, int pos, SCIP_Bool deleteconflict)
data structures and methods for collecting reoptimization information
SCIP_RETCODE SCIPconsGetNVars(SCIP_CONS *cons, SCIP_SET *set, int *nvars, SCIP_Bool *success)
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
#define BMSallocBlockMemoryArray(mem, ptr, num)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
static SCIP_RETCODE conflictstoreCleanUpStorage(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, BMS_BLKMEM *blkmem, SCIP_REOPT *reopt)
SCIP_RETCODE SCIPconsRelease(SCIP_CONS **cons, BMS_BLKMEM *blkmem, SCIP_SET *set)
SCIP_RETCODE SCIPsetGetIntParam(SCIP_SET *set, const char *name, int *value)
#define CONFLICTSTORE_SIZE
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Constraint handler for linear constraints in their most general form, .
int SCIPconflictstoreGetMaxPoolSize(SCIP_CONFLICTSTORE *conflictstore)
#define SCIP_EVENTTYPE_BESTSOLFOUND
void SCIPconsCapture(SCIP_CONS *cons)
#define BMSfreeMemoryNull(ptr)
SCIP_Bool SCIPsetIsGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
enum SCIP_ConflictType SCIP_CONFTYPE
SCIP_RETCODE SCIPconflictstoreAddConflict(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_REOPT *reopt, SCIP_CONS *cons, SCIP_CONFTYPE conftype, SCIP_Bool cutoffinvolved, SCIP_Real primalbound)
#define BMSallocMemory(ptr)
internal methods for constraints and constraint handlers
void SCIPsortPtrReal(void **ptrarray, SCIP_Real *realarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
static SCIP_DECL_EVENTINITSOL(eventInitsolConflictstore)
SCIP_STAGE SCIPsetGetStage(SCIP_SET *set)
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
#define BMSreallocBlockMemoryArray(mem, ptr, oldnum, newnum)
SCIP_RETCODE SCIPconflictstoreGetConflicts(SCIP_CONFLICTSTORE *conflictstore, SCIP_CONS **conflicts, int conflictsize, int *nconflicts)
static void adjustStorageSize(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set)