80 #define PROP_NAME "vbounds" 81 #define PROP_DESC "propagates variable upper and lower bounds" 82 #define PROP_TIMING SCIP_PROPTIMING_BEFORELP | SCIP_PROPTIMING_AFTERLPLOOP 83 #define PROP_PRIORITY 3000000 85 #define PROP_DELAY FALSE 94 #define EVENTHDLR_NAME "vbounds" 95 #define EVENTHDLR_DESC "bound change event handler for for vbounds propagator" 104 #define DEFAULT_USEBDWIDENING TRUE 105 #define DEFAULT_USEIMPLICS FALSE 106 #define DEFAULT_USECLIQUES FALSE 107 #define DEFAULT_USEVBOUNDS TRUE 108 #define DEFAULT_DOTOPOSORT TRUE 109 #define DEFAULT_SORTCLIQUES FALSE 110 #define DEFAULT_DETECTCYCLES FALSE 125 #define getLbIndex(idx) (2*(idx)) 126 #define getUbIndex(idx) (2*(idx)+1) 127 #define getVarIndex(idx) ((idx)/2) 128 #define getBoundtype(idx) (((idx) % 2 == 0) ? SCIP_BOUNDTYPE_LOWER : SCIP_BOUNDTYPE_UPPER) 129 #define isIndexLowerbound(idx) ((idx) % 2 == 0) 130 #define getBoundString(lower) ((lower) ? "lb" : "ub") 131 #define getBoundtypeString(type) ((type) == SCIP_BOUNDTYPE_LOWER ? "lower" : "upper") 132 #define indexGetBoundString(idx) (getBoundString(isIndexLowerbound(idx))) 133 #define getOtherBoundIndex(idx) (((idx) % 2 == 0) ? (idx) + 1 : (idx) - 1) 154 int** vboundboundedidx;
185 unsigned int boundtype:1;
200 inferinfo.val.asint = i;
211 return inferinfo.val.asint;
231 return (
int) inferinfo.val.asbits.pos;
244 assert((
int)boundtype >= 0 && (
int)boundtype <= 1);
247 inferinfo.val.asbits.pos = (
unsigned int) pos;
248 inferinfo.val.asbits.boundtype = (
unsigned int) boundtype;
287 propdata->vars =
NULL;
288 propdata->varhashmap =
NULL;
289 propdata->topoorder =
NULL;
290 propdata->vboundboundedidx =
NULL;
291 propdata->vboundcoefs =
NULL;
292 propdata->vboundconstants =
NULL;
293 propdata->nvbounds =
NULL;
294 propdata->vboundsize =
NULL;
295 propdata->nbounds = 0;
296 propdata->initialized =
FALSE;
315 assert(scip !=
NULL);
316 assert(propdata !=
NULL);
317 assert(propdata->vars !=
NULL);
318 assert(propdata->topoorder !=
NULL);
321 eventhdlr = propdata->eventhdlr;
322 assert(eventhdlr !=
NULL);
324 vars = propdata->vars;
325 nbounds = propdata->nbounds;
328 for( v = 0; v < nbounds; ++v )
330 idx = propdata->topoorder[v];
331 assert(idx >= 0 && idx < nbounds);
342 propdata->topoorder[v] = -1;
374 assert(propdata !=
NULL);
376 eventhdlr = propdata->eventhdlr;
377 assert(eventhdlr !=
NULL);
379 vars = propdata->vars;
380 nbounds = propdata->nbounds;
382 for( v = 0; v < nbounds; ++v )
384 idx = propdata->topoorder[v];
389 assert(idx >= 0 && idx < nbounds);
406 #define INITMEMSIZE 5 421 assert(scip !=
NULL);
422 assert(propdata !=
NULL);
424 if( propdata->vboundsize[startidx] == 0 )
433 else if( propdata->nvbounds[startidx] >= propdata->vboundsize[startidx] )
436 propdata->vboundsize[startidx] =
SCIPcalcMemGrowSize(scip, propdata->nvbounds[startidx] + 1);
437 assert(propdata->nvbounds[startidx] < propdata->vboundsize[startidx]);
444 nvbounds = propdata->nvbounds[startidx];
445 propdata->vboundboundedidx[startidx][nvbounds] = endidx;
446 propdata->vboundcoefs[startidx][nvbounds] = coef;
447 propdata->vboundconstants[startidx][nvbounds] = constant;
448 (propdata->nvbounds[startidx])++;
459 int idx1 = (int)(
size_t)elem1;
460 int idx2 = (int)(
size_t)elem2;
497 assert(scip !=
NULL);
498 assert(propdata !=
NULL);
500 vars = propdata->vars;
503 cycleidx = dfsstack[stacksize - 1];
519 for( j = stacksize - 2; dfsstack[j] != startidx && j >= 0; --j ){};
522 for( ; j < stacksize - 1; ++j )
528 ntmpimpls = (propdata->useimplics ?
SCIPvarGetNImpls(currvar, currlower) : 0);
533 if( stacknextedge[j] <= 0 )
536 #if defined(SCIP_DEBUG) || defined(SCIP_MORE_DEBUG) 556 if( currlower != nextlower )
559 constant = -constant + 1.0;
567 #if defined(SCIP_DEBUG) || defined(SCIP_MORE_DEBUG) 568 if( stacknextedge[j] == 0 )
575 assert(stacknextedge[j] <= -2);
577 k = -stacknextedge[j] - 2;
579 assert(k < ntmpcliques);
587 for( v = 0; v < ncliquevars; ++v )
593 #ifdef SCIP_MORE_DEBUG 594 for( v = 0; v < ncliquevars; ++v )
596 if( cliquevars[v] == vars[
getVarIndex(dfsstack[j+1])] && cliquevals[v] == !nextlower )
599 assert(v < ncliquevars);
602 SCIPdebugMsg(scip,
"%s(%s) -- (*%g + %g)[clique(<%s%s>,<%s%s>,...)] --> %s(%s)\n",
604 (currlower != nextlower ? -1.0 : 1.0),
605 (currlower != nextlower ? 1.0 : 0.0),
615 else if( stacknextedge[j] <= ntmpimpls )
626 k = stacknextedge[j] - 1;
641 newconstant = implbounds[k];
658 newconstant = implbounds[k];
662 coef = coef * newcoef;
663 constant = constant * newcoef + newconstant;
667 newcoef, newconstant,
673 assert(stacknextedge[j] > ntmpimpls);
675 k = stacknextedge[j] - ntmpimpls - 1;
676 assert(k < propdata->nvbounds[dfsstack[j]]);
677 assert(propdata->vboundboundedidx[dfsstack[j]][k] == dfsstack[j+1]);
681 propdata->vboundcoefs[dfsstack[j]][k], propdata->vboundconstants[dfsstack[j]][k],
684 coef = coef * propdata->vboundcoefs[dfsstack[j]][k];
685 constant = constant * propdata->vboundcoefs[dfsstack[j]][k] + propdata->vboundconstants[dfsstack[j]][k];
689 SCIPdebugMsg(scip,
"==> %s(%s) -- (*%g + %g) --> %s(%s)\n",
711 SCIPdebugMsg(scip,
"-> infeasible aggregated variable bound relation 0 >= %g\n", constant);
716 SCIPdebugMsg(scip,
"-> infeasible aggregated variable bound relation 0 <= %g\n", constant);
724 newbound = constant / (1.0 - coef);
778 int visitedflag = (propdata->detectcycles ?
ACTIVE :
VISITED);
780 assert(startnode >= 0);
781 assert(startnode < propdata->nbounds);
782 assert(visited !=
NULL);
783 assert(visited[startnode] == 0);
784 assert(dfsstack !=
NULL);
785 assert(dfsnodes !=
NULL);
786 assert(ndfsnodes !=
NULL);
787 assert(infeasible !=
NULL);
791 vars = propdata->vars;
794 dfsstack[0] = startnode;
795 stacknextedge[0] = 0;
800 while( stacksize > 0 )
803 curridx = dfsstack[stacksize - 1];
806 assert((visited[curridx] != 0) == (stacknextedge[stacksize - 1] != 0));
807 visited[curridx] = visitedflag;
818 if( propdata->sortcliques && propdata->usecliques && stacknextedge[stacksize - 1] == 0 )
819 stacknextedge[stacksize - 1] = -1;
824 if( propdata->sortcliques && propdata->usecliques && stacknextedge[stacksize - 1] < 0 )
836 assert(stacknextedge[stacksize - 1] == -1 || -stacknextedge[stacksize - 1] - 1 <= ncliques);
839 for( j = -stacknextedge[stacksize - 1] - 1; j < ncliques; ++j )
849 for( i = 0; i < ncliquevars; ++i )
851 if( cliquevars[i] == startvar )
867 dfsstack[stacksize] = idx;
868 stacknextedge[stacksize - 1] = -j - 2;
871 visited[idx] ==
ACTIVE, infeasible) );
878 if( idx >= 0 && !visited[idx] )
892 assert(!visited[idx]);
893 assert(j < ncliques);
899 dfsstack[stacksize] = idx;
900 stacknextedge[stacksize] = 0;
901 stacknextedge[stacksize - 1] = -j - 2;
903 assert(stacksize <= propdata->nbounds);
911 stacknextedge[stacksize - 1] = 0;
914 assert(stacknextedge[stacksize - 1] >= 0);
917 if( propdata->useimplics )
921 if( stacknextedge[stacksize - 1] < nimpls )
932 for( i = stacknextedge[stacksize - 1]; i < nimpls; ++i )
943 if( propdata->usecliques && !propdata->sortcliques && implids[i] < 0 )
957 dfsstack[stacksize] = idx;
958 stacknextedge[stacksize - 1] = i + 1;
961 visited[idx] ==
ACTIVE, infeasible) );
968 if( idx >= 0 && !visited[idx] )
975 assert(!visited[idx]);
981 dfsstack[stacksize] = idx;
982 stacknextedge[stacksize] = 0;
983 stacknextedge[stacksize - 1] = i + 1;
985 assert(stacksize <= propdata->nbounds);
992 stacknextedge[stacksize - 1] = nimpls;
996 assert(stacknextedge[stacksize - 1] >= nimpls);
999 if( propdata->usevbounds )
1005 nvbounds = propdata->nvbounds[curridx];
1006 vboundidx = propdata->vboundboundedidx[curridx];
1009 for( i = stacknextedge[stacksize - 1] - nimpls; i < nvbounds; ++i )
1019 dfsstack[stacksize] = idx;
1020 stacknextedge[stacksize - 1] = nimpls + i + 1;
1026 visited[idx] ==
ACTIVE, infeasible) );
1043 assert(!visited[idx]);
1049 dfsstack[stacksize] = idx;
1050 stacknextedge[stacksize] = 0;
1051 stacknextedge[stacksize - 1] = nimpls + i + 1;
1053 assert(stacksize <= propdata->nbounds);
1067 dfsnodes[(*ndfsnodes)] = curridx;
1068 assert(visited[curridx] == visitedflag);
1091 assert(scip !=
NULL);
1092 assert(propdata !=
NULL);
1093 assert(infeasible !=
NULL);
1095 nbounds = propdata->nbounds;
1107 for( i = 0; i < nbounds && !(*infeasible); ++i )
1111 SCIP_CALL(
dfs(scip, propdata, i, visited, dfsstack, stacknextedge, propdata->topoorder, &nsortednodes, infeasible) );
1114 assert((nsortednodes == nbounds) || (*infeasible));
1139 assert(scip !=
NULL);
1140 assert(prop !=
NULL);
1141 assert(infeasible !=
NULL);
1145 assert(propdata !=
NULL);
1146 assert(!propdata->initialized);
1152 nbounds = 2 * nvars;
1154 *infeasible =
FALSE;
1157 propdata->nbounds = nbounds;
1162 propdata->initialized =
TRUE;
1175 for( v = 0; v < nvars; ++v )
1193 for( v = 0; v < nbounds; ++v )
1195 propdata->topoorder[v] = v;
1196 propdata->vboundboundedidx[v] =
NULL;
1197 propdata->vboundcoefs[v] =
NULL;
1198 propdata->vboundconstants[v] =
NULL;
1199 propdata->nvbounds[v] = 0;
1200 propdata->vboundsize[v] = 0;
1204 for( v = 0; v < nbounds; ++v )
1234 for( n = 0; n < nvbvars; ++n )
1242 constant = constants[n];
1243 assert(vbvar !=
NULL);
1247 assert(vbvar !=
NULL);
1257 assert(startidx >= 0);
1267 SCIPdebugMsg(scip,
"varbound <%s> %s %g * <%s> + %g not added to propagator data due to reverse implication\n",
1275 SCIPdebugMsg(scip,
"varbound <%s> %s %g * <%s> + %g added to propagator data\n",
1284 if( propdata->dotoposort )
1306 assert(propdata !=
NULL);
1309 SCIPdebugMsg(scip,
" -> add %s bound of variable <%s> as reason\n",
1368 relaxedbd = (inferlb - 1.0 + 2*
SCIPfeastol(scip) - constant) / coef;
1370 relaxedbd = (inferlb - constant) / coef;
1395 assert(scip !=
NULL);
1396 assert(propdata !=
NULL);
1397 assert(infervar !=
NULL);
1407 if( canwide && propdata->usebdwidening )
1412 SCIPdebugMsg(scip,
"try to create conflict using bound widening order: inference variable, variable bound variable\n");
1422 relaxedub = inferlb - 1.0;
1434 relaxedub = relaxedub + 1.0;
1478 relaxedbd = (inferub + 1.0 - 2*
SCIPfeastol(scip) - constant) / coef;
1480 relaxedbd = (inferub - constant) / coef;
1504 assert(scip !=
NULL);
1505 assert(propdata !=
NULL);
1506 assert(infervar !=
NULL);
1516 if( canwide && propdata->usebdwidening )
1521 SCIPdebugMsg(scip,
"try to create conflict using bound widening order: inference variable, variable bound variable\n");
1531 relaxedlb = inferub + 1.0;
1543 relaxedlb = relaxedlb - 1.0;
1600 assert(scip !=
NULL);
1601 assert(prop !=
NULL);
1602 assert(propdata !=
NULL);
1603 assert(var !=
NULL);
1604 assert(nchgbds !=
NULL);
1605 assert(result !=
NULL);
1633 SCIPdebugMsg(scip,
"tightening%s lower bound of variable <%s> to %g due the %s bound of variable <%s> led to infeasibility\n",
1648 else if( tightened )
1650 SCIPdebugMsg(scip,
"tightened%s lower bound of variable <%s> to %g due the %s bound of variable <%s>\n",
1684 assert(scip !=
NULL);
1685 assert(prop !=
NULL);
1686 assert(propdata !=
NULL);
1687 assert(var !=
NULL);
1688 assert(nchgbds !=
NULL);
1689 assert(result !=
NULL);
1717 SCIPdebugMsg(scip,
"tightening%s upper bound of variable <%s> to %g due the %s bound of variable <%s> led to infeasibility\n",
1732 else if( tightened )
1734 SCIPdebugMsg(scip,
"tightened%s upper bound of variable <%s> to %g due the %s bound of variable <%s>\n",
1766 assert(scip !=
NULL);
1767 assert(prop !=
NULL);
1768 assert(result !=
NULL);
1777 assert(propdata !=
NULL);
1780 if( !propdata->initialized )
1792 assert(propdata->nbounds == 0 || propdata->propqueue !=
NULL);
1794 vars = propdata->vars;
1795 nbounds = propdata->nbounds;
1806 for( v = nbounds - 1; v >= 0; --v )
1808 idx = propdata->topoorder[v];
1809 if( idx != -1 && !propdata->inqueue[v] )
1817 propdata->inqueue[v] =
TRUE;
1840 assert(propdata->inqueue[topopos]);
1841 startpos = propdata->topoorder[topopos];
1842 assert(startpos >= 0);
1843 propdata->inqueue[topopos] =
FALSE;
1850 global =
SCIPisEQ(scip, startbound, globalbound);
1852 SCIPdebugMsg(scip,
"propagate new %s bound of %g of variable <%s>:\n",
1862 if( lower != (startbound > 0.5) )
1866 if( propdata->useimplics )
1888 for( n = 0; n < nimplvars; ++n )
1893 if( implids[n] < 0 )
1905 starttype, force, 0.0, 0.0,
FALSE, &nchgbds, result) );
1910 starttype, force, 0.0, 0.0,
FALSE, &nchgbds, result) );
1920 if( propdata->usecliques )
1937 for( j = 0; j < ncliques; ++j )
1948 for( n = 0; n < ncliquevars; ++n )
1950 if( cliquevars[n] == startvar )
1958 force, 0.0, 0.0,
FALSE, &nchgbds, result) );
1964 force, 0.0, 0.0,
FALSE, &nchgbds, result) );
1975 if( propdata->usevbounds )
1983 for( n = 0; n < propdata->nvbounds[startpos]; ++n )
1985 boundedvar = vars[
getVarIndex(propdata->vboundboundedidx[startpos][n])];
1986 coef = propdata->vboundcoefs[startpos][n];
1987 constant = propdata->vboundconstants[startpos][n];
1990 newbound = startbound * coef + constant;
1995 SCIP_CALL(
tightenVarLb(scip, prop, propdata, boundedvar, newbound, global, startvar, starttype, force,
1996 coef, constant,
TRUE, &nchgbds, result) );
2000 SCIP_CALL(
tightenVarUb(scip, prop, propdata, boundedvar, newbound, global, startvar, starttype, force,
2001 coef, constant,
TRUE, &nchgbds, result) );
2010 SCIPdebugMsg(scip,
"tightened %d variable bounds\n", nchgbds);
2031 assert(prop !=
NULL);
2063 assert(propdata !=
NULL);
2066 if( propdata->initialized )
2072 for( v = 0; v < propdata->nbounds; ++v )
2075 if( propdata->vboundsize[v] > 0 )
2133 assert(propdata !=
NULL);
2138 assert(pos < propdata->nbounds);
2140 vars = propdata->vars;
2141 assert(vars !=
NULL);
2143 assert(startvar !=
NULL);
2144 assert(startvar != infervar);
2151 int* vboundboundedidx;
2158 nvbounds = propdata->nvbounds[pos];
2159 vboundboundedidx = propdata->vboundboundedidx[pos];
2162 assert(inferidx >= 0);
2164 for( b = 0; b < nvbounds; ++b )
2166 if( vboundboundedidx[b] == inferidx )
2169 assert(b < nvbounds);
2171 coef = propdata->vboundcoefs[pos][b];
2172 constant = propdata->vboundconstants[pos][b];
2208 assert(eventhdlr !=
NULL);
2211 assert(propdata !=
NULL);
2213 idx = (int) (
size_t) eventdata;
2233 if( !propdata->inqueue[idx] )
2236 propdata->inqueue[idx] =
TRUE;
2266 propExecVbounds, propdata) );
2267 assert(prop !=
NULL);
2280 "propagating/" PROP_NAME "/usebdwidening",
"should bound widening be used to initialize conflict analysis?",
2283 "propagating/" PROP_NAME "/useimplics",
"should implications be propagated?",
2286 "propagating/" PROP_NAME "/usecliques",
"should cliques be propagated?",
2289 "propagating/" PROP_NAME "/usevbounds",
"should vbounds be propagated?",
2292 "propagating/" PROP_NAME "/dotoposort",
"should the bounds be topologically sorted in advance?",
2295 "propagating/" PROP_NAME "/sortcliques",
"should cliques be regarded for the topological sort?",
2298 "propagating/" PROP_NAME "/detectcycles",
"should cycles in the variable bound graph be identified?",
2313 assert(prop !=
NULL);
2316 assert(propdata !=
NULL);
2331 assert(prop !=
NULL);
enum SCIP_Result SCIP_RESULT
static void resetPropdata(SCIP_PROPDATA *propdata)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
enum SCIP_BoundType SCIP_BOUNDTYPE
int SCIPpqueueNElems(SCIP_PQUEUE *pqueue)
struct InferInfo INFERINFO
static SCIP_RETCODE addVbound(SCIP *scip, SCIP_PROPDATA *propdata, int startidx, int endidx, SCIP_Real coef, SCIP_Real constant)
SCIP_Bool SCIPinRepropagation(SCIP *scip)
SCIP_Real * SCIPvarGetVlbCoefs(SCIP_VAR *var)
#define DEFAULT_USEBDWIDENING
static SCIP_RETCODE resolvePropagation(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx)
SCIP_Real SCIPfeastol(SCIP *scip)
SCIP_VAR ** SCIPcliqueGetVars(SCIP_CLIQUE *clique)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_Real SCIPgetVarUbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
SCIP_STAGE SCIPgetStage(SCIP *scip)
static SCIP_Real computeRelaxedLowerbound(SCIP *scip, SCIP_VAR *var, SCIP_Real inferlb, SCIP_Real coef, SCIP_Real constant)
SCIP_Real SCIPgetVarLbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
static SCIP_RETCODE dropEvents(SCIP *scip, SCIP_PROPDATA *propdata)
#define DEFAULT_USECLIQUES
static SCIP_RETCODE analyzeConflictUpperbound(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_VAR *infervar, SCIP_Real inferub, SCIP_VAR *vbdvar, SCIP_BOUNDTYPE boundtype, SCIP_Real coef, SCIP_Real constant, SCIP_Bool canwide)
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
int SCIPvarGetNVlbs(SCIP_VAR *var)
#define SCIPallocClearBufferArray(scip, ptr, num)
SCIP_PROP * SCIPfindProp(SCIP *scip, const char *name)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_CLIQUE ** SCIPvarGetCliques(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_RETCODE SCIPinferVarLbProp(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_PROP *inferprop, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
struct SCIP_EventhdlrData SCIP_EVENTHDLRDATA
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPadjustedVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real ub)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
#define DEFAULT_SORTCLIQUES
SCIP_RETCODE SCIPcutoffNode(SCIP *scip, SCIP_NODE *node)
SCIP_Bool SCIPvarHasImplic(SCIP_VAR *var, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_BOUNDTYPE impltype)
SCIP_Real SCIPgetConflictVarUb(SCIP *scip, SCIP_VAR *var)
enum SCIP_Retcode SCIP_RETCODE
SCIP_Bool SCIPcliqueIsEquation(SCIP_CLIQUE *clique)
SCIP_RETCODE SCIPaddConflictUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
int SCIPvarGetNVubs(SCIP_VAR *var)
#define SCIP_EVENTTYPE_GLBCHANGED
SCIP_RETCODE SCIPaddConflictRelaxedLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedlb)
static SCIP_DECL_PROPCOPY(propCopyVbounds)
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
#define SCIPfreeBlockMemory(scip, ptr)
void SCIPpqueueFree(SCIP_PQUEUE **pqueue)
static SCIP_BOUNDTYPE inferInfoGetBoundtype(INFERINFO inferinfo)
SCIP_VAR ** SCIPvarGetVlbVars(SCIP_VAR *var)
static SCIP_RETCODE analyzeConflictLowerbound(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_VAR *infervar, SCIP_Real inferlb, SCIP_VAR *vbdvar, SCIP_BOUNDTYPE boundtype, SCIP_Real coef, SCIP_Real constant, SCIP_Bool canwide)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define SCIPfreeBufferArray(scip, ptr)
SCIP_Real SCIPadjustedVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real lb)
#define isIndexLowerbound(idx)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_NODE * SCIPgetRootNode(SCIP *scip)
static int inferInfoToInt(INFERINFO inferinfo)
int SCIPvarGetNCliques(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_RETCODE SCIPaddConflictLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
SCIP_RETCODE SCIPincludePropVbounds(SCIP *scip)
int * SCIPvarGetImplIds(SCIP_VAR *var, SCIP_Bool varfixing)
static SCIP_RETCODE tightenVarLb(SCIP *scip, SCIP_PROP *prop, SCIP_PROPDATA *propdata, SCIP_VAR *var, SCIP_Real newlb, SCIP_Bool global, SCIP_VAR *vbdvar, SCIP_BOUNDTYPE boundtype, SCIP_Bool force, SCIP_Real coef, SCIP_Real constant, SCIP_Bool canwide, int *nchgbds, SCIP_RESULT *result)
#define DEFAULT_USEIMPLICS
const char * SCIPgetProbName(SCIP *scip)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
static SCIP_Real computeRelaxedUpperbound(SCIP *scip, SCIP_VAR *var, SCIP_Real inferub, SCIP_Real coef, SCIP_Real constant)
variable upper and lower bound propagator
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
SCIP_Real SCIPeventGetNewbound(SCIP_EVENT *event)
static SCIP_DECL_EVENTEXEC(eventExecVbound)
#define indexGetBoundString(idx)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPexecPropVbounds(SCIP *scip, SCIP_Bool force, SCIP_RESULT *result)
SCIP_RETCODE SCIPgetProbvarSum(SCIP *scip, SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
SCIP_Real SCIPgetConflictVarLb(SCIP *scip, SCIP_VAR *var)
SCIP_Real * SCIPvarGetVubConstants(SCIP_VAR *var)
struct SCIP_EventData SCIP_EVENTDATA
const char * SCIPvarGetName(SCIP_VAR *var)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
SCIP_RETCODE SCIPtightenVarLbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
static int varGetUbIndex(SCIP_PROPDATA *propdata, SCIP_VAR *var)
#define SCIP_EVENTTYPE_LBTIGHTENED
SCIP_Real * SCIPvarGetVlbConstants(SCIP_VAR *var)
SCIP_RETCODE SCIPinferVarUbProp(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_PROP *inferprop, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
static INFERINFO intToInferInfo(int i)
#define DEFAULT_DOTOPOSORT
SCIP_Real * SCIPvarGetVubCoefs(SCIP_VAR *var)
static SCIP_DECL_PROPEXEC(propExecVbounds)
void * SCIPpqueueRemove(SCIP_PQUEUE *pqueue)
static SCIP_DECL_PROPEXITSOL(propExitsolVbounds)
static SCIP_RETCODE initData(SCIP *scip, SCIP_PROP *prop, SCIP_Bool *infeasible)
static int inferInfoGetPos(INFERINFO inferinfo)
#define SCIPallocBufferArray(scip, ptr, num)
SCIP_BOUNDTYPE * SCIPvarGetImplTypes(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_VAR * SCIPeventGetVar(SCIP_EVENT *event)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
#define getBoundtype(idx)
int SCIPvarGetNImpls(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_RETCODE SCIPaddConflictRelaxedUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedub)
SCIP_Bool * SCIPcliqueGetValues(SCIP_CLIQUE *clique)
static SCIP_RETCODE dfs(SCIP *scip, SCIP_PROPDATA *propdata, int startnode, int *visited, int *dfsstack, int *stacknextedge, int *dfsnodes, int *ndfsnodes, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPsetPropCopy(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPCOPY((*propcopy)))
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
static SCIP_RETCODE extractCycle(SCIP *scip, SCIP_PROPDATA *propdata, int *dfsstack, int *stacknextedge, int stacksize, SCIP_Bool samebound, SCIP_Bool *infeasible)
#define SCIPfreeMemoryArray(scip, ptr)
#define SCIPreallocMemoryArray(scip, ptr, newnum)
#define SCIP_EVENTTYPE_UBTIGHTENED
SCIP_Real * SCIPvarGetImplBounds(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_RETCODE SCIPsetPropExitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
const char * SCIPpropGetName(SCIP_PROP *prop)
int SCIPgetNVars(SCIP *scip)
static SCIP_RETCODE relaxVbdvar(SCIP *scip, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedbd)
#define getBoundString(lower)
SCIP_VAR ** SCIPvarGetImplVars(SCIP_VAR *var, SCIP_Bool varfixing)
static int varGetLbIndex(SCIP_PROPDATA *propdata, SCIP_VAR *var)
SCIP_RETCODE SCIPsetPropResprop(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static INFERINFO getInferInfo(int pos, SCIP_BOUNDTYPE boundtype)
SCIP_RETCODE SCIPpqueueInsert(SCIP_PQUEUE *pqueue, void *elem)
static SCIP_RETCODE tightenVarUb(SCIP *scip, SCIP_PROP *prop, SCIP_PROPDATA *propdata, SCIP_VAR *var, SCIP_Real newub, SCIP_Bool global, SCIP_VAR *vbdvar, SCIP_BOUNDTYPE boundtype, SCIP_Bool force, SCIP_Real coef, SCIP_Real constant, SCIP_Bool canwide, int *nchgbds, SCIP_RESULT *result)
static SCIP_RETCODE catchEvents(SCIP *scip, SCIP_PROPDATA *propdata)
SCIP_RETCODE SCIPpqueueCreate(SCIP_PQUEUE **pqueue, int initsize, SCIP_Real sizefac, SCIP_DECL_SORTPTRCOMP((*ptrcomp)))
#define getOtherBoundIndex(idx)
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
#define getBoundtypeString(type)
struct SCIP_PropData SCIP_PROPDATA
#define DEFAULT_USEVBOUNDS
SCIP_RETCODE SCIPsetPropFree(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
SCIP_VAR ** SCIPvarGetVubVars(SCIP_VAR *var)
SCIP_PROPDATA * SCIPpropGetData(SCIP_PROP *prop)
void SCIPpropSetData(SCIP_PROP *prop, SCIP_PROPDATA *propdata)
static SCIP_RETCODE propagateVbounds(SCIP *scip, SCIP_PROP *prop, SCIP_Bool force, SCIP_RESULT *result)
#define DEFAULT_DETECTCYCLES
static SCIP_DECL_SORTPTRCOMP(compVarboundIndices)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
int SCIPcliqueGetNVars(SCIP_CLIQUE *clique)
SCIP_RETCODE SCIPtightenVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
#define BMSclearMemoryArray(ptr, num)
static SCIP_DECL_PROPRESPROP(propRespropVbounds)
#define SCIP_EVENTTYPE_GUBCHANGED
SCIP_EVENTHDLRDATA * SCIPeventhdlrGetData(SCIP_EVENTHDLR *eventhdlr)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
SCIP_Bool SCIPisPropagatedVbounds(SCIP *scip)
SCIP_RETCODE SCIPanalyzeConflict(SCIP *scip, int validdepth, SCIP_Bool *success)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
static SCIP_RETCODE topologicalSort(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPincludePropBasic(SCIP *scip, SCIP_PROP **propptr, const char *name, const char *desc, int priority, int freq, SCIP_Bool delay, SCIP_PROPTIMING timingmask, SCIP_DECL_PROPEXEC((*propexec)), SCIP_PROPDATA *propdata)
static SCIP_DECL_PROPFREE(propFreeVbounds)