1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /*                                                                           */
3 /*                  This file is part of the program and library             */
4 /*         SCIP --- Solving Constraint Integer Programs                      */
5 /*                                                                           */
6 /*    Copyright (C) 2002-2021 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   scip_conflict.h
17  * @ingroup PUBLICCOREAPI
18  * @brief  public methods for conflict handler plugins and conflict analysis
19  * @author Tobias Achterberg
20  * @author Timo Berthold
21  * @author Thorsten Koch
22  * @author Alexander Martin
23  * @author Marc Pfetsch
24  * @author Kati Wolter
25  * @author Gregor Hendel
26  * @author Leona Gottwald
27  */
28 
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
30 
31 #ifndef __SCIP_SCIP_CONFLICT_H__
32 #define __SCIP_SCIP_CONFLICT_H__
33 
34 
35 #include "scip/def.h"
36 #include "scip/type_conflict.h"
37 #include "scip/type_cons.h"
38 #include "scip/type_lp.h"
39 #include "scip/type_result.h"
40 #include "scip/type_retcode.h"
41 #include "scip/type_scip.h"
42 #include "scip/type_tree.h"
43 #include "scip/type_var.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /**@addtogroup PublicConflicthdlrMethods
50  *
51  * @{
52  */
53 
54 /** creates a conflict handler and includes it in SCIP
55  *
56  *  @note method has all conflict handler callbacks as arguments and is thus changed every time a new
57  *        callback is added
58  *        in future releases; consider using SCIPincludeConflicthdlrBasic() and setter functions
59  *        if you seek for a method which is less likely to change in future releases
60  */
61 SCIP_EXPORT
62 SCIP_RETCODE SCIPincludeConflicthdlr(
63    SCIP*                 scip,               /**< SCIP data structure */
64    const char*           name,               /**< name of conflict handler */
65    const char*           desc,               /**< description of conflict handler */
66    int                   priority,           /**< priority of the conflict handler */
67    SCIP_DECL_CONFLICTCOPY((*conflictcopy)),  /**< copy method of conflict handler or NULL if you don't want to copy your plugin into sub-SCIPs */
68    SCIP_DECL_CONFLICTFREE((*conflictfree)),  /**< destructor of conflict handler */
69    SCIP_DECL_CONFLICTINIT((*conflictinit)),  /**< initialize conflict handler */
70    SCIP_DECL_CONFLICTEXIT((*conflictexit)),  /**< deinitialize conflict handler */
71    SCIP_DECL_CONFLICTINITSOL((*conflictinitsol)),/**< solving process initialization method of conflict handler */
72    SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol)),/**< solving process deinitialization method of conflict handler */
73    SCIP_DECL_CONFLICTEXEC((*conflictexec)),  /**< conflict processing method of conflict handler */
74    SCIP_CONFLICTHDLRDATA* conflicthdlrdata   /**< conflict handler data */
75    );
76 
77 /** creates a conflict handler and includes it in SCIP with its most fundamental callbacks. All non-fundamental
78  *  (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
79  *  Optional callbacks can be set via specific setter functions SCIPsetConflicthdlrCopy(), SCIPsetConflicthdlrFree(),
80  *  SCIPsetConflicthdlrInit(), SCIPsetConflicthdlrExit(), SCIPsetConflicthdlrInitsol(),
81  *  and SCIPsetConflicthdlrExitsol()
82  *
83  *  @note if you want to set all callbacks with a single method call, consider using SCIPincludeConflicthdlr() instead
84  */
85 SCIP_EXPORT
86 SCIP_RETCODE SCIPincludeConflicthdlrBasic(
87    SCIP*                 scip,               /**< SCIP data structure */
88    SCIP_CONFLICTHDLR**   conflicthdlrptr,    /**< reference to a conflict handler pointer, or NULL */
89    const char*           name,               /**< name of conflict handler */
90    const char*           desc,               /**< description of conflict handler */
91    int                   priority,           /**< priority of the conflict handler */
92    SCIP_DECL_CONFLICTEXEC((*conflictexec)),  /**< conflict processing method of conflict handler */
93    SCIP_CONFLICTHDLRDATA* conflicthdlrdata   /**< conflict handler data */
94    );
95 
96 /** set copy method of conflict handler */
97 SCIP_EXPORT
98 SCIP_RETCODE SCIPsetConflicthdlrCopy(
99    SCIP*                 scip,               /**< SCIP data structure */
100    SCIP_CONFLICTHDLR*    conflicthdlr,       /**< conflict handler */
101    SCIP_DECL_CONFLICTCOPY((*conflictcopy))   /**< copy method of conflict handler */
102    );
103 
104 /** set destructor of conflict handler */
105 SCIP_EXPORT
106 SCIP_RETCODE SCIPsetConflicthdlrFree(
107    SCIP*                 scip,               /**< SCIP data structure */
108    SCIP_CONFLICTHDLR*    conflicthdlr,       /**< conflict handler */
109    SCIP_DECL_CONFLICTFREE((*conflictfree))   /**< destructor of conflict handler */
110    );
111 
112 /** set initialization method of conflict handler */
113 SCIP_EXPORT
114 SCIP_RETCODE SCIPsetConflicthdlrInit(
115    SCIP*                 scip,               /**< SCIP data structure */
116    SCIP_CONFLICTHDLR*    conflicthdlr,       /**< conflict handler */
117    SCIP_DECL_CONFLICTINIT((*conflictinit))   /**< initialize conflict handler */
118    );
119 
120 /** set deinitialization method of conflict handler */
121 SCIP_EXPORT
122 SCIP_RETCODE SCIPsetConflicthdlrExit(
123    SCIP*                 scip,               /**< SCIP data structure */
124    SCIP_CONFLICTHDLR*    conflicthdlr,       /**< conflict handler */
125    SCIP_DECL_CONFLICTEXIT((*conflictexit))   /**< deinitialize conflict handler */
126    );
127 
128 /** set solving process initialization method of conflict handler */
129 SCIP_EXPORT
130 SCIP_RETCODE SCIPsetConflicthdlrInitsol(
131    SCIP*                 scip,               /**< SCIP data structure */
132    SCIP_CONFLICTHDLR*    conflicthdlr,       /**< conflict handler */
133    SCIP_DECL_CONFLICTINITSOL((*conflictinitsol))/**< solving process initialization method of conflict handler */
134    );
135 
136 /** set solving process deinitialization method of conflict handler */
137 SCIP_EXPORT
138 SCIP_RETCODE SCIPsetConflicthdlrExitsol(
139    SCIP*                 scip,               /**< SCIP data structure */
140    SCIP_CONFLICTHDLR*    conflicthdlr,       /**< conflict handler */
141    SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol))/**< solving process deinitialization method of conflict handler */
142    );
143 
144 /** returns the conflict handler of the given name, or NULL if not existing */
145 SCIP_EXPORT
146 SCIP_CONFLICTHDLR* SCIPfindConflicthdlr(
147    SCIP*                 scip,               /**< SCIP data structure */
148    const char*           name                /**< name of conflict handler */
149    );
150 
151 /** returns the array of currently available conflict handlers */
152 SCIP_EXPORT
153 SCIP_CONFLICTHDLR** SCIPgetConflicthdlrs(
154    SCIP*                 scip                /**< SCIP data structure */
155    );
156 
157 /** returns the number of currently available conflict handlers */
158 SCIP_EXPORT
159 int SCIPgetNConflicthdlrs(
160    SCIP*                 scip                /**< SCIP data structure */
161    );
162 
163 /** sets the priority of a conflict handler */
164 SCIP_EXPORT
165 SCIP_RETCODE SCIPsetConflicthdlrPriority(
166    SCIP*                 scip,               /**< SCIP data structure */
167    SCIP_CONFLICTHDLR*    conflicthdlr,       /**< conflict handler */
168    int                   priority            /**< new priority of the conflict handler */
169    );
170 
171 /** @} */
172 
173 /**@addtogroup PublicConflictMethods
174  *
175  * @{
176  */
177 
178 /** return TRUE if conflict analysis is applicable; In case the function return FALSE there is no need to initialize the
179  *  conflict analysis since it will not be applied
180  *
181  *  @return return TRUE if conflict analysis is applicable; In case the function return FALSE there is no need to initialize the
182  *          conflict analysis since it will not be applied
183  *
184  *  @pre This method can be called if SCIP is in one of the following stages:
185  *       - \ref SCIP_STAGE_INITPRESOLVE
186  *       - \ref SCIP_STAGE_PRESOLVING
187  *       - \ref SCIP_STAGE_EXITPRESOLVE
188  *       - \ref SCIP_STAGE_SOLVING
189  *
190  *  @note SCIP stage does not get changed
191  */
192 SCIP_EXPORT
193 SCIP_Bool SCIPisConflictAnalysisApplicable(
194    SCIP*                 scip                /**< SCIP data structure */
195    );
196 
197 /** initializes the conflict analysis by clearing the conflict candidate queue; this method must be called before you
198  *  enter the conflict variables by calling SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(),
199  *  SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or SCIPaddConflictBinvar();
200  *
201  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
202  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
203  *
204  *  @pre This method can be called if SCIP is in one of the following stages:
205  *       - \ref SCIP_STAGE_PRESOLVING
206  *       - \ref SCIP_STAGE_SOLVING
207  *
208  *  @note SCIP stage does not get changed
209  */
210 SCIP_EXPORT
211 SCIP_RETCODE SCIPinitConflictAnalysis(
212    SCIP*                 scip,               /**< SCIP data structure */
213    SCIP_CONFTYPE         conftype,           /**< type of conflict */
214    SCIP_Bool             iscutoffinvolved    /**< is the current cutoff bound involved? */
215    );
216 
217 /** adds lower bound of variable at the time of the given bound change index to the conflict analysis' candidate storage;
218  *  this method should be called in one of the following two cases:
219  *   1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictLb() should be called for each lower bound
220  *      that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
221  *   2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictLb() should be called
222  *      for each lower bound, whose current assignment led to the deduction of the given conflict bound.
223  *
224  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
225  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
226  *
227  *  @pre This method can be called if SCIP is in one of the following stages:
228  *       - \ref SCIP_STAGE_PRESOLVING
229  *       - \ref SCIP_STAGE_SOLVING
230  *
231  *  @note SCIP stage does not get changed
232  */
233 SCIP_EXPORT
234 SCIP_RETCODE SCIPaddConflictLb(
235    SCIP*                 scip,               /**< SCIP data structure */
236    SCIP_VAR*             var,                /**< variable whose lower bound should be added to conflict candidate queue */
237    SCIP_BDCHGIDX*        bdchgidx            /**< bound change index representing time on path to current node, when the
238                                               *   conflicting bound was valid, NULL for current local bound */
239    );
240 
241 /** adds lower bound of variable at the time of the given bound change index to the conflict analysis' candidate storage
242  *  with the additional information of a relaxed lower bound; this relaxed lower bound is the one which would be enough
243  *  to explain a certain bound change;
244  *  this method should be called in one of the following two cases:
245  *   1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictRelaxedLb() should be called for each (relaxed) lower bound
246  *      that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
247  *   2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictRelexedLb() should be called
248  *      for each (relaxed) lower bound, whose current assignment led to the deduction of the given conflict bound.
249  *
250  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
251  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
252  *
253  *  @pre This method can be called if SCIP is in one of the following stages:
254  *       - \ref SCIP_STAGE_PRESOLVING
255  *       - \ref SCIP_STAGE_SOLVING
256  *
257  *  @note SCIP stage does not get changed
258  */
259 SCIP_EXPORT
260 SCIP_RETCODE SCIPaddConflictRelaxedLb(
261    SCIP*                 scip,               /**< SCIP data structure */
262    SCIP_VAR*             var,                /**< variable whose lower bound should be added to conflict candidate queue */
263    SCIP_BDCHGIDX*        bdchgidx,           /**< bound change index representing time on path to current node, when the
264                                               *   conflicting bound was valid, NULL for current local bound */
265    SCIP_Real             relaxedlb           /**< the relaxed lower bound */
266    );
267 
268 /** adds upper bound of variable at the time of the given bound change index to the conflict analysis' candidate storage;
269  *  this method should be called in one of the following two cases:
270  *   1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictUb() should be called for each upper bound that
271  *      led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
272  *   2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictUb() should be called for
273  *      each upper bound, whose current assignment led to the deduction of the given conflict bound.
274  *
275  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
276  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
277  *
278  *  @pre This method can be called if SCIP is in one of the following stages:
279  *       - \ref SCIP_STAGE_PRESOLVING
280  *       - \ref SCIP_STAGE_SOLVING
281  *
282  *  @note SCIP stage does not get changed
283  */
284 SCIP_EXPORT
285 SCIP_RETCODE SCIPaddConflictUb(
286    SCIP*                 scip,               /**< SCIP data structure */
287    SCIP_VAR*             var,                /**< variable whose upper bound should be added to conflict candidate queue */
288    SCIP_BDCHGIDX*        bdchgidx            /**< bound change index representing time on path to current node, when the
289                                               *   conflicting bound was valid, NULL for current local bound */
290    );
291 
292 /** adds upper bound of variable at the time of the given bound change index to the conflict analysis' candidate storage
293  *  with the additional information of a relaxed upper bound; this relaxed upper bound is the one which would be enough
294  *  to explain a certain bound change;
295  *  this method should be called in one of the following two cases:
296  *   1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictRelaxedUb() should be called for each (relaxed) upper
297  *      bound that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
298  *   2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictRelaxedUb() should be
299  *      called for each (relaxed) upper bound, whose current assignment led to the deduction of the given conflict
300  *      bound.
301  *
302  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
303  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
304  *
305  *  @pre This method can be called if SCIP is in one of the following stages:
306  *       - \ref SCIP_STAGE_PRESOLVING
307  *       - \ref SCIP_STAGE_SOLVING
308  *
309  *  @note SCIP stage does not get changed
310  */
311 SCIP_EXPORT
312 SCIP_RETCODE SCIPaddConflictRelaxedUb(
313    SCIP*                 scip,               /**< SCIP data structure */
314    SCIP_VAR*             var,                /**< variable whose upper bound should be added to conflict candidate queue */
315    SCIP_BDCHGIDX*        bdchgidx,           /**< bound change index representing time on path to current node, when the
316                                               *   conflicting bound was valid, NULL for current local bound */
317    SCIP_Real             relaxedub           /**< the relaxed upper bound */
318    );
319 
320 /** adds lower or upper bound of variable at the time of the given bound change index to the conflict analysis' candidate
321  *  storage; this method should be called in one of the following two cases:
322  *   1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictBd() should be called for each bound
323  *      that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
324  *   2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictBd() should be called
325  *      for each bound, whose current assignment led to the deduction of the given conflict bound.
326  *
327  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
328  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
329  *
330  *  @pre This method can be called if SCIP is in one of the following stages:
331  *       - \ref SCIP_STAGE_PRESOLVING
332  *       - \ref SCIP_STAGE_SOLVING
333  *
334  *  @note SCIP stage does not get changed
335  */
336 SCIP_EXPORT
337 SCIP_RETCODE SCIPaddConflictBd(
338    SCIP*                 scip,               /**< SCIP data structure */
339    SCIP_VAR*             var,                /**< variable whose upper bound should be added to conflict candidate queue */
340    SCIP_BOUNDTYPE        boundtype,          /**< the type of the conflicting bound (lower or upper bound) */
341    SCIP_BDCHGIDX*        bdchgidx            /**< bound change index representing time on path to current node, when the
342                                               *   conflicting bound was valid, NULL for current local bound */
343    );
344 
345 /** adds lower or upper bound of variable at the time of the given bound change index to the conflict analysis'
346  *  candidate storage; with the additional information of a relaxed upper bound; this relaxed upper bound is the one
347  *  which would be enough to explain a certain bound change;
348  *  this method should be called in one of the following two cases:
349  *   1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictRelaxedBd() should be called for each (relaxed)
350  *      bound that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
351  *   2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictRelaxedBd() should be
352  *      called for each (relaxed) bound, whose current assignment led to the deduction of the given conflict bound.
353  *
354  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
355  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
356  *
357  *  @pre This method can be called if SCIP is in one of the following stages:
358  *       - \ref SCIP_STAGE_PRESOLVING
359  *       - \ref SCIP_STAGE_SOLVING
360  *
361  *  @note SCIP stage does not get changed
362  */
363 SCIP_EXPORT
364 SCIP_RETCODE SCIPaddConflictRelaxedBd(
365    SCIP*                 scip,               /**< SCIP data structure */
366    SCIP_VAR*             var,                /**< variable whose upper bound should be added to conflict candidate queue */
367    SCIP_BOUNDTYPE        boundtype,          /**< the type of the conflicting bound (lower or upper bound) */
368    SCIP_BDCHGIDX*        bdchgidx,           /**< bound change index representing time on path to current node, when the
369                                               *   conflicting bound was valid, NULL for current local bound */
370    SCIP_Real             relaxedbd           /**< the relaxed bound */
371    );
372 
373 /** adds changed bound of fixed binary variable to the conflict analysis' candidate storage;
374  *  this method should be called in one of the following two cases:
375  *   1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictBinvar() should be called for each fixed binary
376  *      variable that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
377  *   2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictBinvar() should be called
378  *      for each binary variable, whose current fixing led to the deduction of the given conflict bound.
379  *
380  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
381  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
382  *
383  *  @pre This method can be called if SCIP is in one of the following stages:
384  *       - \ref SCIP_STAGE_PRESOLVING
385  *       - \ref SCIP_STAGE_SOLVING
386  *
387  *  @note SCIP stage does not get changed
388  */
389 SCIP_EXPORT
390 SCIP_RETCODE SCIPaddConflictBinvar(
391    SCIP*                 scip,               /**< SCIP data structure */
392    SCIP_VAR*             var                 /**< binary variable whose changed bound should be added to conflict queue */
393    );
394 
395 /** checks if the given variable is already part of the current conflict set or queued for resolving with the same or
396  *  even stronger bound
397  *
398  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
399  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
400  *
401  *  @pre This method can be called if SCIP is in one of the following stages:
402  *       - \ref SCIP_STAGE_PRESOLVING
403  *       - \ref SCIP_STAGE_SOLVING
404  *
405  *  @note SCIP stage does not get changed
406  */
407 SCIP_EXPORT
408 SCIP_RETCODE SCIPisConflictVarUsed(
409    SCIP*                 scip,               /**< SCIP data structure */
410    SCIP_VAR*             var,                /**< variable whose upper bound should be added to conflict candidate queue */
411    SCIP_BOUNDTYPE        boundtype,          /**< the type of the conflicting bound (lower or upper bound) */
412    SCIP_BDCHGIDX*        bdchgidx,           /**< bound change index representing time on path to current node, when the
413                                               *   conflicting bound was valid, NULL for current local bound */
414    SCIP_Bool*            used                /**< pointer to store if the variable is already used */
415    );
416 
417 /** returns the conflict lower bound if the variable is present in the current conflict set; otherwise the global lower
418  *  bound
419  *
420  *  @return returns the conflict lower bound if the variable is present in the current conflict set; otherwise the global lower
421  *          bound
422  *
423  *  @pre This method can be called if SCIP is in one of the following stages:
424  *       - \ref SCIP_STAGE_PRESOLVING
425  *       - \ref SCIP_STAGE_SOLVING
426  *
427  *  @note SCIP stage does not get changed
428  */
429 SCIP_EXPORT
430 SCIP_Real SCIPgetConflictVarLb(
431    SCIP*                 scip,               /**< SCIP data structure */
432    SCIP_VAR*             var                 /**< problem variable */
433    );
434 
435 /** returns the conflict upper bound if the variable is present in the current conflict set; otherwise minus global
436  *  upper bound
437  *
438  *  @return returns the conflict upper bound if the variable is present in the current conflict set; otherwise minus global
439  *          upper bound
440  *
441  *  @pre This method can be called if SCIP is in one of the following stages:
442  *       - \ref SCIP_STAGE_PRESOLVING
443  *       - \ref SCIP_STAGE_SOLVING
444  *
445  *  @note SCIP stage does not get changed
446  */
447 SCIP_EXPORT
448 SCIP_Real SCIPgetConflictVarUb(
449    SCIP*                 scip,               /**< SCIP data structure */
450    SCIP_VAR*             var                 /**< problem variable */
451    );
452 
453 /** analyzes conflict bounds that were added after a call to SCIPinitConflictAnalysis() with calls to
454  *  SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(),
455  *  SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or SCIPaddConflictBinvar(); on success, calls the conflict
456  *  handlers to create a conflict constraint out of the resulting conflict set; the given valid depth must be a depth
457  *  level, at which the conflict set defined by calls to SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(),
458  *  SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), and SCIPaddConflictBinvar() is
459  *  valid for the whole subtree; if the conflict was found by a violated constraint, use SCIPanalyzeConflictCons()
460  *  instead of SCIPanalyzeConflict() to make sure, that the correct valid depth is used
461  *
462  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
463  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
464  *
465  *  @pre This method can be called if SCIP is in one of the following stages:
466  *       - \ref SCIP_STAGE_PRESOLVING
467  *       - \ref SCIP_STAGE_SOLVING
468  *
469  *  @note SCIP stage does not get changed
470  */
471 SCIP_EXPORT
472 SCIP_RETCODE SCIPanalyzeConflict(
473    SCIP*                 scip,               /**< SCIP data structure */
474    int                   validdepth,         /**< minimal depth level at which the initial conflict set is valid */
475    SCIP_Bool*            success             /**< pointer to store whether a conflict constraint was created, or NULL */
476    );
477 
478 /** analyzes conflict bounds that were added with calls to SCIPaddConflictLb(), SCIPaddConflictUb(),
479  *  SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or
480  *  SCIPaddConflictBinvar(); on success, calls the conflict handlers to create a conflict constraint out of the
481  *  resulting conflict set; the given constraint must be the constraint that detected the conflict, i.e. the constraint
482  *  that is infeasible in the local bounds of the initial conflict set (defined by calls to SCIPaddConflictLb(),
483  *  SCIPaddConflictUb(), SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(),
484  *  SCIPaddConflictRelaxedBd(), and SCIPaddConflictBinvar())
485  *
486  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
487  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
488  *
489  *  @pre This method can be called if SCIP is in one of the following stages:
490  *       - \ref SCIP_STAGE_PRESOLVING
491  *       - \ref SCIP_STAGE_SOLVING
492  *
493  *  @note SCIP stage does not get changed
494  */
495 SCIP_EXPORT
496 SCIP_RETCODE SCIPanalyzeConflictCons(
497    SCIP*                 scip,               /**< SCIP data structure */
498    SCIP_CONS*            cons,               /**< constraint that detected the conflict */
499    SCIP_Bool*            success             /**< pointer to store whether a conflict constraint was created, or NULL */
500    );
501 
502 /**@} */
503 
504 #ifdef __cplusplus
505 }
506 #endif
507 
508 #endif
509