SCIP Doxygen Documentation
Loading...
Searching...
No Matches

Detailed Description

Methods for generalized resolution conflict analysis.

Author
Gioni Mexi

This file implements a conflict analysis method based on generalized resolution, as detailed in the paper:

Gioni Mexi, et al. "Cut-based Conflict Analysis in Mixed Integer Programming." arXiv preprint arXiv:2410.15110 (2024).

The generalized resolution conflict analysis procedure starts with an initial conflict row and it iteratively aggregates this row with a reason row—the row that propagated the bound change causing the conflict. The aggregation cancels the coefficient of the resolving variable. This process continues until a first unique implication point (FUIP) is reached. If the aggregation does not yield a valid (infeasible) row, the algorithm attempts to reduce the reason row (e.g., using MIR reduction) and retries the aggregation. Once a valid conflict row with negative slack is generated, a conflict constraint is constructed and added to the problem.

Definition in file conflict_resolution.c.

#include "blockmemshell/memory.h"
#include "scip/clock.h"
#include "scip/conflict.h"
#include "scip/conflict_resolution.h"
#include "scip/cons.h"
#include "scip/cons_linear.h"
#include "scip/cuts.h"
#include "scip/history.h"
#include "scip/prob.h"
#include "scip/prop.h"
#include "scip/pub_cons.h"
#include "scip/pub_conflict.h"
#include "scip/pub_lp.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/pub_var.h"
#include "scip/scip_conflict.h"
#include "scip/scip_cons.h"
#include "scip/scip_mem.h"
#include "scip/scip_prob.h"
#include "scip/scip_sol.h"
#include "scip/scip_var.h"
#include "scip/set.h"
#include "scip/sol.h"
#include "scip/struct_conflict.h"
#include "scip/struct_lp.h"
#include "scip/struct_prob.h"
#include "scip/struct_set.h"
#include "scip/struct_stat.h"
#include "scip/tree.h"
#include "scip/var.h"
#include <string.h>
#include <strings.h>

Go to the source code of this file.

Macros

#define BOUNDSWITCH   0.51
#define POSTPROCESS   FALSE
#define USEVBDS   FALSE
#define FIXINTEGRALRHS   FALSE
#define MINFRAC   0.05
#define MAXFRAC   0.999
#define EPS   1e-06

Functions

static SCIP_RETCODE conflictRowCopy (SCIP_CONFLICTROW **targetrow, BMS_BLKMEM *blkmem, SCIP_CONFLICTROW *sourcerow)
static SCIP_RETCODE conflictRowReplace (SCIP_CONFLICTROW *targetrow, BMS_BLKMEM *blkmem, SCIP_CONFLICTROW *sourcerow)
static SCIP_RETCODE conflictEnsureConflictRowsMem (SCIP_CONFLICT *conflict, SCIP_SET *set, int num)
static SCIP_RETCODE conflictInsertConflictRow (SCIP_CONFLICT *conflict, SCIP_SET *set, SCIP_CONFLICTROW **conflictrow)
SCIP_Longint SCIPconflictGetNResConflictConss (SCIP_CONFLICT *conflict)
SCIP_Longint SCIPconflictGetNResSuccess (SCIP_CONFLICT *conflict)
SCIP_Longint SCIPconflictGetNResLargeCoefs (SCIP_CONFLICT *conflict)
SCIP_Longint SCIPconflictGetNResLongConflicts (SCIP_CONFLICT *conflict)
SCIP_Longint SCIPconflictGetNResCalls (SCIP_CONFLICT *conflict)
static int conflictCalcResMaxsize (SCIP_SET *set, SCIP_PROB *prob)
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)
static SCIP_Bool hasRelaxationOnlyVar (SCIP_SET *set, SCIP_VAR **vars, SCIP_CONFLICTROW *row)
static SCIP_Bool isBinaryConflictRow (SCIP_SET *set, SCIP_VAR **vars, SCIP_CONFLICTROW *row)
static void conflictRowRemoveZeroVar (SCIP_CONFLICTROW *row, SCIP_SET *set, int pos)
static void conflictRowRemoveZeroVars (SCIP_CONFLICTROW *row, SCIP_SET *set)
static SCIP_RETCODE ComplementedMirLhs (SCIP_SET *set, SCIP_VAR **vars, SCIP_CONFLICTROW *reasonrow, int *fixsides, SCIP_BDCHGIDX *currbdchgidx, int idxreason, SCIP_Real divisor)
static void linearCombRows (SCIP_SET *set, SCIP_CONFLICTROW *row1, SCIP_CONFLICTROW *row2, SCIP_Real scale)
static SCIP_Bool isResolvableBdchg (SCIP_BDCHGINFO *bdchginfo)
static SCIP_Bool existsResolvablebdchginfo (SCIP_CONFLICT *conflict)
static SCIP_Bool isBdchgConflictRelevant (SCIP_CONFLICT *conflict, SCIP_BDCHGINFO *bdchginfo, int initial)
static SCIP_BDCHGINFOconflictFirstCand (SCIP_SET *set, SCIP_CONFLICT *conflict, int initial)
static SCIP_BDCHGINFOconflictRemoveCand (SCIP_CONFLICT *conflict, int initial)
SCIP_Bool SCIPconflictResolutionApplicable (SCIP_SET *set)
static SCIP_RETCODE conflictRowCreate (SCIP_CONFLICTROW **row, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPconflictInitRows (SCIP_CONFLICT *conflict, BMS_BLKMEM *blkmem)
void SCIPconflictRowFree (SCIP_CONFLICTROW **row, BMS_BLKMEM *blkmem)
static void freeConflictResources (SCIP_CONFLICT *conflict, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_Real *fixbounds, int *fixsides)
static void conflictRowClear (BMS_BLKMEM *blkmem, SCIP_CONFLICTROW *row, int nvars)
static SCIP_RETCODE computeSlack (SCIP_SET *set, SCIP_VAR **vars, SCIP_CONFLICTROW *row, SCIP_BDCHGINFO *currbdchginfo, SCIP_Real *fixbounds, int *fixsides)
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)
static void weakenVarConflictRow (SCIP_CONFLICTROW *row, SCIP_SET *set, SCIP_VAR *var, int pos)
static void weakenConflictRow (SCIP_CONFLICTROW *row, SCIP_SET *set, SCIP_VAR **vars, SCIP_BDCHGIDX *currbdchgidx, int *fixsides)
static SCIP_RETCODE weakenContinuousVarsConflictRow (SCIP_CONFLICTROW *row, SCIP_SET *set, SCIP_VAR **vars, int residx)
static SCIP_Real getQuotLargestSmallestCoef (SCIP_SET *set, int *inds, SCIP_Real *vals, int nnz)
static SCIP_RETCODE updateBdchgQueue (SCIP_SET *set, SCIP_VAR **vars, SCIP_CONFLICTROW *conflictrow, SCIP_BDCHGIDX *inferbdchgidx)
static SCIP_RETCODE slackReducingContinuousBdchgQueue (SCIP_CONFLICT *conflict, SCIP_VAR **vars, SCIP_CONFLICTROW *row, SCIP_BDCHGIDX *inferbdchgidx)
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)
static SCIP_RETCODE updateStatistics (SCIP_CONFLICT *conflict, SCIP_VAR **vars, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_CONFLICTROW *conflictrow, int insertdepth)
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)
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)
static SCIP_RETCODE conflictRowAddSemiSparseData (SCIP_CONFLICTROW *resolutionrow, BMS_BLKMEM *blkmem, SCIP_Real *vals, int *inds, int nnz, SCIP_Real lhs, SCIP_Bool reverse)
static SCIP_Real computeScaleReason (SCIP_SET *set, SCIP_CONFLICTROW *conflictrow, SCIP_CONFLICTROW *reasonrow, int residx)
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)
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)
static SCIP_RETCODE reasonRowFromLpRow (SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_ROW *row, SCIP_CONFLICTROW *reasonrow, SCIP_BDCHGINFO *bdchginfo)
static SCIP_RETCODE conflictRowFromLpRow (SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_ROW *row, SCIP_CONFLICTROW *conflictrow, SCIP_BDCHGINFO *bdchginfo)
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)
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)
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)
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)
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)
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)
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)

Macro Definition Documentation

◆ BOUNDSWITCH

#define BOUNDSWITCH   0.51

threshold for bound switching - see cuts.c

Definition at line 87 of file conflict_resolution.c.

◆ POSTPROCESS

#define POSTPROCESS   FALSE

apply postprocessing after MIR calculation - see SCIPcalcMIR()

Definition at line 88 of file conflict_resolution.c.

◆ USEVBDS

#define USEVBDS   FALSE

use variable bounds - see SCIPcalcMIR()

Definition at line 89 of file conflict_resolution.c.

Referenced by MirReduction().

◆ FIXINTEGRALRHS

#define FIXINTEGRALRHS   FALSE

try to generate an integral rhs - see SCIPcalcMIR()

Definition at line 90 of file conflict_resolution.c.

Referenced by createCGCutCMIR(), generateGMICuts(), MirReduction(), and SCIP_DECL_SEPAEXECLP().

◆ MINFRAC

#define MINFRAC   0.05

minimal fractionality of floor(rhs) - see cuts.c

Definition at line 91 of file conflict_resolution.c.

◆ MAXFRAC

#define MAXFRAC   0.999

maximal fractionality of floor(rhs) - see cuts.c

Definition at line 92 of file conflict_resolution.c.

◆ EPS

#define EPS   1e-06

Function Documentation

◆ conflictRowCopy()

SCIP_RETCODE conflictRowCopy ( SCIP_CONFLICTROW ** targetrow,
BMS_BLKMEM * blkmem,
SCIP_CONFLICTROW * sourcerow )
static

creates a copy of the given generalized resolution row, allocating an additional amount of memory

Parameters
targetrowpointer to store the generalized resolution row
blkmemblock memory of transformed problem
sourcerowsource generalized resolution row

Definition at line 98 of file conflict_resolution.c.

References assert(), BMSallocBlockMemory, BMSallocBlockMemoryArray, BMScopyMemoryArray, SCIP_ConflictRow::coefquotient, SCIP_ConflictRow::conflictdepth, SCIP_ConflictRow::conflicttype, SCIP_ConflictRow::inds, SCIP_ConflictRow::insertdepth, SCIP_ConflictRow::isbinary, SCIP_ConflictRow::lhs, SCIP_ConflictRow::nnz, NULL, nvars, SCIP_ConflictRow::nvars, SCIP_ConflictRow::repropdepth, SCIP_ALLOC, SCIP_OKAY, SCIP_ConflictRow::slack, SCIP_ConflictRow::usescutoffbound, SCIP_ConflictRow::validdepth, and SCIP_ConflictRow::vals.

Referenced by conflictAnalyzeResolution().

◆ conflictRowReplace()

SCIP_RETCODE conflictRowReplace ( SCIP_CONFLICTROW * targetrow,
BMS_BLKMEM * blkmem,
SCIP_CONFLICTROW * sourcerow )
static

◆ conflictEnsureConflictRowsMem()

SCIP_RETCODE conflictEnsureConflictRowsMem ( SCIP_CONFLICT * conflict,
SCIP_SET * set,
int num )
static

resizes conflict rows array to be able to store at least num entries

Parameters
conflictconflict analysis data
setglobal SCIP settings
numminimal number of slots in array

Definition at line 184 of file conflict_resolution.c.

References assert(), BMSreallocMemoryArray, SCIP_Conflict::conflictrows, SCIP_Conflict::conflictrowssize, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPsetCalcMemGrowSize().

Referenced by conflictInsertConflictRow().

◆ conflictInsertConflictRow()

SCIP_RETCODE conflictInsertConflictRow ( SCIP_CONFLICT * conflict,
SCIP_SET * set,
SCIP_CONFLICTROW ** conflictrow )
static

add conflict row to the array of all conflicts rows

Parameters
conflictconflict analysis data
setglobal SCIP settings
conflictrowconflict row to add

Definition at line 208 of file conflict_resolution.c.

References assert(), conflictEnsureConflictRowsMem(), SCIP_Conflict::conflictrows, SCIP_Conflict::nconflictrows, NULL, SCIP_CALL, SCIP_OKAY, and SCIPsetDebugMsgPrint.

Referenced by conflictAnalyzeResolution().

◆ SCIPconflictGetNResConflictConss()

SCIP_Longint SCIPconflictGetNResConflictConss ( SCIP_CONFLICT * conflict)

gets number of conflict constraints found during propagation with the generalized resolution conflict analysis

Parameters
conflictconflict analysis data

Definition at line 233 of file conflict_resolution.c.

References assert(), SCIP_Conflict::nresconfconss, NULL, and SCIP_Longint.

Referenced by SCIPgetNConflictConssFound(), and SCIPprintConflictStatistics().

◆ SCIPconflictGetNResSuccess()

SCIP_Longint SCIPconflictGetNResSuccess ( SCIP_CONFLICT * conflict)

gets number of calls to generalized resolution conflict analysis that yield at least one conflict constraint

Parameters
conflictconflict analysis data

Definition at line 243 of file conflict_resolution.c.

References assert(), SCIP_Conflict::nressuccess, NULL, and SCIP_Longint.

Referenced by SCIPprintConflictStatistics().

◆ SCIPconflictGetNResLargeCoefs()

SCIP_Longint SCIPconflictGetNResLargeCoefs ( SCIP_CONFLICT * conflict)

gets number of calls to generalized resolution conflict analysis terminating because of large coefficients

Parameters
conflictconflict analysis data

Definition at line 254 of file conflict_resolution.c.

References assert(), SCIP_Conflict::nreslargecoefs, NULL, and SCIP_Longint.

Referenced by SCIPprintConflictStatistics().

◆ SCIPconflictGetNResLongConflicts()

SCIP_Longint SCIPconflictGetNResLongConflicts ( SCIP_CONFLICT * conflict)

gets number of calls to generalized resolution conflict analysis terminating because of long conflicts

Parameters
conflictconflict analysis data

Definition at line 264 of file conflict_resolution.c.

References assert(), SCIP_Conflict::nreslongconfs, NULL, and SCIP_Longint.

Referenced by SCIPprintConflictStatistics().

◆ SCIPconflictGetNResCalls()

SCIP_Longint SCIPconflictGetNResCalls ( SCIP_CONFLICT * conflict)

gets number of calls to generalized resolution conflict analysis

Parameters
conflictconflict analysis data

Definition at line 274 of file conflict_resolution.c.

References assert(), SCIP_Conflict::nrescalls, NULL, and SCIP_Longint.

Referenced by SCIPprintConflictStatistics().

◆ conflictCalcResMaxsize()

int conflictCalcResMaxsize ( SCIP_SET * set,
SCIP_PROB * prob )
static

calculates the maximal size of conflict sets to be used

Parameters
setglobal SCIP settings
probproblem data

Definition at line 487 of file conflict_resolution.c.

References assert(), MAX, SCIP_Prob::ncontvars, NULL, and SCIP_Prob::nvars.

Referenced by conflictAnalyzeResolution(), and SCIPconflictAddConflictCon().

◆ tightenCoefs()

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 )
static

perform activity based coefficient tightening on a semi-sparse or sparse row defined with a left hand side

Parameters
setglobal SCIP settings
varsarray of variables
localboundsdo we use local bounds?
rowcoefsdense row of coefficients
rowindsindices of the variables in the row
rownnznumber of non-zeros in the row
rowlhsleft hand side of the row
nchgcoefsnumber of changed coefficients
redundantpointer to store whether the row is redundant

Definition at line 504 of file conflict_resolution.c.

References assert(), EPS, FALSE, i, MAX, NULL, QUAD, QUAD_ASSIGN, QUAD_TO_DBL, SCIP_Bool, SCIP_CALL_ABORT, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPdebugPrintf, SCIPfreeBufferArray, SCIPfreeBufferArrayNull, SCIPgetNContVars(), SCIPgetNVars(), SCIPquadprecProdQD, SCIPquadprecSumDD, SCIPquadprecSumQD, SCIPquadprecSumQQ, SCIPsetIsGE(), SCIPsetIsInfinity(), SCIPsetIsLE(), SCIPsetIsLT(), SCIPsetIsNegative(), SCIPsetIsPositive(), SCIPsetIsRelGE(), SCIPsetIsRelLE(), SCIPsortDownRealInt(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), SCIPvarIsIntegral(), TRUE, var, and vars.

Referenced by conflictAnalyzeResolution().

◆ hasRelaxationOnlyVar()

SCIP_Bool hasRelaxationOnlyVar ( SCIP_SET * set,
SCIP_VAR ** vars,
SCIP_CONFLICTROW * row )
static

check if the generalized resolution row has a relaxation only variable

Parameters
setglobal SCIP settings
varsarray of variables
rowgeneralized resolution row

Definition at line 728 of file conflict_resolution.c.

References assert(), FALSE, i, SCIP_ConflictRow::inds, SCIP_ConflictRow::nnz, NULL, SCIP_Bool, SCIPvarIsRelaxationOnly(), TRUE, var, and vars.

Referenced by SCIPconflictAddConflictCon().

◆ isBinaryConflictRow()

SCIP_Bool isBinaryConflictRow ( SCIP_SET * set,
SCIP_VAR ** vars,
SCIP_CONFLICTROW * row )
static

check if a generalized resolution row has only binary variables

Parameters
setglobal SCIP settings
varsarray of variables
rowgeneralized resolution row

Definition at line 755 of file conflict_resolution.c.

References assert(), FALSE, i, SCIP_ConflictRow::inds, SCIP_ConflictRow::nnz, NULL, SCIP_Bool, SCIPvarIsBinary(), TRUE, var, and vars.

Referenced by ComplementedMirLhs(), executeResolutionStep(), and reduceReason().

◆ conflictRowRemoveZeroVar()

void conflictRowRemoveZeroVar ( SCIP_CONFLICTROW * row,
SCIP_SET * set,
int pos )
static

Removes a variable with zero coefficient in the generalized resolution row

Parameters
rowgeneralized resolution row
setglobal SCIP settings
posposition of variable in conflict row

Definition at line 782 of file conflict_resolution.c.

References assert(), SCIP_ConflictRow::inds, SCIP_ConflictRow::nnz, NULL, SCIPsetIsZero(), and SCIP_ConflictRow::vals.

Referenced by conflictRowRemoveZeroVars().

◆ conflictRowRemoveZeroVars()

void conflictRowRemoveZeroVars ( SCIP_CONFLICTROW * row,
SCIP_SET * set )
static

Removes all variables with zero coefficient (< 1e-09) in the generalized resolution row

Parameters
rowgeneralized resolution row
setglobal SCIP settings

Definition at line 803 of file conflict_resolution.c.

References assert(), conflictRowRemoveZeroVar(), i, SCIP_ConflictRow::inds, SCIP_ConflictRow::nnz, NULL, SCIPsetIsZero(), and SCIP_ConflictRow::vals.

Referenced by ComplementedMirLhs(), conflictAnalyzeResolution(), linearCombRows(), and MirReduction().

◆ ComplementedMirLhs()

SCIP_RETCODE ComplementedMirLhs ( SCIP_SET * set,
SCIP_VAR ** vars,
SCIP_CONFLICTROW * reasonrow,
int * fixsides,
SCIP_BDCHGIDX * currbdchgidx,
int idxreason,
SCIP_Real divisor )
static

complement and apply MIR to a 0-1 reason constraint lhs <= a^T x

Parameters
setglobal SCIP settings
varsarray of variables
reasonrowreason row
fixsidesdense array of variables fixed to a bound
currbdchgidxcurrent bound change index
idxreasonindex in the reason
divisorthe divisor of the row

Definition at line 821 of file conflict_resolution.c.

References assert(), conflictRowRemoveZeroVars(), i, SCIP_ConflictRow::inds, isBinaryConflictRow(), SCIP_ConflictRow::lhs, MAXFRAC, MINFRAC, SCIP_ConflictRow::nnz, NULL, SCIP_OKAY, SCIP_Real, SCIPgetVarLbAtIndex(), SCIPgetVarUbAtIndex(), SCIPsetCeil(), SCIPsetDebugMsgPrint, SCIPsetFloor(), SCIPsetIsGT(), SCIPvarIsBinary(), TRUE, SCIP_ConflictRow::vals, varidx, and vars.

Referenced by reduceReason().

◆ linearCombRows()

void linearCombRows ( SCIP_SET * set,
SCIP_CONFLICTROW * row1,
SCIP_CONFLICTROW * row2,
SCIP_Real scale )
static
Parameters
setglobal SCIP settings
row1first row (aggregated row)
row2second row
scalescale factor for second row

Definition at line 975 of file conflict_resolution.c.

References assert(), conflictRowRemoveZeroVars(), i, SCIP_ConflictRow::inds, SCIP_ConflictRow::lhs, SCIP_ConflictRow::nnz, NULL, SCIP_Real, SCIPsetIsZero(), and SCIP_ConflictRow::vals.

Referenced by rescaleAndResolve().

◆ isResolvableBdchg()

SCIP_Bool isResolvableBdchg ( SCIP_BDCHGINFO * bdchginfo)
static

◆ existsResolvablebdchginfo()

SCIP_Bool existsResolvablebdchginfo ( SCIP_CONFLICT * conflict)
static

returns whether there exists a resolvable bound change or not

Parameters
conflictconflict analysis data

Definition at line 1041 of file conflict_resolution.c.

References FALSE, i, isResolvableBdchg(), SCIP_Conflict::resbdchgqueue, SCIP_Bool, SCIPpqueueElems(), SCIPpqueueNElems(), and TRUE.

Referenced by conflictAnalyzeResolution(), and markBdchgAsFixed().

◆ isBdchgConflictRelevant()

SCIP_Bool isBdchgConflictRelevant ( SCIP_CONFLICT * conflict,
SCIP_BDCHGINFO * bdchginfo,
int initial )
static

returns whether a bound change is relevant for the infeasibility of the conflict row. A bound change is relevant if:

  • It is an upper bound change with a positive row coefficient,
  • It is a lower bound change with a negative row coefficient
Parameters
conflictconflict analysis data
bdchginfobound change to check
initialwhether we are in the initialization of conflict analysis

Definition at line 1064 of file conflict_resolution.c.

References SCIP_Conflict::conflictrow, FALSE, SCIP_ConflictRow::nnz, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIPbdchginfoGetBoundtype(), SCIPbdchginfoGetVar(), SCIPvarGetProbindex(), TRUE, SCIP_ConflictRow::vals, and var.

Referenced by conflictFirstCand(), and conflictRemoveCand().

◆ conflictFirstCand()

SCIP_BDCHGINFO * conflictFirstCand ( SCIP_SET * set,
SCIP_CONFLICT * conflict,
int initial )
static

◆ conflictRemoveCand()

SCIP_BDCHGINFO * conflictRemoveCand ( SCIP_CONFLICT * conflict,
int initial )
static

removes and returns next conflict analysis bound change candidate from the queue

Parameters
conflictconflict analysis data
initialwhether we are in the initialization of conflict analysis

Definition at line 1141 of file conflict_resolution.c.

References assert(), isBdchgConflictRelevant(), NULL, SCIP_Conflict::resbdchgqueue, SCIPbdchginfoIsRedundant(), and SCIPpqueueRemove().

Referenced by conflictAnalyzeResolution(), and markBdchgAsFixed().

◆ SCIPconflictResolutionApplicable()

SCIP_Bool SCIPconflictResolutionApplicable ( SCIP_SET * set)

return TRUE if generalized resolution conflict analysis is applicable

Parameters
setglobal SCIP settings

Definition at line 1161 of file conflict_resolution.c.

References FALSE, SCIP_Bool, and TRUE.

Referenced by SCIPconflictAnalyzeResolution().

◆ conflictRowCreate()

SCIP_RETCODE conflictRowCreate ( SCIP_CONFLICTROW ** row,
BMS_BLKMEM * blkmem )
static

creates a generalized resolution row

Parameters
rowgeneralized resolution row
blkmemblock memory of transformed problem

Definition at line 1174 of file conflict_resolution.c.

References assert(), BMSallocBlockMemory, FALSE, NULL, SCIP_ALLOC, SCIP_CONFTYPE_PROPAGATION, and SCIP_OKAY.

Referenced by SCIPconflictInitRows().

◆ SCIPconflictInitRows()

SCIP_RETCODE SCIPconflictInitRows ( SCIP_CONFLICT * conflict,
BMS_BLKMEM * blkmem )

creates conflict and reason rows

Parameters
conflictconflict analysis data
blkmemblock memory of transformed problem

Definition at line 1202 of file conflict_resolution.c.

References assert(), SCIP_Conflict::conflictrow, conflictRowCreate(), NULL, SCIP_Conflict::reasonrow, SCIP_Conflict::reducedreasonrow, SCIP_Conflict::resolvedconflictrow, SCIP_CALL, and SCIP_OKAY.

Referenced by SCIPconflictCreate().

◆ SCIPconflictRowFree()

void SCIPconflictRowFree ( SCIP_CONFLICTROW ** row,
BMS_BLKMEM * blkmem )

frees a generalized resolution row

Parameters
rowconflict row
blkmemblock memory

Definition at line 1220 of file conflict_resolution.c.

References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, and NULL.

Referenced by freeConflictResources(), SCIPconflictAnalyzeResolution(), and SCIPconflictFree().

◆ freeConflictResources()

void freeConflictResources ( SCIP_CONFLICT * conflict,
BMS_BLKMEM * blkmem,
SCIP_SET * set,
SCIP_Real * fixbounds,
int * fixsides )
static

frees all conflict rows and arrays that track unresolvable (fixed) variables

Parameters
conflictconflict analysis data
blkmemblock memory
setglobal SCIP settings
fixboundsdense array of fixed bounds
fixsidesdense array of variables fixed to a bound

Definition at line 1237 of file conflict_resolution.c.

References SCIP_Conflict::conflictrows, i, SCIP_Conflict::nconflictrows, SCIP_Real, SCIPconflictRowFree(), and SCIPsetFreeBufferArray.

Referenced by conflictAnalyzeResolution().

◆ conflictRowClear()

◆ computeSlack()

SCIP_RETCODE computeSlack ( SCIP_SET * set,
SCIP_VAR ** vars,
SCIP_CONFLICTROW * row,
SCIP_BDCHGINFO * currbdchginfo,
SCIP_Real * fixbounds,
int * fixsides )
static

calculates the slack (maxact - rhs) for a generalized resolution row given a set of bounds and coefficients

Parameters
setglobal SCIP settings
varsarray of variables
rowgeneralized resolution row
currbdchginfocurrent bound change
fixboundsdense array of fixed bounds
fixsidesdense array of variables fixed to a bound

Definition at line 1291 of file conflict_resolution.c.

References assert(), bound, i, SCIP_ConflictRow::inds, SCIP_ConflictRow::lhs, SCIP_ConflictRow::nnz, NULL, QUAD, QUAD_ASSIGN, QUAD_TO_DBL, SCIP_OKAY, SCIP_Real, SCIPbdchginfoGetDepth(), SCIPbdchginfoGetIdx(), SCIPbdchginfoGetPos(), SCIPgetVarLbAtIndex(), SCIPgetVarUbAtIndex(), SCIPquadprecProdDD, SCIPquadprecSumQD, SCIPquadprecSumQQ, SCIPsetDebugMsgPrint, SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetProbindex(), SCIPvarGetUbGlobal(), SCIP_ConflictRow::slack, TRUE, SCIP_ConflictRow::vals, and vars.

Referenced by conflictAnalyzeResolution(), executeResolutionStep(), getConflictRow(), getReasonRow(), markBdchgAsFixed(), MirReduction(), and reduceReason().

◆ MirReduction()

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 )
static

reduces the reason row by applying MIR. In the reference solution, each variable is set to the value that was used for the propagation of currbdchginfo.

Parameters
setglobal SCIP settings
blkmemblock memory of transformed problem
varsarray of variables
nvarsnumber of variables
reasonrowreason row
currbdchginfocurrent bound change to resolve
varidxindex of the variable to resolve
divisorthe divisor of the row

Definition at line 1375 of file conflict_resolution.c.

References assert(), BOUNDSWITCH, computeSlack(), conflictRowClear(), conflictRowRemoveZeroVars(), FALSE, FIXINTEGRALRHS, i, SCIP_ConflictRow::inds, SCIP_ConflictRow::lhs, MAX, MAXFRAC, MIN, MINFRAC, SCIP_ConflictRow::nnz, NULL, nvars, POSTPROCESS, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPaggrRowAddCustomCons(), SCIPaggrRowCreate(), SCIPaggrRowFree(), SCIPbdchginfoGetIdx(), SCIPcalcMIR(), SCIPcreateSol(), SCIPdebug, SCIPfreeSol(), SCIPgetVarLbAtIndex(), SCIPgetVarUbAtIndex(), SCIPsetAllocBufferArray, SCIPsetDebugMsgPrint, SCIPsetFreeBufferArray, SCIPsetIsGT(), SCIPsetSolVal(), SCIPvarGetLbGlobal(), SCIPvarGetUbGlobal(), SCIPvarIsIntegral(), SCIP_ConflictRow::slack, USEVBDS, SCIP_ConflictRow::vals, varidx, and vars.

Referenced by reduceReason().

◆ weakenVarConflictRow()

void weakenVarConflictRow ( SCIP_CONFLICTROW * row,
SCIP_SET * set,
SCIP_VAR * var,
int pos )
static

weaken variable in a generalized resolution row

Parameters
rowgeneralized resolution row
setglobal SCIP settings
varvariable to weaken
posposition in array of indices

Definition at line 1511 of file conflict_resolution.c.

References assert(), SCIP_ConflictRow::inds, SCIP_ConflictRow::lhs, SCIP_ConflictRow::nnz, NULL, nvars, SCIPdebugMessage, SCIPsetIsGT(), SCIPsetIsLT(), SCIPsetIsZero(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIP_ConflictRow::vals, and var.

Referenced by weakenConflictRow(), and weakenContinuousVarsConflictRow().

◆ weakenConflictRow()

void weakenConflictRow ( SCIP_CONFLICTROW * row,
SCIP_SET * set,
SCIP_VAR ** vars,
SCIP_BDCHGIDX * currbdchgidx,
int * fixsides )
static

weaken generalized resolution row by setting variables to their global bounds

Parameters
rowgeneralized resolution row
setglobal SCIP settings
varsarray of variables
currbdchgidxcurrent bound change index
fixsidesdense array of variables fixed to a bound

Definition at line 1543 of file conflict_resolution.c.

References assert(), i, SCIP_ConflictRow::inds, SCIP_ConflictRow::nnz, NULL, SCIP_Real, SCIPdebugMessage, SCIPgetVarLbAtIndex(), SCIPgetVarUbAtIndex(), SCIPsetIsEQ(), SCIPvarGetLbGlobal(), SCIPvarGetUbGlobal(), TRUE, SCIP_ConflictRow::vals, vars, and weakenVarConflictRow().

Referenced by conflictAnalyzeResolution(), and getConflictRow().

◆ weakenContinuousVarsConflictRow()

SCIP_RETCODE weakenContinuousVarsConflictRow ( SCIP_CONFLICTROW * row,
SCIP_SET * set,
SCIP_VAR ** vars,
int residx )
static

weaken all continuous variables in a generalized resolution row

Parameters
rowgeneralized resolution row
setglobal SCIP settings
varsarray of variables
residxindex of variable we are resolving on

Definition at line 1600 of file conflict_resolution.c.

References assert(), i, SCIP_ConflictRow::inds, SCIP_ConflictRow::nnz, NULL, SCIP_OKAY, SCIPdebugMessage, SCIPvarIsIntegral(), SCIP_ConflictRow::vals, vars, and weakenVarConflictRow().

Referenced by executeResolutionStep().

◆ getQuotLargestSmallestCoef()

SCIP_Real getQuotLargestSmallestCoef ( SCIP_SET * set,
int * inds,
SCIP_Real * vals,
int nnz )
static

returns the quotient of the largest and smallest value in a semi-sparse array

Parameters
setglobal SCIP settings
indsarray of indices
valsdense array of values
nnznumber of nonzeros

Definition at line 1647 of file conflict_resolution.c.

References assert(), i, MAX, MIN, NULL, REALABS, SCIP_Real, and SCIPsetInfinity().

Referenced by conflictAnalyzeResolution().

◆ updateBdchgQueue()

SCIP_RETCODE updateBdchgQueue ( SCIP_SET * set,
SCIP_VAR ** vars,
SCIP_CONFLICTROW * conflictrow,
SCIP_BDCHGIDX * inferbdchgidx )
static

for every variable in the row, except the inferred variable, add bound changes

Parameters
setglobal SCIP settings
varsarray of variables
conflictrowconflict row
inferbdchgidxbound change index (time stamp of bound change), or NULL for current time

Definition at line 1678 of file conflict_resolution.c.

References assert(), FALSE, i, SCIP_ConflictRow::inds, SCIP_ConflictRow::nnz, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPgetVarLbAtIndex(), SCIPgetVarUbAtIndex(), SCIPsetIsGT(), SCIPsetIsLT(), SCIPvarGetLbGlobal(), SCIPvarGetNBdchgInfosLb(), SCIPvarGetNBdchgInfosUb(), SCIPvarGetProbindex(), SCIPvarGetUbGlobal(), SCIP_ConflictRow::vals, and vars.

Referenced by conflictAnalyzeResolution(), and markBdchgAsFixed().

◆ slackReducingContinuousBdchgQueue()

SCIP_RETCODE slackReducingContinuousBdchgQueue ( SCIP_CONFLICT * conflict,
SCIP_VAR ** vars,
SCIP_CONFLICTROW * row,
SCIP_BDCHGIDX * inferbdchgidx )
static

add all slack reducing continuous bound changes to the continuous bound change queue

Parameters
conflictconflict analysis data
varsarray of variables
rowconflict row
inferbdchgidxbound change index of latest continuous bound change

Definition at line 1730 of file conflict_resolution.c.

References assert(), SCIP_Conflict::continuousbdchgqueue, FALSE, i, SCIP_ConflictRow::inds, SCIP_ConflictRow::nnz, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPbdchgidxGetDepth(), SCIPbdchgidxGetPos(), SCIPbdchginfoGetDepth(), SCIPbdchginfoGetPos(), SCIPpqueueClear(), SCIPpqueueInsert(), SCIPpqueueNElems(), SCIPvarGetLbchgInfo(), SCIPvarGetProbindex(), SCIPvarGetUbchgInfo(), SCIPvarIsIntegral(), SCIP_ConflictRow::vals, and vars.

Referenced by executeResolutionStep().

◆ incVSIDS()

SCIP_RETCODE incVSIDS ( SCIP_VAR * var,
BMS_BLKMEM * blkmem,
SCIP_SET * set,
SCIP_STAT * stat,
SCIP_BOUNDTYPE boundtype,
SCIP_Real value,
SCIP_Real weight )
static

increases the conflict score of the variable in the given direction

Parameters
varproblem variable
blkmemblock memory
setglobal SCIP settings
statdynamic problem statistics
boundtypetype of bound for which the score should be increased
valuevalue of the bound
weightweight of this VSIDS updates

Definition at line 1795 of file conflict_resolution.c.

References assert(), SCIP_Stat::glbhistory, SCIP_Stat::glbhistorycrun, NULL, SCIP_BOUNDTYPE_LOWER, SCIP_BRANCHDIR_DOWNWARDS, SCIP_BRANCHDIR_UPWARDS, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPhistoryIncVSIDS(), SCIPsetIsZero(), SCIPvarIncVSIDS(), var, and SCIP_Stat::vsidsweight.

Referenced by updateStatistics().

◆ updateStatistics()

SCIP_RETCODE updateStatistics ( SCIP_CONFLICT * conflict,
SCIP_VAR ** vars,
BMS_BLKMEM * blkmem,
SCIP_SET * set,
SCIP_STAT * stat,
SCIP_CONFLICTROW * conflictrow,
int insertdepth )
static

update conflict statistics

Parameters
conflictconflict analysis data
varsarray of variables
blkmemblock memory
setglobal SCIP settings
statdynamic problem statistics
conflictrowconflict row to add to the tree
insertdepthdepth level at which the conflict set should be added

Definition at line 1826 of file conflict_resolution.c.

References assert(), bound, SCIP_Stat::glbhistory, SCIP_Stat::glbhistorycrun, i, incVSIDS(), SCIP_ConflictRow::inds, SCIP_Conflict::nappliedglbconss, SCIP_Conflict::nappliedglbliterals, SCIP_Conflict::nappliedlocconss, SCIP_Conflict::nappliedlocliterals, SCIP_ConflictRow::nnz, NULL, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_BRANCHDIR_DOWNWARDS, SCIP_BRANCHDIR_UPWARDS, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPhistoryIncNActiveConflicts(), SCIPsetIsZero(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), SCIPvarIncNActiveConflicts(), SCIP_ConflictRow::vals, var, and vars.

Referenced by createAndAddConflictCon(), and SCIPconflictAddConflictCon().

◆ createAndAddConflictCon()

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 )
static

creates a conflict constraint and tries to add it to the storage

Parameters
conflictconflict analysis data
blkmemblock memory
setglobal SCIP settings
statdynamic problem statistics
varsarray of variables
treebranch and bound tree
reoptreoptimization data structure
lpcurrent LP data
cliquetableclique table data structure
conflictrowconflict row to add to the tree
insertdepthdepth level at which the conflict set should be added
successpointer to store whether the addition was successful

Definition at line 1885 of file conflict_resolution.c.

References assert(), SCIP_ConflictRow::conflicttype, FALSE, i, SCIP_ConflictRow::inds, SCIP_ConflictRow::lhs, SCIP_ConflictRow::nnz, SCIP_Conflict::nresconfconss, NULL, SCIP_Tree::path, SCIP_Bool, SCIP_CALL, SCIP_LONGINT_FORMAT, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIPaddConflict(), SCIPallocBufferArray, SCIPcreateConsLinear(), SCIPdebugCheckConss, SCIPfreeBufferArray, SCIPnodeGetDepth(), SCIPreleaseCons(), SCIPsetInfinity(), SCIPsnprintf(), SCIPupgradeConsLinear(), TRUE, updateStatistics(), SCIP_ConflictRow::usescutoffbound, SCIP_ConflictRow::validdepth, SCIP_ConflictRow::vals, and vars.

Referenced by SCIPconflictAddConflictCon().

◆ SCIPconflictAddConflictCon()

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 )

create conflict constraints out of conflict row and add them to the problem

Parameters
conflictconflict analysis data
blkmemblock memory
setglobal SCIP settings
statdynamic problem statistics
transprobtransformed problem
origproboriginal problem
treebranch and bound tree
reoptreoptimization data structure
lpcurrent LP data
branchcandbranching candidate storage
eventqueueevent queue
eventfilterglobal event filter
cliquetableclique table data structure
conflictrowconflict row to add to the tree
successtrue if the conflict is added to the problem

Definition at line 1958 of file conflict_resolution.c.

References assert(), bound, conflictCalcResMaxsize(), SCIP_ConflictRow::conflictdepth, createAndAddConflictCon(), SCIP_Lp::diving, FALSE, hasRelaxationOnlyVar(), SCIP_ConflictRow::inds, SCIP_ConflictRow::insertdepth, SCIP_ConflictRow::lhs, SCIP_Conflict::nappliedglbresconss, SCIP_ConflictRow::nnz, SCIP_Conflict::nreslongconfs, NULL, SCIP_Tree::path, SCIP_Tree::pathlen, SCIP_ConflictRow::repropdepth, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPnodeAddBoundchg(), SCIPnodeCutoff(), SCIPprobGetVars(), SCIPsetCeil(), SCIPsetDebugMsg, SCIPsetDebugMsgPrint, SCIPsetFloor(), SCIPsetIsFeasGT(), SCIPsetIsGT(), SCIPsetIsLT(), SCIPsetIsZero(), SCIPtreeGetCurrentDepth(), SCIPtreeGetFocusDepth(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), SCIPvarIsIntegral(), SCIP_Lp::strongbranching, TRUE, updateStatistics(), SCIP_ConflictRow::validdepth, SCIP_ConflictRow::vals, var, and vars.

Referenced by addConflictRows().

◆ conflictRowAddSemiSparseData()

SCIP_RETCODE conflictRowAddSemiSparseData ( SCIP_CONFLICTROW * resolutionrow,
BMS_BLKMEM * blkmem,
SCIP_Real * vals,
int * inds,
int nnz,
SCIP_Real lhs,
SCIP_Bool reverse )
static

adds given data as row to the generalized resolution row

Parameters
resolutionrowgeneralized resolution row
blkmemblock memory
valsvariable coefficients
indsvariable array
nnzsize of variable and coefficient array
lhsleft-hand side of conflict row
reversereverse coefficients

Definition at line 2102 of file conflict_resolution.c.

References assert(), BMSallocBlockMemoryArray, BMSreallocBlockMemoryArray, i, SCIP_ConflictRow::inds, SCIP_ConflictRow::lhs, SCIP_ConflictRow::nnz, NULL, SCIP_ALLOC, SCIP_Bool, SCIP_OKAY, SCIP_Real, SCIP_ConflictRow::size, and SCIP_ConflictRow::vals.

Referenced by conflictRowFromLpRow(), and reasonRowFromLpRow().

◆ computeScaleReason()

SCIP_Real computeScaleReason ( SCIP_SET * set,
SCIP_CONFLICTROW * conflictrow,
SCIP_CONFLICTROW * reasonrow,
int residx )
static

compute scale for the reason constraint such that the resolving variable cancels out

Parameters
setglobal SCIP settings
conflictrowconflict row
reasonrowreason row
residxindex of variable to resolve

Definition at line 2165 of file conflict_resolution.c.

References assert(), REALABS, SCIP_Real, SCIPsetIsZero(), and SCIP_ConflictRow::vals.

Referenced by rescaleAndResolve().

◆ rescaleAndResolve()

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 )
static

compute the resolved conflict row resolvedrow = row1 + scale * row2

Parameters
setglobal SCIP settings
conflictconflict analysis data
row1conflict row
row2reason conflict row
resolvedrowresolved conflict row
blkmemblock memory
residxindex of variable to resolve
successapply resolution

Definition at line 2188 of file conflict_resolution.c.

References assert(), BMSreallocBlockMemoryArray, SCIP_ConflictRow::coefquotient, computeScaleReason(), conflictRowReplace(), FALSE, i, SCIP_ConflictRow::inds, linearCombRows(), MAX, MIN, SCIP_ConflictRow::nnz, SCIP_Conflict::nreslargecoefs, NULL, SCIP_ALLOC, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPsetDebugMsgPrint, SCIPsetInfinity(), SCIPsetIsGE(), SCIPsetIsGT(), SCIPsetIsZero(), SCIP_ConflictRow::size, SCIP_ConflictRow::slack, TRUE, and SCIP_ConflictRow::vals.

Referenced by executeResolutionStep().

◆ reduceReason()

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 )
static

reduce the reason constraint

Parameters
setglobal SCIP settings
blkmemblock memory of transformed problem
varsarray of variables
nvarsnumber of variables
rowtoreducethe row to reduce
currbdchginfocurrent bound change to resolve
residxindex of variable to resolve
fixboundsdense array of fixed bounds
fixsidesdense array of variables fixed to a bound

Definition at line 2270 of file conflict_resolution.c.

References assert(), ComplementedMirLhs(), computeSlack(), isBinaryConflictRow(), MirReduction(), nvars, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPbdchginfoGetIdx(), SCIPdebug, SCIPsetIsZero(), SCIP_ConflictRow::vals, and vars.

Referenced by executeResolutionStep().

◆ reasonRowFromLpRow()

◆ conflictRowFromLpRow()

SCIP_RETCODE conflictRowFromLpRow ( SCIP_SET * set,
BMS_BLKMEM * blkmem,
SCIP_ROW * row,
SCIP_CONFLICTROW * conflictrow,
SCIP_BDCHGINFO * bdchginfo )
static

◆ getReasonRow()

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 )
static

get the reason for the given bound change

Parameters
blkmemblock memory
varsarray of variables
setglobal SCIP settings
currbdchginfobound change to resolve
reasonrowreason row for the bound change
residxindex of the bound change to resolve
fixboundsdense array of fixed bounds
fixsidesdense array of variables fixed to a bound
successpointer to store whether we could get a linear reason

Definition at line 2479 of file conflict_resolution.c.

References assert(), computeSlack(), SCIP_Cons::conshdlr, FALSE, isResolvableBdchg(), SCIP_ConflictRow::lhs, NULL, reasonRowFromLpRow(), SCIP_Bool, SCIP_BOUNDCHGTYPE_CONSINFER, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPbdchginfoGetChgtype(), SCIPbdchginfoGetIdx(), SCIPbdchginfoGetInferCons(), SCIPbdchginfoGetOldbound(), SCIPbdchginfoGetVar(), SCIPconsCreateRow(), SCIPconshdlrGetName(), SCIPconsIsGlobal(), SCIPgetVarLbAtIndex(), SCIPgetVarUbAtIndex(), SCIPsetDebugMsgPrint, SCIPsetIsGT(), SCIPsetIsInfinity(), SCIPsetIsLT(), SCIPvarGetProbindex(), SCIP_ConflictRow::slack, TRUE, SCIP_ConflictRow::vals, var, and vars.

Referenced by conflictAnalyzeResolution(), and executeResolutionStep().

◆ getConflictRow()

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 )
static

get the conflict row for the given bound change from the LP row.

Parameters
conflictconflict analysis data
blkmemblock memory of transformed problem
setglobal SCIP settings
probproblem data
initialconflictrowrow of constraint that detected the conflict
currbdchginfobound change to resolve
maxsizemaximal size of conflict rows
successpointer to store whether we could get a conflict row

Definition at line 2573 of file conflict_resolution.c.

References assert(), computeSlack(), SCIP_Conflict::conflictrow, conflictRowFromLpRow(), FALSE, SCIP_ConflictRow::nnz, SCIP_Conflict::nreslongconfs, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPbdchginfoGetIdx(), SCIProwGetName(), SCIProwGetNNonz(), SCIPsetDebugMsgPrint, SCIPsetIsGE(), SCIPsetIsLT(), SCIP_ConflictRow::slack, TRUE, SCIP_Prob::vars, vars, and weakenConflictRow().

Referenced by conflictAnalyzeResolution().

◆ executeResolutionStep()

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 )
static

execute resolution; reduce reason if necessary

Parameters
conflictconflict analysis data
setglobal SCIP settings
varsarray of variables
blkmemblock memory of transformed problem
currbdchginfocurrent bound change to resolve
residxindex of variable to resolve
maxsizemaximal size of conflict rows
fixboundsdense array of fixed bounds
fixsidesdense array of variables fixed to a bound
successresolutionpointer to store whether the resolution was successful

Definition at line 2650 of file conflict_resolution.c.

References assert(), computeSlack(), SCIP_Conflict::conflictrow, conflictRowClear(), conflictRowReplace(), SCIP_Conflict::continuousbdchgqueue, FALSE, getReasonRow(), isBinaryConflictRow(), SCIP_ConflictRow::nnz, SCIP_Conflict::nreslongconfs, NULL, nvars, SCIP_Conflict::reasonrow, SCIP_Conflict::reducedreasonrow, reduceReason(), rescaleAndResolve(), SCIP_Conflict::resolvedconflictrow, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPbdchginfoGetIdx(), SCIPbdchginfoGetVar(), SCIPdebug, SCIPgetNVars(), SCIPpqueueNElems(), SCIPpqueueRemove(), SCIPsetDebugMsgPrint, SCIPsetIsGE(), SCIPsetIsLE(), SCIPsetIsLT(), SCIPsetIsZero(), SCIPvarGetName(), SCIPvarGetProbindex(), SCIP_ConflictRow::slack, slackReducingContinuousBdchgQueue(), TRUE, SCIP_ConflictRow::vals, varidx, vars, and weakenContinuousVarsConflictRow().

Referenced by conflictAnalyzeResolution().

◆ markBdchgAsFixed()

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 )
static

If a bound change cannot be resolved, it is treated as a branching decision. Subsequent bound changes for that variable are ignored by recording the variable's index in fixsides and its bound type in fixbounds (1 for upper, -1 for lower).

Parameters
conflictconflict analysis data
setglobal SCIP settings
varsarray of variables
currbdchginfopointer to current bound change to resolve
currbdchgdepthpointer to store the depth of the bound change
nresstepsnumber of bound changes that have been resolved so far
fixboundsdense array of fixed bounds
fixsidesdense array of variables fixed to a bound
successpointer to store whether the bound change was ignored

Definition at line 2820 of file conflict_resolution.c.

References assert(), computeSlack(), conflictFirstCand(), conflictRemoveCand(), SCIP_Conflict::conflictrow, SCIP_Conflict::conflictvarslbs, SCIP_Conflict::conflictvarsubs, existsResolvablebdchginfo(), FALSE, NULL, SCIP_Bool, SCIP_BOUNDCHGTYPE_BRANCHING, SCIP_BOUNDCHGTYPE_CONSINFER, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_REAL_MAX, SCIP_REAL_MIN, SCIPbdchginfoGetBoundtype(), SCIPbdchginfoGetChgtype(), SCIPbdchginfoGetDepth(), SCIPbdchginfoGetIdx(), SCIPbdchginfoGetInferCons(), SCIPbdchginfoGetNewbound(), SCIPbdchginfoGetVar(), SCIPconsIsGlobal(), SCIPsetDebugMsgPrint, SCIPsetIsLT(), SCIPvarGetName(), SCIPvarGetProbindex(), SCIP_ConflictRow::slack, TRUE, updateBdchgQueue(), var, varidx, and vars.

Referenced by conflictAnalyzeResolution().

◆ addConflictRows()

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 )
static

add the conflict rows to the problem

Parameters
conflictconflict analysis data
blkmemblock memory
setglobal SCIP settings
statdynamic problem statistics
transprobtransformed problem
origproboriginal problem
treebranch and bound tree
reoptreoptimization data structure
lpcurrent LP data
branchcandbranching candidate storage
eventqueueevent queue
eventfilterglobal event filter
cliquetableclique table data structure
nconstoaddnumber of conflict constraints to add
nconsspointer to store the number of generated conflict constraints
nconfvarspointer to store the number of variables in generated conflict constraints

Definition at line 2909 of file conflict_resolution.c.

References assert(), SCIP_ConflictRow::coefquotient, SCIP_Conflict::conflictrows, i, SCIP_ConflictRow::nnz, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPconflictAddConflictCon(), SCIPsetIsLT(), and SCIP_ConflictRow::slack.

Referenced by conflictAnalyzeResolution().

◆ conflictAnalyzeResolution()

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 )

Analyzes conflicting bound changes added via SCIPconflictAddBound(). This function performs generalized resolution conflict analysis by iteratively aggregating the infeasible conflict row (conflictrow) with the reason row (reasonrow) that propagated the bound change. In each iteration, the coefficient of the resolving variable is cancelled. If the aggregation does not yield an infeasible row, MIR reduction is applied to the reason row and the aggregation is retried, continuing until a first unique implication point (FUIP) is reached. On success, a linear conflict constraint that explains the infeasibility is added to the problem.

Parameters
conflictconflict analysis data
blkmemblock memory of transformed problem
setglobal SCIP settings
statproblem statistics
transprobtransformed problem
origproboriginal problem
treebranch and bound tree
reoptreoptimization data structure
lpLP data
branchcandbranching candidate storage
eventqueueevent queue
eventfilterglobal event filter
cliquetableclique table data structure
initialconflictrowrow of constraint that detected the conflict
validdepthminimal depth level at which the initial conflict set is valid
nconsspointer to store the number of generated conflict constraints
nconfvarspointer to store the number of variables in generated conflict constraints

Definition at line 2961 of file conflict_resolution.c.

References addConflictRows(), assert(), SCIP_ConflictRow::coefquotient, computeSlack(), conflictCalcResMaxsize(), SCIP_ConflictRow::conflictdepth, conflictFirstCand(), conflictInsertConflictRow(), conflictRemoveCand(), SCIP_Conflict::conflictrow, conflictRowClear(), conflictRowCopy(), conflictRowRemoveZeroVars(), conflictRowReplace(), SCIP_ConflictRow::conflicttype, SCIP_Conflict::conflictvarslbs, SCIP_Conflict::conflictvarsubs, EPS, executeResolutionStep(), existsResolvablebdchginfo(), FALSE, freeConflictResources(), getConflictRow(), getQuotLargestSmallestCoef(), getReasonRow(), i, SCIP_ConflictRow::inds, SCIP_ConflictRow::insertdepth, isResolvableBdchg(), SCIP_ConflictRow::lhs, markBdchgAsFixed(), MAX, MIN, SCIP_Conflict::nconflictrows, SCIP_ConflictRow::nnz, SCIP_Conflict::nreslongconfs, NULL, nvars, SCIP_Prob::nvars, SCIP_Tree::pathlen, SCIP_Conflict::reasonrow, SCIP_Conflict::reducedreasonrow, SCIP_ConflictRow::repropdepth, SCIP_Conflict::resolvedconflictrow, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_CALL, SCIP_CONFTYPE_PROPAGATION, SCIP_OKAY, SCIP_Real, SCIP_REAL_MAX, SCIP_REAL_MIN, SCIPbdchginfoGetBoundtype(), SCIPbdchginfoGetDepth(), SCIPbdchginfoGetIdx(), SCIPbdchginfoGetVar(), SCIPdebug, SCIPprobGetVars(), SCIPsetAllocBufferArray, SCIPsetDebugMsgPrint, SCIPsetIsEQ(), SCIPsetIsGE(), SCIPsetIsLE(), SCIPsetIsLT(), SCIPsetIsRelLE(), SCIPsetIsZero(), SCIPtreeGetCurrentDepth(), SCIPtreeGetFocusDepth(), SCIPvarGetName(), SCIPvarGetProbindex(), SCIPvarIsActive(), SCIP_ConflictRow::slack, tightenCoefs(), TRUE, updateBdchgQueue(), SCIP_ConflictRow::validdepth, SCIP_ConflictRow::vals, vars, and weakenConflictRow().

Referenced by SCIPconflictAnalyzeResolution().

◆ SCIPconflictAnalyzeResolution()

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 )

analyzes conflicting bound changes that were added with calls to SCIPconflictAddBound(), and on success, creates a linear constraint that explains the infeasibility

Parameters
conflictconflict analysis data
blkmemblock memory of transformed problem
setglobal SCIP settings
statproblem statistics
transprobtransformed problem
origproboriginal problem
treebranch and bound tree
reoptreoptimization data structure
lpLP data
branchcandbranching candidate storage
eventqueueevent queue
eventfilterglobal event filter
cliquetableclique table data structure
initialconflictrowrow of constraint that detected the conflict
validdepthminimal depth level at which the initial conflict set is valid
successpointer to store whether a conflict constraint was created, or NULL

Definition at line 3336 of file conflict_resolution.c.

References assert(), SCIP_Conflict::bdchgonlyresqueue, conflictAnalyzeResolution(), SCIP_Conflict::conflictrows, SCIP_Conflict::continuousbdchgqueue, FALSE, i, SCIP_Conflict::nconflictrows, SCIP_Conflict::nrescalls, SCIP_Conflict::nresconfconss, SCIP_Conflict::nresconfvariables, SCIP_Conflict::nressuccess, NULL, SCIP_Conflict::resanalyzetime, SCIP_Conflict::resbdchgqueue, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPclockStart(), SCIPclockStop(), SCIPconflictResolutionApplicable(), SCIPconflictRowFree(), SCIPpqueueClear(), SCIPsetDebugMsgPrint, SCIPtreeGetCurrentDepth(), and TRUE.

Referenced by SCIPanalyzeConflict(), and SCIPanalyzeConflictCons().