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
39extern "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
47typedef 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};
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_PB_AND = 9, /**< indicates AND conss in pseudoboolean conss */
89 SYM_CONSOPTYPE_PB_LINEAR = 10, /**< indicates linear conss in pseudoboolean conss */
90 SYM_CONSOPTYPE_PB_SOFT = 11, /**< indicates pseudoboolean cons is soft constraint */
91 SYM_CONSOPTYPE_PB_OBJ = 12, /**< indicates pseudoboolean cons is objective function */
92 SYM_CONSOPTYPE_LAST = 13 /**< number of predefined enum types, needs to always
93 * hold the biggest value */
94};
96
97/* type of symmetry handling codes */
98#define SYM_HANDLETYPE_NONE UINT32_C(0x00000000) /**< no symmetry handling */
99#define SYM_HANDLETYPE_SYMBREAK UINT32_C(0x00000001) /**< symmetry breaking inequalities */
100#define SYM_HANDLETYPE_ORBITALREDUCTION UINT32_C(0x00000002) /**< orbital reduction */
101#define SYM_HANDLETYPE_SST UINT32_C(0x00000004) /**< Schreier Sims cuts */
102#define SYM_HANDLETYPE_SYMCONS (SYM_HANDLETYPE_SYMBREAK | SYM_HANDLETYPE_SST)
103
104typedef uint32_t SYM_HANDLETYPE; /**< type of symmetry handling */
105
106/** selection rules for leaders in SST cuts */
108{
109 SCIP_LEADERRULE_FIRSTINORBIT = 0, /**< first var in orbit */
110 SCIP_LEADERRULE_LASTINORBIT = 1, /**< last var in orbit */
111 SCIP_LEADERRULE_MAXCONFLICTSINORBIT = 2 /**< var with most conflicting vars in its orbit */
114
115/** tie breaks for leader rule based on the leader's orbit */
117{
118 SCIP_LEADERTIEBREAKRULE_MINORBIT = 0, /**< orbit of minimum size */
119 SCIP_LEADERTIEBREAKRULE_MAXORBIT = 1, /**< orbit of maximum size */
120 SCIP_LEADERTIEBREAKRULE_MAXCONFLICTSINORBIT = 2 /**< orbit with maximum number of vars in conflict with leader */
122
123/** variable types for leader in Schreier Sims cuts */
125{
126 SCIP_SSTTYPE_BINARY = 1, /**< binary variables */
127 SCIP_SSTTYPE_INTEGER = 2, /**< integer variables */
128 SCIP_SSTTYPE_IMPLINT = 4, /**< implicitly integer variables */
129 SCIP_SSTTYPE_CONTINUOUS = 8 /**< continuous variables */
131
133
134/** type of orbitope constraint: full, packing, or partitioning orbitope */
136{
137 SCIP_ORBITOPETYPE_FULL = 0, /**< constraint is a full orbitope constraint: rowsum(x) unrestricted */
138 SCIP_ORBITOPETYPE_PARTITIONING = 1, /**< constraint is a partitioning orbitope constraint: rowsum(x) == 1 */
139 SCIP_ORBITOPETYPE_PACKING = 2 /**< constraint is a packing orbitope constraint: rowsum(x) <= 1 */
142
143#ifdef __cplusplus
144}
145#endif
146
147#endif
SCIP callable library.
enum SCIP_SSTType SCIP_SSTTYPE
SCIP_OrbitopeType
@ SCIP_ORBITOPETYPE_PACKING
@ SCIP_ORBITOPETYPE_FULL
@ SCIP_ORBITOPETYPE_PARTITIONING
enum SYM_Symtype SYM_SYMTYPE
Definition: type_symmetry.h:64
SCIP_LeaderRule
@ SCIP_LEADERRULE_LASTINORBIT
@ SCIP_LEADERRULE_MAXCONFLICTSINORBIT
@ SCIP_LEADERRULE_FIRSTINORBIT
enum SYM_Consoptype SYM_CONSOPTYPE
Definition: type_symmetry.h:95
enum SCIP_LeaderRule SCIP_LEADERRULE
SCIP_LeaderTiebreakRule
@ SCIP_LEADERTIEBREAKRULE_MAXORBIT
@ SCIP_LEADERTIEBREAKRULE_MINORBIT
@ SCIP_LEADERTIEBREAKRULE_MAXCONFLICTSINORBIT
enum SYM_Nodetype SYM_NODETYPE
Definition: type_symmetry.h:74
enum SCIP_OrbitopeType SCIP_ORBITOPETYPE
SYM_Nodetype
Definition: type_symmetry.h:68
@ SYM_NODETYPE_CONS
Definition: type_symmetry.h:71
@ SYM_NODETYPE_VAR
Definition: type_symmetry.h:72
@ SYM_NODETYPE_OPERATOR
Definition: type_symmetry.h:69
@ SYM_NODETYPE_VAL
Definition: type_symmetry.h:70
SYM_Consoptype
Definition: type_symmetry.h:78
@ SYM_CONSOPTYPE_EQ
Definition: type_symmetry.h:81
@ SYM_CONSOPTYPE_PB_SOFT
Definition: type_symmetry.h:90
@ SYM_CONSOPTYPE_BDDISJ
Definition: type_symmetry.h:80
@ SYM_CONSOPTYPE_CARD_TUPLE
Definition: type_symmetry.h:87
@ SYM_CONSOPTYPE_SOS2_TUPLE
Definition: type_symmetry.h:82
@ SYM_CONSOPTYPE_PB_AND
Definition: type_symmetry.h:88
@ SYM_CONSOPTYPE_SUM
Definition: type_symmetry.h:83
@ SYM_CONSOPTYPE_PB_LINEAR
Definition: type_symmetry.h:89
@ SYM_CONSOPTYPE_SLACK
Definition: type_symmetry.h:84
@ SYM_CONSOPTYPE_COEF
Definition: type_symmetry.h:85
@ SYM_CONSOPTYPE_SQDIFF
Definition: type_symmetry.h:86
@ SYM_CONSOPTYPE_UNKNOWN
Definition: type_symmetry.h:79
@ SYM_CONSOPTYPE_LAST
Definition: type_symmetry.h:92
@ SYM_CONSOPTYPE_PB_OBJ
Definition: type_symmetry.h:91
SYM_Symtype
Definition: type_symmetry.h:60
@ SYM_SYMTYPE_SIGNPERM
Definition: type_symmetry.h:62
@ SYM_SYMTYPE_PERM
Definition: type_symmetry.h:61
uint32_t SYM_SPEC
Definition: type_symmetry.h:47
uint32_t SYM_HANDLETYPE
SCIP_SSTType
@ SCIP_SSTTYPE_INTEGER
@ SCIP_SSTTYPE_CONTINUOUS
@ SCIP_SSTTYPE_BINARY
@ SCIP_SSTTYPE_IMPLINT