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-2020 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file conflictstore.h
17  * @ingroup INTERNALAPI
18  * @brief internal methods for storing conflicts
19  * @author Jakob Witzig
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_CONFLICTSTORE_H__
25 #define __SCIP_CONFLICTSTORE_H__
26 
27 
28 #include "scip/def.h"
29 #include "blockmemshell/memory.h"
31 #include "scip/type_retcode.h"
32 #include "scip/type_cons.h"
33 #include "scip/type_event.h"
34 #include "scip/type_conflict.h"
35 #include "scip/type_prob.h"
36 #include "scip/type_reopt.h"
37 #include "scip/type_set.h"
38 #include "scip/type_stat.h"
39 #include "scip/type_tree.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 /** creates separation storage */
47  SCIP_CONFLICTSTORE** conflictstore, /**< pointer to store conflict store */
48  SCIP_SET* set /**< global SCIP settings */
49  );
50 
51 /** frees separation storage */
53  SCIP_CONFLICTSTORE** conflictstore, /**< pointer to store conflict store */
54  BMS_BLKMEM* blkmem, /**< block memory */
55  SCIP_SET* set, /**< global SCIP settings */
56  SCIP_STAT* stat, /**< dynamic SCIP statistics */
57  SCIP_REOPT* reopt /**< reoptimization data */
58  );
59 
60 /** clears conflict store */
62  SCIP_CONFLICTSTORE* conflictstore, /**< 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 /** cleans up 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_PROB* transprob, /**< transformed problem */
76  SCIP_REOPT* reopt /**< reoptimization data */
77  );
78 
79 /** adds a constraint to the pool of proof constraints based on dual rays
80  *
81  * @note this methods captures the constraint
82  */
84  SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
85  SCIP_CONS* dualproof, /**< constraint based on a dual ray */
86  BMS_BLKMEM* blkmem, /**< block memory */
87  SCIP_SET* set, /**< global SCIP settings */
88  SCIP_STAT* stat, /**< dynamic SCIP statistics */
89  SCIP_PROB* transprob, /**< transformed problem */
90  SCIP_REOPT* reopt, /**< reoptimization data */
91  SCIP_Bool hasrelaxvar /**< does the dual proof contain at least one variable that exists in
92  * the current relaxation only? */
93  );
94 
95 /** adds a constraint to the pool of proof constraints based on dual solutions
96  *
97  * @note this methods captures the constraint
98  */
100  SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
101  SCIP_CONS* dualproof, /**< constraint based on a dual solution */
102  BMS_BLKMEM* blkmem, /**< block memory */
103  SCIP_SET* set, /**< global SCIP settings */
104  SCIP_STAT* stat, /**< dynamic SCIP statistics */
105  SCIP_PROB* transprob, /**< transformed problem */
106  SCIP_REOPT* reopt, /**< reoptimization data */
107  SCIP_Real scale, /**< scaling factor that needs to be considered when updating the side */
108  SCIP_Bool updateside, /**< should the side be updated if a new incumbent is found */
109  SCIP_Bool hasrelaxvar /**< does the dual proof contain at least one variable that exists in
110  * the current relaxation only? */
111  );
112 
113 /** adds a conflict to the conflict store
114  *
115  * @note this method captures the constraint
116  */
118  SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
119  BMS_BLKMEM* blkmem, /**< block memory */
120  SCIP_SET* set, /**< global SCIP settings */
121  SCIP_STAT* stat, /**< dynamic SCIP statistics */
122  SCIP_TREE* tree, /**< branch and bound tree (or NULL for an original constraint) */
123  SCIP_PROB* transprob, /**< transformed problem (or NULL for an original constraint) */
124  SCIP_REOPT* reopt, /**< reoptimization data */
125  SCIP_CONS* cons, /**< constraint representing the conflict */
126  SCIP_CONFTYPE conftype, /**< type of the conflict */
127  SCIP_Bool cutoffinvolved, /**< is a cutoff bound involved in this conflict */
128  SCIP_Real primalbound /**< primal bound the conflict depend on (or -SCIPinfinity) */
129  );
130 
131 /** deletes all conflicts depending on a cutoff bound larger than the given bound */
133  SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
134  SCIP_SET* set, /**< global SCIP settings */
135  SCIP_STAT* stat, /**< dynamic SCIP statistics */
136  BMS_BLKMEM* blkmem, /**< block memory */
137  SCIP_PROB* transprob, /**< transformed problem*/
138  SCIP_REOPT* reopt, /**< reoptimization data */
139  SCIP_Real cutoffbound /**< current cutoff bound */
140  );
141 
142 /** returns the maximal size of the conflict pool */
144  SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
145  );
146 
147 /** returns the initial size of the conflict pool */
149  SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
150  );
151 
152 /** returns the number of stored conflicts on the conflict pool
153  *
154  * @note the number of active conflicts can be less
155  */
157  SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
158  );
159 
160 /** returns all active conflicts stored in the conflict store */
162  SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
163  SCIP_CONS** conflicts, /**< array to store conflicts */
164  int conflictsize, /**< size of the conflict array */
165  int* nconflicts /**< pointer to store the number of conflicts */
166  );
167 
168 /** transforms all original conflicts into transformed conflicts */
170  SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
171  BMS_BLKMEM* blkmem, /**< block memory */
172  SCIP_SET* set, /**< global SCIP settings */
173  SCIP_STAT* stat, /**< dynamic SCIP statistics */
174  SCIP_TREE* tree, /**< branch and bound tree */
175  SCIP_PROB* transprob, /**< transformed problem */
176  SCIP_REOPT* reopt /**< reoptimization data */
177  );
178 
179 /** returns the average number of non-zeros over all stored dual ray constraints */
181  SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
182  );
183 
184 /** return the number of stored dualray constraints */
186  SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
187  );
188 
189 /** returns the average number of non-zeros over all stored boundexceeding proofs */
191  SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
192  );
193 
194 /** returns the number of all stored boundexceeding proofs */
196  SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
197  );
198 
199 #ifdef __cplusplus
200 }
201 #endif
202 
203 #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:54
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:70
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:163
int SCIPconflictstoreGetMaxPoolSize(SCIP_CONFLICTSTORE *conflictstore)
enum SCIP_ConflictType SCIP_CONFTYPE
Definition: type_conflict.h:56
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:429
SCIP_Real SCIPconflictstoreGetAvgNnzDualInfProofs(SCIP_CONFLICTSTORE *conflictstore)
type definitions for constraints and constraint handlers
memory allocation routines