Scippy

SCIP

Solving Constraint Integer Programs

cons_bounddisjunction.c File Reference

Detailed Description

constraint handler for bound disjunction constraints $(x_1 \{\leq,\geq\} b_1) \vee \ldots \vee (x_n \{\leq,\geq\} b_n)$

Author
Tobias Achterberg
Marc Pfetsch

Definition in file cons_bounddisjunction.c.

#include <assert.h>
#include <string.h>
#include <limits.h>
#include <ctype.h>
#include "scip/cons_bounddisjunction.h"
#include "scip/cons_quadratic.h"
#include "scip/cons_linear.h"
#include "scip/cons_logicor.h"
#include "scip/cons_setppc.h"
#include "scip/pub_misc.h"

Go to the source code of this file.

Macros

Constraint handler properties
#define CONSHDLR_NAME   "bounddisjunction"
 
#define CONSHDLR_DESC   "bound disjunction constraints"
 
#define CONSHDLR_ENFOPRIORITY   -3000000
 
#define CONSHDLR_CHECKPRIORITY   -3000000
 
#define CONSHDLR_PROPFREQ   1
 
#define CONSHDLR_EAGERFREQ   100
 
#define CONSHDLR_MAXPREROUNDS   -1
 
#define CONSHDLR_DELAYPROP   FALSE
 
#define CONSHDLR_NEEDSCONS   TRUE
 
#define CONSHDLR_PRESOLTIMING   SCIP_PRESOLTIMING_FAST
 
#define CONSHDLR_PROP_TIMING   SCIP_PROPTIMING_BEFORELP
 
#define QUADCONSUPGD_PRIORITY   500000
 
Event handler properties
#define EVENTHDLR_NAME   "bounddisjunction"
 
#define EVENTHDLR_DESC   "event handler for bound disjunction constraints"
 
Conflict handler properties
#define CONFLICTHDLR_NAME   "bounddisjunction"
 
#define CONFLICTHDLR_DESC   "conflict handler creating bound disjunction constraints"
 
#define CONFLICTHDLR_PRIORITY   -3000000
 
Default parameter values
#define DEFAULT_CONTINUOUSFRAC   0.4
 
Age increase defines
#define AGEINCREASE(n)   (1.0 + 0.2*n)
 
Comparison for two values
#define isFeasLT(scip, var, val1, val2)   SCIPisFeasLT(scip, val1, val2)
 
#define isFeasLE(scip, var, val1, val2)   SCIPisFeasLE(scip, val1, val2)
 
#define isFeasGT(scip, var, val1, val2)   SCIPisFeasGT(scip, val1, val2)
 
#define isFeasGE(scip, var, val1, val2)   SCIPisFeasGE(scip, val1, val2)
 

Functions

Local methods
static SCIP_RETCODE lockRounding (SCIP *scip, SCIP_CONS *cons, SCIP_CONSDATA *consdata, int pos)
 
static SCIP_RETCODE unlockRounding (SCIP *scip, SCIP_CONS *cons, SCIP_CONSDATA *consdata, int pos)
 
static SCIP_RETCODE catchEvents (SCIP *scip, SCIP_CONS *cons, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, int pos, int *filterpos)
 
static SCIP_RETCODE dropEvents (SCIP *scip, SCIP_CONS *cons, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, int pos, int filterpos)
 
static SCIP_RETCODE conshdlrdataCreate (SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata, SCIP_EVENTHDLR *eventhdlr)
 
static SCIP_RETCODE conshdlrdataFree (SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata)
 
static SCIP_RETCODE consdataCreate (SCIP *scip, SCIP_CONSDATA **consdata, int nvars, SCIP_VAR **vars, SCIP_BOUNDTYPE *boundtypes, SCIP_Real *bounds)
 
static SCIP_RETCODE consdataFree (SCIP *scip, SCIP_CONSDATA **consdata)
 
static void consdataPrint (SCIP *scip, SCIP_CONSDATA *consdata, FILE *file, SCIP_Bool endline)
 
static SCIP_RETCODE switchWatchedvars (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int watchedvar1, int watchedvar2)
 
static SCIP_RETCODE delCoefPos (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int pos)
 
static SCIP_RETCODE addCoef (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_Real bound)
 
static SCIP_RETCODE applyGlobalBounds (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *redundant)
 
static SCIP_Bool isLiteralSatisfied (SCIP *scip, SCIP_CONSDATA *consdata, int pos)
 
static SCIP_Bool isLiteralViolated (SCIP *scip, SCIP_CONSDATA *consdata, int pos)
 
static SCIP_RETCODE removeFixedVariables (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *redundant)
 
static SCIP_RETCODE upgradeCons (SCIP *scip, SCIP_CONS *cons, int *ndelconss, int *naddconss)
 
static SCIP_RETCODE analyzeConflict (SCIP *scip, SCIP_CONS *cons)
 
static SCIP_RETCODE disableCons (SCIP *scip, SCIP_CONS *cons)
 
static SCIP_RETCODE processWatchedVars (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, SCIP_Bool *infeasible, SCIP_Bool *reduceddom, SCIP_Bool *mustcheck)
 
static SCIP_RETCODE checkCons (SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *violated)
 
static SCIP_RETCODE registerBranchingCandidates (SCIP *scip, SCIP_CONS *cons, SCIP_Bool *neednarybranch)
 
static SCIP_RETCODE enforceCurrentSol (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, SCIP_Bool *infeasible, SCIP_Bool *reduceddom, SCIP_Bool *registeredbrcand)
 
static SCIP_RETCODE createNAryBranch (SCIP *scip, SCIP_CONS *cons)
 
Upgrading methods for special quadratic constraint
static SCIP_DECL_QUADCONSUPGD (upgradeConsQuadratic)
 
Callback methods of constraint handler
static SCIP_DECL_CONSHDLRCOPY (conshdlrCopyBounddisjunction)
 
static SCIP_DECL_CONSFREE (consFreeBounddisjunction)
 
static SCIP_DECL_CONSEXITPRE (consExitpreBounddisjunction)
 
static SCIP_DECL_CONSDELETE (consDeleteBounddisjunction)
 
static SCIP_DECL_CONSTRANS (consTransBounddisjunction)
 
static SCIP_DECL_CONSENFOLP (consEnfolpBounddisjunction)
 
static SCIP_DECL_CONSENFOPS (consEnfopsBounddisjunction)
 
static SCIP_DECL_CONSCHECK (consCheckBounddisjunction)
 
static SCIP_DECL_CONSPROP (consPropBounddisjunction)
 
static SCIP_DECL_CONSPRESOL (consPresolBounddisjunction)
 
static SCIP_DECL_CONSRESPROP (consRespropBounddisjunction)
 
static SCIP_DECL_CONSLOCK (consLockBounddisjunction)
 
static SCIP_DECL_CONSACTIVE (consActiveBounddisjunction)
 
static SCIP_DECL_CONSDEACTIVE (consDeactiveBounddisjunction)
 
static SCIP_DECL_CONSPRINT (consPrintBounddisjunction)
 
static SCIP_DECL_CONSCOPY (consCopyBounddisjunction)
 
static SCIP_DECL_CONSPARSE (consParseBounddisjunction)
 
static SCIP_DECL_CONSGETVARS (consGetVarsBounddisjunction)
 
static SCIP_DECL_CONSGETNVARS (consGetNVarsBounddisjunction)
 
Callback methods of event handler
static SCIP_DECL_EVENTEXEC (eventExecBounddisjunction)
 
Callback methods of conflict handler
static SCIP_DECL_CONFLICTEXEC (conflictExecBounddisjunction)
 
static SCIP_DECL_CONFLICTFREE (conflictFreeBounddisjunction)
 
Interface methods
SCIP_RETCODE SCIPincludeConshdlrBounddisjunction (SCIP *scip)
 
SCIP_RETCODE SCIPcreateConsBounddisjunction (SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_BOUNDTYPE *boundtypes, SCIP_Real *bounds, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
 
SCIP_RETCODE SCIPcreateConsBasicBounddisjunction (SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_BOUNDTYPE *boundtypes, SCIP_Real *bounds)
 
int SCIPgetNVarsBounddisjunction (SCIP *scip, SCIP_CONS *cons)
 
SCIP_VAR ** SCIPgetVarsBounddisjunction (SCIP *scip, SCIP_CONS *cons)
 
SCIP_BOUNDTYPESCIPgetBoundtypesBounddisjunction (SCIP *scip, SCIP_CONS *cons)
 
SCIP_RealSCIPgetBoundsBounddisjunction (SCIP *scip, SCIP_CONS *cons)
 

Macro Definition Documentation

#define CONSHDLR_DESC   "bound disjunction constraints"

Definition at line 42 of file cons_bounddisjunction.c.

Referenced by SCIPincludeConshdlrBounddisjunction().

#define CONSHDLR_ENFOPRIORITY   -3000000

priority of the constraint handler for constraint enforcing

Definition at line 43 of file cons_bounddisjunction.c.

Referenced by SCIPincludeConshdlrBounddisjunction().

#define CONSHDLR_CHECKPRIORITY   -3000000

priority of the constraint handler for checking feasibility

Definition at line 44 of file cons_bounddisjunction.c.

Referenced by SCIPincludeConshdlrBounddisjunction().

#define CONSHDLR_PROPFREQ   1

frequency for propagating domains; zero means only preprocessing propagation

Definition at line 45 of file cons_bounddisjunction.c.

Referenced by SCIPincludeConshdlrBounddisjunction().

#define CONSHDLR_EAGERFREQ   100

frequency for using all instead of only the useful constraints in separation, propagation and enforcement, -1 for no eager evaluations, 0 for first only

Definition at line 46 of file cons_bounddisjunction.c.

Referenced by SCIPincludeConshdlrBounddisjunction().

#define CONSHDLR_MAXPREROUNDS   -1

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

Definition at line 49 of file cons_bounddisjunction.c.

Referenced by SCIPincludeConshdlrBounddisjunction().

#define CONSHDLR_DELAYPROP   FALSE

should propagation method be delayed, if other propagators found reductions?

Definition at line 50 of file cons_bounddisjunction.c.

Referenced by SCIPincludeConshdlrBounddisjunction().

#define CONSHDLR_NEEDSCONS   TRUE

should the constraint handler be skipped, if no constraints are available?

Definition at line 51 of file cons_bounddisjunction.c.

Referenced by SCIPincludeConshdlrBounddisjunction().

#define CONSHDLR_PRESOLTIMING   SCIP_PRESOLTIMING_FAST

Definition at line 53 of file cons_bounddisjunction.c.

Referenced by SCIPincludeConshdlrBounddisjunction().

#define CONSHDLR_PROP_TIMING   SCIP_PROPTIMING_BEFORELP

Definition at line 54 of file cons_bounddisjunction.c.

Referenced by SCIPincludeConshdlrBounddisjunction().

#define QUADCONSUPGD_PRIORITY   500000

priority of the constraint handler for upgrading of quadratic constraints

Definition at line 56 of file cons_bounddisjunction.c.

Referenced by SCIPincludeConshdlrBounddisjunction().

#define EVENTHDLR_NAME   "bounddisjunction"
#define EVENTHDLR_DESC   "event handler for bound disjunction constraints"

Definition at line 66 of file cons_bounddisjunction.c.

Referenced by SCIPincludeConshdlrBounddisjunction().

#define CONFLICTHDLR_NAME   "bounddisjunction"
#define CONFLICTHDLR_DESC   "conflict handler creating bound disjunction constraints"

Definition at line 76 of file cons_bounddisjunction.c.

Referenced by SCIPincludeConshdlrBounddisjunction().

#define CONFLICTHDLR_PRIORITY   -3000000

Definition at line 77 of file cons_bounddisjunction.c.

Referenced by SCIPincludeConshdlrBounddisjunction().

#define DEFAULT_CONTINUOUSFRAC   0.4

maximal percantage of continuous variables within a conflict

Definition at line 86 of file cons_bounddisjunction.c.

Referenced by SCIPincludeConshdlrBounddisjunction().

#define AGEINCREASE (   n)    (1.0 + 0.2*n)

Definition at line 97 of file cons_bounddisjunction.c.

Referenced by processWatchedVars().

#define isFeasLT (   scip,
  var,
  val1,
  val2 
)    SCIPisFeasLT(scip, val1, val2)
#define isFeasLE (   scip,
  var,
  val1,
  val2 
)    SCIPisFeasLE(scip, val1, val2)
#define isFeasGT (   scip,
  var,
  val1,
  val2 
)    SCIPisFeasGT(scip, val1, val2)
#define isFeasGE (   scip,
  var,
  val1,
  val2 
)    SCIPisFeasGE(scip, val1, val2)

Function Documentation

static SCIP_RETCODE lockRounding ( SCIP scip,
SCIP_CONS cons,
SCIP_CONSDATA consdata,
int  pos 
)
static

adds rounding locks for the given variable in the given bound disjunction constraint

Parameters
scipSCIP data structure
consbound disjunction constraint
consdatabound disjunction constraint data
posposition of the variable in the constraint

Definition at line 151 of file cons_bounddisjunction.c.

References FALSE, NULL, SCIP_BOUNDTYPE_LOWER, SCIP_CALL, SCIP_OKAY, SCIPlockVarCons(), TRUE, and unlockRounding().

Referenced by addCoef().

static SCIP_RETCODE unlockRounding ( SCIP scip,
SCIP_CONS cons,
SCIP_CONSDATA consdata,
int  pos 
)
static

removes rounding locks for the given variable in the given bound disjunction constraint

Parameters
scipSCIP data structure
consbound disjunction constraint
consdatabound disjunction constraint data
posposition of the variable in the constraint

Definition at line 177 of file cons_bounddisjunction.c.

References catchEvents(), FALSE, NULL, SCIP_BOUNDTYPE_LOWER, SCIP_CALL, SCIP_OKAY, SCIPunlockVarCons(), and TRUE.

Referenced by delCoefPos(), and lockRounding().

static SCIP_RETCODE catchEvents ( SCIP scip,
SCIP_CONS cons,
SCIP_CONSDATA consdata,
SCIP_EVENTHDLR eventhdlr,
int  pos,
int *  filterpos 
)
static

catches the events on a single variable of the bound disjunction constraint

Parameters
scipSCIP data structure
consbound disjunction constraint
consdatabound disjunction constraint data
eventhdlrevent handler to call for the event processing
posposition of the variable in the constraint
filterpospointer to store position of event filter entry, or NULL

Definition at line 203 of file cons_bounddisjunction.c.

References dropEvents(), NULL, SCIP_BOUNDTYPE_LOWER, SCIP_CALL, SCIP_EVENTTYPE_LBRELAXED, SCIP_EVENTTYPE_LBTIGHTENED, SCIP_EVENTTYPE_UBRELAXED, SCIP_EVENTTYPE_UBTIGHTENED, SCIP_OKAY, and SCIPcatchVarEvent().

Referenced by SCIP_DECL_CONSACTIVE(), switchWatchedvars(), and unlockRounding().

static SCIP_RETCODE dropEvents ( SCIP scip,
SCIP_CONS cons,
SCIP_CONSDATA consdata,
SCIP_EVENTHDLR eventhdlr,
int  pos,
int  filterpos 
)
static

drops the events on a single variable of the bound disjunction constraint

Parameters
scipSCIP data structure
consbound disjunction constraint
consdatabound disjunction constraint data
eventhdlrevent handler to call for the event processing
posposition of the variable in the constraint
filterposposition of event filter entry returned by SCIPcatchVarEvent(), or -1

Definition at line 231 of file cons_bounddisjunction.c.

References conshdlrdataCreate(), NULL, SCIP_BOUNDTYPE_LOWER, SCIP_CALL, SCIP_EVENTTYPE_LBRELAXED, SCIP_EVENTTYPE_LBTIGHTENED, SCIP_EVENTTYPE_UBRELAXED, SCIP_EVENTTYPE_UBTIGHTENED, SCIP_OKAY, and SCIPdropVarEvent().

Referenced by catchEvents(), SCIP_DECL_CONSDEACTIVE(), and switchWatchedvars().

static SCIP_RETCODE conshdlrdataCreate ( SCIP scip,
SCIP_CONSHDLRDATA **  conshdlrdata,
SCIP_EVENTHDLR eventhdlr 
)
static

creates constraint handler data for bound disjunction constraint handler

Parameters
scipSCIP data structure
conshdlrdatapointer to store the constraint handler data
eventhdlrevent handler

Definition at line 259 of file cons_bounddisjunction.c.

References conshdlrdataFree(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPallocMemory.

Referenced by dropEvents(), and SCIPincludeConshdlrBounddisjunction().

static SCIP_RETCODE conshdlrdataFree ( SCIP scip,
SCIP_CONSHDLRDATA **  conshdlrdata 
)
static

frees constraint handler data for bound disjunction constraint handler

Parameters
scipSCIP data structure
conshdlrdatapointer to the constraint handler data

Definition at line 279 of file cons_bounddisjunction.c.

References consdataCreate(), NULL, SCIP_OKAY, and SCIPfreeMemory.

Referenced by conshdlrdataCreate(), and SCIP_DECL_CONSFREE().

static SCIP_RETCODE consdataCreate ( SCIP scip,
SCIP_CONSDATA **  consdata,
int  nvars,
SCIP_VAR **  vars,
SCIP_BOUNDTYPE boundtypes,
SCIP_Real bounds 
)
static

creates a bound disjunction constraint data object

Parameters
scipSCIP data structure
consdatapointer to store the bound disjunction constraint data
nvarsnumber of variables in the constraint
varsvariables of the literals in the constraint
boundtypestypes of bounds of the literals (lower or upper bounds)
boundsbounds of the literals

Definition at line 294 of file cons_bounddisjunction.c.

References consdataFree(), NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPduplicateBlockMemoryArray, SCIPgetTransformedVars(), and SCIPisTransformed().

Referenced by conshdlrdataFree(), SCIP_DECL_CONSTRANS(), and SCIPcreateConsBounddisjunction().

static SCIP_RETCODE consdataFree ( SCIP scip,
SCIP_CONSDATA **  consdata 
)
static

frees a bound disjunction constraint data

Parameters
scipSCIP data structure
consdatapointer to the bound disjunction constraint

Definition at line 342 of file cons_bounddisjunction.c.

References consdataPrint(), NULL, SCIP_OKAY, SCIPfreeBlockMemory, and SCIPfreeBlockMemoryArrayNull.

Referenced by consdataCreate(), and SCIP_DECL_CONSDELETE().

static void consdataPrint ( SCIP scip,
SCIP_CONSDATA consdata,
FILE *  file,
SCIP_Bool  endline 
)
static

prints bound disjunction constraint to file stream

Parameters
scipSCIP data structure
consdatabound disjunction constraint data
fileoutput file (or NULL for standard output)
endlineshould an endline be set?

Definition at line 360 of file cons_bounddisjunction.c.

References NULL, SCIP_BOUNDTYPE_LOWER, SCIPinfoMessage(), SCIPvarGetName(), and switchWatchedvars().

Referenced by applyGlobalBounds(), consdataFree(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSDEACTIVE(), and SCIP_DECL_CONSPRINT().

static SCIP_RETCODE switchWatchedvars ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
int  watchedvar1,
int  watchedvar2 
)
static

stores the given variable numbers as watched variables, and updates the event processing

Parameters
scipSCIP data structure
consbound disjunction constraint
eventhdlrevent handler to call for the event processing
watchedvar1new first watched variable
watchedvar2new second watched variable

Definition at line 389 of file cons_bounddisjunction.c.

References catchEvents(), delCoefPos(), dropEvents(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconsGetData().

Referenced by addCoef(), consdataPrint(), delCoefPos(), and processWatchedVars().

static SCIP_RETCODE delCoefPos ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
int  pos 
)
static

deletes coefficient at given position from bound disjunction constraint data

Parameters
scipSCIP data structure
consbound disjunction constraint
eventhdlrevent handler to call for the event processing
posposition of coefficient to delete

Definition at line 452 of file cons_bounddisjunction.c.

References addCoef(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsIsTransformed(), SCIPenableConsPropagation(), SCIPvarIsTransformed(), switchWatchedvars(), and unlockRounding().

Referenced by applyGlobalBounds(), removeFixedVariables(), and switchWatchedvars().

static SCIP_RETCODE addCoef ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
SCIP_VAR var,
SCIP_BOUNDTYPE  boundtype,
SCIP_Real  bound 
)
static

adds literal to bound disjunction constraint data

Parameters
scipSCIP data structure
consbound disjunction constraint
eventhdlrevent handler to call for the event processing
varvariable in literal
boundtypeboundtype of literal
boundbound of literal

Definition at line 505 of file cons_bounddisjunction.c.

References applyGlobalBounds(), lockRounding(), NULL, REALABS, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), SCIPconsGetData(), SCIPconsIsTransformed(), SCIPenableConsPropagation(), SCIPisInfinity(), SCIPreallocBlockMemoryArray, SCIPvarIsTransformed(), and switchWatchedvars().

Referenced by delCoefPos(), and removeFixedVariables().

static SCIP_RETCODE applyGlobalBounds ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
SCIP_Bool redundant 
)
static

deletes all variables with global bounds violating the literal, checks for global bounds satisfying the literal

Parameters
scipSCIP data structure
consbound disjunction constraint
eventhdlrevent handler to call for the event processing
redundantreturns whether a variable fixed to one exists in the constraint

Definition at line 567 of file cons_bounddisjunction.c.

References consdataPrint(), delCoefPos(), FALSE, isFeasGE, isFeasGT, isFeasLE, isFeasLT, isLiteralSatisfied(), NULL, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPcomputeVarLbGlobal(), SCIPcomputeVarUbGlobal(), SCIPconsGetData(), SCIPdebug, SCIPdebugMessage, and TRUE.

Referenced by addCoef(), SCIP_DECL_CONSEXITPRE(), and SCIP_DECL_CONSPRESOL().

static SCIP_Bool isLiteralSatisfied ( SCIP scip,
SCIP_CONSDATA consdata,
int  pos 
)
static

returns whether literal at the given position is satisfied in the local bounds

Parameters
scipSCIP data structure
consdatabound disjunction constraint data
posposition of the literal

Definition at line 642 of file cons_bounddisjunction.c.

References isFeasGE, isFeasLE, isLiteralViolated(), NULL, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_Real, SCIPcomputeVarLbLocal(), and SCIPcomputeVarUbLocal().

Referenced by applyGlobalBounds(), createNAryBranch(), processWatchedVars(), registerBranchingCandidates(), removeFixedVariables(), and SCIP_DECL_CONSPRESOL().

static SCIP_Bool isLiteralViolated ( SCIP scip,
SCIP_CONSDATA consdata,
int  pos 
)
static

returns whether literal at the given position is violated in the local bounds

Parameters
scipSCIP data structure
consdatabound disjunction constraint data
posposition of the literal

Definition at line 667 of file cons_bounddisjunction.c.

References isFeasGT, isFeasLT, NULL, removeFixedVariables(), SCIP_BOUNDTYPE_LOWER, SCIP_Real, SCIPcomputeVarLbLocal(), and SCIPcomputeVarUbLocal().

Referenced by isLiteralSatisfied(), processWatchedVars(), and SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE removeFixedVariables ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
SCIP_Bool redundant 
)
static

replace variables by their representative active (or multi-aggregated) variables

Parameters
scipSCIP data structure
consbound disjunction constraint
eventhdlrevent handler
redundantflag to indicate whether constraint has been bound redundant

Definition at line 692 of file cons_bounddisjunction.c.

References addCoef(), delCoefPos(), isFeasGE, isFeasLE, isLiteralSatisfied(), NULL, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_FIXED, SCIP_VARSTATUS_MULTAGGR, SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMessage, SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetProbvarBound(), SCIPvarGetStatus(), SCIPvarGetUbGlobal(), SCIPvarIsActive(), TRUE, and upgradeCons().

Referenced by isLiteralViolated(), SCIP_DECL_CONSEXITPRE(), and SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE upgradeCons ( SCIP scip,
SCIP_CONS cons,
int *  ndelconss,
int *  naddconss 
)
static

try to upgrade the bounddisjunction constraint

if only binary variables are left, we can upgrade a bounddisjunction to a logicor constraint(, if only two variables are left, this logicor constraint can be formulated as set-packing constraint as well)

e.g.: bounddisjunction( x1 >= 1, x2 <= 0; x3 >= 1; x4 <= 0 ) => x1 + ~x2 + x3 + ~x4 >= 1

Parameters
scipSCIP data structure
consbound disjunction constraint that detected the conflict
ndelconsspointer to store the number of delete constraint
naddconsspointer to store the number of added constraint

Definition at line 778 of file cons_bounddisjunction.c.

References analyzeConflict(), FALSE, NULL, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_OKAY, SCIPaddCons(), SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsLogicor(), SCIPcreateConsSetpack(), SCIPdebugMessage, SCIPdebugPrintCons, SCIPdelCons(), SCIPfreeBufferArray, SCIPgetNegatedVar(), SCIPisFeasGT(), SCIPisFeasLT(), SCIPreleaseCons(), SCIPvarIsBinary(), and TRUE.

Referenced by removeFixedVariables(), and SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE analyzeConflict ( SCIP scip,
SCIP_CONS cons 
)
static

analyzes conflicting assignment on given constraint, and adds conflict constraint to problem

Parameters
scipSCIP data structure
consbound disjunction constraint that detected the conflict

Definition at line 882 of file cons_bounddisjunction.c.

References disableCons(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_SOLVING, SCIPaddConflictBd(), SCIPanalyzeConflictCons(), SCIPboundtypeOpposite(), SCIPconsGetData(), SCIPgetStage(), SCIPinitConflictAnalysis(), SCIPinProbing(), and SCIPisConflictAnalysisApplicable().

Referenced by processWatchedVars(), and upgradeCons().

static SCIP_RETCODE disableCons ( SCIP scip,
SCIP_CONS cons 
)
static

disables or deletes the given constraint, depending on the current depth

Parameters
scipSCIP data structure
consbound disjunction constraint to be disabled

Definition at line 913 of file cons_bounddisjunction.c.

References processWatchedVars(), SCIP_CALL, SCIP_OKAY, SCIPconsGetValidDepth(), SCIPdelCons(), SCIPdisableCons(), and SCIPgetDepth().

Referenced by analyzeConflict(), and processWatchedVars().

static SCIP_RETCODE processWatchedVars ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
SCIP_Bool cutoff,
SCIP_Bool infeasible,
SCIP_Bool reduceddom,
SCIP_Bool mustcheck 
)
static

checks constraint for violation only looking at the watched variables, applies bound changes if possible

Parameters
scipSCIP data structure
consbound disjunction constraint to be processed
eventhdlrevent handler to call for the event processing
cutoffpointer to store TRUE, if the node can be cut off
infeasiblepointer to store TRUE, if the constraint is infeasible in current bounds
reduceddompointer to store TRUE, if a domain reduction was found
mustcheckpointer to store whether this constraint must be checked for feasibility

Definition at line 934 of file cons_bounddisjunction.c.

References AGEINCREASE, analyzeConflict(), checkCons(), CONSHDLR_NAME, disableCons(), FALSE, isLiteralSatisfied(), isLiteralViolated(), NULL, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_BRANCHDIR_DOWNWARDS, SCIP_BRANCHDIR_UPWARDS, SCIP_CALL, SCIP_Longint, SCIP_LONGINT_MAX, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_MULTAGGR, SCIPaddConsAge(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetName(), SCIPconsIsModifiable(), SCIPdebugMessage, SCIPdisableConsPropagation(), SCIPgetDepth(), SCIPinferVarLbCons(), SCIPinferVarUbCons(), SCIPresetConsAge(), SCIPvarGetName(), SCIPvarGetNBranchingsCurrentRun(), SCIPvarGetProbvar(), SCIPvarGetStatus(), switchWatchedvars(), and TRUE.

Referenced by disableCons(), enforceCurrentSol(), and SCIP_DECL_CONSPROP().

static SCIP_RETCODE checkCons ( SCIP scip,
SCIP_CONS cons,
SCIP_SOL sol,
SCIP_Bool violated 
)
static

checks constraint for violation, returns TRUE iff constraint is feasible

Parameters
scipSCIP data structure
consbound disjunction constraint to be checked
solprimal CIP solution
violatedpointer to store whether the given solution violates the constraint

Definition at line 1186 of file cons_bounddisjunction.c.

References FALSE, isFeasGE, isFeasLE, NULL, registerBranchingCandidates(), SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPgetSolVal(), and TRUE.

Referenced by enforceCurrentSol(), processWatchedVars(), and SCIP_DECL_CONSCHECK().

static SCIP_RETCODE registerBranchingCandidates ( SCIP scip,
SCIP_CONS cons,
SCIP_Bool neednarybranch 
)
static
Parameters
scipSCIP data structure
consbound disjunction constraint which variables should be registered for branching
neednarybranchpointer to store TRUE, if n-ary branching is necessary to enforce this constraint

Definition at line 1235 of file cons_bounddisjunction.c.

References CONSHDLR_NAME, enforceCurrentSol(), FALSE, isFeasGT, isFeasLT, isLiteralSatisfied(), NULL, REALABS, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIPaddExternBranchCand(), SCIPcomputeVarLbLocal(), SCIPcomputeVarUbLocal(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPgetSolVal(), SCIPisFeasEQ(), SCIPisFeasGE(), SCIPisFeasLE(), SCIPisInfinity(), SCIPvarGetType(), and TRUE.

Referenced by checkCons(), and enforceCurrentSol().

static SCIP_RETCODE enforceCurrentSol ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
SCIP_Bool cutoff,
SCIP_Bool infeasible,
SCIP_Bool reduceddom,
SCIP_Bool registeredbrcand 
)
static

enforces the pseudo or LP solution on the given constraint

Parameters
scipSCIP data structure
consbound disjunction constraint to be separated
eventhdlrevent handler to call for the event processing
cutoffpointer to store TRUE, if the node can be cut off
infeasiblepointer to store TRUE, if the constraint was infeasible
reduceddompointer to store TRUE, if a domain reduction was found
registeredbrcandpointer to store TRUE, if branching variable candidates were registered or was already true

Definition at line 1317 of file cons_bounddisjunction.c.

References checkCons(), CONSHDLR_NAME, createNAryBranch(), NULL, processWatchedVars(), registerBranchingCandidates(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetName(), SCIPconsIsPropagationEnabled(), SCIPdebugMessage, SCIPresetConsAge(), and TRUE.

Referenced by registerBranchingCandidates(), SCIP_DECL_CONSENFOLP(), and SCIP_DECL_CONSENFOPS().

static SCIP_DECL_QUADCONSUPGD ( upgradeConsQuadratic  )
static
static SCIP_DECL_CONSHDLRCOPY ( conshdlrCopyBounddisjunction  )
static

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

Definition at line 1904 of file cons_bounddisjunction.c.

References CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_DECL_CONSFREE(), SCIP_OKAY, SCIPconshdlrGetName(), SCIPincludeConshdlrBounddisjunction(), and TRUE.

Referenced by SCIP_DECL_QUADCONSUPGD().

static SCIP_DECL_CONSFREE ( consFreeBounddisjunction  )
static

destructor of constraint handler to free constraint handler data (called when SCIP is exiting)

Definition at line 1920 of file cons_bounddisjunction.c.

References CONSHDLR_NAME, conshdlrdataFree(), NULL, SCIP_CALL, SCIP_DECL_CONSEXITPRE(), SCIP_OKAY, SCIPconshdlrGetData(), SCIPconshdlrGetName(), and SCIPconshdlrSetData().

Referenced by SCIP_DECL_CONSHDLRCOPY().

static SCIP_DECL_CONSEXITPRE ( consExitpreBounddisjunction  )
static

presolving deinitialization method of constraint handler (called after presolving has been finished)

Definition at line 1942 of file cons_bounddisjunction.c.

References applyGlobalBounds(), CONSHDLR_NAME, NULL, removeFixedVariables(), SCIP_Bool, SCIP_CALL, SCIP_DECL_CONSDELETE(), SCIP_OKAY, SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPconsIsAdded(), SCIPdebugMessage, and SCIPdelCons().

Referenced by SCIP_DECL_CONSFREE().

static SCIP_DECL_CONSDELETE ( consDeleteBounddisjunction  )
static

frees specific constraint data

Definition at line 1986 of file cons_bounddisjunction.c.

References consdataFree(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_DECL_CONSTRANS(), SCIP_OKAY, and SCIPconshdlrGetName().

Referenced by SCIP_DECL_CONSEXITPRE().

static SCIP_DECL_CONSENFOLP ( consEnfolpBounddisjunction  )
static
static SCIP_DECL_CONSENFOPS ( consEnfopsBounddisjunction  )
static
static SCIP_DECL_CONSCHECK ( consCheckBounddisjunction  )
static
static SCIP_DECL_CONSPROP ( consPropBounddisjunction  )
static
static SCIP_DECL_CONSLOCK ( consLockBounddisjunction  )
static

variable rounding lock method of constraint handler

Definition at line 2484 of file cons_bounddisjunction.c.

References NULL, SCIP_BOUNDTYPE_LOWER, SCIP_CALL, SCIP_DECL_CONSACTIVE(), SCIP_OKAY, SCIPaddVarLocks(), and SCIPconsGetData().

Referenced by SCIP_DECL_CONSRESPROP().

static SCIP_DECL_CONSACTIVE ( consActiveBounddisjunction  )
static
static SCIP_DECL_CONSDEACTIVE ( consDeactiveBounddisjunction  )
static
static SCIP_DECL_CONSPRINT ( consPrintBounddisjunction  )
static

constraint display method of constraint handler

Definition at line 2585 of file cons_bounddisjunction.c.

References consdataPrint(), FALSE, NULL, SCIP_DECL_CONSCOPY(), SCIP_OKAY, and SCIPconsGetData().

Referenced by SCIP_DECL_CONSDEACTIVE().

static SCIP_DECL_CONSGETVARS ( consGetVarsBounddisjunction  )
static

constraint method of constraint handler which returns the variables (if possible)

Definition at line 2774 of file cons_bounddisjunction.c.

References BMScopyMemoryArray, FALSE, NULL, SCIP_DECL_CONSGETNVARS(), SCIP_OKAY, SCIPconsGetData(), and TRUE.

Referenced by SCIP_DECL_CONSPARSE().

static SCIP_DECL_CONSGETNVARS ( consGetNVarsBounddisjunction  )
static

constraint method of constraint handler which returns the number of variables (if possible)

Definition at line 2798 of file cons_bounddisjunction.c.

References NULL, SCIP_DECL_EVENTEXEC(), SCIP_OKAY, SCIPconsGetData(), and TRUE.

Referenced by SCIP_DECL_CONSGETVARS().

static SCIP_DECL_CONFLICTFREE ( conflictFreeBounddisjunction  )
static

free method of conflict handler

Definition at line 2941 of file cons_bounddisjunction.c.

References NULL, SCIP_OKAY, SCIPconflicthdlrGetData(), SCIPfreeMemory, and SCIPincludeConshdlrBounddisjunction().

Referenced by SCIP_DECL_CONFLICTEXEC().

SCIP_RETCODE SCIPcreateConsBounddisjunction ( SCIP scip,
SCIP_CONS **  cons,
const char *  name,
int  nvars,
SCIP_VAR **  vars,
SCIP_BOUNDTYPE boundtypes,
SCIP_Real bounds,
SCIP_Bool  initial,
SCIP_Bool  separate,
SCIP_Bool  enforce,
SCIP_Bool  check,
SCIP_Bool  propagate,
SCIP_Bool  local,
SCIP_Bool  modifiable,
SCIP_Bool  dynamic,
SCIP_Bool  removable,
SCIP_Bool  stickingatnode 
)

creates and captures a bound disjunction constraint

Note
the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
nvarsnumber of variables in the constraint
varsvariables of the literals in the constraint
boundtypestypes of bounds of the literals (lower or upper bounds)
boundsbounds of the literals
initialshould the LP relaxation of constraint be in the initial LP? Usually set to TRUE. Set to FALSE for 'lazy constraints'.
separateshould the constraint be separated during LP processing? Usually set to TRUE.
enforceshould the constraint be enforced during node processing? TRUE for model constraints, FALSE for additional, redundant constraints.
checkshould the constraint be checked for feasibility? TRUE for model constraints, FALSE for additional, redundant constraints.
propagateshould the constraint be propagated during node processing? Usually set to TRUE.
localis constraint only valid locally? Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints.
modifiableis constraint modifiable (subject to column generation)? Usually set to FALSE. In column generation applications, set to TRUE if pricing adds coefficients to this constraint.
dynamicis constraint subject to aging? Usually set to FALSE. Set to TRUE for own cuts which are separated as constraints.
removableshould the relaxation be removed from the LP due to aging or cleanup? Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'.
stickingatnodeshould the constraint always be kept at the node where it was added, even if it may be moved to a more global node? Usually set to FALSE. Set to TRUE to for constraints that represent node data.

Definition at line 3036 of file cons_bounddisjunction.c.

References consdataCreate(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPcreateCons(), SCIPcreateConsBasicBounddisjunction(), SCIPerrorMessage, and SCIPfindConshdlr().

Referenced by adjustOversizedJobBounds(), createConflict(), CUTOFF_CONSTRAINT(), forbidFixation(), readBounds(), readSemicontinuous(), readVariables(), SCIP_DECL_CONFLICTEXEC(), SCIP_DECL_CONSCOPY(), SCIP_DECL_CONSPARSE(), SCIP_DECL_QUADCONSUPGD(), SCIPcreateConsBasicBounddisjunction(), and SCIPincludeConshdlrBounddisjunction().

SCIP_RETCODE SCIPcreateConsBasicBounddisjunction ( SCIP scip,
SCIP_CONS **  cons,
const char *  name,
int  nvars,
SCIP_VAR **  vars,
SCIP_BOUNDTYPE boundtypes,
SCIP_Real bounds 
)

creates and captures an and constraint in its most basic version, i. e., all constraint flags are set to their basic value as explained for the method SCIPcreateConsBounddisjunction(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h

See also
SCIPcreateConsBounddisjunction() for information about the basic constraint flag configuration
Note
the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
nvarsnumber of variables in the constraint
varsvariables of the literals in the constraint
boundtypestypes of bounds of the literals (lower or upper bounds)
boundsbounds of the literals

Definition at line 3100 of file cons_bounddisjunction.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateConsBounddisjunction(), SCIPgetNVarsBounddisjunction(), and TRUE.

Referenced by SCIPcreateConsBounddisjunction().

int SCIPgetNVarsBounddisjunction ( SCIP scip,
SCIP_CONS cons 
)

gets number of variables in bound disjunction constraint

Parameters
scipSCIP data structure
consconstraint data

Definition at line 3119 of file cons_bounddisjunction.c.

References CONSHDLR_NAME, NULL, SCIPABORT, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPerrorMessage, and SCIPgetVarsBounddisjunction().

Referenced by checkBounddisjunction(), createCoveringProblem(), SCIP_DECL_CONSCOPY(), and SCIPcreateConsBasicBounddisjunction().

SCIP_VAR** SCIPgetVarsBounddisjunction ( SCIP scip,
SCIP_CONS cons 
)

gets array of variables in bound disjunction constraint

Parameters
scipSCIP data structure
consconstraint data

Definition at line 3140 of file cons_bounddisjunction.c.

References CONSHDLR_NAME, NULL, SCIPABORT, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPerrorMessage, and SCIPgetBoundtypesBounddisjunction().

Referenced by checkBounddisjunction(), createCoveringProblem(), SCIP_DECL_CONSCOPY(), and SCIPgetNVarsBounddisjunction().

SCIP_BOUNDTYPE* SCIPgetBoundtypesBounddisjunction ( SCIP scip,
SCIP_CONS cons 
)

gets array of bound types in bound disjunction constraint

Parameters
scipSCIP data structure
consconstraint data

Definition at line 3161 of file cons_bounddisjunction.c.

References CONSHDLR_NAME, NULL, SCIP_Real, SCIPABORT, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPerrorMessage, and SCIPgetBoundsBounddisjunction().

Referenced by checkBounddisjunction(), SCIP_DECL_CONSCOPY(), and SCIPgetVarsBounddisjunction().

SCIP_Real* SCIPgetBoundsBounddisjunction ( SCIP scip,
SCIP_CONS cons 
)

gets array of bounds in bound disjunction constraint

Parameters
scipSCIP data structure
consconstraint data

Definition at line 3182 of file cons_bounddisjunction.c.

References CONSHDLR_NAME, NULL, SCIPABORT, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPerrorMessage.

Referenced by checkBounddisjunction(), SCIP_DECL_CONSCOPY(), and SCIPgetBoundtypesBounddisjunction().