Scippy

SCIP

Solving Constraint Integer Programs

cons_orbitope_pp.h
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the program and library */
4/* SCIP --- Solving Constraint Integer Programs */
5/* */
6/* Copyright (c) 2002-2025 Zuse Institute Berlin (ZIB) */
7/* */
8/* Licensed under the Apache License, Version 2.0 (the "License"); */
9/* you may not use this file except in compliance with the License. */
10/* You may obtain a copy of the License at */
11/* */
12/* http://www.apache.org/licenses/LICENSE-2.0 */
13/* */
14/* Unless required by applicable law or agreed to in writing, software */
15/* distributed under the License is distributed on an "AS IS" BASIS, */
16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17/* See the License for the specific language governing permissions and */
18/* limitations under the License. */
19/* */
20/* You should have received a copy of the Apache-2.0 license */
21/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22/* */
23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25/**@file cons_orbitope_pp.h
26 * @ingroup CONSHDLRS
27 * @brief constraint handler for partitioning/packing orbitope constraints w.r.t. the full symmetric group
28 * @author Timo Berthold
29 * @author Marc Pfetsch
30 * @author Christopher Hojny
31 */
32
33/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34
35#ifndef __SCIP_CONS_ORBITOPE_PP_H__
36#define __SCIP_CONS_ORBITOPE_PP_H__
37
38#include "scip/def.h"
39#include "scip/type_cons.h"
40#include "scip/type_retcode.h"
41#include "scip/type_scip.h"
42#include "scip/type_var.h"
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
49/** creates the handler for orbitope constraints and includes it in SCIP
50 *
51 * @ingroup ConshdlrIncludes
52 */
53SCIP_EXPORT
55 SCIP* scip /**< SCIP data structure */
56 );
57
58/**@addtogroup CONSHDLRS
59 *
60 * @{
61 *
62 * @name Orbitope Constraints of Packing and Partitioning Type
63 *
64 * @{
65 *
66 * This constraint handler can be used to handle symmetries in certain 0/1-programs. The principle
67 * structure is that some variables can be ordered in matrix form, such that permuting columns does
68 * not change the validity and objective function value of a solution. That is, the symmetry group
69 * of the program contains the full symmetric group obtained by permuting the columns of this
70 * matrix. These symmetries can be handled by so-called full orbitopes.
71 *
72 * Moreover, if the variables in each row are contained in set packing or partitioning
73 * constraint, these symmetries can be handled by specialized packing or partitioning orbitopes.
74 *
75 * In more mathematical terms the structure has to be as follows: There are 0/1-variables
76 * \f$x_{ij}\f$, \f$i \in \{1, \dots, p\}\f$, \f$j \in \{1, \dots, q\}\f$. The variables may be coupled
77 * through set packing or partitioning constraints:
78 * \f[
79 * \sum_{j = 1}^q x_{ij} \leq 1 \quad \mbox{or} \quad \sum_{j = 1}^q x_{ij} = 1 \quad \mbox{for all }i = 1, \ldots, p.
80 * \f]
81 * Permuting columns of \f$x\f$ does not change the validity and objective function value of any feasible solution.
82 *
83 * We distinguish whether an orbitope is a model constraint or not. If it is a model constraint, then
84 * its information are copied to subSCIPs. Otherwise, the constraint was added just for the purpose of
85 * symmetry handling and we do not copy its information to subSCIPs.
86 */
87
88/** creates and captures a packing/partitioning orbitope constraint
89 *
90 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
91 */
92SCIP_EXPORT
94 SCIP* scip, /**< SCIP data structure */
95 SCIP_CONS** cons, /**< pointer to hold the created constraint */
96 const char* name, /**< name of constraint */
97 SCIP_VAR*** vars, /**< matrix of variables on which the symmetry acts */
98 SCIP_ORBITOPETYPE orbitopetype, /**< type of orbitope constraint */
99 int nrows, /**< number of rows in orbitope matrix <=> p */
100 int ncols, /**< number of columns in orbitope matrix <=> q */
101 SCIP_Bool resolveprop, /**< should propagation be resolved? */
102 SCIP_Bool ismodelcons, /**< whether the orbitope is a model constraint */
103 SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
104 * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
105 SCIP_Bool separate, /**< should the constraint be separated during LP processing?
106 * Usually set to TRUE. */
107 SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
108 * TRUE for model constraints, FALSE for additional, redundant constraints. */
109 SCIP_Bool check, /**< should the constraint be checked for feasibility?
110 * TRUE for model constraints, FALSE for additional, redundant constraints. */
111 SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
112 * Usually set to TRUE. */
113 SCIP_Bool local, /**< is constraint only valid locally?
114 * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
115 SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
116 * Usually set to FALSE. In column generation applications, set to TRUE if pricing
117 * adds coefficients to this constraint. */
118 SCIP_Bool dynamic, /**< is constraint subject to aging?
119 * Usually set to FALSE. Set to TRUE for own cuts which
120 * are separated as constraints. */
121 SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
122 * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
123 SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
124 * if it may be moved to a more global node?
125 * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
126 );
127
128/** creates and captures a packing/partitioning orbitope constraint in its most basic variant, i. e., with all
129 * constraint flags set to their default values, which can be set afterwards using SCIPsetConsFLAGNAME()
130 *
131 * @see SCIPcreateConsOrbitopePP() for the default constraint flag configuration
132 *
133 * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
134 */
135SCIP_EXPORT
137 SCIP* scip, /**< SCIP data structure */
138 SCIP_CONS** cons, /**< pointer to hold the created constraint */
139 const char* name, /**< name of constraint */
140 SCIP_VAR*** vars, /**< matrix of variables on which the symmetry acts */
141 SCIP_ORBITOPETYPE orbitopetype, /**< type of orbitope constraint */
142 int nrows, /**< number of rows in orbitope matrix <=> p */
143 int ncols, /**< number of columns in orbitope matrix <=> q */
144 SCIP_Bool resolveprop, /**< should propagation be resolved? */
145 SCIP_Bool ismodelcons /**< whether the orbitope is a model constraint */
146 );
147
148/** @} */
149
150/** @} */
151
152#ifdef __cplusplus
153}
154#endif
155
156#endif
common defines and data types used in all packages of SCIP
#define SCIP_Bool
Definition: def.h:91
SCIP_RETCODE SCIPcreateConsOrbitopePP(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR ***vars, SCIP_ORBITOPETYPE orbitopetype, int nrows, int ncols, SCIP_Bool resolveprop, SCIP_Bool ismodelcons, 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 SCIPcreateConsBasicOrbitopePP(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR ***vars, SCIP_ORBITOPETYPE orbitopetype, int nrows, int ncols, SCIP_Bool resolveprop, SCIP_Bool ismodelcons)
SCIP_RETCODE SCIPincludeConshdlrOrbitopePP(SCIP *scip)
static SCIP_RETCODE separate(SCIP *scip, SCIP_SEPA *sepa, SCIP_SOL *sol, SCIP_RESULT *result)
Main separation function.
Definition: sepa_flower.c:1221
type definitions for constraints and constraint handlers
type definitions for return codes for SCIP methods
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for SCIP's main datastructure
type definitions for symmetry computations
enum SCIP_OrbitopeType SCIP_ORBITOPETYPE
type definitions for problem variables