Constraint handler for logic or constraints \(1^T x \ge 1\) (equivalent to set covering, but algorithms are suited for depth first search).
Definition in file cons_logicor.c.
#include "blockmemshell/memory.h"
#include "scip/cons_linear.h"
#include "scip/cons_logicor.h"
#include "scip/cons_setppc.h"
#include "scip/presolve.h"
#include "scip/pub_conflict.h"
#include "scip/pub_cons.h"
#include "scip/pub_event.h"
#include "scip/pub_lp.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/pub_misc_sort.h"
#include "scip/pub_var.h"
#include "scip/scip_conflict.h"
#include "scip/scip_cons.h"
#include "scip/scip_cut.h"
#include "scip/scip_event.h"
#include "scip/scip_general.h"
#include "scip/scip_lp.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_prob.h"
#include "scip/scip_probing.h"
#include "scip/scip_sol.h"
#include "scip/scip_solvingstats.h"
#include "scip/scip_tree.h"
#include "scip/scip_var.h"
#include "scip/symmetry_graph.h"
#include "symmetry/struct_symmetry.h"
#include <string.h>
Go to the source code of this file.
Functions | |
static SCIP_RETCODE | lockRounding (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var) |
static SCIP_RETCODE | unlockRounding (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var) |
static SCIP_RETCODE | conshdlrdataCreate (SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata, SCIP_EVENTHDLR *eventhdlr) |
static void | conshdlrdataFree (SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata) |
static SCIP_RETCODE | consdataEnsureVarsSize (SCIP *scip, SCIP_CONSDATA *consdata, int num) |
static SCIP_RETCODE | consdataCreate (SCIP *scip, SCIP_CONSDATA **consdata, int nvars, SCIP_VAR **vars) |
static SCIP_RETCODE | consdataFree (SCIP *scip, SCIP_CONSDATA **consdata) |
static SCIP_RETCODE | 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 | addCoef (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var) |
static SCIP_RETCODE | delCoefPos (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int pos) |
static SCIP_RETCODE | dualPresolving (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int *nfixedvars, int *ndelconss, int *nchgcoefs, int *naggrvars, SCIP_RESULT *result) |
static SCIP_RETCODE | applyFixings (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *redundant, int *nchgcoefs, int *naddconss, int *ndelconss) |
static SCIP_RETCODE | analyzeConflict (SCIP *scip, SCIP_CONS *cons) |
static SCIP_RETCODE | disableCons (SCIP *scip, SCIP_CONS *cons) |
static SCIP_RETCODE | mergeMultiples (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, unsigned char **entries, int *nentries, SCIP_Bool *redundant, int *nchgcoefs) |
static SCIP_RETCODE | processWatchedVars (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, SCIP_Bool *reduceddom, SCIP_Bool *addcut, SCIP_Bool *mustcheck) |
static SCIP_Bool | isConsViolated (SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol) |
static SCIP_RETCODE | createRow (SCIP *scip, SCIP_CONS *cons) |
static SCIP_RETCODE | addNlrow (SCIP *scip, SCIP_CONS *cons) |
static SCIP_RETCODE | addCut (SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff) |
static SCIP_RETCODE | separateCons (SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, SCIP_Bool *separated, SCIP_Bool *reduceddom) |
static SCIP_RETCODE | enforcePseudo (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, SCIP_Bool *infeasible, SCIP_Bool *reduceddom, SCIP_Bool *solvelp) |
static void | consdataSort (SCIP_CONSDATA *consdata) |
static | SCIP_DECL_HASHGETKEY (hashGetKeyLogicorcons) |
static | SCIP_DECL_HASHKEYEQ (hashKeyEqLogicorcons) |
static | SCIP_DECL_HASHKEYVAL (hashKeyValLogicorcons) |
static SCIP_RETCODE | detectRedundantConstraints (SCIP *scip, BMS_BLKMEM *blkmem, SCIP_CONS **conss, int nconss, int *firstchange, int *ndelconss) |
static SCIP_RETCODE | removeRedundantCons (SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1, int *ndelconss) |
static unsigned int | calcSignature (SCIP_VAR **vars, int nvars) |
static void | consdataCalcSignature (SCIP_CONSDATA *consdata) |
static void | removeConsFromOccurList (SCIP_CONS *cons, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int occurlistlength) |
static void | findShortestOccurlist (SCIP_VAR **vars, int nvars, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int occurlistlength, int *nentries, SCIP_CONS ***shortestlist) |
static SCIP_RETCODE | removeRedundantConss (SCIP *scip, SCIP_CONS *cons, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int occurlistlength, int *ndelconss) |
static | SCIP_DECL_SORTPTRCOMP (conssLogicorComp) |
static SCIP_RETCODE | addConsToOccurList (SCIP *scip, SCIP_CONS *cons, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int *occurlistsizes, int *occurlistlength, int occurlistsize) |
static SCIP_RETCODE | removeRedundantNonZeros (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *artvar, int artpos, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int occurlistlength, SCIP_EVENTHDLR *eventhdlr, int *nchgcoefs, SCIP_Bool *deleted) |
static SCIP_RETCODE | strengthenConss (SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int occurlistlength, SCIP_EVENTHDLR *eventhdlr, int *ndelconss, int *nchgcoefs) |
static SCIP_RETCODE | prepareCons (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, unsigned char **entries, int *nentries, SCIP_Bool *redundant, int *nfixedvars, int *nchgcoefs, int *ndelconss, SCIP_Bool *cutoff) |
static SCIP_RETCODE | removeRedundantConssAndNonzeros (SCIP *scip, SCIP_CONS **conss, int nconss, unsigned char **entries, int *nentries, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool usestrengthening, int *firstchange, int *nfixedvars, int *ndelconss, int *nchgcoefs, SCIP_Bool *cutoff) |
static SCIP_RETCODE | shortenConss (SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_EVENTHDLR *eventhdlr, SCIP_CONS **conss, int nconss, unsigned char **entries, int *nentries, int *nfixedvars, int *ndelconss, int *nchgcoefs, SCIP_Bool *cutoff) |
static SCIP_RETCODE | removeConstraintsDueToNegCliques (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLR *conshdlrsetppc, SCIP_EVENTHDLR *eventhdlr, SCIP_CONS **conss, int nconss, unsigned char **entries, int *nentries, int *nfixedvars, int *ndelconss, int *nupgdconss, int *nchgcoefs, SCIP_Bool *cutoff) |
static SCIP_RETCODE | fixDeleteOrUpgradeCons (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_CONSHDLR *conshdlrlinear, SCIP_CONSHDLR *conshdlrsetppc, int *nfixedvars, int *nchgbds, int *nchgcoefs, int *ndelconss, int *naddconss, int *nupgdconss, SCIP_Bool *cutoff) |
static SCIP_RETCODE | createNormalizedLogicor (SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, int mult, 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) |
static | SCIP_DECL_LINCONSUPGD (linconsUpgdLogicor) |
static SCIP_RETCODE | enforceConstraint (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int nusefulconss, SCIP_SOL *sol, SCIP_RESULT *result) |
static SCIP_RETCODE | addSymmetryInformation (SCIP *scip, SYM_SYMTYPE symtype, SCIP_CONS *cons, SYM_GRAPH *graph, SCIP_Bool *success) |
static | SCIP_DECL_CONSHDLRCOPY (conshdlrCopyLogicor) |
static | SCIP_DECL_CONSFREE (consFreeLogicor) |
static | SCIP_DECL_CONSINITPRE (consInitpreLogicor) |
static | SCIP_DECL_CONSEXITPRE (consExitpreLogicor) |
static | SCIP_DECL_CONSINITSOL (consInitsolLogicor) |
static | SCIP_DECL_CONSEXITSOL (consExitsolLogicor) |
static | SCIP_DECL_CONSDELETE (consDeleteLogicor) |
static | SCIP_DECL_CONSTRANS (consTransLogicor) |
static | SCIP_DECL_CONSINITLP (consInitlpLogicor) |
static | SCIP_DECL_CONSSEPALP (consSepalpLogicor) |
static | SCIP_DECL_CONSSEPASOL (consSepasolLogicor) |
static | SCIP_DECL_CONSENFOLP (consEnfolpLogicor) |
static | SCIP_DECL_CONSENFORELAX (consEnforelaxLogicor) |
static | SCIP_DECL_CONSENFOPS (consEnfopsLogicor) |
static | SCIP_DECL_CONSCHECK (consCheckLogicor) |
static | SCIP_DECL_CONSPROP (consPropLogicor) |
static | SCIP_DECL_CONSPRESOL (consPresolLogicor) |
static | SCIP_DECL_CONSRESPROP (consRespropLogicor) |
static | SCIP_DECL_CONSLOCK (consLockLogicor) |
static | SCIP_DECL_CONSACTIVE (consActiveLogicor) |
static | SCIP_DECL_CONSDEACTIVE (consDeactiveLogicor) |
static | SCIP_DECL_CONSPRINT (consPrintLogicor) |
static | SCIP_DECL_CONSCOPY (consCopyLogicor) |
static | SCIP_DECL_CONSPARSE (consParseLogicor) |
static | SCIP_DECL_CONSGETVARS (consGetVarsLogicor) |
static | SCIP_DECL_CONSGETNVARS (consGetNVarsLogicor) |
static | SCIP_DECL_CONSGETPERMSYMGRAPH (consGetPermsymGraphLogicor) |
static | SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH (consGetSignedPermsymGraphLogicor) |
static | SCIP_DECL_EVENTEXEC (eventExecLogicor) |
static | SCIP_DECL_CONFLICTEXEC (conflictExecLogicor) |
SCIP_RETCODE | SCIPincludeConshdlrLogicor (SCIP *scip) |
SCIP_RETCODE | SCIPcreateConsLogicor (SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, 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 | SCIPcreateConsBasicLogicor (SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars) |
SCIP_RETCODE | SCIPaddCoefLogicor (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var) |
int | SCIPgetNVarsLogicor (SCIP *scip, SCIP_CONS *cons) |
SCIP_VAR ** | SCIPgetVarsLogicor (SCIP *scip, SCIP_CONS *cons) |
SCIP_Real | SCIPgetDualsolLogicor (SCIP *scip, SCIP_CONS *cons) |
SCIP_Real | SCIPgetDualfarkasLogicor (SCIP *scip, SCIP_CONS *cons) |
SCIP_ROW * | SCIPgetRowLogicor (SCIP *scip, SCIP_CONS *cons) |
SCIP_RETCODE | SCIPcleanupConssLogicor (SCIP *scip, SCIP_Bool onlychecked, int *naddconss, int *ndelconss, int *nchgcoefs) |
#define CONSHDLR_NAME "logicor" |
Definition at line 70 of file cons_logicor.c.
#define CONSHDLR_DESC "logic or constraints" |
Definition at line 71 of file cons_logicor.c.
#define CONSHDLR_SEPAPRIORITY +10000 |
priority of the constraint handler for separation
Definition at line 72 of file cons_logicor.c.
#define CONSHDLR_ENFOPRIORITY -2000000 |
priority of the constraint handler for constraint enforcing
Definition at line 73 of file cons_logicor.c.
#define CONSHDLR_CHECKPRIORITY -2000000 |
priority of the constraint handler for checking feasibility
Definition at line 74 of file cons_logicor.c.
#define CONSHDLR_SEPAFREQ 0 |
frequency for separating cuts; zero means to separate only in the root node
Definition at line 75 of file cons_logicor.c.
#define CONSHDLR_PROPFREQ 1 |
frequency for propagating domains; zero means only preprocessing propagation
Definition at line 76 of file cons_logicor.c.
#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 77 of file cons_logicor.c.
#define CONSHDLR_MAXPREROUNDS -1 |
maximal number of presolving rounds the constraint handler participates in (-1: no limit)
Definition at line 79 of file cons_logicor.c.
#define CONSHDLR_DELAYSEPA FALSE |
should separation method be delayed, if other separators found cuts?
Definition at line 80 of file cons_logicor.c.
#define CONSHDLR_DELAYPROP FALSE |
should propagation method be delayed, if other propagators found reductions?
Definition at line 81 of file cons_logicor.c.
#define CONSHDLR_NEEDSCONS TRUE |
should the constraint handler be skipped, if no constraints are available?
Definition at line 82 of file cons_logicor.c.
#define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_ALWAYS |
Definition at line 84 of file cons_logicor.c.
#define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP |
Definition at line 85 of file cons_logicor.c.
#define LINCONSUPGD_PRIORITY +800000 |
priority of the constraint handler for upgrading of linear constraints
Definition at line 87 of file cons_logicor.c.
#define EVENTHDLR_NAME "logicor" |
Definition at line 89 of file cons_logicor.c.
#define EVENTHDLR_DESC "event handler for logic or constraints" |
Definition at line 90 of file cons_logicor.c.
#define CONFLICTHDLR_NAME "logicor" |
Definition at line 92 of file cons_logicor.c.
#define CONFLICTHDLR_DESC "conflict handler creating logic or constraints" |
Definition at line 93 of file cons_logicor.c.
#define CONFLICTHDLR_PRIORITY LINCONSUPGD_PRIORITY |
Definition at line 94 of file cons_logicor.c.
#define DEFAULT_PRESOLPAIRWISE TRUE |
should pairwise constraint comparison be performed in presolving?
Definition at line 96 of file cons_logicor.c.
#define DEFAULT_STRENGTHEN TRUE |
should pairwise constraint comparison try to strengthen constraints by removing superflous non-zeros?
Definition at line 97 of file cons_logicor.c.
Referenced by SCIPincludeConshdlrLogicor(), and SCIPincludeSepaDisjunctive().
#define HASHSIZE_LOGICORCONS 500 |
minimal size of hash table in logicor constraint tables
Definition at line 99 of file cons_logicor.c.
Referenced by detectRedundantConstraints(), and presoldataInitHashtables().
#define DEFAULT_PRESOLUSEHASHING TRUE |
should hash table be used for detecting redundant constraints in advance
Definition at line 100 of file cons_logicor.c.
#define DEFAULT_DUALPRESOLVING TRUE |
should dual presolving steps be performed?
Definition at line 101 of file cons_logicor.c.
#define DEFAULT_NEGATEDCLIQUE TRUE |
should negated clique information be used in presolving
Definition at line 102 of file cons_logicor.c.
#define DEFAULT_IMPLICATIONS TRUE |
should we try to shrink the variables and derive global boundchanges by using cliques and implications
Definition at line 103 of file cons_logicor.c.
Referenced by SCIPincludeConshdlrLogicor().
#define AGEINCREASE | ( | n | ) |
Definition at line 108 of file cons_logicor.c.
Referenced by processWatchedVars().
#define MAX_CONSLENGTH 200 |
Definition at line 3214 of file cons_logicor.c.
Referenced by shortenConss().
#define MAXCOMPARISONS 1000000 |
Definition at line 3417 of file cons_logicor.c.
Referenced by removeConstraintsDueToNegCliques().
|
static |
installs rounding locks for the given variable in the given logic or constraint
scip | SCIP data structure |
cons | logic or constraint |
var | variable of constraint entry |
Definition at line 177 of file cons_logicor.c.
References FALSE, SCIP_CALL, SCIP_OKAY, SCIPlockVarCons(), TRUE, and var.
Referenced by addCoef().
|
static |
removes rounding locks for the given variable in the given logic or constraint
scip | SCIP data structure |
cons | logic or constraint |
var | variable of constraint entry |
Definition at line 190 of file cons_logicor.c.
References FALSE, SCIP_CALL, SCIP_OKAY, SCIPunlockVarCons(), TRUE, and var.
Referenced by delCoefPos().
|
static |
creates constraint handler data for logic or constraint handler
scip | SCIP data structure |
conshdlrdata | pointer to store the constraint handler data |
eventhdlr | event handler |
Definition at line 203 of file cons_logicor.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPallocBlockMemory.
Referenced by SCIPincludeConshdlrLogicor().
|
static |
frees constraint handler data for logic or constraint handler
scip | SCIP data structure |
conshdlrdata | pointer to the constraint handler data |
Definition at line 228 of file cons_logicor.c.
References assert(), NULL, and SCIPfreeBlockMemory.
Referenced by SCIP_DECL_CONSFREE().
|
static |
ensures, that the vars array can store at least num entries
scip | SCIP data structure |
consdata | logicor constraint data |
num | minimum number of entries to store |
Definition at line 241 of file cons_logicor.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), and SCIPreallocBlockMemoryArray.
Referenced by addCoef().
|
static |
creates a logic or constraint data object
scip | SCIP data structure |
consdata | pointer to store the logic or constraint data |
nvars | number of variables in the constraint |
vars | variables of the constraint |
Definition at line 265 of file cons_logicor.c.
References assert(), FALSE, NULL, nvars, SCIP_CALL, SCIP_OKAY, SCIP_VARSTATUS_MULTAGGR, SCIPallocBlockMemory, SCIPcaptureVar(), SCIPduplicateBlockMemoryArray, SCIPgetTransformedVars(), SCIPisTransformed(), SCIPvarGetProbvar(), SCIPvarGetStatus(), TRUE, var, and vars.
Referenced by SCIP_DECL_CONSTRANS(), and SCIPcreateConsLogicor().
|
static |
frees a logic or constraint data
scip | SCIP data structure |
consdata | pointer to the logic or constraint |
Definition at line 334 of file cons_logicor.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArrayNull, SCIPreleaseNlRow(), SCIPreleaseRow(), and SCIPreleaseVar().
Referenced by SCIP_DECL_CONSDELETE().
|
static |
prints logic or constraint to file stream
scip | SCIP data structure |
consdata | logic or constraint data |
file | output file (or NULL for standard output) |
endline | should an endline be set? |
Definition at line 371 of file cons_logicor.c.
References assert(), NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPinfoMessage(), SCIPwriteVarsList(), and TRUE.
Referenced by applyFixings(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSDEACTIVE(), and SCIP_DECL_CONSPRINT().
|
static |
stores the given variable numbers as watched variables, and updates the event processing
scip | SCIP data structure |
cons | logic or constraint |
eventhdlr | event handler to call for the event processing |
watchedvar1 | new first watched variable |
watchedvar2 | new second watched variable |
Definition at line 397 of file cons_logicor.c.
References assert(), NULL, nvars, SCIP_CALL, SCIP_EVENTTYPE_LBRELAXED, SCIP_EVENTTYPE_UBTIGHTENED, SCIP_OKAY, SCIPcatchVarEvent(), SCIPconsGetData(), and SCIPdropVarEvent().
Referenced by delCoefPos(), and processWatchedVars().
|
static |
adds coefficient in logicor constraint
scip | SCIP data structure |
cons | logicor constraint |
var | variable to add to the constraint |
Definition at line 468 of file cons_logicor.c.
References assert(), consdataEnsureVarsSize(), CONSHDLR_NAME, FALSE, lockRounding(), NULL, SCIP_Bool, SCIP_CALL, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIP_STAGE_INITPRESOLVE, SCIP_STAGE_PRESOLVING, SCIP_VARSTATUS_MULTAGGR, SCIPaddVarToRow(), SCIPcaptureVar(), SCIPcatchVarEvent(), SCIPconsGetData(), SCIPconshdlrGetData(), SCIPconsIsTransformed(), SCIPfindConshdlr(), SCIPgetStage(), SCIPgetTransformedVar(), SCIPvarGetProbvar(), SCIPvarGetStatus(), SCIPvarIsTransformed(), TRUE, and var.
Referenced by applyFixings(), and SCIPaddCoefLogicor().
|
static |
deletes coefficient at given position from logic or constraint data
scip | SCIP data structure |
cons | logic or constraint |
eventhdlr | event handler to call for the event processing |
pos | position of coefficient to delete |
Definition at line 538 of file cons_logicor.c.
References assert(), FALSE, NULL, nvars, SCIP_CALL, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIP_STAGE_INITPRESOLVE, SCIP_STAGE_PRESOLVING, SCIPconsGetData(), SCIPconsIsTransformed(), SCIPdropVarEvent(), SCIPenableConsPropagation(), SCIPgetStage(), SCIPreleaseVar(), SCIPvarIsTransformed(), switchWatchedvars(), TRUE, and unlockRounding().
Referenced by applyFixings(), dualPresolving(), mergeMultiples(), removeConstraintsDueToNegCliques(), removeRedundantNonZeros(), and shortenConss().
|
static |
in case a part (more than one variable) in the logic or constraint is independent of every else, we can perform dual reductions;
also added the special case were exactly one variable is locked by this constraint and another variable without any uplocks has a better objective value than this single variable
Moreover, if there exists a variable that is only locked by a constraint with two variables, one can aggregate variables.
Note: the following dual reduction for logic or constraints is already performed by the presolver "dualfix"
scip | SCIP data structure |
cons | setppc constraint |
eventhdlr | event handler to call for the event processing |
nfixedvars | pointer to count number of fixings |
ndelconss | pointer to count number of deleted constraints |
nchgcoefs | pointer to count number of changed/deleted coefficients |
naggrvars | pointer to count number of variables aggregated |
result | pointer to store the result SCIP_SUCCESS, if presolving was performed |
Definition at line 622 of file cons_logicor.c.
References assert(), delCoefPos(), FALSE, NULL, nvars, objval, result, SCIP_Bool, SCIP_CALL, SCIP_INVALID, SCIP_LOCKTYPE_MODEL, SCIP_OKAY, SCIP_Real, SCIP_SUCCESS, SCIPaggregateVars(), SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsModifiable(), SCIPdebugMsg, SCIPdelCons(), SCIPfixVar(), SCIPinfinity(), SCIPisGE(), SCIPisLT(), SCIPisNegative(), SCIPvarGetAggregatedObj(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetNLocksDownType(), SCIPvarGetNLocksUpType(), SCIPvarGetObj(), SCIPvarGetProbvarBinary(), SCIPvarGetUbGlobal(), SCIPvarIsActive(), var, and vars.
Referenced by SCIP_DECL_CONSPRESOL().
|
static |
deletes all zero-fixed variables, checks for variables fixed to one, replace all variables which are not active or not a negation of an active variable by there active or negation of an active counterpart
scip | SCIP data structure |
cons | logic or constraint |
eventhdlr | event handler to call for the event processing |
redundant | returns whether a variable fixed to one exists in the constraint |
nchgcoefs | pointer to count number of changed/deleted coefficients |
naddconss | pointer to count number of added constraints, or NULL indicating we can not resolve multi-aggregations |
ndelconss | pointer to count number of deleted constraints, or NULL indicating we can not resolve multi-aggregations |
Definition at line 914 of file cons_logicor.c.
References addCoef(), assert(), consdataPrint(), delCoefPos(), FALSE, MAX, NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_MULTAGGR, SCIP_VARSTATUS_NEGATED, SCIPaddCons(), SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsAdded(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsLinear(), SCIPdebug, SCIPdebugMsg, SCIPdebugPrintCons, SCIPdelCons(), SCIPfreeBufferArray, SCIPgetBinvarRepresentatives(), SCIPgetProbvarLinearSum(), SCIPinfinity(), SCIPisEQ(), SCIPisFeasEQ(), SCIPisZero(), SCIPreallocBufferArray, SCIPreleaseCons(), SCIPsnprintf(), SCIPvarGetLbGlobal(), SCIPvarGetNegatedVar(), SCIPvarGetNegationVar(), SCIPvarGetStatus(), SCIPvarGetUbGlobal(), SCIPvarIsActive(), SCIPvarIsBinary(), SCIPwarningMessage(), TRUE, var, and vars.
Referenced by fixDeleteOrUpgradeCons(), prepareCons(), SCIP_DECL_CONSEXITPRE(), SCIP_DECL_CONSPRESOL(), and SCIPcleanupConssLogicor().
|
static |
analyzes conflicting assignment on given constraint, and adds conflict constraint to problem
scip | SCIP data structure |
cons | logic or constraint that detected the conflict |
Definition at line 1185 of file cons_logicor.c.
References assert(), FALSE, NULL, SCIP_CALL, SCIP_CONFTYPE_PROPAGATION, SCIP_OKAY, SCIP_STAGE_SOLVING, SCIPaddConflictBinvar(), SCIPanalyzeConflictCons(), SCIPconsGetData(), SCIPgetStage(), SCIPinitConflictAnalysis(), SCIPinProbing(), and SCIPisConflictAnalysisApplicable().
Referenced by processWatchedVars().
|
static |
disables or deletes the given constraint, depending on the current depth
scip | SCIP data structure |
cons | bound disjunction constraint to be disabled |
Definition at line 1216 of file cons_logicor.c.
References assert(), SCIP_CALL, SCIP_OKAY, SCIPconsGetName(), SCIPconsGetValidDepth(), SCIPdebugMsg, SCIPdelCons(), SCIPdisableCons(), and SCIPgetDepth().
Referenced by processWatchedVars().
|
static |
find pairs of negated variables in constraint: constraint is redundant find sets of equal variables in constraint: multiple entries of variable can be replaced by single entry
scip | SCIP data structure |
cons | logic or constraint |
eventhdlr | event handler to call for the event processing |
entries | array to store whether two positions in constraints represent the same variable |
nentries | pointer for array size, if array will be to small it's corrected |
redundant | returns whether a variable fixed to one exists in the constraint |
nchgcoefs | pointer to count number of changed/deleted coefficients |
Definition at line 1240 of file cons_logicor.c.
References assert(), delCoefPos(), FALSE, nbinvars, nintvars, NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_VARSTATUS_NEGATED, SCIP_VARTYPE_BINARY, SCIP_VARTYPE_IMPLINT, SCIP_VARTYPE_INTEGER, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPfreeBufferArray, SCIPgetNBinVars(), SCIPgetNImplVars(), SCIPgetNIntVars(), SCIPvarGetName(), SCIPvarGetNegationVar(), SCIPvarGetProbindex(), SCIPvarGetStatus(), SCIPvarGetType(), SCIPvarIsActive(), SCIPvarIsBinary(), SCIPvarIsNegated(), TRUE, var, and vars.
Referenced by prepareCons(), SCIP_DECL_CONSPRESOL(), and SCIPcleanupConssLogicor().
|
static |
checks constraint for violation only looking at the watched variables, applies fixings if possible
scip | SCIP data structure |
cons | logic or constraint to be processed |
eventhdlr | event handler to call for the event processing |
cutoff | pointer to store TRUE, if the node can be cut off |
reduceddom | pointer to store TRUE, if a domain reduction was found |
addcut | pointer to store whether this constraint must be added as a cut |
mustcheck | pointer to store whether this constraint must be checked for feasibility |
Definition at line 1389 of file cons_logicor.c.
References AGEINCREASE, analyzeConflict(), assert(), CONSHDLR_NAME, cutoff, disableCons(), FALSE, NULL, nvars, SCIP_Bool, SCIP_BRANCHDIR_DOWNWARDS, SCIP_CALL, SCIP_Longint, SCIP_LONGINT_MAX, SCIP_OKAY, SCIPaddConsAge(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetName(), SCIPconsIsModifiable(), SCIPdebugMsg, SCIPdisableConsPropagation(), SCIPgetDepth(), SCIPinferBinvarCons(), SCIPisFeasEQ(), SCIPresetConsAge(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetNBranchingsCurrentRun(), SCIPvarGetUbLocal(), switchWatchedvars(), TRUE, and vars.
Referenced by enforcePseudo(), SCIP_DECL_CONSPROP(), and separateCons().
checks constraint for violation, returns TRUE iff constraint is feasible
scip | SCIP data structure |
cons | logic or constraint to be checked |
sol | primal CIP solution |
Definition at line 1607 of file cons_logicor.c.
References assert(), NULL, nvars, SCIP_Bool, SCIP_Real, SCIPconsGetData(), SCIPgetSolVal(), SCIPisFeasGE(), SCIPisFeasLE(), SCIPisFeasLT(), SCIPrelDiff(), SCIPupdateSolLPConsViolation(), SCIPvarIsBinary(), sol, and vars.
Referenced by enforcePseudo(), SCIP_DECL_CONSCHECK(), and separateCons().
|
static |
creates an LP row in a logic or constraint data object
scip | SCIP data structure |
cons | logic or constraint |
Definition at line 1650 of file cons_logicor.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPaddVarsToRowSameCoef(), SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsRemovable(), SCIPcreateEmptyRowCons(), and SCIPinfinity().
Referenced by addCut().
|
static |
adds logicor constraint as row to the NLP, if not added yet
scip | SCIP data structure |
cons | logicor constraint |
Definition at line 1671 of file cons_logicor.c.
References assert(), i, NULL, SCIP_CALL, SCIP_EXPRCURV_LINEAR, SCIP_OKAY, SCIP_Real, SCIPaddNlRow(), SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsLocal(), SCIPcreateNlRow(), SCIPfreeBufferArray, SCIPinfinity(), SCIPisNLPConstructed(), and SCIPnlrowIsInNLP().
Referenced by SCIP_DECL_CONSACTIVE(), and SCIP_DECL_CONSINITSOL().
|
static |
adds logic or constraint as cut to the LP
scip | SCIP data structure |
cons | logic or constraint |
cutoff | whether a cutoff has been detected |
Definition at line 1713 of file cons_logicor.c.
References assert(), createRow(), cutoff, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPaddRow(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, and SCIProwIsInLP().
Referenced by SCIP_DECL_CONSINITLP(), and separateCons().
|
static |
checks constraint for violation, and adds it as a cut if possible
scip | SCIP data structure |
cons | logic or constraint to be separated |
sol | primal CIP solution, NULL for current LP solution |
eventhdlr | event handler to call for the event processing |
cutoff | pointer to store TRUE, if the node can be cut off |
separated | pointer to store TRUE, if a cut was found |
reduceddom | pointer to store TRUE, if a domain reduction was found |
Definition at line 1746 of file cons_logicor.c.
References addCut(), assert(), CONSHDLR_NAME, cutoff, FALSE, isConsViolated(), NULL, processWatchedVars(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetName(), SCIPconsIsPropagationEnabled(), SCIPdebugMsg, SCIPgetRowLPFeasibility(), SCIPisFeasNegative(), SCIPresetConsAge(), SCIProwIsInLP(), sol, and TRUE.
Referenced by enforceConstraint(), SCIP_DECL_CONSSEPALP(), and SCIP_DECL_CONSSEPASOL().
|
static |
enforces the pseudo solution on the given constraint
scip | SCIP data structure |
cons | logic or constraint to be separated |
eventhdlr | event handler to call for the event processing |
cutoff | pointer to store TRUE, if the node can be cut off |
infeasible | pointer to store TRUE, if the constraint was infeasible |
reduceddom | pointer to store TRUE, if a domain reduction was found |
solvelp | pointer to store TRUE, if the LP has to be solved |
Definition at line 1823 of file cons_logicor.c.
References assert(), CONSHDLR_NAME, cutoff, FALSE, isConsViolated(), NULL, processWatchedVars(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPconsIsPropagationEnabled(), SCIPhasCurrentNodeLP(), SCIPresetConsAge(), and TRUE.
Referenced by SCIP_DECL_CONSENFOPS().
|
static |
sorts logicor constraint's variables by non-decreasing variable index
consdata | linear constraint data |
Definition at line 1879 of file cons_logicor.c.
References assert(), NULL, nvars, SCIP_Bool, SCIPsortedvecFindPtr(), SCIPsortPtr(), SCIPvarCompare(), and TRUE.
Referenced by detectRedundantConstraints(), removeRedundantConssAndNonzeros(), removeRedundantNonZeros(), and SCIP_DECL_HASHKEYEQ().
|
static |
gets the key of the given element
Definition at line 1960 of file cons_logicor.c.
|
static |
returns TRUE iff both keys are equal; two constraints are equal if they have the same variables
Definition at line 1968 of file cons_logicor.c.
References assert(), consdataSort(), FALSE, i, NULL, SCIP_Bool, SCIPconsGetData(), SCIPvarCompare(), and TRUE.
|
static |
returns the hash value of the key
Definition at line 2014 of file cons_logicor.c.
References assert(), NULL, SCIPconsGetData(), SCIPhashFour, and SCIPvarGetIndex().
|
static |
compares each constraint with all other constraints for a possible duplication and removes duplicates using a hash table; also
scip | SCIP data structure |
blkmem | block memory |
conss | constraint set |
nconss | number of constraints in constraint set |
firstchange | pointer to store first changed constraint |
ndelconss | pointer to count number of deleted constraints |
Definition at line 2038 of file cons_logicor.c.
References assert(), c, consdataSort(), HASHSIZE_LOGICORCONS, MAX, NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetPos(), SCIPconsIsActive(), SCIPconsIsModifiable(), SCIPdelCons(), SCIPhashtableCreate(), SCIPhashtableFree(), SCIPhashtableInsert(), SCIPhashtableRetrieve(), and SCIPupdateConsFlags().
Referenced by SCIP_DECL_CONSPRESOL().
|
static |
removes the redundant second constraint and updates the flags of the first one
scip | SCIP data structure |
cons0 | constraint that should stay |
cons1 | constraint that should be deleted |
ndelconss | pointer to count number of deleted constraints |
Definition at line 2127 of file cons_logicor.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetName(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPdelCons(), and SCIPupdateConsFlags().
Referenced by removeRedundantConss().
|
static |
compute and return a signature for given variables
vars | variables to calculate the signature for |
nvars | number of variables to calculate the signature for |
Definition at line 2154 of file cons_logicor.c.
References assert(), NULL, nvars, SCIPvarGetIndex(), and vars.
Referenced by consdataCalcSignature(), and removeRedundantNonZeros().
|
static |
compute the constraint signature which is used to detect constraints, that contain potentially the same set of variables
consdata | logicor constraint data |
Definition at line 2177 of file cons_logicor.c.
References calcSignature(), and TRUE.
Referenced by removeRedundantConssAndNonzeros(), and removeRedundantNonZeros().
|
static |
remove a constraint from the column representation
cons | logicor constraint |
varstopos | map for mapping variables to positions in the occurlist |
occurlist | column representation of logicor constraints |
noccurlistentries | arrray with number of constraints for each variable in the occurlist |
occurlistlength | number of columns in the occurlist |
Definition at line 2190 of file cons_logicor.c.
References assert(), NULL, nvars, SCIPconsGetData(), SCIPconsIsActive(), SCIPhashmapExists(), SCIPhashmapGetImageInt(), var, and vars.
Referenced by removeRedundantConss(), and removeRedundantNonZeros().
|
static |
determine shortest constraint list in column representation
vars | variables to find the shortestlist for |
nvars | number of variables |
varstopos | map for mapping variables to positions in the occurlist |
occurlist | column representation of logicor constraints |
noccurlistentries | arrray with number of constraints for each variable in the occurlist |
occurlistlength | number of columns in the occurlist |
nentries | pointer to store the number of entries in the shortest list |
shortestlist | pointer to store smallest array with constraints |
Definition at line 2250 of file cons_logicor.c.
References assert(), NULL, nvars, SCIPhashmapExists(), SCIPhashmapGetImageInt(), var, and vars.
Referenced by removeRedundantConss(), and removeRedundantNonZeros().
|
static |
run a pairwise comparison for detecting subset-constraints of other constraint while using a signature
scip | SCIP data structure |
cons | logicor constraint to check if it covers another |
varstopos | map for mapping variables to positions in the occurlist |
occurlist | column representation of logicor constraints |
noccurlistentries | arrray with number of constraints for each variable in the occurlist |
occurlistlength | number of columns in the occurlist |
ndelconss | pointer to store the number of deleted constraints |
Definition at line 2305 of file cons_logicor.c.
References assert(), c, findShortestOccurlist(), NULL, nvars, removeConsFromOccurList(), removeRedundantCons(), SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsModifiable(), SCIPvarCompare(), var, and vars.
Referenced by removeRedundantConssAndNonzeros().
|
static |
compararer for sorting constraints after their number of variables
Definition at line 2423 of file cons_logicor.c.
References assert(), NULL, and SCIPconsGetData().
|
static |
add a constraint to the column representation
scip | SCIP data structure |
cons | logicor constraint |
varstopos | map for mapping variables to positions in the occurlist |
occurlist | column representation of logicor constraints |
noccurlistentries | arrray with number of constraints for each variable in the occurlist |
occurlistsizes | array of sizes for each variable in the occurlist |
occurlistlength | number of columns in the occurlist |
occurlistsize | size of occurlist |
Definition at line 2442 of file cons_logicor.c.
References assert(), NULL, SCIP_CALL, SCIP_LOCKTYPE_MODEL, SCIP_OKAY, SCIPallocBufferArray, SCIPcalcMemGrowSize(), SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPhashmapExists(), SCIPhashmapGetImageInt(), SCIPhashmapInsertInt(), SCIPreallocBufferArray, SCIPvarGetNegatedVar(), SCIPvarGetNLocksDownType(), SCIPvarIsActive(), var, and vars.
Referenced by removeRedundantConssAndNonzeros().
|
static |
run a pairwise comparison for the given variables against all constraits to detect redundant non-zeros in these constraints
scip | SCIP data structure |
cons | logicor constraint to check if it covers another |
artvar | artificial negated variable of constraint |
artpos | position to replace constraint variable with artvar |
varstopos | map for mapping variables to positions in the occurlist |
occurlist | column representation of logicor constraints |
noccurlistentries | number of constraints for each variable in the occurlist |
occurlistlength | number of columns in the occurlist |
eventhdlr | event handler |
nchgcoefs | pointer to store the number of deleted non-zeros |
deleted | pointer to store if cons will be deleted |
Definition at line 2541 of file cons_logicor.c.
References assert(), c, calcSignature(), consdataCalcSignature(), consdataSort(), delCoefPos(), FALSE, findShortestOccurlist(), NULL, nvars, removeConsFromOccurList(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsActive(), SCIPconsIsModifiable(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPdelCons(), SCIPhashmapExists(), SCIPhashmapGetImageInt(), SCIPupdateConsFlags(), SCIPvarCompare(), SCIPvarGetName(), SCIPvarGetNegatedVar(), TRUE, var, and vars.
Referenced by strengthenConss().
|
static |
find and remove redundant non-zero entries
scip | SCIP data structure |
conss | sorted array of logicor constraint |
nconss | number of sorted constraints |
varstopos | map for mapping variables to positions in the occurlist |
occurlist | column representation of logicor constraints |
noccurlistentries | number of constraints for each variable in the occurlist |
occurlistlength | number of columns in the occurlist |
eventhdlr | event handler to call for the event processing |
ndelconss | pointer to store the number of deleted constraints |
nchgcoefs | pointer to store the number of remove coefficients |
Definition at line 2786 of file cons_logicor.c.
References assert(), c, NULL, nvars, removeRedundantNonZeros(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsModifiable(), SCIPhashmapExists(), SCIPvarGetNegatedVar(), and vars.
Referenced by removeRedundantConssAndNonzeros().
|
static |
prepares a constraint by removing fixings and merge it
scip | SCIP data structure |
cons | logic or constraint |
eventhdlr | event handler to call for the event processing |
entries | array to store whether two positions in constraints represent the same variable |
nentries | pointer for array size, if array will be to small it's corrected |
redundant | returns whether a variable fixed to one exists in the constraint |
nfixedvars | pointer to count number of fixings |
nchgcoefs | pointer to count number of changed/deleted coefficients |
ndelconss | pointer to count number of deleted constraints |
cutoff | pointer to store, if cut off appeared |
Definition at line 2877 of file cons_logicor.c.
References applyFixings(), assert(), cutoff, FALSE, mergeMultiples(), NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsIsDeleted(), SCIPdebugMsg, SCIPdelCons(), SCIPfixVar(), and TRUE.
Referenced by removeConstraintsDueToNegCliques(), removeRedundantConssAndNonzeros(), and shortenConss().
|
static |
find covered/subsumed constraints and redundant non-zero entries
covered: e.g.: c1: x1 + x2 + x3 >= 1 c2: x1 + x2 + x3 + x4 >= 1
strengthen: e.g.: c1: x1 + x2 + x3 >= 1 c2: x1 + x2 + ~x3 + x4 >= 1
=> c2: x1 + x2 + x4 >= 1
scip | SCIP data structure |
conss | array of logicor constraints |
nconss | number of logicor constraints |
entries | array to store whether two positions in constraints represent the same variable |
nentries | pointer for array size, if array will be to small it's corrected |
eventhdlr | event handler to call for the event processing |
usestrengthening | should we try to strengthen constraints by removing superflous non-zeros? |
firstchange | pointer to store first changed constraint |
nfixedvars | pointer to count number of fixings |
ndelconss | pointer to store the number of deleted constraints |
nchgcoefs | pointer to store the number of deleted coefficients |
cutoff | pointer to store, if cut off appeared |
Definition at line 2973 of file cons_logicor.c.
References addConsToOccurList(), assert(), BMSclearMemoryArray, c, consdataCalcSignature(), consdataSort(), cutoff, FALSE, nbinvars, NULL, nvars, prepareCons(), removeRedundantConss(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPblkmem(), SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsModifiable(), SCIPdebugMsg, SCIPduplicateBufferArray, SCIPfreeBufferArray, SCIPfreeBufferArrayNull, SCIPgetNContVars(), SCIPgetNVars(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPsortPtr(), strengthenConss(), and TRUE.
Referenced by SCIP_DECL_CONSPRESOL().
|
static |
try to tighten constraints by reducing the number of variables in the constraints using implications and cliques, also derive fixations through them,
scip | SCIP data structure |
conshdlrdata | logic or constraint handler data |
eventhdlr | event handler to call for the event processing |
conss | all constraints |
nconss | number of constraints |
entries | array to store whether two positions in constraints represent the same variable |
nentries | pointer for array size, if array will be to small it's corrected |
nfixedvars | pointer to count number of fixings |
ndelconss | pointer to count number of deleted constraints |
nchgcoefs | pointer to count number of changed/deleted coefficients |
cutoff | pointer to store, if cut off appeared |
Definition at line 3220 of file cons_logicor.c.
References assert(), BMSclearMemoryArray, c, cutoff, delCoefPos(), FALSE, MAX_CONSLENGTH, NULL, prepareCons(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_NEGATED, SCIPallocBufferArray, SCIPallocCleanBufferArray, SCIPcleanupCliques(), SCIPconsGetData(), SCIPconsIsDeleted(), SCIPdebugMsg, SCIPdelCons(), SCIPfixVar(), SCIPfreeBufferArray, SCIPfreeCleanBufferArray, SCIPgetNCliques(), SCIPgetNContVars(), SCIPgetNImplications(), SCIPgetNVars(), SCIPshrinkDisjunctiveVarSet(), SCIPvarGetNegationVar(), SCIPvarGetStatus(), SCIPvarIsActive(), TRUE, and var.
Referenced by SCIP_DECL_CONSPRESOL().
|
static |
try to find a negated clique in a constraint which makes this constraint redundant but we need to keep the negated clique information alive, so we create a corresponding set-packing constraint
scip | SCIP data structure |
conshdlr | logicor constraint handler |
conshdlrsetppc | setppc constraint handler, or NULL |
eventhdlr | event handler to call for the event processing |
conss | all constraints |
nconss | number of constraints |
entries | array to store whether two positions in constraints represent the same variable |
nentries | pointer for array size, if array will be to small it's corrected |
nfixedvars | pointer to count number of fixings |
ndelconss | pointer to count number of deleted constraints |
nupgdconss | pointer to count number of upgraded constraints |
nchgcoefs | pointer to count number of changed/deleted coefficients |
cutoff | pointer to store, if cut off appeared |
Definition at line 3423 of file cons_logicor.c.
References assert(), BMScopyMemoryArray, c, cutoff, delCoefPos(), FALSE, MAXCOMPARISONS, NULL, nvars, prepareCons(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_VARSTATUS_NEGATED, SCIPaddCons(), SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsDeleted(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsSetpack(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPdelCons(), SCIPfreeBufferArray, SCIPgetNCliques(), SCIPgetNContVars(), SCIPgetNImplications(), SCIPgetNVars(), SCIPisStopped(), SCIPreleaseCons(), SCIPvarGetName(), SCIPvarGetNCliques(), SCIPvarGetNegatedVar(), SCIPvarGetNegationVar(), SCIPvarGetNImpls(), SCIPvarGetStatus(), SCIPvarIsActive(), SCIPvarIsNegated(), SCIPvarsHaveCommonClique(), TRUE, vars, and w.
Referenced by SCIP_DECL_CONSPRESOL().
|
static |
handle all cases with less than three variables in a logicor constraint
in case a constraint has zero variables left, we detected infeasibility in case a constraint has one variables left, we will fix it to one in case a constraint has two variables left, we will add the implication and upgrade it to a set-packing constraint
scip | SCIP data structure |
cons | logic or constraint |
eventhdlr | event handler to call for the event processing |
conshdlrlinear | linear constraint handler, or NULL |
conshdlrsetppc | setppc constraint handler, or NULL |
nfixedvars | pointer to count number of fixings |
nchgbds | pointer to count number of tightened bounds |
nchgcoefs | pointer to count number of changed/deleted coefficients |
ndelconss | pointer to count number of deleted constraints |
naddconss | pointer to count number of added constraints |
nupgdconss | pointer to count number of upgraded constraints |
cutoff | pointer to store TRUE, if the node can be cut off |
Definition at line 3697 of file cons_logicor.c.
References applyFixings(), assert(), cutoff, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_MULTAGGR, SCIPaddClique(), SCIPaddCons(), SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsDeleted(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsLinear(), SCIPcreateConsSetpack(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPdelCons(), SCIPfixVar(), SCIPgetNegatedVar(), SCIPreleaseCons(), SCIPsnprintf(), SCIPvarGetName(), SCIPvarGetStatus(), TRUE, and vars.
Referenced by SCIP_DECL_CONSPRESOL().
|
static |
creates and captures a normalized (with all coefficients +1) logic or constraint
scip | SCIP data structure |
cons | pointer to hold the created constraint |
name | name of constraint |
nvars | number of variables in the constraint |
vars | array with variables of constraint entries |
vals | array with coefficients (+1.0 or -1.0) |
mult | multiplier on the coefficients(+1 or -1) |
initial | should the LP relaxation of constraint be in the initial LP? Usually set to TRUE. Set to FALSE for 'lazy constraints'. |
separate | should the constraint be separated during LP processing? Usually set to TRUE. |
enforce | should the constraint be enforced during node processing? TRUE for model constraints, FALSE for additional, redundant constraints. |
check | should the constraint be checked for feasibility? TRUE for model constraints, FALSE for additional, redundant constraints. |
propagate | should the constraint be propagated during node processing? Usually set to TRUE. |
local | is constraint only valid locally? Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. |
modifiable | is constraint modifiable (subject to column generation)? Usually set to FALSE. In column generation applications, set to TRUE if pricing adds coefficients to this constraint. |
dynamic | is constraint subject to aging? Usually set to FALSE. Set to TRUE for own cuts which are separated as constraints. |
removable | should 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'. |
stickingatnode | should 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 3882 of file cons_logicor.c.
References assert(), NULL, nvars, propagate, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcreateConsLogicor(), SCIPfreeBufferArray, SCIPgetNegatedVar(), and vars.
Referenced by SCIP_DECL_LINCONSUPGD().
|
static |
Definition at line 3948 of file cons_logicor.c.
References assert(), createNormalizedLogicor(), NULL, nvars, SCIP_CALL, SCIP_OKAY, SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPdebugMsg, SCIPisEQ(), SCIPisInfinity(), and vars.
|
static |
helper function to enforce constraints
scip | SCIP data structure |
conshdlr | constraint handler |
conss | constraints to process |
nconss | number of constraints |
nusefulconss | number of useful (non-obsolete) constraints to process |
sol | solution to enforce (NULL for the LP solution) |
result | pointer to store the result of the enforcing call |
Definition at line 3988 of file cons_logicor.c.
References assert(), c, CONSHDLR_NAME, cutoff, FALSE, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_FEASIBLE, SCIP_OKAY, SCIP_REDUCEDDOM, SCIP_SEPARATED, SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPdebugMsg, separateCons(), and sol.
Referenced by SCIP_DECL_CONSENFOLP(), and SCIP_DECL_CONSENFORELAX().
|
static |
adds symmetry information of constraint to a symmetry detection graph
scip | SCIP pointer |
symtype | type of symmetries that need to be added |
cons | constraint |
graph | symmetry detection graph |
success | pointer to store whether symmetry information could be added |
Definition at line 4045 of file cons_logicor.c.
References assert(), i, NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPconsGetData(), SCIPextendPermsymDetectionGraphLinear(), SCIPfreeBufferArray, SCIPgetNVars(), SCIPgetNVarsLogicor(), SCIPgetSymActiveVariables(), SCIPgetVarsLogicor(), SCIPinfinity(), SCIPisTransformed(), and vars.
Referenced by SCIP_DECL_CONSGETPERMSYMGRAPH(), and SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH().
|
static |
copy method for constraint handler plugins (called when SCIP copies plugins)
Definition at line 4101 of file cons_logicor.c.
References assert(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetName(), SCIPincludeConshdlrLogicor(), TRUE, and valid.
|
static |
destructor of constraint handler to free constraint handler data (called when SCIP is exiting)
Definition at line 4117 of file cons_logicor.c.
References assert(), CONSHDLR_NAME, conshdlrdataFree(), NULL, SCIP_OKAY, SCIPconshdlrGetData(), SCIPconshdlrGetName(), and SCIPconshdlrSetData().
|
static |
presolving initialization method of constraint handler (called when presolving is about to begin)
Definition at line 4139 of file cons_logicor.c.
References assert(), c, NULL, SCIP_CALL, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIPcatchVarEvent(), SCIPconsGetData(), and SCIPconshdlrGetData().
|
static |
presolving deinitialization method of constraint handler (called after presolving has been finished)
Definition at line 4172 of file cons_logicor.c.
References applyFixings(), assert(), c, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsAdded(), SCIPconsIsDeleted(), SCIPdebugMsg, SCIPdelCons(), and SCIPdropVarEvent().
|
static |
solving process initialization method of constraint handler
Definition at line 4228 of file cons_logicor.c.
References addNlrow(), c, SCIP_CALL, SCIP_OKAY, and SCIPisNLPConstructed().
|
static |
solving process deinitialization method of constraint handler (called before branch and bound process data is freed)
Definition at line 4245 of file cons_logicor.c.
References assert(), c, NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPreleaseNlRow(), and SCIPreleaseRow().
|
static |
frees specific constraint data
Definition at line 4273 of file cons_logicor.c.
References assert(), consdataFree(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIP_STAGE_INITPRESOLVE, SCIP_STAGE_PRESOLVING, SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPdropVarEvent(), and SCIPgetStage().
|
static |
transforms constraint data into data belonging to the transformed problem
Definition at line 4304 of file cons_logicor.c.
References assert(), consdataCreate(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_TRANSFORMING, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetName(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateCons(), and SCIPgetStage().
|
static |
LP initialization method of constraint handler (called before the initial LP relaxation at a node is solved)
Definition at line 4337 of file cons_logicor.c.
References addCut(), assert(), c, FALSE, SCIP_CALL, SCIP_OKAY, and SCIPconsIsInitial().
|
static |
separation method of constraint handler for LP solutions
Definition at line 4355 of file cons_logicor.c.
References assert(), c, CONSHDLR_NAME, cutoff, FALSE, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_REDUCEDDOM, SCIP_SEPARATED, SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPdebugMsg, and separateCons().
|
static |
separation method of constraint handler for arbitrary primal solutions
Definition at line 4402 of file cons_logicor.c.
References assert(), c, CONSHDLR_NAME, cutoff, FALSE, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_REDUCEDDOM, SCIP_SEPARATED, SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPdebugMsg, separateCons(), and sol.
|
static |
constraint enforcing method of constraint handler for LP solutions
Definition at line 4449 of file cons_logicor.c.
References enforceConstraint(), NULL, result, SCIP_CALL, and SCIP_OKAY.
|
static |
constraint enforcing method of constraint handler for relaxation solutions
Definition at line 4459 of file cons_logicor.c.
References enforceConstraint(), result, SCIP_CALL, SCIP_OKAY, and sol.
|
static |
constraint enforcing method of constraint handler for pseudo solutions
Definition at line 4469 of file cons_logicor.c.
References assert(), c, CONSHDLR_NAME, cutoff, enforcePseudo(), FALSE, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, SCIP_REDUCEDDOM, SCIP_SOLVELP, SCIPconshdlrGetData(), SCIPconshdlrGetName(), and SCIPdebugMsg.
|
static |
feasibility check method of constraint handler for integral solutions
Definition at line 4516 of file cons_logicor.c.
References assert(), c, CONSHDLR_NAME, isConsViolated(), NULL, result, SCIP_CALL, SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, SCIPconsGetData(), SCIPconshdlrGetName(), SCIPgetSolVal(), SCIPinfoMessage(), SCIPisFeasLT(), SCIPprintCons(), SCIProwIsInLP(), SCIPvarIsBinary(), and sol.
|
static |
domain propagation method of constraint handler
Definition at line 4567 of file cons_logicor.c.
References assert(), c, CONSHDLR_NAME, cutoff, FALSE, NULL, processWatchedVars(), result, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_REDUCEDDOM, SCIP_STAGE_INITSOLVE, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPdebugMsg, and SCIPgetStage().
|
static |
presolving method of constraint handler
Definition at line 4612 of file cons_logicor.c.
References applyFixings(), assert(), c, CONSHDLR_NAME, cutoff, detectRedundantConstraints(), dualPresolving(), FALSE, fixDeleteOrUpgradeCons(), mergeMultiples(), NULL, removeConstraintsDueToNegCliques(), removeRedundantConssAndNonzeros(), result, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_PRESOLTIMING_EXHAUSTIVE, SCIP_PRESOLTIMING_MEDIUM, SCIP_SUCCESS, SCIPallocBufferArray, SCIPallowStrongDualReds(), SCIPblkmem(), SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsModifiable(), SCIPdebugMsg, SCIPdelCons(), SCIPenableConsPropagation(), SCIPfreeBufferArray, SCIPgetNContVars(), SCIPgetNVars(), SCIPisPresolveFinished(), SCIPisStopped(), and shortenConss().
|
static |
propagation conflict resolving method of constraint handler
Definition at line 4824 of file cons_logicor.c.
References assert(), CONSHDLR_NAME, FALSE, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_SUCCESS, SCIPaddConflictBinvar(), SCIPconsGetData(), SCIPconshdlrGetName(), SCIPdebugMsg, SCIPgetVarLbAtIndex(), SCIPgetVarUbAtIndex(), and TRUE.
|
static |
variable rounding lock method of constraint handler
Definition at line 4877 of file cons_logicor.c.
References assert(), i, NULL, SCIP_CALL, SCIP_OKAY, SCIPaddVarLocksType(), and SCIPconsGetData().
|
static |
constraint activation notification method of constraint handler
Definition at line 4897 of file cons_logicor.c.
References addNlrow(), assert(), consdataPrint(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_EVENTTYPE_LBRELAXED, SCIP_EVENTTYPE_UBTIGHTENED, SCIP_OKAY, SCIP_STAGE_SOLVING, SCIPcatchVarEvent(), SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPconsIsTransformed(), SCIPdebug, SCIPdebugMsg, SCIPgetStage(), SCIPisNLPConstructed(), and TRUE.
|
static |
constraint deactivation notification method of constraint handler
Definition at line 4941 of file cons_logicor.c.
References assert(), consdataPrint(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_EVENTTYPE_LBRELAXED, SCIP_EVENTTYPE_UBTIGHTENED, SCIP_OKAY, SCIP_STAGE_SOLVING, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPconsIsTransformed(), SCIPdebug, SCIPdebugMsg, SCIPdelNlRow(), SCIPdropVarEvent(), SCIPgetStage(), and TRUE.
|
static |
constraint display method of constraint handler
Definition at line 4994 of file cons_logicor.c.
References assert(), consdataPrint(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, and SCIPconsGetData().
|
static |
constraint copying method of constraint handler
Definition at line 5007 of file cons_logicor.c.
References assert(), NULL, nvars, propagate, SCIP_CALL, SCIP_OKAY, SCIPconsGetName(), SCIPcopyConsLinear(), SCIPgetNVarsLogicor(), SCIPgetVarsLogicor(), SCIPinfinity(), and valid.
|
static |
constraint parsing method of constraint handler
Definition at line 5033 of file cons_logicor.c.
References assert(), FALSE, NULL, nvars, propagate, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPcreateConsLogicor(), SCIPdebugMsg, SCIPduplicateBufferArray, SCIPerrorMessage, SCIPfreeBufferArray, SCIPparseVarsList(), SCIPreallocBufferArray, TRUE, and vars.
|
static |
constraint method of constraint handler which returns the variables (if possible)
Definition at line 5128 of file cons_logicor.c.
References assert(), BMScopyMemoryArray, FALSE, NULL, nvars, SCIP_OKAY, SCIPconsGetData(), TRUE, and vars.
|
static |
constraint method of constraint handler which returns the number of variables (if possible)
Definition at line 5150 of file cons_logicor.c.
References assert(), NULL, SCIP_OKAY, SCIPconsGetData(), and TRUE.
|
static |
constraint handler method which returns the permutation symmetry detection graph of a constraint
Definition at line 5165 of file cons_logicor.c.
References addSymmetryInformation(), SCIP_CALL, SCIP_OKAY, and SYM_SYMTYPE_PERM.
|
static |
constraint handler method which returns the signed permutation symmetry detection graph of a constraint
Definition at line 5174 of file cons_logicor.c.
References addSymmetryInformation(), SCIP_CALL, SCIP_OKAY, and SYM_SYMTYPE_SIGNPERM.
|
static |
Definition at line 5186 of file cons_logicor.c.
References assert(), EVENTHDLR_NAME, FALSE, NULL, SCIP_CALL, SCIP_EVENTTYPE_LBRELAXED, SCIP_EVENTTYPE_UBTIGHTENED, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIP_STAGE_PRESOLVING, SCIP_VARSTATUS_FIXED, SCIP_VARSTATUS_MULTAGGR, SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsActive(), SCIPdebugMsg, SCIPenableCons(), SCIPenableConsPropagation(), SCIPeventGetType(), SCIPeventGetVar(), SCIPeventhdlrGetName(), SCIPgetDepth(), SCIPgetStage(), SCIPvarGetLbGlobal(), SCIPvarGetProbvar(), SCIPvarGetStatus(), SCIPvarGetUbGlobal(), TRUE, and var.
|
static |
conflict processing method of conflict handler (called when conflict was found)
Definition at line 5249 of file cons_logicor.c.
References assert(), CONFLICTHDLR_NAME, FALSE, i, NULL, result, SCIP_CALL, SCIP_CONSADDED, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_LONGINT_FORMAT, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPaddConflict(), SCIPallocBufferArray, SCIPbdchginfoGetNewbound(), SCIPbdchginfoGetVar(), SCIPconflicthdlrGetName(), SCIPcreateConsLogicor(), SCIPfreeBufferArray, SCIPgetNConflictConssApplied(), SCIPgetNegatedVar(), SCIPgetNRuns(), SCIPsnprintf(), SCIPvarIsBinary(), TRUE, and vars.