1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 /* */ 3 /* This file is part of the program and library */ 4 /* SCIP --- Solving Constraint Integer Programs */ 5 /* */ 6 /* Copyright (c) 2002-2023 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_COMPUTETIMING_BEFOREPRESOL 0 /**< compute symmetries before presolving */ 51 #define SYM_COMPUTETIMING_DURINGPRESOL 1 /**< compute symmetries during presolving */ 52 #define SYM_COMPUTETIMING_AFTERPRESOL 2 /**< compute symmetries after presolving */ 53 54 /** define symmetry types detectable by SCIP */ 55 enum SYM_Symtype 56 { 57 SYM_SYMTYPE_PERM = 0, /**< permutation symmetries */ 58 SYM_SYMTYPE_SIGNPERM = 1 /**< signed permutation symmetries */ 59 }; 60 typedef enum SYM_Symtype SYM_SYMTYPE; 61 62 /** define type of nodes in symmetry detection expression trees */ 63 enum SYM_Nodetype 64 { 65 SYM_NODETYPE_OPERATOR = 0, /**< operator node */ 66 SYM_NODETYPE_VAL = 1, /**< numerical value node */ 67 SYM_NODETYPE_CONS = 2, /**< constraint node */ 68 SYM_NODETYPE_VAR = 3 /**< variable node */ 69 }; 70 typedef enum SYM_Nodetype SYM_NODETYPE; 71 72 /** define type of simple constraints/operators in symmetry detection */ 73 enum SYM_Consoptype 74 { 75 SYM_CONSOPTYPE_UNKNOWN = 0, /**< unknown constraint type */ 76 SYM_CONSOPTYPE_BDDISJ = 1, /**< constraint of type bounddisjunction */ 77 SYM_CONSOPTYPE_EQ = 2, /**< encodes == in indicator constraints for activation variable */ 78 SYM_CONSOPTYPE_SOS2_TUPLE = 3, /**< encodes pairs in SOS2 constraints */ 79 SYM_CONSOPTYPE_SUM = 4, /**< indicates sums if sum-expr undefined */ 80 SYM_CONSOPTYPE_SLACK = 5, /**< indicates slack vars in indicator constraints */ 81 SYM_CONSOPTYPE_COEF = 6, /**< indicates coefficients from parent expressions */ 82 SYM_CONSOPTYPE_SQDIFF = 7, /**< indicates a squared difference */ 83 SYM_CONSOPTYPE_CARD_TUPLE = 8, /**< encodes pairs in cardinality constraints */ 84 SYM_CONSOPTYPE_LAST = 9 /**< number of predefined enum types, needs to always 85 * hold the biggest value */ 86 }; 87 typedef enum SYM_Consoptype SYM_CONSOPTYPE; 88 89 /* type of symmetry handling codes */ 90 #define SYM_HANDLETYPE_NONE UINT32_C(0x00000000) /**< no symmetry handling */ 91 #define SYM_HANDLETYPE_SYMBREAK UINT32_C(0x00000001) /**< symmetry breaking inequalities */ 92 #define SYM_HANDLETYPE_ORBITALREDUCTION UINT32_C(0x00000002) /**< orbital reduction */ 93 #define SYM_HANDLETYPE_SST UINT32_C(0x00000004) /**< Schreier Sims cuts */ 94 #define SYM_HANDLETYPE_SYMCONS (SYM_HANDLETYPE_SYMBREAK | SYM_HANDLETYPE_SST) 95 96 typedef uint32_t SYM_HANDLETYPE; /**< type of symmetry handling */ 97 98 /** selection rules for leaders in SST cuts */ 99 enum SCIP_LeaderRule 100 { 101 SCIP_LEADERRULE_FIRSTINORBIT = 0, /**< first var in orbit */ 102 SCIP_LEADERRULE_LASTINORBIT = 1, /**< last var in orbit */ 103 SCIP_LEADERRULE_MAXCONFLICTSINORBIT = 2 /**< var with most conflicting vars in its orbit */ 104 }; 105 typedef enum SCIP_LeaderRule SCIP_LEADERRULE; 106 107 /** tie breaks for leader rule based on the leader's orbit */ 108 enum SCIP_LeaderTiebreakRule 109 { 110 SCIP_LEADERTIEBREAKRULE_MINORBIT = 0, /**< orbit of minimum size */ 111 SCIP_LEADERTIEBREAKRULE_MAXORBIT = 1, /**< orbit of maximum size */ 112 SCIP_LEADERTIEBREAKRULE_MAXCONFLICTSINORBIT = 2 /**< orbit with maximum number of vars in conflict with leader */ 113 }; 114 115 /** variable types for leader in Schreier Sims cuts */ 116 enum SCIP_SSTType 117 { 118 SCIP_SSTTYPE_BINARY = 1, /**< binary variables */ 119 SCIP_SSTTYPE_INTEGER = 2, /**< integer variables */ 120 SCIP_SSTTYPE_IMPLINT = 4, /**< implicitly integer variables */ 121 SCIP_SSTTYPE_CONTINUOUS = 8 /**< continuous variables */ 122 }; 123 124 typedef enum SCIP_SSTType SCIP_SSTTYPE; 125 126 /** type of orbitope constraint: full, packing, or partitioning orbitope */ 127 enum SCIP_OrbitopeType 128 { 129 SCIP_ORBITOPETYPE_FULL = 0, /**< constraint is a full orbitope constraint: rowsum(x) unrestricted */ 130 SCIP_ORBITOPETYPE_PARTITIONING = 1, /**< constraint is a partitioning orbitope constraint: rowsum(x) == 1 */ 131 SCIP_ORBITOPETYPE_PACKING = 2 /**< constraint is a packing orbitope constraint: rowsum(x) <= 1 */ 132 }; 133 typedef enum SCIP_OrbitopeType SCIP_ORBITOPETYPE; 134 135 #ifdef __cplusplus 136 } 137 #endif 138 139 #endif 140