Scippy

SCIP

Solving Constraint Integer Programs

type_symmetry.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-2024 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 type_symmetry.h
26  * @brief type definitions for symmetry computations
27  * @author Marc Pfetsch
28  * @author Christopher Hojny
29  */
30 
31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32 
33 #ifndef __SCIP_TYPE_SYMMETRY_H_
34 #define __SCIP_TYPE_SYMMETRY_H_
35 
36 #include "scip/scip.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /** symmetry type specification */
43 #define SYM_SPEC_INTEGER UINT32_C(0x00000001) /**< need symmetries for integer variables only */
44 #define SYM_SPEC_BINARY UINT32_C(0x00000002) /**< need symmetries for binary variables only */
45 #define SYM_SPEC_REAL UINT32_C(0x00000004) /**< need symmetries also for continuous variables */
46 
47 typedef uint32_t SYM_SPEC; /**< types of variables handled by symmetry */
48 
49 /** symmetry timings */
50 #define SYM_TIMING_BEFOREPRESOL 0 /**< compute and handle symmetries before presolving */
51 #define SYM_TIMING_DURINGPRESOL 1 /**< compute and handle symmetries during presolving */
52 #define SYM_TIMING_AFTERPRESOL 2 /**< compute and handle symmetries after presolving */
53 
54 #define SYM_COMPUTETIMING_BEFOREPRESOL SYM_TIMING_BEFOREPRESOL /**< compute symmetries before presolving */
55 #define SYM_COMPUTETIMING_DURINGPRESOL SYM_TIMING_DURINGPRESOL /**< compute symmetries during presolving */
56 #define SYM_COMPUTETIMING_AFTERPRESOL SYM_TIMING_AFTERPRESOL /**< compute symmetries after presolving */
57 
58 /** define symmetry types detectable by SCIP */
60 {
61  SYM_SYMTYPE_PERM = 0, /**< permutation symmetries */
62  SYM_SYMTYPE_SIGNPERM = 1 /**< signed permutation symmetries */
63 };
64 typedef enum SYM_Symtype SYM_SYMTYPE;
65 
66 /** define type of nodes in symmetry detection expression trees */
68 {
69  SYM_NODETYPE_OPERATOR = 0, /**< operator node */
70  SYM_NODETYPE_VAL = 1, /**< numerical value node */
71  SYM_NODETYPE_CONS = 2, /**< constraint node */
72  SYM_NODETYPE_VAR = 3 /**< variable node */
73 };
75 
76 /** define type of simple constraints/operators in symmetry detection */
78 {
79  SYM_CONSOPTYPE_UNKNOWN = 0, /**< unknown constraint type */
80  SYM_CONSOPTYPE_BDDISJ = 1, /**< constraint of type bounddisjunction */
81  SYM_CONSOPTYPE_EQ = 2, /**< encodes == in indicator constraints for activation variable */
82  SYM_CONSOPTYPE_SOS2_TUPLE = 3, /**< encodes pairs in SOS2 constraints */
83  SYM_CONSOPTYPE_SUM = 4, /**< indicates sums if sum-expr undefined */
84  SYM_CONSOPTYPE_SLACK = 5, /**< indicates slack vars in indicator constraints */
85  SYM_CONSOPTYPE_COEF = 6, /**< indicates coefficients from parent expressions */
86  SYM_CONSOPTYPE_SQDIFF = 7, /**< indicates a squared difference */
87  SYM_CONSOPTYPE_CARD_TUPLE = 8, /**< encodes pairs in cardinality constraints */
88  SYM_CONSOPTYPE_LAST = 9 /**< number of predefined enum types, needs to always
89  * hold the biggest value */
90 };
92 
93 /* type of symmetry handling codes */
94 #define SYM_HANDLETYPE_NONE UINT32_C(0x00000000) /**< no symmetry handling */
95 #define SYM_HANDLETYPE_SYMBREAK UINT32_C(0x00000001) /**< symmetry breaking inequalities */
96 #define SYM_HANDLETYPE_ORBITALREDUCTION UINT32_C(0x00000002) /**< orbital reduction */
97 #define SYM_HANDLETYPE_SST UINT32_C(0x00000004) /**< Schreier Sims cuts */
98 #define SYM_HANDLETYPE_SYMCONS (SYM_HANDLETYPE_SYMBREAK | SYM_HANDLETYPE_SST)
99 
100 typedef uint32_t SYM_HANDLETYPE; /**< type of symmetry handling */
101 
102 /** selection rules for leaders in SST cuts */
104 {
105  SCIP_LEADERRULE_FIRSTINORBIT = 0, /**< first var in orbit */
106  SCIP_LEADERRULE_LASTINORBIT = 1, /**< last var in orbit */
107  SCIP_LEADERRULE_MAXCONFLICTSINORBIT = 2 /**< var with most conflicting vars in its orbit */
108 };
110 
111 /** tie breaks for leader rule based on the leader's orbit */
113 {
114  SCIP_LEADERTIEBREAKRULE_MINORBIT = 0, /**< orbit of minimum size */
115  SCIP_LEADERTIEBREAKRULE_MAXORBIT = 1, /**< orbit of maximum size */
116  SCIP_LEADERTIEBREAKRULE_MAXCONFLICTSINORBIT = 2 /**< orbit with maximum number of vars in conflict with leader */
117 };
118 
119 /** variable types for leader in Schreier Sims cuts */
121 {
122  SCIP_SSTTYPE_BINARY = 1, /**< binary variables */
123  SCIP_SSTTYPE_INTEGER = 2, /**< integer variables */
124  SCIP_SSTTYPE_IMPLINT = 4, /**< implicitly integer variables */
125  SCIP_SSTTYPE_CONTINUOUS = 8 /**< continuous variables */
126 };
127 
129 
130 /** type of orbitope constraint: full, packing, or partitioning orbitope */
132 {
133  SCIP_ORBITOPETYPE_FULL = 0, /**< constraint is a full orbitope constraint: rowsum(x) unrestricted */
134  SCIP_ORBITOPETYPE_PARTITIONING = 1, /**< constraint is a partitioning orbitope constraint: rowsum(x) == 1 */
135  SCIP_ORBITOPETYPE_PACKING = 2 /**< constraint is a packing orbitope constraint: rowsum(x) <= 1 */
136 };
138 
139 #ifdef __cplusplus
140 }
141 #endif
142 
143 #endif
enum SCIP_LeaderRule SCIP_LEADERRULE
enum SCIP_OrbitopeType SCIP_ORBITOPETYPE
SCIP_OrbitopeType
SYM_Consoptype
Definition: type_symmetry.h:77
SCIP_LeaderTiebreakRule
SYM_Nodetype
Definition: type_symmetry.h:67
uint32_t SYM_SPEC
Definition: type_symmetry.h:47
enum SYM_Symtype SYM_SYMTYPE
Definition: type_symmetry.h:64
SCIP_LeaderRule
uint32_t SYM_HANDLETYPE
enum SYM_Consoptype SYM_CONSOPTYPE
Definition: type_symmetry.h:91
enum SYM_Nodetype SYM_NODETYPE
Definition: type_symmetry.h:74
SYM_Symtype
Definition: type_symmetry.h:59
SCIP_SSTType
SCIP callable library.
enum SCIP_SSTType SCIP_SSTTYPE