dual inference presolver
This presolver does bound strengthening on continuous variables for getting better bounds on dual variables y. The bounds on the dual variables are then used to derive variable fixings or side changes. We distinguish two cases: i) positive reduced costs: c_j - sup{A_{.j}^T y} > 0 => x_j = l_j ii) positive dual lower bound: y_i > 0 => A_{i.}x = b_i
Definition in file presol_dualinfer.c.
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include "scip/pub_matrix.h"
#include "scip/cons_linear.h"
#include "presol_dualinfer.h"
Go to the source code of this file.
Macros | |
#define | PRESOL_NAME "dualinfer" |
#define | PRESOL_DESC "exploit dual informations for fixings and side changes" |
#define | PRESOL_PRIORITY -2000 |
#define | PRESOL_MAXROUNDS 0 |
#define | PRESOL_TIMING SCIP_PRESOLTIMING_EXHAUSTIVE /* timing of the presolver (fast, medium, or exhaustive) */ |
#define | MAX_LOOPS 3 |
Typedefs | |
typedef enum Fixingdirection | FIXINGDIRECTION |
typedef enum SideChange | SIDECHANGE |
Enumerations | |
enum | Fixingdirection { FIXATLB = -1, NOFIX = 0, FIXATUB = 1, FIXATLB = -1, NOFIX = 0, FIXATUB = 1, FIXATLB = -1, NOFIX = 0, FIXATLB = -1, NOFIX = 0, FIXATUB = 1 } |
enum | SideChange { RHSTOLHS = -1, NOCHANGE = 0, LHSTORHS = 1 } |
Functions | |
static SCIP_Real | getMaxActivitySingleRowWithoutCol (SCIP *scip, SCIP_MATRIX *matrix, int row, int col) |
static SCIP_Real | getMinActivitySingleRowWithoutCol (SCIP *scip, SCIP_MATRIX *matrix, int row, int col) |
static void | getMinMaxActivityResiduals (SCIP *scip, SCIP_MATRIX *matrix, int col, int row, SCIP_Real val, SCIP_Real *minresactivity, SCIP_Real *maxresactivity, SCIP_Bool *isminsettoinfinity, SCIP_Bool *ismaxsettoinfinity) |
static void | getVarUpperBoundOfRow (SCIP *scip, SCIP_MATRIX *matrix, int col, int row, SCIP_Real val, SCIP_Real *rowub, SCIP_Bool *ubfound) |
static SCIP_Bool | isUpperBoundImplied (SCIP *scip, SCIP_MATRIX *matrix, int col) |
static SCIP_Real | getMinColActWithoutRow (SCIP *scip, SCIP_MATRIX *matrix, int col, int withoutrow, SCIP_Real *lbdual[2], SCIP_Real *ubdual[2], int part) |
static void | calcColActResidual (SCIP *scip, SCIP_MATRIX *matrix, int col, int row, SCIP_Real val, SCIP_Real *lbdual[2], SCIP_Real *ubdual[2], int part, SCIP_Real *mincolact, int *mincolactinf, SCIP_Real *mincolresact) |
static void | calcColActivity (SCIP *scip, SCIP_MATRIX *matrix, SCIP_Bool onlyconvars, int startcol, int stopcol, SCIP_Real *lbdual[2], SCIP_Real *ubdual[2], SCIP_Real *mincolact, SCIP_Real *maxcolact, int *maxcolactinf, int *mincolactinf, SCIP_Bool *isimplfree) |
static void | updateDualBounds (SCIP *scip, SCIP_MATRIX *matrix, SCIP_Real objval, SCIP_Real val, int row, SCIP_Real mincolresact, SCIP_Real *lbdual[2], SCIP_Real *ubdual[2], int part, int *boundchanges, SCIP_Bool *updateinfcnt) |
static void | infCntUpdate (SCIP *scip, SCIP_MATRIX *matrix, SCIP_Real val, int row, SCIP_Real *lbdual[2], SCIP_Real *ubdual[2], int part, SCIP_Real *mincolact, SCIP_Real *maxcolact, int *maxcolactinf, int *mincolactinf, SCIP_Bool *isimplfree) |
static SCIP_RETCODE | dualBoundStrengthening (SCIP *scip, SCIP_MATRIX *matrix, FIXINGDIRECTION *varstofix, int *npossiblefixings, SIDECHANGE *sidestochange, int *npossiblesidechanges) |
static | SCIP_DECL_PRESOLCOPY (presolCopyDualinfer) |
static | SCIP_DECL_PRESOLEXEC (presolExecDualinfer) |
SCIP_RETCODE | SCIPincludePresolDualinfer (SCIP *scip) |
#define PRESOL_NAME "dualinfer" |
Definition at line 39 of file presol_dualinfer.c.
Referenced by SCIP_DECL_PRESOLCOPY(), and SCIPincludePresolDualinfer().
#define PRESOL_DESC "exploit dual informations for fixings and side changes" |
Definition at line 40 of file presol_dualinfer.c.
Referenced by SCIPincludePresolDualinfer().
#define PRESOL_PRIORITY -2000 |
priority of the presolver (>= 0: before, < 0: after constraint handlers)
Definition at line 41 of file presol_dualinfer.c.
Referenced by SCIPincludePresolDualinfer().
#define PRESOL_MAXROUNDS 0 |
maximal number of presolving rounds the presolver participates in (-1: no limit)
Definition at line 42 of file presol_dualinfer.c.
Referenced by SCIPincludePresolDualinfer().
#define PRESOL_TIMING SCIP_PRESOLTIMING_EXHAUSTIVE /* timing of the presolver (fast, medium, or exhaustive) */ |
Definition at line 43 of file presol_dualinfer.c.
Referenced by SCIPincludePresolDualinfer().
#define MAX_LOOPS 3 |
maximal number of dual bound strengthening loops
Definition at line 44 of file presol_dualinfer.c.
Referenced by dualBoundStrengthening().
typedef enum Fixingdirection FIXINGDIRECTION |
Definition at line 58 of file presol_dualinfer.c.
typedef enum SideChange SIDECHANGE |
Definition at line 67 of file presol_dualinfer.c.
enum Fixingdirection |
type of fixing direction
Definition at line 53 of file presol_dualinfer.c.
enum SideChange |
type of side change
Enumerator | |
---|---|
RHSTOLHS | |
NOCHANGE | |
LHSTORHS |
Definition at line 61 of file presol_dualinfer.c.
|
static |
calculate max activity of one row without one column
scip | SCIP main data structure |
matrix | matrix containing the constraints |
row | row index |
col | column index |
Definition at line 76 of file presol_dualinfer.c.
References NULL, SCIP_Real, SCIPisInfinity(), SCIPmatrixGetColLb(), SCIPmatrixGetColUb(), SCIPmatrixGetRowIdxPtr(), SCIPmatrixGetRowNNonzs(), and SCIPmatrixGetRowValPtr().
Referenced by getMinMaxActivityResiduals().
|
static |
calculate min activity of one row without one column
scip | SCIP main data structure |
matrix | matrix containing the constraints |
row | row index |
col | column index |
Definition at line 128 of file presol_dualinfer.c.
References NULL, SCIP_Real, SCIPisInfinity(), SCIPmatrixGetColLb(), SCIPmatrixGetColUb(), SCIPmatrixGetRowIdxPtr(), SCIPmatrixGetRowNNonzs(), and SCIPmatrixGetRowValPtr().
Referenced by getMinMaxActivityResiduals().
|
static |
get min/max residual activity without the specified column
scip | SCIP main data structure |
matrix | matrix containing the constraints |
col | column index |
row | row index |
val | coefficient of this variable in this row |
minresactivity | minimum residual activity of this row |
maxresactivity | maximum residual activity of this row |
isminsettoinfinity | flag indicating if minresactiviy is set to infinity |
ismaxsettoinfinity | flag indicating if maxresactiviy is set to infinity |
Definition at line 180 of file presol_dualinfer.c.
References FALSE, getMaxActivitySingleRowWithoutCol(), getMinActivitySingleRowWithoutCol(), NULL, SCIP_Real, SCIPinfinity(), SCIPisInfinity(), SCIPmatrixGetColLb(), SCIPmatrixGetColUb(), SCIPmatrixGetRowMaxActivity(), SCIPmatrixGetRowMinActivity(), SCIPmatrixGetRowNMaxActNegInf(), SCIPmatrixGetRowNMaxActPosInf(), SCIPmatrixGetRowNMinActNegInf(), SCIPmatrixGetRowNMinActPosInf(), and TRUE.
Referenced by getVarUpperBoundOfRow().
|
static |
calculate the upper bound of one variable from one row
scip | SCIP main data structure |
matrix | matrix containing the constraints |
col | column index of variable |
row | row index |
val | coefficient of this column in this row |
rowub | upper bound of row |
ubfound | flag indicating that an upper bound was calculated |
Definition at line 318 of file presol_dualinfer.c.
References FALSE, getMinMaxActivityResiduals(), NULL, SCIP_Bool, SCIP_Real, SCIPinfinity(), SCIPisInfinity(), SCIPmatrixGetRowLhs(), SCIPmatrixGetRowRhs(), and TRUE.
Referenced by isUpperBoundImplied().
|
static |
verify which variable upper bounds are implied
scip | SCIP main data structure |
matrix | matrix containing the constraints |
col | column index for implied free test |
Definition at line 368 of file presol_dualinfer.c.
References FALSE, getVarUpperBoundOfRow(), NULL, SCIP_Bool, SCIP_Real, SCIPinfinity(), SCIPisFeasLE(), SCIPisInfinity(), SCIPmatrixGetColIdxPtr(), SCIPmatrixGetColNNonzs(), SCIPmatrixGetColUb(), SCIPmatrixGetColValPtr(), and TRUE.
Referenced by dualBoundStrengthening().
|
static |
calculate minimal column activity from one continuous variable without one row
scip | SCIP main data structure |
matrix | matrix containing the constraints |
col | column index |
withoutrow | exclude row index |
lbdual | lower bounds of dual variables |
ubdual | upper bounds of dual variables |
part | which of part of the dual variables is active |
Definition at line 413 of file presol_dualinfer.c.
References NULL, SCIP_Real, SCIPisInfinity(), SCIPmatrixGetColIdxPtr(), SCIPmatrixGetColNNonzs(), SCIPmatrixGetColValPtr(), and SCIPmatrixIsRowRhsInfinity().
Referenced by calcColActResidual().
|
static |
calculate minimal/maximal column residual activities
scip | SCIP main data structure |
matrix | matrix containing the constraints |
col | column index |
row | row index |
val | matrix coefficient |
lbdual | lower bounds of dual variables |
ubdual | upper bounds of dual variables |
part | which of part of the dual variables is active |
mincolact | minimal column activities |
mincolactinf | number of (negative) infinite contributions to minimal column activity |
mincolresact | minimal column residual activity |
Definition at line 507 of file presol_dualinfer.c.
References getMinColActWithoutRow(), NULL, SCIPinfinity(), SCIPisInfinity(), and SCIPmatrixIsRowRhsInfinity().
Referenced by dualBoundStrengthening().
|
static |
calculate minimal/maximal column activities
scip | SCIP main data structure |
matrix | matrix containing the constraints |
onlyconvars | consider only continuous variables for activity calculation |
startcol | start column for activity calculations |
stopcol | stop column for activity calculations |
lbdual | lower bounds of dual variables |
ubdual | upper bounds of dual variables |
mincolact | minimal column activities |
maxcolact | maximal column activities |
maxcolactinf | number of (positive) infinite contributions to maximal column activity |
mincolactinf | number of (negative) infinite contributions to minimal column activity |
isimplfree | is upper bound of variable implied |
Definition at line 575 of file presol_dualinfer.c.
References NULL, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIPinfinity(), SCIPisInfinity(), SCIPmatrixGetColIdxPtr(), SCIPmatrixGetColNNonzs(), SCIPmatrixGetColValPtr(), SCIPmatrixGetVar(), SCIPmatrixIsRowRhsInfinity(), SCIPvarGetLbGlobal(), SCIPvarGetType(), and SCIPvarGetUbGlobal().
Referenced by dualBoundStrengthening(), and infCntUpdate().
|
static |
update bounds on dual variables
scip | SCIP main data structure |
matrix | matrix containing the constraints |
objval | objective function value |
val | matrix coefficient |
row | row index |
mincolresact | minimal column residual activity |
lbdual | dual lower bounds (ranged, equality) |
ubdual | dual upper bounds (ranged, equatity) |
part | which of part of the dual variables is active |
boundchanges | number of bound changes |
updateinfcnt | flag indicating to update infinity counters |
Definition at line 721 of file presol_dualinfer.c.
References FALSE, NULL, SCIP_Real, SCIPisGE(), SCIPisInfinity(), SCIPmatrixIsRowRhsInfinity(), and TRUE.
Referenced by dualBoundStrengthening().
|
static |
update minimal/maximal column activity infinity counters
scip | SCIP main data structure |
matrix | matrix containing the constraints |
val | matrix coefficient |
row | row index |
lbdual | lower bounds of dual variables |
ubdual | upper bounds of dual variables |
part | which part of the dual variables is active |
mincolact | minimal column activities |
maxcolact | maximal column activities |
maxcolactinf | number of (positive) infinity contributions to maximal column activity |
mincolactinf | number of (negative) infinity contributions to minimal column activity |
isimplfree | is upper bound of variable implied |
Definition at line 789 of file presol_dualinfer.c.
References calcColActivity(), NULL, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIPisInfinity(), SCIPmatrixGetRowIdxPtr(), SCIPmatrixGetRowNNonzs(), SCIPmatrixGetRowValPtr(), SCIPmatrixGetVar(), SCIPmatrixIsRowRhsInfinity(), SCIPvarGetLbGlobal(), SCIPvarGetType(), and TRUE.
Referenced by dualBoundStrengthening().
|
static |
dual bound strengthening
scip | SCIP main data structure |
matrix | matrix containing the constraints |
varstofix | array holding information for later upper/lower bound fixing |
npossiblefixings | number of possible fixings |
sidestochange | array holding if this is an implied equality |
npossiblesidechanges | number of possible equality changes |
Definition at line 890 of file presol_dualinfer.c.
References calcColActivity(), calcColActResidual(), FALSE, FIXATLB, infCntUpdate(), isUpperBoundImplied(), LHSTORHS, MAX_LOOPS, NOCHANGE, NOFIX, NULL, RHSTOLHS, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPinfinity(), SCIPisEQ(), SCIPisGT(), SCIPisInfinity(), SCIPisLT(), SCIPmatrixGetColIdxPtr(), SCIPmatrixGetColNNonzs(), SCIPmatrixGetColValPtr(), SCIPmatrixGetNColumns(), SCIPmatrixGetNRows(), SCIPmatrixGetRowLhs(), SCIPmatrixGetRowRhs(), SCIPmatrixGetVar(), SCIPmatrixIsRowRhsInfinity(), SCIPvarGetLbGlobal(), SCIPvarGetObj(), SCIPvarGetType(), SCIPvarGetUbGlobal(), TRUE, and updateDualBounds().
Referenced by SCIP_DECL_PRESOLEXEC().
|
static |
copy method for constraint handler plugins (called when SCIP copies plugins)
Definition at line 1094 of file presol_dualinfer.c.
References NULL, PRESOL_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludePresolDualinfer(), and SCIPpresolGetName().
|
static |
execution method of presolver
Definition at line 1108 of file presol_dualinfer.c.
References BMSclearMemoryArray, dualBoundStrengthening(), FALSE, FIXATLB, NOCHANGE, NULL, RHSTOLHS, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_Real, SCIP_STAGE_PRESOLVING, SCIP_SUCCESS, SCIP_VARTYPE_BINARY, SCIP_VARTYPE_CONTINUOUS, SCIPallocBufferArray, SCIPallowDualReds(), SCIPchgLhsLinear(), SCIPchgRhsLinear(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPdebugMsg, SCIPfixVar(), SCIPfreeBufferArray, SCIPgetLhsLinear(), SCIPgetNContVars(), SCIPgetRhsLinear(), SCIPgetStage(), SCIPinProbing(), SCIPisEQ(), SCIPmatrixCreate(), SCIPmatrixFree(), SCIPmatrixGetColNDownlocks(), SCIPmatrixGetColNUplocks(), SCIPmatrixGetCons(), SCIPmatrixGetNColumns(), SCIPmatrixGetNRows(), SCIPmatrixGetRowLhs(), SCIPmatrixGetRowRhs(), SCIPmatrixGetVar(), SCIPvarGetLbLocal(), SCIPvarGetNLocksDown(), SCIPvarGetNLocksUp(), SCIPvarGetType(), and TRUE.