Scippy

SCIP

Solving Constraint Integer Programs

conflictstore.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-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 conflictstore.h
26  * @ingroup INTERNALAPI
27  * @brief internal methods for storing conflicts
28  * @author Jakob Witzig
29  */
30 
31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32 
33 #ifndef __SCIP_CONFLICTSTORE_H__
34 #define __SCIP_CONFLICTSTORE_H__
35 
36 
37 #include "scip/def.h"
38 #include "blockmemshell/memory.h"
40 #include "scip/type_retcode.h"
41 #include "scip/type_cons.h"
42 #include "scip/type_event.h"
43 #include "scip/type_conflict.h"
44 #include "scip/type_prob.h"
45 #include "scip/type_reopt.h"
46 #include "scip/type_set.h"
47 #include "scip/type_stat.h"
48 #include "scip/type_tree.h"
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 /** creates separation storage */
56  SCIP_CONFLICTSTORE** conflictstore, /**< pointer to store conflict store */
57  SCIP_SET* set /**< global SCIP settings */
58  );
59 
60 /** frees separation storage */
62  SCIP_CONFLICTSTORE** conflictstore, /**< pointer to store conflict store */
63  BMS_BLKMEM* blkmem, /**< block memory */
64  SCIP_SET* set, /**< global SCIP settings */
65  SCIP_STAT* stat, /**< dynamic SCIP statistics */
66  SCIP_REOPT* reopt /**< reoptimization data */
67  );
68 
69 /** clears conflict store */
71  SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
72  BMS_BLKMEM* blkmem, /**< block memory */
73  SCIP_SET* set, /**< global SCIP settings */
74  SCIP_STAT* stat, /**< dynamic SCIP statistics */
75  SCIP_REOPT* reopt /**< reoptimization data */
76  );
77 
78 /** cleans up conflict store */
80  SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
81  BMS_BLKMEM* blkmem, /**< block memory */
82  SCIP_SET* set, /**< global SCIP settings */
83  SCIP_STAT* stat, /**< dynamic SCIP statistics */
84  SCIP_PROB* transprob, /**< transformed problem */
85  SCIP_REOPT* reopt /**< reoptimization data */
86  );
87 
88 /** adds a constraint to the pool of proof constraints based on dual rays
89  *
90  * @note this methods captures the constraint
91  */
93  SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
94  SCIP_CONS* dualproof, /**< constraint based on a dual ray */
95  BMS_BLKMEM* blkmem, /**< block memory */
96  SCIP_SET* set, /**< global SCIP settings */
97  SCIP_STAT* stat, /**< dynamic SCIP statistics */
98  SCIP_PROB* transprob, /**< transformed problem */
99  SCIP_REOPT* reopt, /**< reoptimization data */
100  SCIP_Bool hasrelaxvar /**< does the dual proof contain at least one variable that exists in
101  * the current relaxation only? */
102  );
103 
104 /** adds a constraint to the pool of proof constraints based on dual solutions
105  *
106  * @note this methods captures the constraint
107  */
109  SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
110  SCIP_CONS* dualproof, /**< constraint based on a dual solution */
111  BMS_BLKMEM* blkmem, /**< block memory */
112  SCIP_SET* set, /**< global SCIP settings */
113  SCIP_STAT* stat, /**< dynamic SCIP statistics */
114  SCIP_PROB* transprob, /**< transformed problem */
115  SCIP_REOPT* reopt, /**< reoptimization data */
116  SCIP_Real scale, /**< scaling factor that needs to be considered when updating the side */
117  SCIP_Bool updateside, /**< should the side be updated if a new incumbent is found */
118  SCIP_Bool hasrelaxvar /**< does the dual proof contain at least one variable that exists in
119  * the current relaxation only? */
120  );
121 
122 /** adds a conflict to the conflict store
123  *
124  * @note this method captures the constraint
125  */
127  SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
128  BMS_BLKMEM* blkmem, /**< block memory */
129  SCIP_SET* set, /**< global SCIP settings */
130  SCIP_STAT* stat, /**< dynamic SCIP statistics */
131  SCIP_TREE* tree, /**< branch and bound tree (or NULL for an original constraint) */
132  SCIP_PROB* transprob, /**< transformed problem (or NULL for an original constraint) */
133  SCIP_REOPT* reopt, /**< reoptimization data */
134  SCIP_CONS* cons, /**< constraint representing the conflict */
135  SCIP_CONFTYPE conftype, /**< type of the conflict */
136  SCIP_Bool cutoffinvolved, /**< is a cutoff bound involved in this conflict */
137  SCIP_Real primalbound /**< primal bound the conflict depend on (or -SCIPinfinity) */
138  );
139 
140 /** deletes all conflicts depending on a cutoff bound larger than the given bound */
142  SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
143  SCIP_SET* set, /**< global SCIP settings */
144  SCIP_STAT* stat, /**< dynamic SCIP statistics */
145  BMS_BLKMEM* blkmem, /**< block memory */
146  SCIP_PROB* transprob, /**< transformed problem*/
147  SCIP_REOPT* reopt, /**< reoptimization data */
148  SCIP_Real cutoffbound /**< current cutoff bound */
149  );
150 
151 /** returns the maximal size of the conflict pool */
153  SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
154  );
155 
156 /** returns the initial size of the conflict pool */
158  SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
159  );
160 
161 /** returns the number of stored conflicts on the conflict pool
162  *
163  * @note the number of active conflicts can be less
164  */
166  SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
167  );
168 
169 /** returns all active conflicts stored in the conflict store */
171  SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
172  SCIP_CONS** conflicts, /**< array to store conflicts */
173  int conflictsize, /**< size of the conflict array */
174  int* nconflicts /**< pointer to store the number of conflicts */
175  );
176 
177 /** transforms all original conflicts into transformed conflicts */
179  SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
180  BMS_BLKMEM* blkmem, /**< block memory */
181  SCIP_SET* set, /**< global SCIP settings */
182  SCIP_STAT* stat, /**< dynamic SCIP statistics */
183  SCIP_TREE* tree, /**< branch and bound tree */
184  SCIP_PROB* transprob, /**< transformed problem */
185  SCIP_REOPT* reopt /**< reoptimization data */
186  );
187 
188 /** returns the average number of non-zeros over all stored dual ray constraints */
190  SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
191  );
192 
193 /** return the number of stored dualray constraints */
195  SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
196  );
197 
198 /** returns the average number of non-zeros over all stored boundexceeding proofs */
200  SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
201  );
202 
203 /** returns the number of all stored boundexceeding proofs */
205  SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
206  );
207 
208 #ifdef __cplusplus
209 }
210 #endif
211 
212 #endif
int SCIPconflictstoreGetNConflictsInStore(SCIP_CONFLICTSTORE *conflictstore)
SCIP_RETCODE SCIPconflictstoreCleanNewIncumbent(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_PROB *transprob, SCIP_REOPT *reopt, SCIP_Real cutoffbound)
type definitions for conflict store
SCIP_RETCODE SCIPconflictstoreClean(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_REOPT *reopt)
SCIP_RETCODE SCIPconflictstoreTransform(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_REOPT *reopt)
int SCIPconflictstoreGetNDualInfProofs(SCIP_CONFLICTSTORE *conflictstore)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for global SCIP settings
SCIP_RETCODE SCIPconflictstoreCreate(SCIP_CONFLICTSTORE **conflictstore, SCIP_SET *set)
type definitions for return codes for SCIP methods
type definitions for collecting reoptimization information
SCIP_RETCODE SCIPconflictstoreAddDualraycons(SCIP_CONFLICTSTORE *conflictstore, SCIP_CONS *dualproof, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_REOPT *reopt, SCIP_Bool hasrelaxvar)
SCIP_RETCODE SCIPconflictstoreFree(SCIP_CONFLICTSTORE **conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_REOPT *reopt)
type definitions for problem statistics
type definitions for conflict analysis
type definitions for managing events
SCIP_RETCODE SCIPconflictstoreClear(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_REOPT *reopt)
#define SCIP_Bool
Definition: def.h:93
int SCIPconflictstoreGetInitPoolSize(SCIP_CONFLICTSTORE *conflictstore)
SCIP_Real SCIPconflictstoreGetAvgNnzDualBndProofs(SCIP_CONFLICTSTORE *conflictstore)
type definitions for branch and bound tree
SCIP_RETCODE SCIPconflictstoreAddConflict(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_REOPT *reopt, SCIP_CONS *cons, SCIP_CONFTYPE conftype, SCIP_Bool cutoffinvolved, SCIP_Real primalbound)
type definitions for storing and manipulating the main problem
SCIP_RETCODE SCIPconflictstoreGetConflicts(SCIP_CONFLICTSTORE *conflictstore, SCIP_CONS **conflicts, int conflictsize, int *nconflicts)
#define SCIP_Real
Definition: def.h:186
int SCIPconflictstoreGetMaxPoolSize(SCIP_CONFLICTSTORE *conflictstore)
enum SCIP_ConflictType SCIP_CONFTYPE
Definition: type_conflict.h:65
SCIP_RETCODE SCIPconflictstoreAddDualsolcons(SCIP_CONFLICTSTORE *conflictstore, SCIP_CONS *dualproof, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_REOPT *reopt, SCIP_Real scale, SCIP_Bool updateside, SCIP_Bool hasrelaxvar)
int SCIPconflictstoreGetNDualBndProofs(SCIP_CONFLICTSTORE *conflictstore)
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:439
SCIP_Real SCIPconflictstoreGetAvgNnzDualInfProofs(SCIP_CONFLICTSTORE *conflictstore)
type definitions for constraints and constraint handlers
memory allocation routines