Scippy

SCIP

Solving Constraint Integer Programs

symmetry_orbitopal.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 symmetry_orbitopal.c
26 * @ingroup OTHER_CFILES
27 * @brief methods for handling orbitopal symmetries
28 * @author Jasper van Doornmalen
29 */
30
31/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32
33#ifndef __SCIP_SYMMETRY_ORBITOPAL_H__
34#define __SCIP_SYMMETRY_ORBITOPAL_H__
35
36#include "scip/def.h"
37#include "scip/type_retcode.h"
38#include "scip/type_scip.h"
39#include "scip/type_var.h"
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
46
47/** variants for orbitope column ordering */
49{
50 SCIP_COLUMNORDERING_NONE = 0, /**< do not order the columns */
51 SCIP_COLUMNORDERING_FIRST = 1, /**< choose first possible column */
52 SCIP_COLUMNORDERING_LAST = 2, /**< choose last possible column */
53 SCIP_COLUMNORDERING_CENTRE = 3, /**< choose centremost possible column */
54 SCIP_COLUMNORDERING_MEDIAN = 4 /**< choose median column */
55};
56typedef enum SCIP_ColumnOrdering SCIP_COLUMNORDERING; /**< variants for orbitope column ordering*/
57
58/** variants for orbitope row ordering */
60{
61 SCIP_ROWORDERING_NONE = 0, /**< do not order the rows */
62 SCIP_ROWORDERING_BRANCHING = 1 /**< choose rows based on branching variables */
63};
64typedef enum SCIP_RowOrdering SCIP_ROWORDERING; /**< variants for orbitope row ordering*/
65
66
67/** data for orbitopal reduction */
68struct SCIP_OrbitopalReductionData;
69typedef struct SCIP_OrbitopalReductionData SCIP_ORBITOPALREDDATA; /**< data for orbitopal reduction */
70
71
72/** gets the number of reductions */
73SCIP_EXPORT
75 SCIP* scip, /**< SCIP data structure */
76 SCIP_ORBITOPALREDDATA* orbireddata, /**< orbitopal reduction data structure */
77 int* nred, /**< total number of reductions applied */
78 int* ncutoff /**< total number of cutoffs applied */
79 );
80
81
82/** prints orbitopal reduction data */
83SCIP_EXPORT
85 SCIP* scip, /**< SCIP data structure */
86 SCIP_ORBITOPALREDDATA* orbireddata /**< orbitopal reduction data structure */
87 );
88
89/** propagates orbitopal reduction */
90SCIP_EXPORT
92 SCIP* scip, /**< SCIP data structure */
93 SCIP_ORBITOPALREDDATA* orbireddata, /**< orbitopal reduction data structure */
94 SCIP_Bool* infeasible, /**< pointer to store whether infeasibility is found */
95 int* nred, /**< pointer to store the number of domain reductions */
96 SCIP_Bool* didrun /**< a global pointer maintaining if any symmetry propagator has run
97 * only set this to TRUE when a reduction is found, never set to FALSE */
98 );
99
100
101/** adds orbitopal component to orbitopal symmetry handler */
102SCIP_EXPORT
104 SCIP* scip, /**< SCIP data structure */
105 SCIP_ORBITOPALREDDATA* orbireddata, /**< orbitopal reduction data structure */
106 SCIP_ROWORDERING rowordering, /**< specifies how rows of orbitope are ordered */
107 SCIP_COLUMNORDERING colordering, /**< specifies how columnss of orbitope are ordered */
108 SCIP_VAR** vars, /**< matrix of variables on which the symmetry acts */
109 int nrows, /**< number of rows */
110 int ncols, /**< number of columns */
111 SCIP_Bool* success /**< to store whether the component is successfully added */
112 );
113
114/** resets orbitopal reduction data structure (clears all orbitopes) */
115SCIP_EXPORT
117 SCIP* scip, /**< SCIP data structure */
118 SCIP_ORBITOPALREDDATA* orbireddata /**< pointer to orbitopal reduction structure to populate */
119 );
120
121
122/** frees orbitopal reduction data */
123SCIP_EXPORT
125 SCIP* scip, /**< SCIP data structure */
126 SCIP_ORBITOPALREDDATA** orbireddata /**< pointer to orbitopal reduction structure to populate */
127 );
128
129
130/** initializes structures needed for orbitopal reduction
131 *
132 * This is only done exactly once.
133 */
134SCIP_EXPORT
136 SCIP* scip, /**< SCIP data structure */
137 SCIP_ORBITOPALREDDATA** orbireddata /**< pointer to orbitopal reduction structure to populate */
138 );
139
140
141/** returns the default column ordering */
142SCIP_EXPORT
144 SCIP_ORBITOPALREDDATA* orbireddata /**< pointer to orbitopal reduction structure to populate */
145 );
146
147#ifdef __cplusplus
148}
149#endif
150
151#endif
common defines and data types used in all packages of SCIP
#define SCIP_Bool
Definition: def.h:91
SCIP_RETCODE SCIPincludeOrbitopalReduction(SCIP *scip, SCIP_ORBITOPALREDDATA **orbireddata)
SCIP_RETCODE SCIPorbitopalReductionFree(SCIP *scip, SCIP_ORBITOPALREDDATA **orbireddata)
SCIP_ColumnOrdering
@ SCIP_COLUMNORDERING_CENTRE
@ SCIP_COLUMNORDERING_FIRST
@ SCIP_COLUMNORDERING_NONE
@ SCIP_COLUMNORDERING_LAST
@ SCIP_COLUMNORDERING_MEDIAN
SCIP_RETCODE SCIPorbitopalReductionReset(SCIP *scip, SCIP_ORBITOPALREDDATA *orbireddata)
SCIP_RETCODE SCIPorbitopalReductionAddOrbitope(SCIP *scip, SCIP_ORBITOPALREDDATA *orbireddata, SCIP_ROWORDERING rowordering, SCIP_COLUMNORDERING colordering, SCIP_VAR **vars, int nrows, int ncols, SCIP_Bool *success)
SCIP_RETCODE SCIPorbitopalReductionPropagate(SCIP *scip, SCIP_ORBITOPALREDDATA *orbireddata, SCIP_Bool *infeasible, int *nred, SCIP_Bool *didrun)
enum SCIP_ColumnOrdering SCIP_COLUMNORDERING
SCIP_RETCODE SCIPorbitopalReductionGetStatistics(SCIP *scip, SCIP_ORBITOPALREDDATA *orbireddata, int *nred, int *ncutoff)
SCIP_RETCODE SCIPorbitopalReductionPrintStatistics(SCIP *scip, SCIP_ORBITOPALREDDATA *orbireddata)
SCIP_RowOrdering
@ SCIP_ROWORDERING_BRANCHING
@ SCIP_ROWORDERING_NONE
struct SCIP_OrbitopalReductionData SCIP_ORBITOPALREDDATA
enum SCIP_RowOrdering SCIP_ROWORDERING
SCIP_COLUMNORDERING SCIPorbitopalReductionGetDefaultColumnOrdering(SCIP_ORBITOPALREDDATA *orbireddata)
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
type definitions for problem variables