conflict_resolution.c
Go to the documentation of this file.
47/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
96/** creates a copy of the given generalized resolution row, allocating an additional amount of memory */
138/** replaces a generalized resolution row by another; allocate an additional amount of memory if needed */
220 SCIPsetDebugMsgPrint(set, "inserting conflict row (valid depth: %d, conf depth: %d, reprop depth: %d):\n",
232/** gets number of conflict constraints found during propagation with the generalized resolution conflict analysis */
242/** gets number of calls to generalized resolution conflict analysis that yield at least one conflict constraint */
253/** gets number of calls to generalized resolution conflict analysis terminating because of large coefficients */
263/** gets number of calls to generalized resolution conflict analysis terminating because of long conflicts */
290 RESOLVED_CONFLICT_ROWTYPE, /**< resolved infeasible row (after adding the conflict and reason rows) */
376 SCIPsetDebugMsgPrint(set, " %+g<%s>[B]", QUAD_TO_DBL(val), SCIPvarGetName(vars[aggrrow->inds[i]]));
378 SCIPsetDebugMsgPrint(set, " %+g<%s>[I]", QUAD_TO_DBL(val), SCIPvarGetName(vars[aggrrow->inds[i]]));
380 SCIPsetDebugMsgPrint(set, " %+g<%s>[C]", QUAD_TO_DBL(val), SCIPvarGetName(vars[aggrrow->inds[i]]));
394 SCIPsetDebugMsgPrint(set, " \t -> Bound change <%s> %s %.15g [status:%d, type:%d, depth:%d, pos:%d, reason:<%s>, global bounds:[%.15g,%.15g], local bounds:[%.15g,%.15g]] \n",
403 : (SCIPbdchginfoGetInferProp(bdchginfo) != NULL ? SCIPpropGetName(SCIPbdchginfoGetInferProp(bdchginfo))
404 : "none")), SCIPvarGetLbGlobal(var), SCIPvarGetUbGlobal(var), SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var));
425 SCIPsetDebugMsgPrint(set, "Bound changes in %s bound change queue: \n", continuousbdchgqueue ? "continuous" : "resolution");
437 SCIPsetDebugMsgPrint(set, " \t -> Bound change %d: <%s> %s %.15g [status:%d, type:%d, depth:%d, pos:%d, reason:<%s>, global bounds:[%.15g,%.15g], local bounds:[%.15g,%.15g]] \n",
446 : (SCIPbdchginfoGetInferProp(bdchginfo) != NULL ? SCIPpropGetName(SCIPbdchginfoGetInferProp(bdchginfo))
479 SCIPsetDebugMsgPrint(set, " \t -> Not resolvable bound change: constraint %s \n", SCIPconsGetName(SCIPbdchginfoGetInferCons(bdchginfo)));
502/** perform activity based coefficient tightening on a semi-sparse or sparse row defined with a left hand side */
616 /* loop over the integral variables and try to tighten the coefficients; see cons_linear for more details */
630 /* due to sorting, we can exit if we reached a continuous variable: all further integral variables have 0 coefficents anyway */
641 assert(SCIPsetIsGE(set, newcoef + EPS, rowcoefs[coefidx]) || SCIPsetIsRelGE(set, newcoef, rowcoefs[coefidx]));
653 SCIPdebugPrintf("tightened coefficient from %g to %g; lhs changed from %g to %g; the bounds are [%g,%g]\n",
681 assert(SCIPsetIsLE(set, newcoef, rowcoefs[coefidx] + EPS) || SCIPsetIsRelLE(set, newcoef, rowcoefs[coefidx]));
693 SCIPdebugPrintf("tightened coefficient from %g to %g; lhs changed from %g to %g; the bounds are [%g,%g]\n",
716 else /* due to sorting we can stop completely if the precondition was not fulfilled for this variable */
851 SCIPsetDebugMsgPrint(set, "MIR on 0-1 constraint with LHS %f and divisor %f\n" , reasonrow->lhs, divisor);
860 * The coefficient of ~x_i is going to be -a_i, which after division is going to be -a_i/divisor; and after MIR,
861 * it becomes CEIL(-a_i / divisor) if f(-a_i/divisor) >= f(lhs) or FLOOR(-a_i / divisor)+f(-a_i/divisor)/f(lhs) otherwise.
862 * Complementing this again (to go back to x_i) the new coefficient of x_i is going to be -CEIL(-a_i / divisor)
865 * So we keep to lhs deltas, one for complementing in the original space, and another for complementing after we do C-G
867 * On the other hand, if a_k < 0 (so this reason constraint fixes x_k to 0), then we complement x_k (so modify the lhs by -a_k)
868 * and then we are in the previous case. However, at the end, we need to complement back, which means that we modify the lhs by -1
888 * In a second loop set the new coefficients for the other variables and compute the lhs delta after complementation */
904 if( (coef > 0.0 && (SCIPgetVarUbAtIndex(set->scip, currentvar, currbdchgidx, TRUE) > 0.5 && fixsides[varidx] != 1) ) ||
905 (coef < 0.0 && (SCIPgetVarLbAtIndex(set->scip, currentvar, currbdchgidx, TRUE) > 0.5 || fixsides[varidx] == -1)))
917 SCIPsetDebugMsgPrint(set, "skip MIR because the fractionality of the lhs %f is not in [%f,%f]\n", fraclhs, MINFRAC, MAXFRAC);
937 if( (coef > 0.0 && (SCIPgetVarUbAtIndex(set->scip, currentvar, currbdchgidx, TRUE) > 0.5 && fixsides[varidx] != 1) ) ||
938 (coef < 0.0 && (SCIPgetVarLbAtIndex(set->scip, currentvar, currbdchgidx, TRUE) > 0.5 || fixsides[varidx] == -1)))
1086 if( (conflictrow->vals[idx] > 0 ) && (SCIPbdchginfoGetBoundtype(bdchginfo) == SCIP_BOUNDTYPE_UPPER) )
1088 else if( (conflictrow->vals[idx] < 0 ) && (SCIPbdchginfoGetBoundtype(bdchginfo) == SCIP_BOUNDTYPE_LOWER) )
1115 SCIPsetDebugMsgPrint(set, "\t -> bound change info [%d:%d<%s> %s %g] is invalid -> pop it from the queue\n",
1266 /* this is necesseary to avoid memory leaks if the number of variables in the problem changes */
1289/** calculates the slack (maxact - rhs) for a generalized resolution row given a set of bounds and coefficients */
1307 SCIPsetDebugMsgPrint(set, "Calculating slack for row at depth %d position %d \n", SCIPbdchginfoGetDepth(currbdchginfo), SCIPbdchginfoGetPos(currbdchginfo));
1355 SCIPsetDebugMsgPrint(set, "var: %s, coef: %f, bound: %f global bounds:[%.15g,%.15g], current bounds:[%.15g,%.15g] \n",
1356 SCIPvarGetName(vars[v]), coef, bound, SCIPvarGetLbGlobal(vars[v]), SCIPvarGetUbGlobal(vars[v]),
1357 SCIPgetVarLbAtIndex(set->scip, vars[v], currbdchgidx, TRUE), SCIPgetVarUbAtIndex(set->scip, vars[v],
1411 SCIPsetDebugMsgPrint(set, "Apply MIR on general constraint with LHS %f and divisor %f\n" , reasonrow->lhs, divisor);
1414 /* creating the aggregation row. There will be only a single row in this aggregation, since it is only used to
1450 fracval = SCIPgetVarUbAtIndex(set->scip, vars[idx], currbdchgidx, FALSE) - reasonrow->slack / coef;
1457 fracval = SCIPgetVarLbAtIndex(set->scip, vars[idx], currbdchgidx, FALSE) - reasonrow->slack / coef;
1466 SCIP_CALL( SCIPsetSolVal(set->scip, refsol, vars[idx], SCIPgetVarUbAtIndex(set->scip, vars[idx], currbdchgidx, FALSE)) );
1468 SCIP_CALL( SCIPsetSolVal(set->scip, refsol, vars[idx], SCIPgetVarLbAtIndex(set->scip, vars[idx], currbdchgidx, FALSE)) );
1475 SCIP_CALL( SCIPaggrRowAddCustomCons(set->scip, aggrrow, rowinds, rowvals, rownnz, rowrhs, 1.0 / divisor, 1, FALSE) );
1480 SCIP_CALL( SCIPcalcMIR(set->scip, refsol, POSTPROCESS, BOUNDSWITCH, USEVBDS, FALSE, FIXINTEGRALRHS, NULL, NULL,
1481 MINFRAC, MAXFRAC, 1.0, aggrrow, cutcoefs, &cutrhs, cutinds, &cutnnz, NULL, NULL, &cutislocal, &success) );
1575 if( SCIPsetIsEQ(set, ub, SCIPvarGetUbGlobal(vartoweaken)) && (fixsides == NULL || fixsides[idx] == 0) )
1587 if( SCIPsetIsEQ(set, lb, SCIPvarGetLbGlobal(vartoweaken)) && (fixsides == NULL || fixsides[idx] == 0) )
1682 SCIP_BDCHGIDX* inferbdchgidx /**< bound change index (time stamp of bound change), or NULL for current time */
1748 /* For a row of the form ax >= b, we can add all continuous bound changes before inferbdchgidx that reduce the slack
1750 * - a_k > 0: then add bound changes (if not already present). Uses SCIPvarGetUbchgInfo() to get the latest
1752 * - a_k < 0: then add bound changes (if not already present). Uses SCIPvarGetLbchgInfo() to get the latest
1775 (SCIPbdchginfoGetDepth(bdchginfo) == SCIPbdchgidxGetDepth(inferbdchgidx) && SCIPbdchginfoGetPos(bdchginfo) < SCIPbdchgidxGetPos(inferbdchgidx)));
1785 (SCIPbdchginfoGetDepth(bdchginfo) == SCIPbdchgidxGetDepth(inferbdchgidx) && SCIPbdchginfoGetPos(bdchginfo) < SCIPbdchgidxGetPos(inferbdchgidx)));
1816 branchdir = (boundtype == SCIP_BOUNDTYPE_LOWER ? SCIP_BRANCHDIR_UPWARDS : SCIP_BRANCHDIR_DOWNWARDS); /*lint !e641*/
1867 branchdir = (boundtype == SCIP_BOUNDTYPE_LOWER ? SCIP_BRANCHDIR_UPWARDS : SCIP_BRANCHDIR_DOWNWARDS); /*lint !e641*/
1869 SCIP_CALL( SCIPvarIncNActiveConflicts(var, blkmem, set, stat, branchdir, bound, (SCIP_Real)conflictlength) );
1928 (void) SCIPsnprintf(consname, SCIP_MAXSTRLEN, "confres_%" SCIP_LONGINT_FORMAT, conflict->nresconfconss);
1930 lhs, SCIPsetInfinity(set), FALSE, FALSE, FALSE, FALSE, TRUE, (SCIPnodeGetDepth(tree->path[conflictrow->validdepth]) > 0 ),
1933 /* try to automatically convert a linear constraint into a more specific and more specialized constraint */
1945 SCIP_CALL( updateStatistics(conflict, vars, blkmem, set, stat, conflictrow, conflictrow->validdepth) );
1948 SCIP_CALL( SCIPaddConflict(set->scip, tree->path[insertdepth], &cons, tree->path[conflictrow->validdepth], conflictrow->conflicttype, conflictrow->usescutoffbound) );
2000 SCIPsetDebugMsgPrint(set, "flushing conflict constraint at focus depth %d (id: %d, vd: %d, cd: %d, rd: %d, maxsize: %d)\n",
2001 focusdepth, conflictrow->insertdepth, conflictrow->validdepth, conflictrow->conflictdepth, conflictrow->repropdepth, maxsize);
2009 SCIPsetDebugMsgPrint(set, " \t -> conflict row is too long: %d > %d nnzs\n", conflictrow->nnz, maxsize);
2016 SCIPsetDebugMsgPrint(set, " \t -> empty conflict row with lhs %f in depth %d cuts off sub tree at depth %d\n",
2019 SCIP_CALL( SCIPnodeCutoff(tree->path[conflictrow->validdepth], set, stat, eventfilter, tree, transprob, origprob, reopt, lp, blkmem) );
2021 /* in case the conflict set contains only one bound change which is globally valid we apply that bound change
2022 * directly (except if we are in strong branching or diving - in this case a bound change would yield an unflushed LP
2025 * @note A bound change can only be applied if it is related to the active node or if is a global bound
2026 * change. Bound changes which are related to any other node cannot be handled at point due to the internal
2029 else if( !hasRelaxationOnlyVar(set, vars, conflictrow) && conflictrow->nnz == 1 && conflictrow->insertdepth == 0 && !lp->strongbranching && !lp->diving )
2056 if( boundtype == SCIP_BOUNDTYPE_LOWER && SCIPsetIsFeasGT(set, bound, SCIPvarGetUbGlobal(var)) )
2058 SCIPsetDebugMsgPrint(set, " \t -> Bound %s >= %f contradicts with the global upper bound %s <= %f\n",
2060 SCIP_CALL( SCIPnodeCutoff(tree->path[conflictrow->validdepth], set, stat, eventfilter, tree, transprob, origprob, reopt, lp, blkmem) );
2062 else if( boundtype == SCIP_BOUNDTYPE_UPPER && SCIPsetIsLT(set, bound, SCIPvarGetLbGlobal(var)) )
2064 SCIPsetDebugMsgPrint(set, " \t -> Bound %s <= %f contradicts with the global lower bound %s >= %f\n",
2066 SCIP_CALL( SCIPnodeCutoff(tree->path[conflictrow->validdepth], set, stat, eventfilter, tree, transprob, origprob, reopt, lp, blkmem) );
2072 SCIP_CALL( SCIPnodeAddBoundchg(tree->path[conflictrow->validdepth], blkmem, set, stat, transprob, origprob, tree,
2077 SCIP_CALL( updateStatistics(conflict, vars, blkmem, set, stat, conflictrow, conflictrow->validdepth) );
2086 SCIPsetDebugMsgPrint(set, " \t -> conflict row added (cdpt:%d, fdpt:%d, insert:%d, valid:%d, conf: %d, reprop: %d, len:%d):\n",
2133 SCIP_ALLOC( BMSreallocBlockMemoryArray(blkmem, &resolutionrow->inds, resolutionrow->size, nnz) );
2216 SCIPsetDebugMsgPrint(set, "Scale %f exceeds max allowed scale %f \n", scale, set->conf_maxcoefquot);
2229 SCIP_ALLOC( BMSreallocBlockMemoryArray(blkmem, &resolvedrow->inds, resolvedrow->size, newsize ) );
2258 SCIPsetDebugMsgPrint(set, "Quotient %f exceeds max allowed quotient", (resolvedrow->nnz > 0) ? fabs(largestcoef / smallestcoef) : 0.0);
2290 SCIP_CALL( ComplementedMirLhs(set, vars, rowtoreduce, fixsides, currbdchgidx, residx, coefinrow) );
2292 SCIP_CALL( MirReduction(set, blkmem, vars, nvars, rowtoreduce, currbdchginfo, residx, coefinrow) );
2358 if( strcmp(SCIPconshdlrGetName(bdchginfo->inferencedata.reason.cons->conshdlr), "knapsack") != 0 )
2365 if( strcmp(SCIPconshdlrGetName(bdchginfo->inferencedata.reason.cons->conshdlr), "knapsack") != 0 )
2387 SCIP_CALL( conflictRowAddSemiSparseData(reasonrow, blkmem, vals, inds, nnz, lhs, changesign) );
2470 SCIP_CALL( conflictRowAddSemiSparseData(conflictrow, blkmem, vals, inds, nnz, lhs, changesign) );
2496 if( isResolvableBdchg(currbdchginfo) && SCIPbdchginfoGetChgtype(currbdchginfo) == SCIP_BOUNDCHGTYPE_CONSINFER )
2521 /* it may happen that some specialized propagation took place and the real reason is not the constraint
2537 /* If the slack is greater than 0, we check that the reason actually propagated the variable we resolve.
2552 boundusedinslack = coef > 0 ? SCIPgetVarUbAtIndex(set->scip, var, currbdchgidx, TRUE) : SCIPgetVarLbAtIndex(set->scip, var, currbdchgidx, TRUE);
2554 if( !SCIPsetIsLT(set, reasonrow->slack - coef * (boundusedinslack - SCIPbdchginfoGetOldbound(currbdchginfo)), 0.0) )
2556 SCIPsetDebugMsgPrint(set, "Reason row does not propagate because of non-linear propagation \n");
2601 SCIP_CALL( conflictRowFromLpRow(set, blkmem, initialconflictrow, conflictrow, currbdchginfo) );
2607 SCIPsetDebugMsgPrint(set, "Number of nonzeros in conflict is larger than maxsize %d > %d\n", conflictrow->nnz, maxsize);
2614 SCIPsetDebugMsgPrint(set, "Conflict row is still too large after weakening %d > %d\n", conflictrow->nnz, maxsize);
2683 SCIPsetDebugMsgPrint(set, "Resolve %s without reducing the reason row \n", SCIPvarGetName(vars[residx]));
2684 SCIP_CALL( rescaleAndResolve(set, conflict, conflictrow, reasonrow, resolvedconflictrow, blkmem,
2703 SCIP_CALL( reduceReason(set, blkmem, vars, nvars, reducedreasonrow, currbdchginfo, residx, fixbounds, fixsides) );
2706 SCIPsetDebugMsgPrint(set, "Resolve %s after reducing the reason row \n", SCIPvarGetName(vars[residx]));
2707 SCIP_CALL( rescaleAndResolve(set, conflict, conflictrow, reducedreasonrow, resolvedconflictrow, blkmem,
2727 /* In the following the reducedreasonrow is the aggregation of the different reasonrows of continuous bound changes */
2728 SCIP_CALL( slackReducingContinuousBdchgQueue(conflict, vars, reducedreasonrow, SCIPbdchginfoGetIdx(currbdchginfo)) );
2757 SCIP_CALL( getReasonRow(blkmem, vars, set, continuousbdchginfo, reasonrow, varidx, fixbounds, fixsides,
2767 SCIPsetDebugMsgPrint(set, "Resolve slack-reducing continuous variable %s \n", SCIPvarGetName(vars[varidx]));
2770 SCIP_CALL( rescaleAndResolve(set, conflict, reducedreasonrow, reasonrow, resolvedconflictrow, blkmem,
2776 /* if the coefficient of the variable we are resolving changed sign, then we have a new conflict constraint */
2780 SCIPsetDebugMsgPrint(set, "The sign of the coefficient of the variable we are resolving changed \n");
2782 assert(SCIPsetIsLT(set, resolvedconflictrow->slack, 0.0) || !isBinaryConflictRow(set, vars, reducedreasonrow));
2790 SCIP_CALL( slackReducingContinuousBdchgQueue(conflict, vars, reducedreasonrow, SCIPbdchginfoGetIdx(continuousbdchginfo)) );
2796 /* after resolving the continuous variables we resolve once more if the constraint is binary */
2800 SCIP_CALL( reduceReason(set, blkmem, vars, nvars, reducedreasonrow, currbdchginfo, residx, fixbounds, fixsides) );
2802 SCIPsetDebugMsgPrint(set, "Resolve %s after reducing the reason row \n", SCIPvarGetName(vars[residx]));
2804 SCIP_CALL( rescaleAndResolve(set, conflict, conflictrow, reducedreasonrow, resolvedconflictrow, blkmem,
2847 /* If the bound change is due to constraint inference, ensure it comes from a global constraint */
2882 SCIP_CALL( updateBdchgQueue(set, vars, conflict->conflictrow, SCIPbdchginfoGetIdx(*currbdchginfo)) );
2899 SCIP_CALL( computeSlack(set, vars, conflict->conflictrow, *currbdchginfo, fixbounds, fixsides) );
2925 int* nconfvars /**< pointer to store the number of variables in generated conflict constraints */
2941 SCIP_CALL( SCIPconflictAddConflictCon(conflict, blkmem, set, stat, transprob, origprob, tree, reopt,
2954 * This function performs generalized resolution conflict analysis by iteratively aggregating the
2955 * infeasible conflict row (conflictrow) with the reason row (reasonrow) that propagated the bound change.
2956 * In each iteration, the coefficient of the resolving variable is cancelled. If the aggregation does not
2957 * yield an infeasible row, MIR reduction is applied to the reason row and the aggregation is retried,
2958 * continuing until a first unique implication point (FUIP) is reached. On success, a linear conflict
2978 int* nconfvars /**< pointer to store the number of variables in generated conflict constraints */
3051 SCIPsetDebugMsgPrint(set, "Conflict analysis not applicable since no resolvable bounds exist \n");
3069 SCIP_CALL( getConflictRow(conflict, blkmem, set, transprob, initialconflictrow, bdchginfo, maxsize, &successgetconflict) );
3073 SCIPsetDebugMsgPrint(set, "Conflict analysis not applicable since no conflict row could be created \n");
3077 /* before we resolve any bound change the resolved conflict row is the same as the conflict row */
3094 conflictrow->coefquotient = getQuotLargestSmallestCoef(set, conflictrow->inds, conflictrow->vals, conflictrow->nnz);
3170 SCIP_CALL( getReasonRow(blkmem, vars, set, bdchginfo, conflict->reasonrow, residx, fixbounds, fixsides,
3184 SCIPsetDebugMsgPrint(set, " Applying resolution with resolving variable <%s>\n", SCIPvarGetName(vartoresolve));
3185 SCIP_CALL( executeResolutionStep(conflict, set, vars, blkmem, bdchginfo, residx, maxsize, fixbounds, fixsides, &successresolution ) );
3246 SCIPsetDebugMsgPrint(set, "Tightened %d coefficients in the resolved constraint, old slack %f, new slack %f \n", nchgcoefs, previousslack, conflictrow->slack);
3247 assert(SCIPsetIsLE(set, conflictrow->slack, previousslack + EPS) || SCIPsetIsRelLE(set, conflictrow->slack, previousslack));
3322 nconstoadd = (set->conf_resfuiplevels > 0) ? MIN(set->conf_resfuiplevels, conflict->nconflictrows) : conflict->nconflictrows;
3324 SCIP_CALL( addConflictRows(conflict, blkmem, set, stat, transprob, origprob, tree, reopt, lp, branchcand, eventqueue,
3333/** analyzes conflicting bound changes that were added with calls to SCIPconflictAddBound(), and on success,
3371 SCIPsetDebugMsgPrint(set, "Starting resolution based conflict analysis after infeasible propagation in depth %d\n",
3383 SCIP_CALL( conflictAnalyzeResolution(conflict, blkmem, set, stat, transprob, origprob, tree, reopt, lp, branchcand, eventqueue,
3406 SCIPsetDebugMsgPrint(set, "resolution based conflict analysis added %d constraints \n \n", nconss);
internal methods for clocks and timing issues
internal methods for conflict analysis
static void conflictRowRemoveZeroVars(SCIP_CONFLICTROW *row, SCIP_SET *set)
Definition: conflict_resolution.c:803
static SCIP_RETCODE conflictEnsureConflictRowsMem(SCIP_CONFLICT *conflict, SCIP_SET *set, int num)
Definition: conflict_resolution.c:184
static SCIP_Real getQuotLargestSmallestCoef(SCIP_SET *set, int *inds, SCIP_Real *vals, int nnz)
Definition: conflict_resolution.c:1647
static void conflictRowClear(BMS_BLKMEM *blkmem, SCIP_CONFLICTROW *row, int nvars)
Definition: conflict_resolution.c:1257
static SCIP_RETCODE updateStatistics(SCIP_CONFLICT *conflict, SCIP_VAR **vars, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_CONFLICTROW *conflictrow, int insertdepth)
Definition: conflict_resolution.c:1826
static void weakenConflictRow(SCIP_CONFLICTROW *row, SCIP_SET *set, SCIP_VAR **vars, SCIP_BDCHGIDX *currbdchgidx, int *fixsides)
Definition: conflict_resolution.c:1543
static void weakenVarConflictRow(SCIP_CONFLICTROW *row, SCIP_SET *set, SCIP_VAR *var, int pos)
Definition: conflict_resolution.c:1511
static SCIP_RETCODE conflictInsertConflictRow(SCIP_CONFLICT *conflict, SCIP_SET *set, SCIP_CONFLICTROW **conflictrow)
Definition: conflict_resolution.c:208
static SCIP_Bool isBdchgConflictRelevant(SCIP_CONFLICT *conflict, SCIP_BDCHGINFO *bdchginfo, int initial)
Definition: conflict_resolution.c:1064
void SCIPconflictRowFree(SCIP_CONFLICTROW **row, BMS_BLKMEM *blkmem)
Definition: conflict_resolution.c:1220
static void linearCombRows(SCIP_SET *set, SCIP_CONFLICTROW *row1, SCIP_CONFLICTROW *row2, SCIP_Real scale)
Definition: conflict_resolution.c:975
static SCIP_Real computeScaleReason(SCIP_SET *set, SCIP_CONFLICTROW *conflictrow, SCIP_CONFLICTROW *reasonrow, int residx)
Definition: conflict_resolution.c:2165
SCIP_RETCODE SCIPconflictAddConflictCon(SCIP_CONFLICT *conflict, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, SCIP_CONFLICTROW *conflictrow, SCIP_Bool *success)
Definition: conflict_resolution.c:1958
static int conflictCalcResMaxsize(SCIP_SET *set, SCIP_PROB *prob)
Definition: conflict_resolution.c:487
static SCIP_RETCODE updateBdchgQueue(SCIP_SET *set, SCIP_VAR **vars, SCIP_CONFLICTROW *conflictrow, SCIP_BDCHGIDX *inferbdchgidx)
Definition: conflict_resolution.c:1678
static SCIP_Bool isResolvableBdchg(SCIP_BDCHGINFO *bdchginfo)
Definition: conflict_resolution.c:1012
static SCIP_Bool existsResolvablebdchginfo(SCIP_CONFLICT *conflict)
Definition: conflict_resolution.c:1041
static SCIP_RETCODE weakenContinuousVarsConflictRow(SCIP_CONFLICTROW *row, SCIP_SET *set, SCIP_VAR **vars, int residx)
Definition: conflict_resolution.c:1600
SCIP_RETCODE conflictAnalyzeResolution(SCIP_CONFLICT *conflict, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, SCIP_ROW *initialconflictrow, int validdepth, int *nconss, int *nconfvars)
Definition: conflict_resolution.c:2961
SCIP_Longint SCIPconflictGetNResConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict_resolution.c:233
static void conflictRowRemoveZeroVar(SCIP_CONFLICTROW *row, SCIP_SET *set, int pos)
Definition: conflict_resolution.c:782
static SCIP_RETCODE conflictRowReplace(SCIP_CONFLICTROW *targetrow, BMS_BLKMEM *blkmem, SCIP_CONFLICTROW *sourcerow)
Definition: conflict_resolution.c:140
static SCIP_BDCHGINFO * conflictFirstCand(SCIP_SET *set, SCIP_CONFLICT *conflict, int initial)
Definition: conflict_resolution.c:1095
SCIP_Longint SCIPconflictGetNResLargeCoefs(SCIP_CONFLICT *conflict)
Definition: conflict_resolution.c:254
static SCIP_RETCODE addConflictRows(SCIP_CONFLICT *conflict, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, int nconstoadd, int *nconss, int *nconfvars)
Definition: conflict_resolution.c:2909
static SCIP_RETCODE MirReduction(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **vars, int nvars, SCIP_CONFLICTROW *reasonrow, SCIP_BDCHGINFO *currbdchginfo, int varidx, SCIP_Real divisor)
Definition: conflict_resolution.c:1375
static SCIP_RETCODE getReasonRow(BMS_BLKMEM *blkmem, SCIP_VAR **vars, SCIP_SET *set, SCIP_BDCHGINFO *currbdchginfo, SCIP_CONFLICTROW *reasonrow, int residx, SCIP_Real *fixbounds, int *fixsides, SCIP_Bool *success)
Definition: conflict_resolution.c:2479
static SCIP_RETCODE conflictRowFromLpRow(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_ROW *row, SCIP_CONFLICTROW *conflictrow, SCIP_BDCHGINFO *bdchginfo)
Definition: conflict_resolution.c:2396
SCIP_Longint SCIPconflictGetNResSuccess(SCIP_CONFLICT *conflict)
Definition: conflict_resolution.c:243
SCIP_Longint SCIPconflictGetNResCalls(SCIP_CONFLICT *conflict)
Definition: conflict_resolution.c:274
static SCIP_Bool hasRelaxationOnlyVar(SCIP_SET *set, SCIP_VAR **vars, SCIP_CONFLICTROW *row)
Definition: conflict_resolution.c:728
static SCIP_RETCODE conflictRowAddSemiSparseData(SCIP_CONFLICTROW *resolutionrow, BMS_BLKMEM *blkmem, SCIP_Real *vals, int *inds, int nnz, SCIP_Real lhs, SCIP_Bool reverse)
Definition: conflict_resolution.c:2102
SCIP_RETCODE SCIPconflictInitRows(SCIP_CONFLICT *conflict, BMS_BLKMEM *blkmem)
Definition: conflict_resolution.c:1202
static SCIP_RETCODE getConflictRow(SCIP_CONFLICT *conflict, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_PROB *prob, SCIP_ROW *initialconflictrow, SCIP_BDCHGINFO *currbdchginfo, int maxsize, SCIP_Bool *success)
Definition: conflict_resolution.c:2573
static SCIP_RETCODE ComplementedMirLhs(SCIP_SET *set, SCIP_VAR **vars, SCIP_CONFLICTROW *reasonrow, int *fixsides, SCIP_BDCHGIDX *currbdchgidx, int idxreason, SCIP_Real divisor)
Definition: conflict_resolution.c:821
static SCIP_RETCODE slackReducingContinuousBdchgQueue(SCIP_CONFLICT *conflict, SCIP_VAR **vars, SCIP_CONFLICTROW *row, SCIP_BDCHGIDX *inferbdchgidx)
Definition: conflict_resolution.c:1730
static void freeConflictResources(SCIP_CONFLICT *conflict, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_Real *fixbounds, int *fixsides)
Definition: conflict_resolution.c:1237
static SCIP_RETCODE incVSIDS(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_BOUNDTYPE boundtype, SCIP_Real value, SCIP_Real weight)
Definition: conflict_resolution.c:1795
static SCIP_RETCODE reduceReason(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **vars, int nvars, SCIP_CONFLICTROW *rowtoreduce, SCIP_BDCHGINFO *currbdchginfo, int residx, SCIP_Real *fixbounds, int *fixsides)
Definition: conflict_resolution.c:2270
SCIP_Longint SCIPconflictGetNResLongConflicts(SCIP_CONFLICT *conflict)
Definition: conflict_resolution.c:264
SCIP_Bool SCIPconflictResolutionApplicable(SCIP_SET *set)
Definition: conflict_resolution.c:1161
static SCIP_Bool isBinaryConflictRow(SCIP_SET *set, SCIP_VAR **vars, SCIP_CONFLICTROW *row)
Definition: conflict_resolution.c:755
static SCIP_RETCODE conflictRowCopy(SCIP_CONFLICTROW **targetrow, BMS_BLKMEM *blkmem, SCIP_CONFLICTROW *sourcerow)
Definition: conflict_resolution.c:98
static SCIP_BDCHGINFO * conflictRemoveCand(SCIP_CONFLICT *conflict, int initial)
Definition: conflict_resolution.c:1141
static SCIP_RETCODE computeSlack(SCIP_SET *set, SCIP_VAR **vars, SCIP_CONFLICTROW *row, SCIP_BDCHGINFO *currbdchginfo, SCIP_Real *fixbounds, int *fixsides)
Definition: conflict_resolution.c:1291
static SCIP_RETCODE tightenCoefs(SCIP_SET *set, SCIP_VAR **vars, SCIP_Bool localbounds, SCIP_Real *rowcoefs, int *rowinds, int *rownnz, SCIP_Real *rowlhs, int *nchgcoefs, SCIP_Bool *redundant)
Definition: conflict_resolution.c:504
SCIP_RETCODE SCIPconflictAnalyzeResolution(SCIP_CONFLICT *conflict, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, SCIP_ROW *initialconflictrow, int validdepth, SCIP_Bool *success)
Definition: conflict_resolution.c:3336
static SCIP_RETCODE markBdchgAsFixed(SCIP_CONFLICT *conflict, SCIP_SET *set, SCIP_VAR **vars, SCIP_BDCHGINFO **currbdchginfo, int *currbdchgdepth, int nressteps, SCIP_Real *fixbounds, int *fixsides, SCIP_Bool *success)
Definition: conflict_resolution.c:2820
static SCIP_RETCODE executeResolutionStep(SCIP_CONFLICT *conflict, SCIP_SET *set, SCIP_VAR **vars, BMS_BLKMEM *blkmem, SCIP_BDCHGINFO *currbdchginfo, int residx, int maxsize, SCIP_Real *fixbounds, int *fixsides, SCIP_Bool *successresolution)
Definition: conflict_resolution.c:2650
static SCIP_RETCODE createAndAddConflictCon(SCIP_CONFLICT *conflict, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR **vars, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_CLIQUETABLE *cliquetable, SCIP_CONFLICTROW *conflictrow, int insertdepth, SCIP_Bool *success)
Definition: conflict_resolution.c:1885
static SCIP_RETCODE rescaleAndResolve(SCIP_SET *set, SCIP_CONFLICT *conflict, SCIP_CONFLICTROW *row1, SCIP_CONFLICTROW *row2, SCIP_CONFLICTROW *resolvedrow, BMS_BLKMEM *blkmem, int residx, SCIP_Bool *success)
Definition: conflict_resolution.c:2188
static SCIP_RETCODE reasonRowFromLpRow(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_ROW *row, SCIP_CONFLICTROW *reasonrow, SCIP_BDCHGINFO *bdchginfo)
Definition: conflict_resolution.c:2306
static SCIP_RETCODE conflictRowCreate(SCIP_CONFLICTROW **row, BMS_BLKMEM *blkmem)
Definition: conflict_resolution.c:1174
Methods for generalized resolution conflict analysis.
internal methods for constraints and constraint handlers
Constraint handler for linear constraints in their most general form, .
methods for the aggregation rows
SCIP_RETCODE SCIPupgradeConsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **upgdcons)
Definition: cons_linear.c:18652
SCIP_RETCODE SCIPcreateConsLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
Definition: cons_linear.c:17755
SCIP_RETCODE SCIPaddConflict(SCIP *scip, SCIP_NODE *node, SCIP_CONS **cons, SCIP_NODE *validnode, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
Definition: scip_prob.c:3806
SCIP_RETCODE SCIPpqueueInsert(SCIP_PQUEUE *pqueue, void *elem)
Definition: misc.c:1396
SCIP_RETCODE SCIPaddConflictLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
Definition: scip_conflict.c:365
SCIP_RETCODE SCIPaddConflictUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
Definition: scip_conflict.c:432
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition: scip_cons.c:1173
SCIP_RETCODE SCIPcalcMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Bool postprocess, SCIP_Real boundswitch, int vartypeusevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real scale, SCIP_AGGRROW *aggrrow, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, SCIP_Real *cutefficacy, int *cutrank, SCIP_Bool *cutislocal, SCIP_Bool *success)
Definition: cuts.c:7923
SCIP_RETCODE SCIPaggrRowCreate(SCIP *scip, SCIP_AGGRROW **aggrrow)
Definition: cuts.c:2668
SCIP_RETCODE SCIPaggrRowAddCustomCons(SCIP *scip, SCIP_AGGRROW *aggrrow, int *inds, SCIP_Real *vals, int len, SCIP_Real rhs, SCIP_Real weight, int rank, SCIP_Bool local)
Definition: cuts.c:3143
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip_sol.c:516
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
Definition: scip_sol.c:1571
SCIP_Bool SCIPbdchginfoIsRedundant(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:25057
SCIP_BDCHGIDX * SCIPbdchginfoGetIdx(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:24979
SCIP_BDCHGINFO * SCIPvarGetLbchgInfo(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: var.c:22629
SCIP_PROP * SCIPbdchginfoGetInferProp(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:25013
SCIP_CONS * SCIPbdchginfoGetInferCons(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:25001
SCIP_Real SCIPgetVarUbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: scip_var.c:2872
SCIP_Real SCIPbdchginfoGetOldbound(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:24909
SCIP_BOUNDCHGTYPE SCIPbdchginfoGetChgtype(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:24939
SCIP_BDCHGINFO * SCIPvarGetUbchgInfo(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: var.c:22685
SCIP_Real SCIPgetVarLbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: scip_var.c:2736
SCIP_BOUNDTYPE SCIPbdchginfoGetBoundtype(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:24949
SCIP_Real SCIPbdchginfoGetNewbound(SCIP_BDCHGINFO *bdchginfo)
Definition: var.c:24919
void SCIPsortDownRealInt(SCIP_Real *realarray, int *intarray, int len)
void SCIPhistoryIncNActiveConflicts(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, SCIP_Real length)
Definition: history.c:674
void SCIPhistoryIncVSIDS(SCIP_HISTORY *history, SCIP_BRANCHDIR dir, SCIP_Real weight)
Definition: history.c:635
internal methods for branching and inference history
memory allocation routines
#define BMSfreeBlockMemoryArrayNull(mem, ptr, num)
Definition: memory.h:468
#define BMSreallocBlockMemoryArray(mem, ptr, oldnum, newnum)
Definition: memory.h:458
SCIP_RETCODE SCIPconsCreateRow(SCIP *scip, SCIP_CONS *cons, SCIP_ROW **row)
Definition: misc_linear.c:599
internal methods for storing and manipulating the main problem
internal methods for propagators
public methods for conflict analysis handlers
public methods for managing constraints
public methods for LP management
public methods for message output
public data structures and miscellaneous methods
public methods for problem variables
public methods for conflict handler plugins and conflict analysis
public methods for constraint handler plugins and constraints
public methods for memory management
public methods for global and local (sub)problems
public methods for solutions
public methods for SCIP variables
SCIP_Bool SCIPsetIsGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6617
SCIP_Bool SCIPsetIsFeasGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:7017
SCIP_Bool SCIPsetIsLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6577
SCIP_Bool SCIPsetIsEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6537
SCIP_Bool SCIPsetIsLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6557
SCIP_Bool SCIPsetIsRelGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:7559
SCIP_Bool SCIPsetIsGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6597
SCIP_Bool SCIPsetIsRelLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:7511
internal methods for global SCIP settings
internal methods for storing primal CIP solutions
Definition: struct_cuts.h:41
Definition: struct_var.h:114
Definition: struct_var.h:121
Definition: struct_branch.h:47
Definition: struct_implics.h:98
Definition: struct_lp.h:138
Definition: struct_conflict.h:105
Definition: struct_conflict.h:137
SCIP_CONFLICTROW * resolvedconflictrow
Definition: struct_conflict.h:216
SCIP_PQUEUE * continuousbdchgqueue
Definition: struct_conflict.h:212
Definition: struct_cons.h:47
Definition: struct_cons.h:128
Definition: struct_event.h:202
Definition: struct_event.h:237
Definition: struct_lp.h:275
Definition: struct_misc.h:79
Definition: struct_prob.h:49
Definition: struct_prop.h:47
Definition: struct_reopt.h:140
Definition: struct_lp.h:205
Definition: struct_set.h:75
Definition: struct_sol.h:74
Definition: struct_stat.h:62
Definition: struct_tree.h:187
Definition: struct_var.h:262
datastructures for conflict analysis
data structures for LP management
datastructures for storing and manipulating the main problem
datastructures for global SCIP settings
datastructures for problem statistics
Definition: heur_padm.c:135
SCIP_RETCODE SCIPnodeAddBoundchg(SCIP_NODE *node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var, SCIP_Real newbound, SCIP_BOUNDTYPE boundtype, SCIP_Bool probingchange)
Definition: tree.c:2539
SCIP_RETCODE SCIPnodeCutoff(SCIP_NODE *node, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTFILTER *eventfilter, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_REOPT *reopt, SCIP_LP *lp, BMS_BLKMEM *blkmem)
Definition: tree.c:1259
internal methods for branch and bound tree
SCIP_RETCODE SCIPvarIncVSIDS(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_BRANCHDIR dir, SCIP_Real value, SCIP_Real weight)
Definition: var.c:21103
SCIP_RETCODE SCIPvarIncNActiveConflicts(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_BRANCHDIR dir, SCIP_Real value, SCIP_Real length)
Definition: var.c:21239
internal methods for problem variables