40 #define CONFLICTSTORE_DUALRAYSIZE 100 41 #define CONFLICTSTORE_DUALSOLSIZE 75 42 #define CONFLICTSTORE_MINSIZE 2000 43 #define CONFLICTSTORE_MAXSIZE 60000 44 #define CONFLICTSTORE_SIZE 10000 45 #define CONFLICTSTORE_SORTFREQ 20 48 #define EVENTHDLR_NAME "ConflictStore" 49 #define EVENTHDLR_DESC "Solution event handler for conflict store." 56 assert(eventhdlr != NULL);
58 assert(event != NULL);
76 assert(eventhdlr != NULL);
81 if( !cleanboundexceeding )
96 assert(eventhdlr != NULL);
101 if( !cleanboundexceeding )
117 assert(cons1 != NULL);
118 assert(cons2 != NULL);
125 #ifdef SCIP_DISABLED_CODE 141 if( nvars1 >= nvars2 )
169 assert(conflictstore != NULL);
190 else if( nvars/2 <= 5000 )
226 assert(conflictstore != NULL);
245 newsize =
MAX(newsize, num);
260 for( i = conflictstore->
nconflicts; i < newsize; i++ )
285 assert(conflictstore != NULL);
292 conflictstore->
storesize += MIN(set->conf_maxconss, (
int)(increase));
315 assert(conflictstore != NULL);
316 assert(pos >= 0 && pos < conflictstore->nconflicts);
319 conflict = conflictstore->
conflicts[pos];
320 assert(conflict != NULL);
325 #ifdef SCIP_PRINT_DETAILS 332 assert(transprob != NULL);
345 conflictstore->
conflicts[lastpos] = NULL;
373 assert(conflictstore != NULL);
377 assert(dualproof != NULL);
384 #ifdef SCIP_PRINT_DETAILS 391 assert(transprob != NULL);
430 assert(conflictstore != NULL);
431 assert(pos >= 0 && pos < conflictstore->ndualsolconfs);
435 assert(dualproof != NULL);
442 #ifdef SCIP_PRINT_DETAILS 449 assert(transprob != NULL);
489 assert(conflictstore != NULL);
494 for( i = conflictstore->
nconflicts-1; i >= 0; i-- )
496 assert(conflictstore->
conflicts[i] != NULL);
507 SCIPsetDebugMsg(
set,
"> removed %d/%d as deleted marked conflicts.\n", *ndelconfs, conflictstore->
nconflicts + (*ndelconfs));
525 assert(conflictstore != NULL);
544 SCIPsetDebugMsg(
set,
"> removed %d/%d as deleted marked dual infeasibility proofs.\n",
563 assert(conflictstore != NULL);
582 SCIPsetDebugMsg(
set,
"> removed %d/%d as deleted marked dual boundexceeding proofs.\n",
601 assert(conflictstore != NULL);
602 assert(blkmem != NULL);
604 assert(stat != NULL);
605 assert(transprob != NULL);
652 for( i = 1; i < 0.1 * conflictstore->
nconflicts; i++ )
669 if( set->conf_maxstoresize == -1 )
679 SCIPsetDebugMsg(
set,
"clean-up #%lld: removed %d/%d conflicts, %d depending on cutoff bound\n",
698 assert(conflictstore != NULL);
699 assert(cons != NULL);
727 assert(conflictstore != NULL);
731 (*conflictstore)->conflicts = NULL;
732 (*conflictstore)->confprimalbnds = NULL;
733 (*conflictstore)->dualprimalbnds = NULL;
734 (*conflictstore)->scalefactors = NULL;
735 (*conflictstore)->updateside = NULL;
736 (*conflictstore)->dualrayconfs = NULL;
737 (*conflictstore)->dualsolconfs = NULL;
738 (*conflictstore)->origconfs = NULL;
739 (*conflictstore)->nnzdualrays = 0;
740 (*conflictstore)->nnzdualsols = 0;
741 (*conflictstore)->conflictsize = 0;
742 (*conflictstore)->origconflictsize = 0;
743 (*conflictstore)->nconflicts = 0;
744 (*conflictstore)->ndualrayconfs = 0;
745 (*conflictstore)->ndualsolconfs = 0;
746 (*conflictstore)->norigconfs = 0;
747 (*conflictstore)->ncbconflicts = 0;
748 (*conflictstore)->nconflictsfound = 0;
749 (*conflictstore)->initstoresize = -1;
750 (*conflictstore)->storesize = -1;
751 (*conflictstore)->maxstoresize = -1;
752 (*conflictstore)->ncleanups = 0;
754 (*conflictstore)->lastnodenum = -1;
758 if( (*conflictstore)->eventhdlr == NULL )
761 NULL, NULL, eventInitsolConflictstore, eventExitsolConflictstore, NULL, eventExecConflictstore, NULL) );
764 assert((*conflictstore)->eventhdlr != NULL);
778 assert(conflictstore != NULL);
779 assert(*conflictstore != NULL);
808 assert(conflictstore != NULL);
810 SCIPsetDebugMsg(
set,
"clearing conflict store: %d origconfs, %d conflicts, %d dual proofs\n",
816 for( i = 0; i < conflictstore->
norigconfs; i++ )
828 for( i = conflictstore->
nconflicts-1; i >= 0; i--)
873 assert(conflictstore != NULL);
875 SCIPsetDebugMsg(
set,
"cleaning conflict store: %d conflicts, %d dual proofs\n",
922 assert(conflictstore != NULL);
990 assert(conflictstore != NULL);
1067 assert(conflictstore != NULL);
1068 assert(blkmem != NULL);
1069 assert(
set != NULL);
1070 assert(stat != NULL);
1073 assert(cons != NULL);
1111 assert(tree != NULL);
1131 #ifdef SCIP_PRINT_DETAILS 1133 SCIPsetDebugMsg(
set,
" -> conflict type: %d, cutoff involved = %u\n", conftype, cutoffinvolved);
1134 if( cutoffinvolved )
1157 assert(conflictstore != NULL);
1158 assert(
set != NULL);
1159 assert(stat != NULL);
1160 assert(blkmem != NULL);
1161 assert(transprob != NULL);
1164 if( set->conf_maxstoresize == 0 )
1168 if( !set->conf_cleanbnddepend )
1183 improvement = (1 -
set->conf_minimprove);
1185 improvement = (1 +
set->conf_minimprove);
1195 assert(conflictstore->
conflicts[i] != NULL);
1214 SCIPsetDebugMsg(
set,
"-> removed %d/%d conflicts, %d depending on cutoff bound\n", ndelconfs,
1215 conflictstore->
nconflicts+ndelconfs, ndelconfs);
1226 assert(dualproof != NULL);
1239 assert(conshdlr != NULL);
1302 SCIPsetDebugMsg(
set,
"-> changed %d sides of dual solution constraints\n", nchgsides);
1303 SCIPsetDebugMsg(
set,
"-> deleted %d dual solution constraints\n", ndelconfs);
1313 assert(conflictstore != NULL);
1323 assert(conflictstore != NULL);
1336 assert(conflictstore != NULL);
1351 assert(conflictstore != NULL);
1354 if( conflictstore->
nconflicts > conflictsize )
1361 for( i = 0; i < conflictstore->
nconflicts; i++ )
1366 assert(conflict != NULL);
1373 if( *nconflicts > conflictsize )
1377 conflicts[*nconflicts] = conflict;
1399 assert(conflictstore != NULL);
1400 assert(
set != NULL);
1409 for( i = 0; i < conflictstore->
norigconfs; i++ )
1413 assert(conflictstore->
origconfs[i] != NULL);
1418 if( transcons != NULL )
1441 assert(conflictstore != NULL);
1454 assert(conflictstore != NULL);
1464 assert(conflictstore != NULL);
1478 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)
SCIP_Bool SCIPsetIsLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
#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_RETCODE delPosDualsol(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 SCIPgetCutoffbound(SCIP *scip)
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_Real * confprimalbnds
int SCIPprobGetNVars(SCIP_PROB *prob)
void SCIPconsMarkConflict(SCIP_CONS *cons)
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
static SCIP_RETCODE cleanDeletedDualsolCons(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_REOPT *reopt, int *ndelproofs)
static SCIP_RETCODE conflictstoreEnsureMem(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set, BMS_BLKMEM *blkmem, int num)
enum SCIP_Retcode SCIP_RETCODE
int SCIPsetCalcMemGrowSize(SCIP_SET *set, int num)
SCIP_NODE * SCIPtreeGetFocusNode(SCIP_TREE *tree)
SCIP_CONS ** dualsolconfs
SCIP_Bool SCIPsetIsNegative(SCIP_SET *set, SCIP_Real val)
SCIP_CONS * SCIPconsGetTransformed(SCIP_CONS *cons)
SCIP_Real SCIPgetRhsLinear(SCIP *scip, 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)
#define CONFLICTSTORE_DUALRAYSIZE
SCIP_RETCODE SCIPconflictstoreCreate(SCIP_CONFLICTSTORE **conflictstore, SCIP_SET *set)
int SCIPconflictstoreGetNDualInfProofs(SCIP_CONFLICTSTORE *conflictstore)
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)
SCIP_Real lastcutoffbound
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)
#define CONFLICTSTORE_DUALSOLSIZE
SCIP_RETCODE SCIPconflictstoreClear(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_REOPT *reopt)
SCIP_Real SCIPconsGetAge(SCIP_CONS *cons)
internal methods for storing and manipulating the main problem
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
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
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)
#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)
SCIP_Real SCIPsetSumepsilon(SCIP_SET *set)
#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)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_Real SCIPconflictstoreGetAvgNnzDualBndProofs(SCIP_CONFLICTSTORE *conflictstore)
#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)
SCIP_RETCODE SCIPconflictstoreAddDualraycons(SCIP_CONFLICTSTORE *conflictstore, SCIP_CONS *dualproof, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_REOPT *reopt)
Constraint handler for linear constraints in their most general form, .
SCIP_RETCODE SCIPchgRhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real rhs)
int SCIPconflictstoreGetMaxPoolSize(SCIP_CONFLICTSTORE *conflictstore)
SCIP_Real * dualprimalbnds
static SCIP_RETCODE cleanDeletedDualrayCons(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_REOPT *reopt, int *ndelproofs)
#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)
void SCIPsortPtrRealRealInt(void **ptrarray, SCIP_Real *realarray1, SCIP_Real *realarray2, int *intarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
#define BMSallocMemory(ptr)
SCIP_RETCODE SCIPconflictstoreAddDualsolcons(SCIP_CONFLICTSTORE *conflictstore, SCIP_CONS *dualproof, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_REOPT *reopt, SCIP_Real scale, SCIP_Bool updateside)
internal methods for constraints and constraint handlers
void SCIPsortPtrReal(void **ptrarray, SCIP_Real *realarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
int SCIPconflictstoreGetNDualBndProofs(SCIP_CONFLICTSTORE *conflictstore)
static SCIP_DECL_EVENTINITSOL(eventInitsolConflictstore)
SCIP_Real SCIPconflictstoreGetAvgNnzDualInfProofs(SCIP_CONFLICTSTORE *conflictstore)
SCIP_STAGE SCIPsetGetStage(SCIP_SET *set)
SCIP_RETCODE SCIPchgLhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real lhs)
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
SCIP_Bool SCIPisInRestart(SCIP *scip)
#define BMSreallocBlockMemoryArray(mem, ptr, oldnum, newnum)
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPconflictstoreGetConflicts(SCIP_CONFLICTSTORE *conflictstore, SCIP_CONS **conflicts, int conflictsize, int *nconflicts)
static void adjustStorageSize(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set)