All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
conflict.c
Go to the documentation of this file.
27 * Given is a set of bound changes that are not allowed being applied simultaneously, because they
28 * render the current node infeasible (e.g. because a single constraint is infeasible in the these
29 * bounds, or because the LP relaxation is infeasible). The goal is to deduce a clause on variables
30 * -- a conflict clause -- representing the "reason" for this conflict, i.e., the branching decisions
31 * or the deductions (applied e.g. in domain propagation) that lead to the conflict. This clause can
34 * conflict was detected by a locally valid constraint. In this case, the resulting conflict clause
113 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
143 #define CONFLICTSETSCORE(conflictset) (-(conflictset)->nbdchginfos - 100*(conflictset)->repropdepth \
158 static SCIP_BDCHGINFO* confgraphcurrentbdchginfo = NULL; /**< currently resolved bound change */
173 SCIPgmlWriteNode(confgraphfile, (unsigned int)(size_t)idptr, label, nodetype, fillcolor, bordercolor);
187 SCIPgmlWriteArc(confgraphfile, (unsigned int)(size_t)source, (unsigned int)(size_t)target, NULL, color);
189 SCIPgmlWriteEdge(confgraphfile, (unsigned int)(size_t)source, (unsigned int)(size_t)target, NULL, color);
193 /** creates a file to output the current conflict graph into; adds the conflict vertex to the graph */
243 /** adds a bound change node to the conflict graph and links it to the currently resolved bound change */
281 (void) SCIPsnprintf(label, SCIP_MAXSTRLEN, "%s %s %g\n[%s:%d]", SCIPvarGetName(SCIPbdchginfoGetVar(bdchginfo)),
318 (void) SCIPsnprintf(label, SCIP_MAXSTRLEN, "conf %d (%d)", confgraphnconflictsets, conflictset->validdepth);
319 confgraphWriteNode((void*)(size_t)confgraphnconflictsets, label, "rectangle", "#ff00ff", "#000000");
321 confgraphWriteEdge((void*)(size_t)confgraphnconflictsets, conflictset->bdchginfos[i], "#ff00ff");
341 return strcmp(SCIPconflicthdlrGetName((SCIP_CONFLICTHDLR*)elem1), SCIPconflicthdlrGetName((SCIP_CONFLICTHDLR*)elem2));
354 SCIP_CALL( SCIPsetConflicthdlrPriority(scip, (SCIP_CONFLICTHDLR*)paramdata, SCIPparamGetInt(param)) ); /*lint !e740*/
371 SCIPdebugMessage("including conflict handler %s in subscip %p\n", SCIPconflicthdlrGetName(conflicthdlr), (void*)set->scip);
387 SCIP_DECL_CONFLICTCOPY((*conflictcopy)), /**< copy method of conflict handler or NULL if you don't want to copy your plugin into sub-SCIPs */
391 SCIP_DECL_CONFLICTINITSOL((*conflictinitsol)),/**< solving process initialization method of conflict handler */
392 SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol)),/**< solving process deinitialization method of conflict handler */
581 SCIP_Real* relaxedbds, /**< array with relaxed bounds which are efficient to create a valid conflict */
599 SCIP_CALL( conflicthdlr->conflictexec(set->scip, conflicthdlr, node, validnode, bdchginfos, relaxedbds, nbdchginfos,
600 set->conf_seperate, (SCIPnodeGetDepth(validnode) > 0), set->conf_dynamic, set->conf_removable, resolved, result) );
686 SCIP_DECL_CONFLICTINITSOL((*conflictinitsol))/**< solving process initialization method of conflict handler */
697 SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol))/**< solving process deinitialization method of conflict handler */
839 /** resizes the array of the temporary bound change informations to be able to store at least num bound change entries */
863 /** creates a temporary bound change information object that is destroyed after the conflict sets are flushed */
960 BMScopyMemoryArray((*targetconflictset)->bdchginfos, sourceconflictset->bdchginfos, sourceconflictset->nbdchginfos);
961 BMScopyMemoryArray((*targetconflictset)->relaxedbds, sourceconflictset->relaxedbds, sourceconflictset->nbdchginfos);
962 BMScopyMemoryArray((*targetconflictset)->sortvals, sourceconflictset->sortvals, sourceconflictset->nbdchginfos);
983 BMSfreeBlockMemoryArrayNull(blkmem, &(*conflictset)->bdchginfos, (*conflictset)->bdchginfossize);
984 BMSfreeBlockMemoryArrayNull(blkmem, &(*conflictset)->relaxedbds, (*conflictset)->bdchginfossize);
989 /** resizes the arrays of the conflict set to be able to store at least num bound change entries */
1006 SCIP_ALLOC( BMSreallocBlockMemoryArray(blkmem, &conflictset->bdchginfos, conflictset->bdchginfossize, newsize) );
1007 SCIP_ALLOC( BMSreallocBlockMemoryArray(blkmem, &conflictset->relaxedbds, conflictset->bdchginfossize, newsize) );
1008 SCIP_ALLOC( BMSreallocBlockMemoryArray(blkmem, &conflictset->sortvals, conflictset->bdchginfossize, newsize) );
1027 /** check if the bound change info (which is the potential next candidate which is queued) is valid for the current
1028 * conflict analysis; a bound change info can get invalid if after this one was added to the queue, a weaker bound
1029 * change was added to the queue (due the bound widening idea) which immediately makes this bound change redundant; due
1030 * to the priority we did not removed that bound change info since that cost O(log(n)); hence we have to skip/ignore it
1033 * The following situations can occur before for example the bound change info (x >= 3) is potentially popped from the
1036 * Postcondition: the reason why (x >= 3) was queued is that at this time point no lower bound of x was involved yet in
1037 * the current conflict or the lower bound which was involved until then was stronger, e.g., (x >= 2).
1039 * 1) during the time until (x >= 3) gets potentially popped no weaker lower bound was added to the queue, in that case
1040 * the conflictlbcount is valid and conflictlb is 3; that is (var->conflictlbcount == conflict->count &&
1043 * 2) a weaker bound change info gets queued (e.g., x >= 4); this bound change is popped before (x >= 3) since it has
1044 * higher priority (which is the time stamp of the bound change info and (x >= 4) has to be done after (x >= 3)
1047 * a) if (x >= 4) is popped and added to the conflict set the conflictlbcount is still valid and conflictlb is at
1048 * most 4; that is (var->conflictlbcount == conflict->count && var->conflictlb >= 4); it follows that any bound
1051 * b) if (x >= 4) is popped and resolved without introducing a new lower bound on x until (x >= 3) is a potentially
1055 * c) if (x >= 4) is popped and resolved and a new lower bound on x (e.g., x >= 2) is introduced until (x >= 3) is
1056 * pooped, the conflictlbcount indicates that bound change is currently present; that is (var->conflictlbcount ==
1057 * conflict->count); however the (x >= 3) only has be explained if conflictlb matches that one; that is
1073 /* the bound change info of a binary (domained) variable can never be invalid since the concepts of relaxed bounds
1079 /* check if the bdchginfo is invaild since a tight/weaker bound change was already explained */
1082 if( var->conflictlbcount != conflict->count || var->conflictlb != SCIPbdchginfoGetNewbound(bdchginfo) ) /*lint !e777*/
1092 if( var->conflictubcount != conflict->count || var->conflictub != SCIPbdchginfoGetNewbound(bdchginfo) ) /*lint !e777*/
1125 SCIP_CALL( conflictsetEnsureBdchginfosMem(conflictset, blkmem, set, conflictset->nbdchginfos+1) );
1127 /* insert the new bound change in the arrays sorted by increasing variable index and by bound type */
1136 sortval = 2*idx + (int)boundtype; /* first sorting criteria: variable index, second criteria: boundtype */
1138 /* insert new element into the sorted arrays; if an element exits with the same value insert the new element afterwards
1140 * @todo check if it better (faster) to first search for the position O(log n) and compare the sort values and if
1144 SCIPsortedvecInsertIntPtrReal(sortvals, (void**)bdchginfos, relaxedbds, sortval, (void*)bdchginfo, relaxedbd, &conflictset->nbdchginfos, &pos);
1154 SCIPsortedvecDelPosIntPtrReal(sortvals, (void**)bdchginfos, relaxedbds, pos-1, &conflictset->nbdchginfos);
1159 SCIPsortedvecDelPosIntPtrReal(sortvals, (void**)bdchginfos, relaxedbds, pos, &conflictset->nbdchginfos);
1163 /* both bound change are equivalent; hence, keep the worse relaxed bound and remove one of them */
1164 relaxedbds[pos-1] = boundtype == SCIP_BOUNDTYPE_LOWER ? MAX(relaxedbds[pos-1], relaxedbd) : MIN(relaxedbds[pos-1], relaxedbd);
1165 SCIPsortedvecDelPosIntPtrReal(sortvals, (void**)bdchginfos, relaxedbds, pos, &conflictset->nbdchginfos);
1213 SCIP_CALL( conflictsetAddBound(conflictset, blkmem, set, bdchginfo, SCIPbdchginfoGetRelaxedBound(bdchginfo)) );
1217 SCIPdebugMessage("-> bound change info [%d:<%s> %s %g] is invaild -> ignore it\n", SCIPbdchginfoGetDepth(bdchginfo),
1229 SCIP_CALL( conflictsetEnsureBdchginfosMem(conflictset, blkmem, set, confnbdchginfos + nbdchginfos) );
1254 sortval = 2*idx + (int)boundtype; /* first sorting criteria: variable index, second criteria: boundtype */
1264 SCIPdebugMessage("-> bound change info [%d:<%s> %s %g] is invaild -> ignore it\n", SCIPbdchginfoGetDepth(bdchginfo),
1303 /* both bound change are equivalent; hence, keep the worse relaxed bound and remove one of them */
1304 confrelaxedbds[k] = (confsortvals[k] % 2 == 0) ? MAX(confrelaxedbds[k], confrelaxedbds[i]) : MIN(confrelaxedbds[k], confrelaxedbds[i]);
1326 /* the number of bound change infos cannot be decreased, it would mean that the conflict set was not merged
1374 * - if the branching rule operates on variables only, and if all branching variables up to a certain
1375 * depth level are member of the conflict, the conflict constraint can only be violated in the subtree
1376 * of the node at that depth, because in all other nodes, at least one of these branching variables
1378 * - if there is at least one branching variable in a node, we assume, that this branching was performed
1379 * on variables, and that the siblings of this node are disjunct w.r.t. the branching variables' fixings
1413 depth = MIN(depth, currentdepth+1); /* put diving/probing/strong branching changes in this depth level */
1418 while( conflictset->insertdepth < currentdepth && branchingincluded[conflictset->insertdepth+1] )
1424 assert(conflictset->validdepth <= conflictset->insertdepth && conflictset->insertdepth <= currentdepth);
1446 /* check, if all bound changes in conflictset2 are also present at least as tight in conflictset1;
1447 * we can stop immediately, if more bound changes are remaining in conflictset2 than in conflictset1
1449 for( i1 = 0, i2 = 0; i2 < conflictset2->nbdchginfos && conflictset1->nbdchginfos - i1 >= conflictset2->nbdchginfos - i2;
1516 /** inserts conflict set into sorted conflictsets array and deletes the conflict set pointer */
1540 /* if we apply repropagations, the conflict set should be inserted at most at its repropdepth */
1548 (*conflictset)->validdepth, (*conflictset)->insertdepth, (*conflictset)->conflictdepth, (*conflictset)->repropdepth);
1555 for( pos = 0; pos < conflict->nconflictsets && score < conflict->conflictsetscores[pos]; ++pos )
1566 /**@todo like in sepastore.c: calculate overlap between conflictsets -> large overlap reduces score */
1652 branchdir = (boundtype == SCIP_BOUNDTYPE_LOWER ? SCIP_BRANCHDIR_UPWARDS : SCIP_BRANCHDIR_DOWNWARDS); /*lint !e641*/
1695 branchdir = (boundtype == SCIP_BOUNDTYPE_LOWER ? SCIP_BRANCHDIR_UPWARDS : SCIP_BRANCHDIR_DOWNWARDS); /*lint !e641*/
1697 SCIP_CALL( SCIPvarIncNActiveConflicts(var, blkmem, set, stat, branchdir, bound, (SCIP_Real)conflictlength) );
1712 /** check conflict set for redundancy, other conflicts in the same conflict analysis could have led to global reductions
1743 assert(SCIPbdchginfoGetBoundtype(bdchginfos[v]) == SCIP_BOUNDTYPE_LOWER || SCIPsetIsGE(set, relaxedbds[v], SCIPbdchginfoGetNewbound(bdchginfos[v])));
1744 assert(SCIPbdchginfoGetBoundtype(bdchginfos[v]) == SCIP_BOUNDTYPE_UPPER || SCIPsetIsLE(set, relaxedbds[v], SCIPbdchginfoGetNewbound(bdchginfos[v])));
1787 SCIP_Bool* redundant /**< did we found a gloabl reduction on a conflict set variable, which makes this conflict redundant */
1816 /* due to other conflict in the same conflict analysis, this conflict set might have become redundant */
1837 /* due to multiple conflict sets for one conflict, it can happen, that we already have redundant information in the
1866 SCIPdebugMessage("trivially removed %d redundant of %d variables from conflictset (%p)\n", ntrivialredvars, conflictset->nbdchginfos, (void*)conflictset);
1871 if( conflictset->nbdchginfos > set->conf_maxvarsdetectimpliedbounds || conflictset->nbdchginfos == 1 )
1895 assert(SCIPbdchginfoGetBoundtype(bdchginfos[v]) == SCIP_BOUNDTYPE_LOWER || SCIPsetIsGE(set, relaxedbds[v], SCIPbdchginfoGetNewbound(bdchginfos[v])));
1896 assert(SCIPbdchginfoGetBoundtype(bdchginfos[v]) == SCIP_BOUNDTYPE_UPPER || SCIPsetIsLE(set, relaxedbds[v], SCIPbdchginfoGetNewbound(bdchginfos[v])));
1898 /* for continuous variables, we can only use the relaxed version of the bounds negation: !(x <= u) -> x >= u */
1905 nbinimpls[v] = SCIPvarGetNBinImpls(var, TRUE) + (SCIP_Longint)SCIPvarGetNCliques(var, TRUE) * 2;
1911 nbinimpls[v] = SCIPvarGetNBinImpls(var, FALSE) + (SCIP_Longint)SCIPvarGetNCliques(var, FALSE) * 2;
1924 /* the literal is satisfied in global bounds (may happen due to weak "negation" of continuous variables)
1939 if( v == nbdchginfos && ((!set->conf_fullshortenconflict && nzeroimpls < 2) || (set->conf_fullshortenconflict && nzeroimpls < nbdchginfos)) )
1947 SCIPdebugMessage("checking for global reductions and redundant conflict variables(in %s) on conflict:\n", SCIPprobGetName(prob));
1951 SCIPdebugPrintf("%s %s %g", SCIPvarGetName(SCIPbdchginfoGetVar(bdchginfos[v])), (!boundtypes[v]) ? ">=" : "<=", bounds[v]);
1964 SCIP_CALL( SCIPshrinkDisjunctiveVarSet(set->scip, vars, bounds, boundtypes, redundants, nbdchginfos, nredvars, nbdchgs, redundant, set->conf_fullshortenconflict) );
1969 SCIPdebugMessage("conflict set (%p) led to %d global bound reductions\n", (void*) conflictset, *nbdchgs);
1976 SCIPdebugMessage("conflict set (%p) is redundant because at least one global reduction, fulfills the conflict constraint\n", (void*)conflictset);
1993 SCIPdebugMessage("remove redundant variable <%s> from conflict set\n", SCIPvarGetName(SCIPbdchginfoGetVar(bdchginfos[v])));
2004 SCIPdebugMessage("removed %d redundant of %d variables from conflictset (%p)\n", (*nredvars), conflictset->nbdchginfos, (void*)conflictset);
2027 SCIPdebugPrintf("%s %s %g", SCIPvarGetName(SCIPbdchginfoGetVar(bdchginfos[v])), (!boundtypes[v]) ? ">=" : "<=", bounds[v]);
2082 /* try to derive global bound changes and shorten the conflictset by using implication and clique and variable bound
2096 SCIP_CALL( detectImpliedBounds(set, transprob, conflictset, &nbdchgs, &nredvars, &redundant) );
2102 SCIP_CALL( SCIPdebugCheckConflict(blkmem, set, tree->root, conflictset->bdchginfos, conflictset->relaxedbds, conflictset->nbdchginfos) ); /*lint !e506 !e774*/
2105 SCIPdebugMessage(" -> conflict set removed %d redundant variables (old nvars %d, new nvars = %d)\n", nredvars, oldnbdchginfos, conflictset->nbdchginfos);
2106 SCIPdebugMessage(" -> conflict set led to %d global bound changes %s(cdpt:%d, fdpt:%d, confdpt:%d, len:%d):\n",
2107 nbdchgs, redundant ? "(conflict became redundant) " : "", SCIPtreeGetCurrentDepth(tree), SCIPtreeGetFocusDepth(tree),
2122 /* in case the conflict set contains only one bound change which is globally valid we apply that bound change
2123 * directly (except if we are in strong branching or diving - in this case a bound change would yield an unflushed LP
2126 * @note A bound change can only be applied if it is are related to the active node or if is a global bound
2127 * change. Bound changes which are related to any other node cannot be handled at point due to the internal
2142 /* for continuous variables, we can only use the relaxed version of the bounds negation: !(x <= u) -> x >= u */
2152 SCIP_CALL( SCIPnodeAddBoundchg(tree->path[conflictset->validdepth], blkmem, set, stat, transprob, origprob, tree, lp, branchcand,
2169 tree->path[conflictset->validdepth], conflictset->bdchginfos, conflictset->relaxedbds, conflictset->nbdchginfos, *success, &result) );
2176 SCIPdebugMessage(" -> call conflict handler <%s> (prio=%d) to create conflict set with %d bounds returned result %d\n",
2177 SCIPconflicthdlrGetName(set->conflicthdlrs[h]), SCIPconflicthdlrGetPriority(set->conflicthdlrs[h]),
2185 /** adds the collected conflict constraints to the corresponding nodes; the best set->conf_maxconss conflict constraints
2186 * are added to the node of their validdepth; additionally (if not yet added, and if repropagation is activated), the
2187 * conflict constraint that triggers the earliest repropagation is added to the node of its validdepth
2223 /* calculate the maximal number of conflict sets to accept, and the maximal size of each accepted conflict set */
2234 SCIPdebugMessage("flushing %d conflict sets at focus depth %d (maxconflictsets: %d, maxsize: %d)\n",
2255 assert(conflictset->repropdepth <= currentdepth || conflictset->repropdepth == INT_MAX); /* INT_MAX for dive/probing/strong */
2256 assert(conflictset->conflictdepth <= currentdepth || conflictset->conflictdepth == INT_MAX); /* INT_MAX for dive/probing/strong */
2266 /* if no conflict bounds exist, the node and its sub tree in the conflict set's valid depth can be
2279 /* if the conflict set is too long, use the conflict set only if it decreases the repropagation depth */
2282 SCIPdebugMessage(" -> conflict set is too long: %d > %d literals\n", conflictset->nbdchginfos, maxsize);
2283 if( set->conf_keepreprop && conflictset->repropagate && conflictset->repropdepth < repropdepth )
2299 SCIPdebugMessage(" -> conflict set %d/%d added (cdpt:%d, fdpt:%d, insert:%d, valid:%d, conf:%d, reprop:%d, len:%d):\n",
2300 nconflictsetsused+1, maxconflictsets, SCIPtreeGetCurrentDepth(tree), SCIPtreeGetFocusDepth(tree),
2301 conflictset->insertdepth, conflictset->validdepth, conflictset->conflictdepth, conflictset->repropdepth,
2315 /* reactivate propagation on the first node where one of the new conflict sets trigger a deduction */
2321 /* if the conflict constraint of smallest repropagation depth was not yet added, insert it now */
2334 SCIPdebugMessage(" -> additional reprop conflict set added (cdpt:%d, fdpt:%d, insert:%d, valid:%d, conf:%d, reprop:%d, len:%d):\n",
2336 repropconflictset->insertdepth, repropconflictset->validdepth, repropconflictset->conflictdepth,
2346 SCIPdebugMessage("marked node %p in depth %d to be repropagated due to conflicts found in depth %d\n",
2384 /** returns the total number of literals in conflict constraints that were added to the problem */
2404 /** returns the total number of conflict constraints that were added globally to the problem */
2414 /** returns the total number of literals in conflict constraints that were added globally to the problem */
2444 /** returns the total number of literals in conflict constraints that were added locally to the problem */
2461 /** returns whether bound change has a valid reason that can be resolved in conflict analysis */
2491 if( !SCIPbdchgidxIsEarlierNonNull(SCIPbdchginfoGetIdx(bdchginfo1), SCIPbdchginfoGetIdx(bdchginfo2)) )
2497 /** return TRUE if conflict analysis is applicable; In case the function return FALSE there is no need to initialize the
2532 SCIP_CALL( SCIPpqueueCreate(&(*conflict)->bdchgqueue, set->mem_arraygrowinit, set->mem_arraygrowfac,
2534 SCIP_CALL( SCIPpqueueCreate(&(*conflict)->forcedbdchgqueue, set->mem_arraygrowinit, set->mem_arraygrowfac,
2651 /* increase the conflict counter, such that binary variables of new conflict set and new conflict queue are labeled
2655 if( conflict->count == 0 ) /* make sure, 0 is not a valid conflict counter (may happen due to integer overflow) */
2665 /* if the conflict score for the next conflict exceeds 1000.0, rescale all history conflict scores */
2689 /** marks bound to be present in the current conflict and returns whether a bound which is at least as tight was already
2714 /* the variable is already member of the conflict; hence check if the new bound is redundant */
2717 SCIPdebugMessage("ignoring redundant bound change <%s> >= %g since a stronger lower bound exist <%s> >= %g\n",
2723 SCIPdebugMessage("ignoring redundant bound change <%s> >= %g since this lower bound is already present\n", SCIPvarGetName(var), newbound);
2733 /* remember the lower bound and relaxed bound to allow only better/tighter lower bounds for that variables
2745 /* the variable is already member of the conflict; hence check if the new bound is redundant */
2748 SCIPdebugMessage("ignoring redundant bound change <%s> <= %g since a stronger upper bound exist <%s> <= %g\n",
2754 SCIPdebugMessage("ignoring redundant bound change <%s> <= %g since this upper bound is already present\n", SCIPvarGetName(var), newbound);
2764 /* remember the upper bound and relaxed bound to allow only better/tighter upper bounds for that variables
2793 assert(SCIPbdchginfoGetBoundtype(bdchginfo) == SCIP_BOUNDTYPE_LOWER || SCIPsetIsGE(set, relaxedbd, SCIPbdchginfoGetNewbound(bdchginfo)));
2794 assert(SCIPbdchginfoGetBoundtype(bdchginfo) == SCIP_BOUNDTYPE_UPPER || SCIPsetIsLE(set, relaxedbd, SCIPbdchginfoGetNewbound(bdchginfo)));
2798 SCIPbdchginfoGetBoundtype(bdchginfo) == SCIP_BOUNDTYPE_LOWER ? ">=" : "<=", SCIPbdchginfoGetNewbound(bdchginfo),
2801 /* mark the bound to be member of the conflict and check if a bound which is at least as tight is already member of
2822 /** returns whether the negation of the given bound change would lead to a globally valid literal */
2838 && ((boundtype == SCIP_BOUNDTYPE_LOWER && SCIPsetIsFeasGE(set, bound, SCIPvarGetUbGlobal(var)))
2839 || (boundtype == SCIP_BOUNDTYPE_UPPER && SCIPsetIsFeasLE(set, bound, SCIPvarGetLbGlobal(var)))));
2857 assert(SCIPbdchginfoGetBoundtype(bdchginfo) == SCIP_BOUNDTYPE_LOWER || SCIPsetIsGE(set, relaxedbd, SCIPbdchginfoGetNewbound(bdchginfo)));
2858 assert(SCIPbdchginfoGetBoundtype(bdchginfo) == SCIP_BOUNDTYPE_UPPER || SCIPsetIsLE(set, relaxedbd, SCIPbdchginfoGetNewbound(bdchginfo)));
2860 /* mark the bound to be member of the conflict and check if a bound which is at least as tight is already member of
2893 SCIP_BOUNDTYPE* boundtype, /**< pointer to type of bound that was changed: lower or upper bound */
2940 SCIPdebugMessage(" -> adding bound <%s> %s %.15g(%.15g) [status:%d, type:%d, depth:%d, pos:%d, reason:<%s>, info:%d] to candidates\n",
2949 : (SCIPbdchginfoGetInferProp(bdchginfo) != NULL ? SCIPpropGetName(SCIPbdchginfoGetInferProp(bdchginfo))
2951 SCIPbdchginfoGetChgtype(bdchginfo) != SCIP_BOUNDCHGTYPE_BRANCHING ? SCIPbdchginfoGetInferInfo(bdchginfo) : -1);
2954 * we even put bound changes without inference information on the queue in order to automatically
2963 assert(boundtype == SCIP_BOUNDTYPE_LOWER ? SCIPsetIsLE(set, relaxedbd, SCIPbdchginfoGetNewbound(bdchginfo)) : SCIPsetIsGE(set, relaxedbd, SCIPbdchginfoGetNewbound(bdchginfo)));
2966 assert(boundtype == SCIP_BOUNDTYPE_LOWER ? SCIPsetIsGT(set, relaxedbd, SCIPbdchginfoGetOldbound(bdchginfo)) : SCIPsetIsLT(set, relaxedbd, SCIPbdchginfoGetOldbound(bdchginfo)));
2975 SCIP_CALL( incVSIDS(var, blkmem, set, stat, boundtype, relaxedbd, set->conf_conflictgraphweight) );
2988 SCIP_BDCHGIDX* bdchgidx /**< bound change index (time stamp of bound change), or NULL for current time */
3028 /* if bound of variable was not changed (this means it is still the global bound), we can ignore the conflicting
3036 SCIP_CALL( conflictAddBound(conflict, blkmem, set, stat, var, boundtype, bdchginfo, SCIPbdchginfoGetNewbound(bdchginfo)) );
3049 SCIP_BDCHGIDX* bdchgidx, /**< bound change index (time stamp of bound change), or NULL for current time */
3072 SCIPdebugMessage("ignoring relaxed bound information since variable <%s> is multi-aggregated active\n", SCIPvarGetName(var));
3084 /* if bound of variable was not changed (this means it is still the global bound), we can ignore the conflicting
3093 /* get the position of the bound change information within the bound change array of the variable */
3097 /* if the relaxed bound should be ignored, set the relaxed bound to the bound given by the bdchgidx; that ensures
3111 /* due to numericis we compare the relaxed lower bound to the one present at the particular time point and take
3117 /* check if relaxed lower bound is smaller or equal to global lower bound; if so we can ignore the conflicting
3127 /* check if the old lower bound is greater than or equal to relaxed lower bound; if not we found the bound
3135 SCIPdebugMessage("lower bound change %d oldbd=%.15g, newbd=%.15g, depth=%d, pos=%d, redundant=%u\n",
3140 /* if bound change is redundant (this means it now a global bound), we can ignore the conflicting bound */
3157 /* due to numericis we compare the relaxed upper bound to the one present at the particular time point and take
3163 /* check if relaxed upper bound is greater or equal to global upper bound; if so we can ignore the conflicting
3173 /* check if the old upper bound is smaller than or equal to the relaxed upper bound; if not we found the
3181 SCIPdebugMessage("upper bound change %d oldbd=%.15g, newbd=%.15g, depth=%d, pos=%d, redundant=%u\n",
3186 /* if bound change is redundant (this means it now a global bound), we can ignore the conflicting bound */
3198 SCIP_CALL( conflictAddBound(conflict, blkmem, set, stat, var, boundtype, bdchginfo, relaxedbd) );
3203 /** checks if the given variable is already part of the current conflict set or queued for resolving with the same or
3211 SCIP_BDCHGIDX* bdchgidx, /**< bound change index (time stamp of bound change), or NULL for current time */
3220 if( SCIPvarGetStatus(var) == SCIP_VARSTATUS_FIXED || SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR )
3263 /** returns the conflict lower bound if the variable is present in the current conflict set; otherwise the global lower
3280 /** returns the conflict upper bound if the variable is present in the current conflict set; otherwise the global upper
3318 /* mark the bound change to be no longer in the conflict (it will be either added again to the conflict set or
3359 SCIPdebugMessage("bound change info [%d:<%s> %s %g] is invaild -> pop it from the force queue\n", SCIPbdchginfoGetDepth(bdchginfo),
3378 SCIPdebugMessage("bound change info [%d:<%s> %s %g] is invaild -> pop it from the queue\n", SCIPbdchginfoGetDepth(bdchginfo),
3395 /** adds the current conflict set (extended by all remaining bound changes in the queue) to the pool of conflict sets */
3437 assert(0 <= conflict->conflictset->validdepth && conflict->conflictset->validdepth <= currentdepth);
3444 /* create a copy of the current conflict set, allocating memory for the additional elements of the queue */
3450 SCIPdebugMessage("adding %d variables from the queue as temporary conflict variables\n", nbdchginfos);
3451 SCIP_CALL( conflictsetAddBounds(conflict, conflictset, blkmem, set, bdchginfos, nbdchginfos) );
3455 assert(conflictset->validdepth <= conflictset->insertdepth && conflictset->insertdepth <= currentdepth);
3456 SCIPdebugMessage(" -> conflict with %d literals found at depth %d is active in depth %d and valid in depth %d\n",
3462 if( (diving || conflictset->insertdepth < currentdepth) && conflictset->insertdepth <= focusdepth )
3464 /* if the conflict should not be located only in the subtree where it is useful, put it to its valid depth level */
3473 conflictset->bdchginfos, conflictset->relaxedbds, conflictset->nbdchginfos) ); /*lint !e506 !e774*/
3490 * current minimal valid depth level, because this depth level is the topmost level to add the conflict
3530 SCIPdebugMessage("processing next conflicting bound (depth: %d, valid depth: %d, bdchgtype: %s [%s], vartype: %d): [<%s> %s %g(%g)]\n",
3547 SCIPdebugPrintf(" [%d:<%s> %s %g(%g)]", SCIPbdchginfoGetDepth(conflict->conflictset->bdchginfos[i]),
3549 SCIPbdchginfoGetBoundtype(conflict->conflictset->bdchginfos[i]) == SCIP_BOUNDTYPE_LOWER ? ">=" : "<=",
3550 SCIPbdchginfoGetNewbound(conflict->conflictset->bdchginfos[i]), conflict->conflictset->relaxedbds[i]);
3558 SCIPdebugPrintf(" [%d:<%s> %s %g(%g)]", SCIPbdchginfoGetDepth(info), SCIPvarGetName(SCIPbdchginfoGetVar(info)),
3559 bdchginfoIsInvalid(conflict, info) ? "<!>" : SCIPbdchginfoGetBoundtype(info) == SCIP_BOUNDTYPE_LOWER ? ">=" : "<=",
3568 SCIPdebugPrintf(" [%d:<%s> %s %g(%g)]", SCIPbdchginfoGetDepth(info), SCIPvarGetName(SCIPbdchginfoGetVar(info)),
3569 bdchginfoIsInvalid(conflict, info) ? "<!>" : SCIPbdchginfoGetBoundtype(info) == SCIP_BOUNDTYPE_LOWER ? ">=" : "<=",
3577 * current minimal valid depth level (which is initialized with the valid depth level of the initial
3578 * conflict set), because this depth level is the topmost level to add the conflict constraint to anyways
3593 /* resolve bound change by asking the constraint that infered the bound to put all bounds that were
3602 SCIPdebugMessage("resolving bound <%s> %s %g(%g) [status:%d, type:%d, depth:%d, pos:%d]: <%s> %s %g [cons:<%s>(%s), info:%d]\n",
3615 /* in case the inference variables is not an active variables, we need to transform the relaxed bound */
3638 SCIP_CALL( SCIPconsResolvePropagation(infercons, set, infervar, inferinfo, inferboundtype, bdchgidx, relaxedbd, &result) );
3652 /* resolve bound change by asking the propagator that infered the bound to put all bounds that were
3661 SCIPdebugMessage("resolving bound <%s> %s %g(%g) [status:%d, depth:%d, pos:%d]: <%s> %s %g [prop:<%s>, info:%d]\n",
3671 SCIP_CALL( SCIPpropResolvePropagation(inferprop, set, infervar, inferinfo, inferboundtype, bdchgidx, relaxedbd, &result) );
3692 /* in case the bound change was not resolved, the conflict queues should have the same size (contents) */
3699 /** if only one conflicting bound change of the last depth level was used, and if this can be resolved,
3700 * creates GRASP-like reconvergence conflict constraints in the conflict graph up to the branching variable of this
3715 int* nreconvliterals /**< pointer to store the number of literals generated reconvergence constraints */
3735 /* check, whether local constraints are allowed; however, don't generate reconvergence constraints that are only valid
3744 /* for each succeeding UIP pair of the last depth level, create one reconvergence constraint */
3746 while( uip != NULL && SCIPbdchginfoGetDepth(uip) == SCIPbdchginfoGetDepth(firstuip) && bdchginfoIsResolvable(uip) )
3759 SCIPvarGetName(SCIPbdchginfoGetVar(uip)), SCIPbdchginfoGetBoundtype(uip) == SCIP_BOUNDTYPE_LOWER ? ">=" : "<=",
3767 * for reconvergence constraints for continuous variables we can only use the "negation" !(x <= u) == (x >= u);
3768 * during conflict analysis, we treat a continuous bound "x >= u" in the conflict set as "x > u", and in the
3780 oppositeuipboundtype, oppositeuipboundtype == SCIP_BOUNDTYPE_LOWER ? SCIP_REAL_MIN : SCIP_REAL_MAX,
3803 /* remove currently processed candidate and get next conflicting bound from the conflict candidate queue before
3804 * we remove the candidate we have to collect the relaxed bound since removing the candidate from the queue
3814 assert(nextbdchginfo == NULL || SCIPbdchginfoGetDepth(bdchginfo) >= SCIPbdchginfoGetDepth(nextbdchginfo)
3818 /* bound changes that are higher in the tree than the valid depth of the conflict can be ignored;
3862 assert(conflict->conflictset->nbdchginfos >= 1); /* starting UIP is already member of the conflict set */
3864 /* if this is the first variable of the conflict set besides the current starting UIP, it is the next
3883 bdchginfo, conflict->conflictset->bdchginfos, conflict->conflictset->relaxedbds, conflict->conflictset->nbdchginfos,
3886 /* get next conflicting bound from the conflict candidate queue (this does not need to be nextbdchginfo, because
3894 /* if only one propagation was resolved, the reconvergence constraint is already member of the constraint set
3904 SCIPdebugMessage("creating reconvergence constraint from UIP <%s> to UIP <%s> in depth %d with %d literals after %d resolutions\n",
3909 SCIP_CALL( conflictAddConflictset(conflict, blkmem, set, stat, tree, validdepth, diving, FALSE,
3918 /* clear the conflict candidate queue and the conflict set (to make sure, oppositeuip is not referenced anymore) */
3927 /** analyzes conflicting bound changes that were added with calls to SCIPconflictAddBound() and
3928 * SCIPconflictAddRelaxedBound(), and on success, calls the conflict handlers to create a conflict constraint out of
3941 SCIP_Bool mustresolve, /**< should the conflict set only be used, if a resolution was applied? */
3943 int* nliterals, /**< pointer to store the number of literals in generated conflict constraints */
3945 int* nreconvliterals /**< pointer to store the number of literals generated reconvergence constraints */
3979 /* if we must resolve at least one bound change, find the first UIP at least in the last depth level */
3983 SCIPdebugMessage("analyzing conflict with %d+%d conflict candidates and starting conflict set of size %d in depth %d (resolvedepth=%d)\n",
3992 /* check, whether local conflicts are allowed; however, don't generate conflict constraints that are only valid in the
3999 /* allocate temporary memory for storing first UIPs (in each depth level, at most two bound changes can be flagged
4013 NULL, conflict->conflictset->bdchginfos, conflict->conflictset->relaxedbds, conflict->conflictset->nbdchginfos,
4035 assert(SCIPbdchginfoGetPos(bdchginfo) < (int)tree->path[bdchgdepth]->domchg->domchgbound.nboundchgs);
4036 assert(tree->path[bdchgdepth]->domchg->domchgbound.boundchgs[SCIPbdchginfoGetPos(bdchginfo)].var
4038 assert(tree->path[bdchgdepth]->domchg->domchgbound.boundchgs[SCIPbdchginfoGetPos(bdchginfo)].newbound
4041 ? SCIPvarGetLbGlobal(SCIPbdchginfoGetVar(bdchginfo)) : SCIPvarGetUbGlobal(SCIPbdchginfoGetVar(bdchginfo)))
4043 assert((SCIP_BOUNDTYPE)tree->path[bdchgdepth]->domchg->domchgbound.boundchgs[SCIPbdchginfoGetPos(bdchginfo)].boundtype
4051 lastconsresoldepth = bdchgdepth; /* all intermediate depth levels consisted of only unresolved bound changes */
4052 else if( bdchgdepth < lastconsresoldepth && (set->conf_interconss == -1 || *nconss < set->conf_interconss) )
4058 SCIPdebugMessage("creating intermediate conflictset after %d resolutions up to depth %d (valid at depth %d): %d conflict bounds, %d bounds in queue\n",
4073 /* remove currently processed candidate and get next conflicting bound from the conflict candidate queue before
4074 * we remove the candidate we have to collect the relaxed bound since removing the candidate from the queue
4083 assert(nextbdchginfo == NULL || SCIPbdchginfoGetDepth(bdchginfo) >= SCIPbdchginfoGetDepth(nextbdchginfo)
4086 /* we don't need to resolve bound changes that are already active in the valid depth of the current conflict set,
4087 * because the conflict set can only be added locally at the valid depth, and all bound changes applied in this
4088 * depth or earlier can be removed from the conflict constraint, since they are already applied in the constraint's
4152 bdchginfo, conflict->conflictset->bdchginfos, conflict->conflictset->relaxedbds, conflict->conflictset->nbdchginfos,
4155 /* get next conflicting bound from the conflict candidate queue (this needs not to be nextbdchginfo, because
4173 SCIP_CALL( conflictAddConflictset(conflict, blkmem, set, stat, tree, validdepth, diving, TRUE, &success, &nlits) );
4208 /** analyzes conflicting bound changes that were added with calls to SCIPconflictAddBound(), and on success, calls the
4246 SCIPdebugMessage("analyzing conflict after infeasible propagation in depth %d\n", SCIPtreeGetCurrentDepth(tree));
4300 /** gets number of calls to propagation conflict analysis that yield at least one conflict constraint */
4320 /** gets total number of literals in conflict constraints created in propagation conflict analysis */
4340 /** gets total number of literals in reconvergence constraints created in propagation conflict analysis */
4394 /** adds removal of row's side to side change arrays; finite sides are only replaced by near infinite sides, such
4429 SCIP_CALL( ensureSidechgsSize(set, sidechginds, sidechgoldlhss, sidechgoldrhss, sidechgnewlhss, sidechgnewrhss,
4472 SCIP_LPBDCHGS* oldlpbdchgs, /**< old LP bound changes used for reset the LP bound change, or NULL */
4473 SCIP_LPBDCHGS* relaxedlpbdchgs /**< relaxed LP bound changes used for reset the LP bound change, or NULL */
4504 assert(oldlpbdchgs->bdchglbs[oldlpbdchgs->bdchgcolinds[c]] == SCIPvarGetLbLP(var, set)); /*lint !e777*/
4505 assert(oldlpbdchgs->bdchgubs[oldlpbdchgs->bdchgcolinds[c]] == SCIPvarGetUbLP(var, set)); /*lint !e777*/
4568 /** adds variable to candidate list, if the current best bound corresponding to the proof coefficient is local;
4569 * returns the array position in the candidate list, where the new candidate was inserted, or -1 if the
4572 * - prefer bound changes that have been applied deeper in the tree, to get a more global conflict
4573 * - prefer variables with small Farkas coefficient to get rid of as many bound changes as possible
4580 int lbchginfopos, /**< positions of currently active lower bound change information in variable's array */
4581 int ubchginfopos, /**< positions of currently active upper bound change information in variable's array */
4588 SCIP_Real** proofactdeltas, /**< pointer to proof activity increase array for undoing bound changes */
4617 /* in the infeasibility or dual bound proof, the variable's bound is chosen to maximize the proof's activity */
4620 assert(ubchginfopos >= 0); /* otherwise, undoBdchgsProof() should already have relaxed the local bound */
4642 assert(lbchginfopos >= 0); /* otherwise, undoBdchgsProof() should already have relaxed the local bound */
4679 SCIP_CALL( ensureCandsSize(set, cands, candscores, newbounds, proofactdeltas, candssize, (*ncands)+1) );
4685 SCIPdebugMessage(" -> local <%s> %s %g, relax <%s> %s %g, proofcoef=%g, dpt=%d, resolve=%u, delta=%g, score=%g\n",
4707 /** after changing the global bound of a variable, the bdchginfos that are now redundant are replaced with
4708 * oldbound = newbound = global bound; if the current bdchginfo is of such kind, the bound is equal to the
4709 * global bound and we can ignore it by installing a -1 as the corresponding bound change info position
4725 == (var->lbchginfos[*lbchginfopos].oldbound == var->lbchginfos[*lbchginfopos].newbound)); /*lint !e777*/
4728 == (var->ubchginfos[*ubchginfopos].oldbound == var->ubchginfos[*ubchginfopos].newbound)); /*lint !e777*/
4730 if( *lbchginfopos >= 0 && *lbchginfopos < var->nlbchginfos && var->lbchginfos[*lbchginfopos].redundant )
4735 if( *ubchginfopos >= 0 && *ubchginfopos < var->nubchginfos && var->ubchginfos[*ubchginfopos].redundant )
4753 int* lbchginfoposs, /**< positions of currently active lower bound change information in variables' arrays */
4754 int* ubchginfoposs, /**< positions of currently active upper bound change information in variables' arrays */
4755 SCIP_LPBDCHGS* oldlpbdchgs, /**< old LP bound changes used for reset the LP bound change, or NULL */
4756 SCIP_LPBDCHGS* relaxedlpbdchgs, /**< relaxed LP bound changes used for reset the LP bound change, or NULL */
4757 SCIP_Bool* resolve /**< pointer to store whether the changed LP should be resolved again, or NULL */
4786 /* calculate the order in which the bound changes are tried to be undone, and relax all bounds if this doesn't
4802 /* after changing the global bound of a variable, the bdchginfos that are now redundant are replaced with
4803 * oldbound = newbound = global bound; if the current bdchginfo is of such kind, the bound is equal to the
4849 prooflhs, proofact, &cands, &candscores, &newbounds, &proofactdeltas, &candssize, &ncands, 0) );
4860 assert((lbchginfoposs[SCIPvarGetProbindex(cands[i])] >= 0) != (ubchginfoposs[SCIPvarGetProbindex(cands[i])] >= 0));
4862 /* when relaxing a constraint we still need to stay infeasible; therefore we need to do the comparison in
4863 * feasibility tolerance because if 'prooflhs' is (feas-))equal to 'proofact + proofactdeltas[i]' it would mean
4872 SCIPdebugMessage(" -> relaxing variable <%s>[%g,%g] to [%g,%g]: proofcoef=%g, %g <= %g + %g\n",
4902 SCIP_CALL( addBdchg(set, cands[i], curvarlbs[v], curvarubs[v], oldlpbdchgs, relaxedlpbdchgs) );
4908 /* after changing the global bound of a variable, the bdchginfos that are now redundant are replaced with
4909 * oldbound = newbound = global bound; if the current bdchginfo is of such kind, the bound is equal to the
4917 SCIP_CALL( addCand(set, currentdepth, cands[i], lbchginfoposs[v], ubchginfoposs[v], proofcoefs[v],
4918 prooflhs, proofact, &cands, &candscores, &newbounds, &proofactdeltas, &candssize, &ncands, i+1) );
4932 /* because calculations might cancel out some values, we stop the infeasibility analysis if a value is bigger than
4946 int* lbchginfoposs, /**< positions of currently active lower bound change information in variables' arrays */
4947 int* ubchginfoposs, /**< positions of currently active upper bound change information in variables' arrays */
4948 SCIP_LPBDCHGS* oldlpbdchgs, /**< old LP bound changes used for reset the LP bound change, or NULL */
4949 SCIP_LPBDCHGS* relaxedlpbdchgs, /**< relaxed LP bound changes used for reset the LP bound change, or NULL */
5001 /* if solve for some reason did not produce a dual ray, e.g. because of numerical instabilities, abort conflict analysis */
5007 if( retcode == SCIP_LPERROR ) /* on an error in the LP solver, just abort the conflict analysis */
5088 /* calculate the current Farkas activity, always using the best bound w.r.t. the Farkas coefficient */
5100 assert((SCIPvarGetStatus(var) == SCIP_VARSTATUS_COLUMN && SCIPcolGetLPPos(SCIPvarGetCol(var)) >= 0)
5110 assert((SCIPvarGetStatus(var) == SCIP_VARSTATUS_COLUMN && SCIPcolGetLPPos(SCIPvarGetCol(var)) >= 0)
5121 /* check, if the Farkas row is still violated (using current bounds and ignoring local rows) */
5130 /* resolving does not make sense: the old dual ray is still valid -> resolving will not change the solution */
5143 /** analyzes an LP exceeding the objective limit and undoes additional bound changes while staying beyond the
5154 int* lbchginfoposs, /**< positions of currently active lower bound change information in variables' arrays */
5155 int* ubchginfoposs, /**< positions of currently active upper bound change information in variables' arrays */
5156 SCIP_LPBDCHGS* oldlpbdchgs, /**< old LP bound changes used for reset the LP bound change, or NULL */
5157 SCIP_LPBDCHGS* relaxedlpbdchgs, /**< relaxed LP bound changes used for reset the LP bound change, or NULL */
5197 SCIPdebugMessage("undoing bound changes in LP exceeding cutoff: cutoff=%g\n", lp->cutoffbound);
5220 if( retcode == SCIP_LPERROR ) /* on an error in the LP solver, just abort the conflict analysis */
5234 * Define the set X := {x | lhs <= Ax <= rhs, lb <= x <= ub, c^Tx <= c*}, with c* being the current primal bound.
5249 /* use a slightly tighter cutoff bound, because solutions with equal objective value should also be declared
5256 * process rows: add z^T{lhs,rhs} to the dual row's left hand side, and -(y-z)^TA to the dual row's coefficients
5271 if( (SCIPsetIsInfinity(set, -row->lhs) && dualsols[r] > 0.0) || (SCIPsetIsInfinity(set, row->rhs) && dualsols[r] < 0.0) )
5278 /* local rows add up to the dual row's coefficients (because z_i == 0 => -(y_i - z_i) == -y_i),
5294 /* add minimal value to dual row's left hand side: z_i == y_i > 0 -> lhs, z_i == y_i < 0 -> rhs */
5306 SCIProwGetName(row), row->lhs - row->constant, row->rhs - row->constant, dualsols[r], duallhs);
5311 * process variables: subtract reduced costs from dual row's coefficients, and calculate current maximal dual
5339 if( (SCIPsetIsGT(set, primsols[c], curvarlbs[v]) && SCIPsetIsFeasPositive(set, varredcosts[v]))
5340 || (SCIPsetIsLT(set, primsols[c], curvarubs[v]) && SCIPsetIsFeasNegative(set, varredcosts[v])) )
5389 /** applies conflict analysis starting with given bound changes, that could not be undone during previous
5401 int* lbchginfoposs, /**< positions of currently active lower bound change information in variables' arrays */
5402 int* ubchginfoposs, /**< positions of currently active upper bound change information in variables' arrays */
5404 int* nliterals, /**< pointer to store the number of literals in generated conflict constraints */
5406 int* nreconvliterals /**< pointer to store the number of literals generated reconvergence constraints */
5458 assert((lbchginfoposs[v] == var->nlbchginfos) != (ubchginfoposs[v] == var->nubchginfos)); /* only one can be tight in the dual! */
5459 assert(lbchginfoposs[v] < var->nlbchginfos || SCIPvarGetLbLP(var, set) > SCIPvarGetLbLocal(var));
5460 assert(ubchginfoposs[v] < var->nubchginfos || SCIPvarGetUbLP(var, set) < SCIPvarGetUbLocal(var));
5489 SCIP_CALL( incVSIDS(var, blkmem, set, stat, SCIPbdchginfoGetBoundtype(bdchginfo), relaxedbd, set->conf_conflictgraphweight) );
5497 SCIP_CALL( conflictAddBound(conflict, blkmem, set, stat, var, SCIP_BOUNDTYPE_LOWER, &var->lbchginfos[lbchginfoposs[v]], SCIPbdchginfoGetNewbound(&var->lbchginfos[lbchginfoposs[v]])) );
5503 SCIP_CALL( conflictAddBound(conflict, blkmem, set, stat, var, SCIP_BOUNDTYPE_UPPER, &var->ubchginfos[ubchginfoposs[v]], SCIPbdchginfoGetNewbound(&var->ubchginfos[ubchginfoposs[v]])) );
5535 int* nliterals, /**< pointer to store the number of literals in generated conflict constraints */
5537 int* nreconvliterals, /**< pointer to store the number of literals generated reconvergence constraints */
5538 SCIP_Bool marklpunsolved /**< whether LP should be marked unsolved after analysis (needed for strong branching) */
5559 assert(SCIPprobAllColsInLP(transprob, set, lp)); /* LP conflict analysis is only valid, if all variables are known */
5579 assert(SCIPlpiIsPrimalInfeasible(lpi) || SCIPlpiIsObjlimExc(lpi) || SCIPlpiIsDualFeasible(lpi));
5589 * With FASTMIP setting, CPLEX does not apply the final pivot to reach the dual solution exceeding the objective
5590 * limit. Therefore, we have to either turn off FASTMIP and resolve the problem or continue solving it without
5591 * objective limit for at least one iteration. It seems that the strategy to continue with FASTMIP for one
5625 SCIPdebugMessage(" -> resolved objlim exceeding LP in %d iterations (total: %"SCIP_LONGINT_FORMAT") (infeasible:%u, objlim: %u, optimal:%u)\n",
5628 valid = (SCIPlpiIsObjlimExc(lpi) || SCIPlpiIsPrimalInfeasible(lpi) || SCIPlpiIsDualFeasible(lpi));
5640 assert(SCIPlpiIsPrimalInfeasible(lpi) || SCIPlpiIsObjlimExc(lpi) || SCIPlpiIsDualFeasible(lpi));
5651 SCIPdebugMessage(" -> LP does not exceed the cutoff bound: obj=%g, cutoff=%g\n", objval, lp->lpiuobjlim);
5656 SCIPdebugMessage(" -> LP exceeds the cutoff bound: obj=%g, cutoff=%g\n", objval, lp->lpiuobjlim);
5660 SCIPdebugMessage("analyzing conflict on infeasible LP (infeasible: %u, objlimexc: %u, optimal:%u) in depth %d (diving: %u)\n",
5661 SCIPlpiIsPrimalInfeasible(lpi), SCIPlpiIsObjlimExc(lpi), SCIPlpiIsOptimal(lpi), SCIPtreeGetCurrentDepth(tree), diving);
5667 SCIPdebugMessage(" -> objective limit in LP solver: %g (in LP: %g)\n", uobjlim, lp->lpiuobjlim);
5675 /* get temporary memory for remembering variables' current bounds and corresponding bound change information
5683 /* the following algorithm is used to find a subset of changed bounds leading to an infeasible LP:
5723 /* the bound in the diving LP was relaxed -> the LP is not a subproblem of the current node -> abort! */
5724 /**@todo we could still analyze such a conflict, but we would have to take care with our data structures */
5731 /* the bound in the diving LP was relaxed -> the LP is not a subproblem of the current node -> abort! */
5732 /**@todo we could still analyze such a conflict, but we would have to take care with our data structures */
5753 SCIP_CALL( undoBdchgsDualfarkas(set, transprob, lp, currentdepth, curvarlbs, curvarubs, lbchginfoposs,
5759 SCIP_CALL( undoBdchgsDualsol(set, transprob, lp, currentdepth, curvarlbs, curvarubs, lbchginfoposs, ubchginfoposs,
5821 SCIP_CALL( addSideRemoval(set, rows[r], lpiinfinity, &sidechginds, &sidechgoldlhss, &sidechgoldrhss,
5843 SCIPdebugMessage("infeasible LP conflict analysis loop %d (changed col bounds: %d)\n", nloops, relaxedlpbdchgs->nbdchgs);
5849 SCIPdebugMessage(" -> applying %d bound changes to the LP solver\n", relaxedlpbdchgs->nbdchgs);
5879 SCIPdebugMessage(" -> resolved LP in %d iterations (total: %"SCIP_LONGINT_FORMAT") (infeasible:%u)\n",
5912 SCIPdebugMessage(" -> finished infeasible LP conflict analysis loop %d (iter: %d, nbdchgs: %d)\n",
5963 SCIP_CALL( conflictAnalyzeRemainingBdchgs(conflict, blkmem, set, stat, transprob, tree, diving,
5976 SCIP_CALL( SCIPconflictFlushConss(conflict, blkmem, set, stat, transprob, origprob, tree, lp, branchcand, eventqueue) );
5981 /** analyzes an infeasible LP to find out the bound changes on variables that were responsible for the infeasibility;
5982 * on success, calls standard conflict analysis with the responsible variables as starting conflict set, thus creating
6010 assert(SCIPprobAllColsInLP(transprob, set, lp)); /* LP conflict analysis is only valid, if all variables are known */
6022 SCIPdebugMessage("analyzing conflict on infeasible LP in depth %d (solstat: %d, objchanged: %u)\n",
6030 SCIP_CALL( conflictAnalyzeLP(conflict, blkmem, set, stat, transprob, origprob, tree, lp, branchcand, eventqueue,
6047 /** analyzes a bound exceeding LP to find out the bound changes on variables that were responsible for exceeding the
6049 * on success, calls standard conflict analysis with the responsible variables as starting conflict set, thus creating
6078 assert(SCIPprobAllColsInLP(transprob, set, lp)); /* LP conflict analysis is only valid, if all variables are known */
6098 SCIP_CALL( conflictAnalyzeLP(conflict, blkmem, set, stat, transprob, origprob, tree, lp, branchcand, eventqueue,
6115 /** analyzes an infeasible or bound exceeding LP to find out the bound changes on variables that were responsible for the
6117 * on success, calls standard conflict analysis with the responsible variables as starting conflict set, thus creating
6145 /* in rare cases, it might happen that the solution stati of the LP and the LPI are out of sync; in particular this
6146 * happens when a new incumbent which cuts off the current node is found during the LP solving loop; in this case the
6147 * LP has status objlimit, but if diving has been used, the LPI only has the basis information, but is not solved
6156 assert( SCIPlpGetSolstat(lp) == SCIP_LPSOLSTAT_INFEASIBLE || SCIPlpGetSolstat(lp) == SCIP_LPSOLSTAT_OBJLIMIT
6203 SCIP_CALL( conflictAnalyzeInfeasibleLP(conflict, blkmem, set, stat, transprob, origprob, tree, lp, branchcand, eventqueue, success) );
6207 SCIP_CALL( conflictAnalyzeBoundexceedingLP(conflict, blkmem, set, stat, transprob, origprob, tree, lp, branchcand, eventqueue, success) );
6275 /** gets number of calls to infeasible LP conflict analysis that yield at least one conflict constraint */
6295 /** gets total number of literals in conflict constraints created in infeasible LP conflict analysis */
6315 /** gets total number of literals in reconvergence constraints created in infeasible LP conflict analysis */
6355 /** gets number of calls to bound exceeding LP conflict analysis that yield at least one conflict constraint */
6375 /** gets total number of literals in conflict constraints created in bound exceeding LP conflict analysis */
6385 /** gets number of reconvergence constraints detected in bound exceeding LP conflict analysis */
6395 /** gets total number of literals in reconvergence constraints created in bound exceeding LP conflict analysis */
6435 SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
6459 assert(SCIPprobAllColsInLP(transprob, set, lp)); /* LP conflict analysis is only valid, if all variables are known */
6505 SCIPdebugMessage("analyzing conflict on infeasible downwards strongbranch for variable <%s>[%g,%g] in depth %d\n",
6506 SCIPvarGetName(SCIPcolGetVar(col)), SCIPvarGetLbLocal(SCIPcolGetVar(col)), SCIPvarGetUbLocal(SCIPcolGetVar(col)),
6536 /* perform conflict analysis on infeasible LP; last parameter guarantees status 'solved' on return */
6537 SCIP_CALL( conflictAnalyzeLP(conflict, blkmem, set, stat, transprob, origprob, tree, lp, branchcand,
6567 SCIPdebugMessage("analyzing conflict on infeasible upwards strongbranch for variable <%s>[%g,%g] in depth %d\n",
6568 SCIPvarGetName(SCIPcolGetVar(col)), SCIPvarGetLbLocal(SCIPcolGetVar(col)), SCIPvarGetUbLocal(SCIPcolGetVar(col)),
6598 /* perform conflict analysis on infeasible LP; last parameter guarantees status 'solved' on return */
6599 SCIP_CALL( conflictAnalyzeLP(conflict, blkmem, set, stat, transprob, origprob, tree, lp, branchcand,
6671 /** gets number of calls to infeasible strong branching conflict analysis that yield at least one conflict constraint */
6681 /** gets number of conflict constraints detected in infeasible strong branching conflict analysis */
6691 /** gets total number of literals in conflict constraints created in infeasible strong branching conflict analysis */
6701 /** gets number of reconvergence constraints detected in infeasible strong branching conflict analysis */
6711 /** gets total number of literals in reconvergence constraints created in infeasible strong branching conflict analysis */
6738 /** analyzes a pseudo solution with objective value exceeding the current cutoff to find out the bound changes on
6740 * on success, calls standard conflict analysis with the responsible variables as starting conflict set, thus creating
6805 * In the local subproblem, this row is violated. We want to undo bound changes while still keeping the
6809 /* get temporary memory for remembering variables' current bounds and corresponding bound change information
6820 /* use a slightly tighter cutoff bound, because solutions with equal objective value should also be declared
6825 /* store the objective values as infeasibility proof coefficients, and recalculate the pseudo activity */
6841 SCIPdebugMessage(" -> recalculated pseudo infeasibility proof: %g <= %g\n", pseudolhs, pseudoact);
6852 SCIP_CALL( undoBdchgsProof(set, transprob, SCIPtreeGetCurrentDepth(tree), pseudocoefs, pseudolhs, pseudoact,
6875 SCIP_CALL( SCIPconflictFlushConss(conflict, blkmem, set, stat, transprob, origprob, tree, lp, branchcand, eventqueue) );
6903 /** gets number of calls to pseudo solution conflict analysis that yield at least one conflict constraint */
6923 /** gets total number of literals in conflict constraints created in pseudo solution conflict analysis */
|