constraint handler for partitioning/packing orbitope constraints w.r.t. the full symmetric group
The type of constraints of this constraint handler is described in cons_orbitope_pp.h. When creating the constraint, users can decide whether it is a constraint defining the model or "just" use to handle symmetries. In the latter case, symmetry reductions are only performed by the constraint handler if strong dual reductions are permitted.
The details of the method implemented here are described in the following papers.
Packing and Partitioning Orbitopes
Volker Kaibel and Marc E. Pfetsch,
Math. Program. 114, No. 1, 1-36 (2008)
Among other things, this paper describes so-called shifted column inequalities of the following form \(x(S) \leq x(B)\), where \(S\) is a so-called shifted column and \(B\) is a so-called bar. These inequalities can be used to handle symmetry and they are separated in this constraint handler. We use the linear time separation algorithm of the paper.
Orbitopal Fixing
Volker Kaibel, Matthias Peinhardt, and Marc E. Pfetsch,
Discrete Optimization 8, No. 4, 595-610 (2011) (A preliminary version appears in Proc. IPCO 2007.)
In this paper a linear time propagation algorithm is described, a variant of which is implemented here. The implemented variant does not run in linear time, but is very fast in practice.
| here | paper |
| nrows | p |
| ncols | q |
| vars | x |
| vals | A^\star |
| weights | \omega |
| cases | \tau |
| fixtriangle | – |
| resolveprop | – |
| firstnonzeros | \mu |
| lastones | \alpha |
| frontiersteps | \Gamma |
Definition in file cons_orbitope_pp.c.
#include "blockmemshell/memory.h"#include "scip/cons_orbitope_pp.h"#include "scip/cons_setppc.h"#include "scip/pub_cons.h"#include "scip/pub_message.h"#include "scip/pub_var.h"#include "scip/scip.h"#include "scip/scip_branch.h"#include "scip/scip_conflict.h"#include "scip/scip_cons.h"#include "scip/scip_copy.h"#include "scip/scip_cut.h"#include "scip/scip_general.h"#include "scip/scip_lp.h"#include "scip/scip_mem.h"#include "scip/scip_message.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_var.h"#include "scip/symmetry.h"#include <symmetry/type_symmetry.h>Go to the source code of this file.
Macros | |
| #define | CONSHDLR_NAME "orbitope_pp" |
| #define | CONSHDLR_DESC "symmetry breaking constraint handler relying on partitioning/packing orbitopes" |
| #define | CONSHDLR_SEPAPRIORITY +40100 |
| #define | CONSHDLR_ENFOPRIORITY -1005200 |
| #define | CONSHDLR_CHECKPRIORITY -1005200 |
| #define | CONSHDLR_SEPAFREQ -1 |
| #define | CONSHDLR_PROPFREQ 1 |
| #define | CONSHDLR_EAGERFREQ -1 |
| #define | CONSHDLR_MAXPREROUNDS -1 |
| #define | CONSHDLR_DELAYSEPA FALSE |
| #define | CONSHDLR_DELAYPROP FALSE |
| #define | CONSHDLR_NEEDSCONS TRUE |
| #define | CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP |
| #define | CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_MEDIUM |
| #define | DEFAULT_FORCECONSCOPY FALSE |
| #define CONSHDLR_NAME "orbitope_pp" |
Definition at line 103 of file cons_orbitope_pp.c.
| #define CONSHDLR_DESC "symmetry breaking constraint handler relying on partitioning/packing orbitopes" |
Definition at line 104 of file cons_orbitope_pp.c.
| #define CONSHDLR_SEPAPRIORITY +40100 |
priority of the constraint handler for separation
Definition at line 105 of file cons_orbitope_pp.c.
| #define CONSHDLR_ENFOPRIORITY -1005200 |
priority of the constraint handler for constraint enforcing
Definition at line 106 of file cons_orbitope_pp.c.
| #define CONSHDLR_CHECKPRIORITY -1005200 |
priority of the constraint handler for checking feasibility
Definition at line 107 of file cons_orbitope_pp.c.
| #define CONSHDLR_SEPAFREQ -1 |
frequency for separating cuts; zero means to separate only in the root node
Definition at line 108 of file cons_orbitope_pp.c.
| #define CONSHDLR_PROPFREQ 1 |
frequency for propagating domains; zero means only preprocessing propagation
Definition at line 109 of file cons_orbitope_pp.c.
| #define CONSHDLR_EAGERFREQ -1 |
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 110 of file cons_orbitope_pp.c.
| #define CONSHDLR_MAXPREROUNDS -1 |
maximal number of presolving rounds the constraint handler participates in (-1: no limit)
Definition at line 112 of file cons_orbitope_pp.c.
| #define CONSHDLR_DELAYSEPA FALSE |
should separation method be delayed, if other separators found cuts?
Definition at line 113 of file cons_orbitope_pp.c.
| #define CONSHDLR_DELAYPROP FALSE |
should propagation method be delayed, if other propagators found reductions?
Definition at line 114 of file cons_orbitope_pp.c.
| #define CONSHDLR_NEEDSCONS TRUE |
should the constraint handler be skipped, if no constraints are available?
Definition at line 115 of file cons_orbitope_pp.c.
| #define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP |
propagation timing mask of the constraint handler
Definition at line 117 of file cons_orbitope_pp.c.
| #define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_MEDIUM |
presolving timing of the constraint handler (fast, medium, or exhaustive)
Definition at line 118 of file cons_orbitope_pp.c.
| #define DEFAULT_FORCECONSCOPY FALSE |
whether orbitope constraints should be forced to be copied to sub SCIPs
Definition at line 120 of file cons_orbitope_pp.c.
|
static |
frees an orbitope constraint data
| scip | SCIP data structure |
| consdata | pointer to orbitope constraint data |
Definition at line 156 of file cons_orbitope_pp.c.
References assert(), i, NULL, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArrayNull, and SCIPreleaseVar().
Referenced by SCIP_DECL_CONSDELETE().
|
static |
creates orbitope constraint data
| scip | SCIP data structure |
| consdata | pointer to store constraint data |
| vars | variables array, must have size nspcons x nblocks |
| nrows | number of rows in orbitope matrix <=> p |
| ncols | number of columns in orbitope matrix <=> q |
| orbitopetype | type of orbitope constraint |
| resolveprop | should propagation be resolved? |
| ismodelcons | whether the orbitope is a model constraint |
Definition at line 202 of file cons_orbitope_pp.c.
References assert(), FALSE, i, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPallocBlockMemoryArray, SCIPcaptureVar(), SCIPduplicateBlockMemoryArray, SCIPgetTransformedVar(), SCIPisTransformed(), SCIPmarkDoNotMultaggrVar(), and vars.
Referenced by SCIP_DECL_CONSTRANS(), and SCIPcreateConsOrbitopePP().
|
static |
copies the variables values from the solution to the constraint data structure
| scip | the SCIP data structure |
| consdata | the constraint data |
| sol | a primal solution or NULL for the current LP optimum |
Definition at line 419 of file cons_orbitope_pp.c.
References assert(), i, NULL, SCIPgetSolVal(), and sol.
Referenced by checkPackingPartitioningOrbitopeSolution(), enfopsPackingPartitioningOrbitopeSolution(), and separateConstraints().
|
static |
compute the dynamic programming table for SC
Build up dynamic programming table in order to find SCs with minimum weight.
The values of the minimal SCIs are stored in weights. The array cases[i][j] stores which of the cases were applied to get weights[i][j]. Here, 3 means that we have reached the upper limit.
We assume that the upper right triangle is fixed to 0. Hence we can perform the computation a bit more efficient.
| scip | SCIP pointer |
| nrows | number of rows in orbitope matrix <=> p |
| ncols | number of columns in orbitope matrix <=> q |
| weights | SC weight table |
| cases | indicator of the SC cases |
| vals | current solution |
Definition at line 455 of file cons_orbitope_pp.c.
References assert(), i, NULL, SCIP_Real, and SCIPisLT().
Referenced by checkPackingPartitioningOrbitopeSolution(), enfopsPackingPartitioningOrbitopeSolution(), resolvePropagation(), and separateSCIs().
|
static |
fix upper right triangle if necessary
| scip | SCIP data structure |
| cons | constraint to be processed |
| infeasible | pointer to store TRUE, if the node can be cut off |
| nfixedvars | pointer to add up the number of found domain reductions |
Definition at line 550 of file cons_orbitope_pp.c.
References assert(), FALSE, i, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPfixVar(), SCIPvarGetUbGlobal(), TRUE, and vars.
Referenced by enfopsPackingPartitioningOrbitopeSolution(), propagateCons(), and separateSCIs().
|
static |
separates shifted column inequalities according to the solution stored in consdata->vals
| scip | the SCIP data structure |
| conshdlr | constraint handler |
| cons | constraint |
| consdata | the constraint data |
| infeasible | whether we detected infeasibility |
| nfixedvars | pointer to store the number of variables fixed |
| ncuts | pointer to store number of separated SCIs |
Definition at line 634 of file cons_orbitope_pp.c.
References assert(), computeSCTable(), FALSE, fixTriangle(), i, NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIPaddRow(), SCIPaddVarsToRow(), SCIPcreateEmptyRowConshdlr(), SCIPinfinity(), SCIPisEfficacious(), SCIPisSumEQ(), SCIPreleaseRow(), SCIPsnprintf(), TRUE, and vars.
Referenced by separateConstraints().
|
static |
propagation method for a single orbitope constraint
| scip | SCIP data structure |
| cons | constraint to be processed |
| infeasible | pointer to store TRUE, if the node can be cut off |
| nfixedvars | pointer to add up the number of found domain reductions |
Definition at line 797 of file cons_orbitope_pp.c.
References assert(), FALSE, fixTriangle(), i, NULL, SCIP_Bool, SCIP_CALL, SCIP_CONFTYPE_PROPAGATION, SCIP_OKAY, SCIP_ORBITOPETYPE_PACKING, SCIP_ORBITOPETYPE_PARTITIONING, SCIP_STAGE_SOLVING, SCIPaddConflictBinvar(), SCIPallocBufferArray, SCIPallowStrongDualReds(), SCIPanalyzeConflictCons(), SCIPconsGetData(), SCIPdebugMsg, SCIPfreeBufferArray, SCIPgetStage(), SCIPinferBinvarCons(), SCIPinitConflictAnalysis(), SCIPinProbing(), SCIPisConflictAnalysisApplicable(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), TRUE, and vars.
Referenced by SCIP_DECL_CONSPRESOL(), and SCIP_DECL_CONSPROP().
|
static |
Propagation conflict resolving method of propagator
In this function we use that the propagation method above implicitly propagates SCIs, i.e., every fixing can also be gotten via an SCI-fixing.
Since the storage of an integer is not enough to store the complete information about the fixing nor a complete shifted column, we have to use the linear time algorithm for SCIs.
The inferinfo integer is set as follows:
| scip | SCIP data structure |
| cons | constraint that inferred the bound change |
| inferinfo | inference information |
| bdchgidx | bound change index (time stamp of bound change), or NULL for current time |
| result | pointer to store the result of the propagation conflict resolving call |
Definition at line 1173 of file cons_orbitope_pp.c.
References assert(), computeSCTable(), FALSE, i, MIN, NULL, result, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_ORBITOPETYPE_PARTITIONING, SCIP_Real, SCIP_SUCCESS, SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPconsGetData(), SCIPdebugMsg, SCIPgetVarLbAtIndex(), SCIPgetVarUbAtIndex(), SCIPsnprintf(), and vars.
Referenced by SCIP_DECL_CONSRESPROP().
|
static |
check packing/partitioning orbitope solution for feasibility
| scip | SCIP data structure |
| cons | pointer to orbitope constraint |
| result | pointer to store the result of the enforcing call |
Definition at line 1448 of file cons_orbitope_pp.c.
References assert(), computeSCTable(), copyValues(), FALSE, fixTriangle(), i, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_INFEASIBLE, SCIP_OKAY, SCIP_Real, SCIP_REDUCEDDOM, SCIPallowStrongDualReds(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPisGT(), and SCIPisIntegral().
Referenced by SCIP_DECL_CONSENFOPS().
|
static |
check packing/partitioning orbitope solution for feasibility
| scip | SCIP data structure |
| cons | pointer to orbitope constraint |
| sol | solution to be checked |
| result | pointer to store the result of the enforcing call |
| printreason | whether reason for infeasibility should be printed |
Definition at line 1545 of file cons_orbitope_pp.c.
References assert(), computeSCTable(), copyValues(), i, NULL, result, SCIP_Bool, SCIP_INFEASIBLE, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMsg, SCIPinfoMessage(), SCIPisFeasIntegral(), SCIPisFeasZero(), SCIPisGT(), SCIPvarGetName(), sol, and vars.
Referenced by SCIP_DECL_CONSCHECK().
|
static |
separate or 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 separate (NULL for the LP solution) |
| result | pointer to store the result (should be initialized) |
| enforce | whether we enforce orbitope constraints |
Definition at line 1694 of file cons_orbitope_pp.c.
References assert(), c, CONSHDLR_NAME, copyValues(), FALSE, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_OKAY, SCIP_REDUCEDDOM, SCIP_SEPARATED, SCIPallowStrongDualReds(), SCIPconsGetData(), SCIPconshdlrGetName(), SCIPdebugMsg, separateSCIs(), and sol.
Referenced by SCIP_DECL_CONSENFOLP(), SCIP_DECL_CONSENFORELAX(), SCIP_DECL_CONSSEPALP(), and SCIP_DECL_CONSSEPASOL().
|
static |
check whether all variables in an orbitope constraint are fixed
| scip | SCIP data structure |
| cons | constraint to be processed |
| redundant | pointer to store whether constraint is redundant (contains no active vars) |
Definition at line 1775 of file cons_orbitope_pp.c.
References assert(), FALSE, i, NULL, SCIP_Bool, SCIP_OKAY, SCIPconsGetData(), SCIPvarIsActive(), TRUE, and vars.
Referenced by SCIP_DECL_CONSPRESOL().
|
static |
replace aggregated variables by active variables
| scip | SCIP data structure |
| cons | constraint to be processed |
Definition at line 1820 of file cons_orbitope_pp.c.
References assert(), i, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_UNUSED, SCIP_VARSTATUS_FIXED, SCIP_VARSTATUS_MULTAGGR, SCIP_VARSTATUS_NEGATED, SCIPcaptureVar(), SCIPconsGetData(), SCIPgetBinvarRepresentative(), SCIPreleaseVar(), SCIPvarGetStatus(), SCIPvarIsActive(), var, and vars.
Referenced by SCIP_DECL_CONSEXITPRE().
|
static |
copy method for constraint handler plugins (called when SCIP copies plugins)
Definition at line 1877 of file cons_orbitope_pp.c.
References assert(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetName(), SCIPincludeConshdlrOrbitopePP(), TRUE, and valid.
|
static |
frees constraint handler
Definition at line 1894 of file cons_orbitope_pp.c.
References assert(), CONSHDLR_NAME, NULL, SCIP_OKAY, SCIPconshdlrGetData(), SCIPconshdlrGetName(), and SCIPfreeBlockMemory.
|
static |
frees specific constraint data
Definition at line 1912 of file cons_orbitope_pp.c.
References assert(), consdataFree(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetName().
|
static |
transforms constraint data into data belonging to the transformed problem
Definition at line 1924 of file cons_orbitope_pp.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 |
separation method of constraint handler for LP solutions
Definition at line 1954 of file cons_orbitope_pp.c.
References assert(), FALSE, NULL, result, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_OKAY, SCIPconshdlrGetName(), SCIPdebugMsg, SCIPgetNLPBranchCands(), and separateConstraints().
|
static |
separation method of constraint handler for arbitrary primal solutions
Definition at line 1978 of file cons_orbitope_pp.c.
References assert(), FALSE, NULL, result, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_OKAY, SCIPconshdlrGetName(), SCIPdebugMsg, separateConstraints(), and sol.
|
static |
constraint enforcing method of constraint handler for LP solutions
Definition at line 1997 of file cons_orbitope_pp.c.
References assert(), NULL, result, SCIP_CALL, SCIP_FEASIBLE, SCIP_OKAY, SCIPconshdlrGetName(), SCIPdebugMsg, SCIPgetNLPBranchCands(), separateConstraints(), and TRUE.
|
static |
constraint enforcing method of constraint handler for relaxation solutions
Definition at line 2019 of file cons_orbitope_pp.c.
References assert(), NULL, result, SCIP_CALL, SCIP_FEASIBLE, SCIP_OKAY, SCIPconshdlrGetName(), SCIPdebugMsg, separateConstraints(), sol, and TRUE.
|
static |
constraint enforcing method of constraint handler for pseudo solutions
Definition at line 2039 of file cons_orbitope_pp.c.
References assert(), c, CONSHDLR_NAME, enfopsPackingPartitioningOrbitopeSolution(), NULL, result, SCIP_CALL, SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, SCIPconsGetData(), and SCIPconshdlrGetName().
|
static |
feasibility check method of constraint handler for integral solutions
Definition at line 2081 of file cons_orbitope_pp.c.
References assert(), c, checkPackingPartitioningOrbitopeSolution(), CONSHDLR_NAME, NULL, result, SCIP_CALL, SCIP_FEASIBLE, SCIP_OKAY, SCIPconsGetData(), SCIPconshdlrGetName(), SCIPdebugMsg, and sol.
|
static |
domain propagation method of constraint handler
Definition at line 2123 of file cons_orbitope_pp.c.
References assert(), c, CONSHDLR_NAME, FALSE, NULL, propagateCons(), result, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_REDUCEDDOM, SCIPconsGetName(), SCIPconshdlrGetName(), and SCIPdebugMsg.
|
static |
presolving method of constraint handler
Definition at line 2173 of file cons_orbitope_pp.c.
References assert(), c, checkRedundantCons(), CONSHDLR_NAME, FALSE, NULL, propagateCons(), result, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_SUCCESS, SCIPconsGetName(), SCIPconshdlrGetName(), SCIPconsIsActive(), SCIPdebugMsg, and SCIPdelCons().
|
static |
propagation conflict resolving method of constraint handler
Definition at line 2243 of file cons_orbitope_pp.c.
References assert(), NULL, resolvePropagation(), result, SCIP_CALL, and SCIP_OKAY.
|
static |
presolving deinitialization method of constraint handler (called after presolving has been finished)
Definition at line 2259 of file cons_orbitope_pp.c.
References assert(), c, CONSHDLR_NAME, NULL, replaceAggregatedVarsOrbitopePP(), SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetName().
|
static |
variable rounding lock method of constraint handler
Definition at line 2278 of file cons_orbitope_pp.c.
References assert(), CONSHDLR_NAME, i, NULL, SCIP_CALL, SCIP_LOCKTYPE_MODEL, SCIP_OKAY, SCIPaddVarLocksType(), SCIPconsGetData(), SCIPconshdlrGetName(), SCIPdebugMsg, and vars.
|
static |
constraint display method of constraint handler
Definition at line 2318 of file cons_orbitope_pp.c.
References assert(), CONSHDLR_NAME, i, NULL, SCIP_CALL, SCIP_OKAY, SCIP_ORBITOPETYPE_PACKING, SCIP_ORBITOPETYPE_PARTITIONING, SCIPABORT, SCIPconsGetData(), SCIPconshdlrGetName(), SCIPdebugMsg, SCIPinfoMessage(), SCIPwriteVarName(), TRUE, and vars.
|
static |
constraint copying method of constraint handler
Definition at line 2377 of file cons_orbitope_pp.c.
References assert(), CONSHDLR_NAME, FALSE, i, NULL, propagate, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPcreateConsOrbitopePP(), SCIPdebugMsg, SCIPfreeBufferArray, SCIPgetVarCopy(), separate(), TRUE, valid, and vars.
|
static |
constraint parsing method of constraint handler
Definition at line 2460 of file cons_orbitope_pp.c.
References assert(), FALSE, NULL, propagate, SCIP_CALL, SCIP_OKAY, SCIP_ORBITOPETYPE_PACKING, SCIP_ORBITOPETYPE_PARTITIONING, SCIPallocBufferArray, SCIPcalcMemGrowSize(), SCIPcreateConsOrbitopePP(), SCIPerrorMessage, SCIPfreeBufferArray, SCIPparseVarName(), SCIPreallocBufferArray, SCIPskipSpace(), separate(), TRUE, var, and vars.
|
static |
constraint method of constraint handler which returns the variables (if possible)
Definition at line 2594 of file cons_orbitope_pp.c.
References assert(), FALSE, i, NULL, SCIP_OKAY, SCIPconsGetData(), TRUE, and vars.
|
static |
constraint method of constraint handler which returns the number of variables (if possible)
Definition at line 2627 of file cons_orbitope_pp.c.
References assert(), NULL, nvars, SCIP_OKAY, SCIPconsGetData(), and TRUE.