constraint handler for disjunction constraints
Definition in file cons_disjunction.c.
#include "blockmemshell/memory.h"#include "scip/cons_disjunction.h"#include "scip/pub_cons.h"#include "scip/pub_message.h"#include "scip/pub_tree.h"#include "scip/scip_branch.h"#include "scip/scip_cons.h"#include "scip/scip_copy.h"#include "scip/scip_general.h"#include "scip/scip_mem.h"#include "scip/scip_message.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/symmetry_graph.h"#include <string.h>Go to the source code of this file.
Macros | |
| #define | CONSHDLR_NAME "disjunction" |
| #define | CONSHDLR_DESC "disjunction of constraints (or(cons1, cons2, ..., consn))" |
| #define | CONSHDLR_ENFOPRIORITY -950000 |
| #define | CONSHDLR_CHECKPRIORITY -900000 |
| #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 | DEFAULT_ALWAYSBRANCH TRUE |
| #define CONSHDLR_NAME "disjunction" |
Definition at line 56 of file cons_disjunction.c.
| #define CONSHDLR_DESC "disjunction of constraints (or(cons1, cons2, ..., consn))" |
Definition at line 57 of file cons_disjunction.c.
| #define CONSHDLR_ENFOPRIORITY -950000 |
priority of the constraint handler for constraint enforcing
Definition at line 58 of file cons_disjunction.c.
| #define CONSHDLR_CHECKPRIORITY -900000 |
priority of the constraint handler for checking feasibility
Definition at line 59 of file cons_disjunction.c.
| #define CONSHDLR_PROPFREQ -1 |
frequency for propagating domains; zero means only preprocessing propagation
Definition at line 60 of file cons_disjunction.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 61 of file cons_disjunction.c.
| #define CONSHDLR_MAXPREROUNDS -1 |
maximal number of presolving rounds the constraint handler participates in (-1: no limit)
Definition at line 63 of file cons_disjunction.c.
| #define CONSHDLR_DELAYPROP FALSE |
should propagation method be delayed, if other propagators found reductions?
Definition at line 65 of file cons_disjunction.c.
| #define CONSHDLR_NEEDSCONS TRUE |
should the constraint handler be skipped, if no constraints are available?
Definition at line 66 of file cons_disjunction.c.
| #define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_FAST |
Definition at line 68 of file cons_disjunction.c.
| #define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP |
Definition at line 69 of file cons_disjunction.c.
| #define DEFAULT_ALWAYSBRANCH TRUE |
alawys perform branching if one of the constraints is violated, otherwise only if all integers are fixed
Definition at line 72 of file cons_disjunction.c.
Referenced by SCIPincludeConshdlrDisjunction().
|
static |
creates disjunction constraint data, captures initial constraints of disjunction
| scip | SCIP data structure |
| consdata | pointer to constraint data |
| conss | initial constraint in disjunction |
| nconss | number of initial constraints in disjunction |
| relaxcons | a conjunction constraint containing the liner relaxation of the disjunction constraint, or NULL |
Definition at line 101 of file cons_disjunction.c.
References assert(), c, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPcaptureCons(), SCIPduplicateBlockMemoryArray, SCIPisTransformed(), SCIPtransformCons(), and SCIPtransformConss().
Referenced by SCIP_DECL_CONSTRANS(), and SCIPcreateConsDisjunction().
|
static |
frees constraint data and releases all constraints in disjunction
| scip | SCIP data structure |
| consdata | pointer to constraint data |
Definition at line 164 of file cons_disjunction.c.
References assert(), c, NULL, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArrayNull, and SCIPreleaseCons().
Referenced by SCIP_DECL_CONSDELETE().
|
static |
adds constraint to disjunction
| scip | SCIP data structure |
| consdata | constraint data |
| cons | constraint to add to the disjunction |
Definition at line 196 of file cons_disjunction.c.
References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPcaptureCons(), SCIPensureBlockMemoryArray, SCIPisTransformed(), and SCIPtransformCons().
Referenced by SCIPaddConsElemDisjunction().
|
static |
branches on disjunctive constraint
| scip | SCIP data structure |
| cons | active disjunction constraint |
| result | pointer to store the result |
Definition at line 230 of file cons_disjunction.c.
References assert(), i, NULL, result, SCIP_BRANCHED, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPaddConsNode(), SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsModifiable(), SCIPcreateChild(), SCIPdebugMsg, SCIPdelConsNode(), SCIPgetCurrentNode(), SCIPgetLocalTransEstimate(), SCIPnodeGetNumber(), SCIPresetConsAge(), SCIPsetConsChecked(), SCIPsetConsLocal(), and TRUE.
Referenced by enforceConssSOS1(), enforceConstraint(), enforceIndicators(), and enforceSOS2().
|
static |
checks disjunction constraints if at least one is feasible
| scip | SCIP data structure |
| cons | active disjunction constraint |
| sol | solution to check |
| checkintegrality | Has integrality to be checked? |
| checklprows | Do constraints represented by rows in the current LP have to be checked? |
| printreason | Should the reason for the violation be printed? |
| result | pointer to store the result |
Definition at line 298 of file cons_disjunction.c.
References assert(), FALSE, i, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, SCIPactivateSolViolationUpdates(), SCIPcheckCons(), SCIPconsGetData(), SCIPconsGetName(), SCIPdeactivateSolViolationUpdates(), SCIPdebug, SCIPinfoMessage(), SCIPprintCons(), SCIPupdateSolConsViolation(), and sol.
Referenced by enforceConstraint(), and SCIP_DECL_CONSCHECK().
|
static |
propagation method for disjunction constraint
| scip | SCIP data structure |
| cons | disjunctive constraint |
| ndelconss | pointer to count number of deleted constraints |
Definition at line 354 of file cons_disjunction.c.
References assert(), c, NULL, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_PRESOLVING, SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsDeleted(), SCIPdelCons(), SCIPdelConsLocal(), SCIPgetNNodes(), SCIPgetStage(), SCIPsetConsChecked(), and TRUE.
Referenced by SCIP_DECL_CONSPRESOL(), and SCIP_DECL_CONSPROP().
|
static |
helper function to enforce constraints
| scip | SCIP data structure |
| conshdlr | constraint handler |
| conss | constraints to process |
| nconss | number of constraints |
| sol | solution to enforce (NULL for LP solution) |
| result | pointer to store the result of the enforcing call |
Definition at line 417 of file cons_disjunction.c.
References assert(), branch(), branchCons(), c, checkCons(), FALSE, NULL, result, SCIP_Bool, SCIP_BRANCHED, SCIP_CALL, SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, SCIPconshdlrGetData(), SCIPgetNPseudoBranchCands(), and sol.
Referenced by SCIP_DECL_CONSENFOLP(), SCIP_DECL_CONSENFOPS(), 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 453 of file cons_disjunction.c.
References assert(), c, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPaddSymgraphConsnode(), SCIPaddSymgraphEdge(), SCIPclearSymgraph(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrSupportsPermsymDetection(), SCIPconshdlrSupportsSignedPermsymDetection(), SCIPcopySymgraphAsSubgraph(), SCIPcreateSymgraph(), SCIPfreeSymgraph(), SCIPgetConsPermsymGraph(), SCIPgetConsSignedPermsymGraph(), SCIPgetNVars(), SCIPgetVars(), SYM_SYMTYPE_PERM, SYM_SYMTYPE_SIGNPERM, and TRUE.
Referenced by SCIP_DECL_CONSGETPERMSYMGRAPH(), and SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH().
|
static |
copy method for constraint handler plugins (called when SCIP copies plugins)
Definition at line 547 of file cons_disjunction.c.
References assert(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetName(), SCIPincludeConshdlrDisjunction(), TRUE, and valid.
|
static |
destructor of constraint handler to free constraint handler data (called when SCIP is exiting)
Definition at line 563 of file cons_disjunction.c.
References assert(), CONSHDLR_NAME, NULL, SCIP_OKAY, SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPconshdlrSetData(), and SCIPfreeBlockMemory.
|
static |
frees specific constraint data
Definition at line 584 of file cons_disjunction.c.
References consdataFree(), SCIP_CALL, and SCIP_OKAY.
|
static |
transforms constraint data into data belonging to the transformed problem
Definition at line 594 of file cons_disjunction.c.
References assert(), consdataCreate(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), and SCIPcreateCons().
|
static |
LP initialization method of constraint handler
Definition at line 617 of file cons_disjunction.c.
References assert(), c, FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPaddConsLocal(), SCIPconsGetData(), and SCIPconsIsActive().
|
static |
constraint enforcing method of constraint handler for LP solutions
Definition at line 642 of file cons_disjunction.c.
References enforceConstraint(), NULL, result, SCIP_CALL, and SCIP_OKAY.
|
static |
constraint enforcing method of constraint handler for relaxation solutions
Definition at line 652 of file cons_disjunction.c.
References enforceConstraint(), result, SCIP_CALL, SCIP_OKAY, and sol.
|
static |
constraint enforcing method of constraint handler for pseudo solutions
Definition at line 662 of file cons_disjunction.c.
References enforceConstraint(), NULL, result, SCIP_CALL, and SCIP_OKAY.
|
static |
feasibility check method of constraint handler for integral solutions
Definition at line 672 of file cons_disjunction.c.
References assert(), c, checkCons(), result, SCIP_CALL, SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, and sol.
|
static |
domain propagation method of constraint handler
Definition at line 696 of file cons_disjunction.c.
References c, propagateCons(), result, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_REDUCEDDOM, and SCIPinProbing().
|
static |
presolving method of constraint handler
Definition at line 725 of file cons_disjunction.c.
References assert(), c, NULL, propagateCons(), result, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_SUCCESS, SCIPaddCons(), SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsModifiable(), SCIPdelCons(), SCIPsetConsChecked(), and TRUE.
|
static |
variable rounding lock method of constraint handler
Definition at line 779 of file cons_disjunction.c.
References assert(), c, NULL, SCIP_CALL, SCIP_LOCKTYPE_MODEL, SCIP_OKAY, SCIPaddConsLocksType(), and SCIPconsGetData().
|
static |
constraint display method of constraint handler
Definition at line 801 of file cons_disjunction.c.
References assert(), i, NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPinfoMessage(), and SCIPprintCons().
|
static |
constraint parsing method of constraint handler
Definition at line 836 of file cons_disjunction.c.
References assert(), FALSE, NULL, propagate, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPcalcMemGrowSize(), SCIPcreateConsDisjunction(), SCIPdebugMsg, SCIPduplicateBufferArray, SCIPfreeBufferArray, SCIPparseCons(), SCIPreallocBufferArray, SCIPreleaseCons(), separate(), and TRUE.
|
static |
constraint copying method of constraint handler
Definition at line 1045 of file cons_disjunction.c.
References assert(), c, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsDisjunction(), SCIPfreeBufferArray, SCIPgetConsCopy(), SCIPreleaseCons(), TRUE, and valid.
|
static |
constraint handler method which returns the permutation symmetry detection graph of a constraint
Definition at line 1131 of file cons_disjunction.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 1141 of file cons_disjunction.c.
References addSymmetryInformation(), SCIP_CALL, SCIP_OKAY, and SYM_SYMTYPE_SIGNPERM.