Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

dual compensation presolver

Author
Dieter Weninger

This presolver looks for variables with i) objcoef >= 0 and exactly one downlock ii) objcoef <= 0 and exactly one uplock and fixes the variable in case i) at the lower bound and in case ii) at the upper bound if a combination of singleton continuous variables can compensate the downlock in case i) and the uplock in case ii).

Definition in file presol_dualcomp.c.

#include "blockmemshell/memory.h"
#include "scip/presol_dualcomp.h"
#include "scip/pub_matrix.h"
#include "scip/pub_message.h"
#include "scip/pub_presol.h"
#include "scip/pub_var.h"
#include "scip/scip_general.h"
#include "scip/scip_mem.h"
#include "scip/scip_message.h"
#include "scip/scip_nlp.h"
#include "scip/scip_numerics.h"
#include "scip/scip_param.h"
#include "scip/scip_presol.h"
#include "scip/scip_pricer.h"
#include "scip/scip_prob.h"
#include "scip/scip_probing.h"
#include "scip/scip_var.h"
#include <string.h>

Go to the source code of this file.

Macros

#define PRESOL_NAME   "dualcomp"
 
#define PRESOL_DESC   "compensate single up-/downlocks by singleton continuous variables"
 
#define PRESOL_PRIORITY   -50
 
#define PRESOL_MAXROUNDS   -1
 
#define PRESOL_TIMING   SCIP_PRESOLTIMING_EXHAUSTIVE /* timing of the presolver (fast, medium, or exhaustive) */
 
#define DEFAULT_COMP_ONLY_DIS_VARS   FALSE
 

Typedefs

typedef enum Fixingdirection FIXINGDIRECTION
 
typedef enum Lockcompensation LOCKCOMPENSATION
 

Enumerations

enum  Fixingdirection {
  FIXATLB = -1,
  NOFIX = 0,
  FIXATUB = 1,
  FIXATLB = -1,
  NOFIX = 0,
  FIXATUB = 1,
  FIXATLB = -1,
  NOFIX = 0,
  FIXATUB = 1,
  FIXATLB = -1,
  NOFIX = 0,
  FIXATUB = 1
}
 
enum  Lockcompensation {
  COMPENSATE_DOWNLOCK = 0,
  COMPENSATE_UPLOCK = 1
}
 

Functions

static SCIP_RETCODE compensateVarLock (SCIP *scip, SCIP_MATRIX *matrix, int col, int row, SCIP_Real val, SCIP_Bool twosides, LOCKCOMPENSATION compensation, FIXINGDIRECTION *varstofix, int *nfixings)
 
static SCIP_DECL_PRESOLCOPY (presolCopyDualcomp)
 
static SCIP_DECL_PRESOLEXEC (presolExecDualcomp)
 
static SCIP_DECL_PRESOLFREE (presolFreeDualcomp)
 
SCIP_RETCODE SCIPincludePresolDualcomp (SCIP *scip)
 

Macro Definition Documentation

◆ PRESOL_NAME

#define PRESOL_NAME   "dualcomp"

Definition at line 59 of file presol_dualcomp.c.

Referenced by SCIP_DECL_PRESOLCOPY(), and SCIPincludePresolDualcomp().

◆ PRESOL_DESC

#define PRESOL_DESC   "compensate single up-/downlocks by singleton continuous variables"

Definition at line 60 of file presol_dualcomp.c.

Referenced by SCIPincludePresolDualcomp().

◆ PRESOL_PRIORITY

#define PRESOL_PRIORITY   -50

priority of the presolver (>= 0: before, < 0: after constraint handlers)

Definition at line 66 of file presol_dualcomp.c.

Referenced by SCIPincludePresolDualcomp().

◆ PRESOL_MAXROUNDS

#define PRESOL_MAXROUNDS   -1

maximal number of presolving rounds the presolver participates in (-1: no limit)

Definition at line 67 of file presol_dualcomp.c.

Referenced by SCIPincludePresolDualcomp().

◆ PRESOL_TIMING

#define PRESOL_TIMING   SCIP_PRESOLTIMING_EXHAUSTIVE /* timing of the presolver (fast, medium, or exhaustive) */

Definition at line 68 of file presol_dualcomp.c.

Referenced by SCIPincludePresolDualcomp().

◆ DEFAULT_COMP_ONLY_DIS_VARS

#define DEFAULT_COMP_ONLY_DIS_VARS   FALSE

should only discrete variables be compensated?

Definition at line 70 of file presol_dualcomp.c.

Referenced by SCIPincludePresolDualcomp().

Typedef Documentation

◆ FIXINGDIRECTION

Definition at line 89 of file presol_dualcomp.c.

◆ LOCKCOMPENSATION

Definition at line 97 of file presol_dualcomp.c.

Enumeration Type Documentation

◆ Fixingdirection

type of fixing direction

Enumerator
FIXATLB 

fix variable at lower bound

NOFIX 

do not fix variable

FIXATUB 

fix variable at upper bound

FIXATLB 

fix variable at lower bound

NOFIX 

do not fix variable

FIXATUB 

fix variable at upper bound

FIXATLB 
NOFIX 

fix variable at its lower bound

FIXATUB 

no fixing

FIXATLB 

fix variable at lower bound

NOFIX 

do not fix variable

FIXATUB 

fix variable at upper bound

Definition at line 83 of file presol_dualcomp.c.

◆ Lockcompensation

type of variable lock compensation

Enumerator
COMPENSATE_DOWNLOCK 
COMPENSATE_UPLOCK 

Definition at line 92 of file presol_dualcomp.c.

Function Documentation

◆ compensateVarLock()

static SCIP_RETCODE compensateVarLock ( SCIP scip,
SCIP_MATRIX matrix,
int  col,
int  row,
SCIP_Real  val,
SCIP_Bool  twosides,
LOCKCOMPENSATION  compensation,
FIXINGDIRECTION varstofix,
int *  nfixings 
)
static

try to compensate a variable with a single opposite lock by using singleton continuous variables

Parameters
scipSCIP main data structure
matrixmatrix containing the constraints
colvariable fixing candidate
rowrow index with opposite lock
valvalue of fixing candidate in the opposite lock constraint
twosidesflag indicating that two sides are present
compensationtype of lock compensation
varstofixarray holding fixing information
nfixingsnumber of possible fixings

Definition at line 106 of file presol_dualcomp.c.

References COMPENSATE_DOWNLOCK, COMPENSATE_UPLOCK, FALSE, FIXATLB, FIXATUB, NOFIX, NULL, SCIP_Bool, SCIP_LOCKTYPE_MODEL, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIPdebugMsg, SCIPisGT(), SCIPisInfinity(), SCIPisLE(), SCIPisLT(), SCIPmatrixGetColNDownlocks(), SCIPmatrixGetColNNonzs(), SCIPmatrixGetColNUplocks(), SCIPmatrixGetNColumns(), SCIPmatrixGetNRows(), SCIPmatrixGetRowIdxPtr(), SCIPmatrixGetRowLhs(), SCIPmatrixGetRowNNonzs(), SCIPmatrixGetRowRhs(), SCIPmatrixGetRowValPtr(), SCIPmatrixGetVar(), SCIPmatrixPrintRow(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetNLocksDownType(), SCIPvarGetNLocksUpType(), SCIPvarGetObj(), SCIPvarGetType(), SCIPvarGetUbGlobal(), and TRUE.

Referenced by SCIP_DECL_PRESOLEXEC().

◆ SCIP_DECL_PRESOLCOPY()

static SCIP_DECL_PRESOLCOPY ( presolCopyDualcomp  )
static

copy method for constraint handler plugins (called when SCIP copies plugins)

Definition at line 514 of file presol_dualcomp.c.

References NULL, PRESOL_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludePresolDualcomp(), and SCIPpresolGetName().

◆ SCIP_DECL_PRESOLEXEC()

◆ SCIP_DECL_PRESOLFREE()

static SCIP_DECL_PRESOLFREE ( presolFreeDualcomp  )
static

destructor of presolver to free user data (called when SCIP is exiting)

Definition at line 831 of file presol_dualcomp.c.

References NULL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPpresolGetData(), and SCIPpresolSetData().