Scippy

SCIP

Solving Constraint Integer Programs

type_conflict.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-2016 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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file type_conflict.h
17  * @ingroup TYPEDEFINITIONS
18  * @brief type definitions for conflict analysis
19  * @author Tobias Achterberg
20  *
21  * This file defines the interface for conflict handler implemented in C.
22  *
23  */
24 
25 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
26 
27 #ifndef __SCIP_TYPE_CONFLICT_H__
28 #define __SCIP_TYPE_CONFLICT_H__
29 
30 #include "scip/def.h"
31 #include "scip/type_retcode.h"
32 #include "scip/type_result.h"
33 #include "scip/type_var.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 typedef struct SCIP_Conflicthdlr SCIP_CONFLICTHDLR; /**< conflict handler to process conflict sets */
40 typedef struct SCIP_ConflicthdlrData SCIP_CONFLICTHDLRDATA; /**< conflict handler data */
41 typedef struct SCIP_ConflictSet SCIP_CONFLICTSET; /**< set of conflicting bound changes */
42 typedef struct SCIP_LPBdChgs SCIP_LPBDCHGS; /**< set of LP bound changes */
43 typedef struct SCIP_Conflict SCIP_CONFLICT; /**< conflict analysis data structure */
44 
45 
46 /** copy method for conflict handler plugins (called when SCIP copies plugins)
47  *
48  * input:
49  * - scip : SCIP main data structure
50  * - conflicthdlr : the conflict handler itself
51  */
52 #define SCIP_DECL_CONFLICTCOPY(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONFLICTHDLR* conflicthdlr)
53 
54 /** destructor of conflict handler to free conflict handler data (called when SCIP is exiting)
55  *
56  * input:
57  * - scip : SCIP main data structure
58  * - conflicthdlr : the conflict handler itself
59  */
60 #define SCIP_DECL_CONFLICTFREE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONFLICTHDLR* conflicthdlr)
61 
62 /** initialization method of conflict handler (called after problem was transformed)
63  *
64  * input:
65  * - scip : SCIP main data structure
66  * - conflicthdlr : the conflict handler itself
67  */
68 #define SCIP_DECL_CONFLICTINIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONFLICTHDLR* conflicthdlr)
69 
70 /** deinitialization method of conflict handler (called before transformed problem is freed)
71  *
72  * input:
73  * - scip : SCIP main data structure
74  * - conflicthdlr : the conflict handler itself
75  */
76 #define SCIP_DECL_CONFLICTEXIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONFLICTHDLR* conflicthdlr)
77 
78 /** solving process initialization method of conflict handler (called when branch and bound process is about to begin)
79  *
80  * This method is called when the presolving was finished and the branch and bound process is about to begin.
81  * The conflict handler may use this call to initialize its branch and bound specific data.
82  *
83  * input:
84  * - scip : SCIP main data structure
85  * - conflicthdlr : the conflict handler itself
86  */
87 #define SCIP_DECL_CONFLICTINITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONFLICTHDLR* conflicthdlr)
88 
89 /** solving process deinitialization method of conflict handler (called before branch and bound process data is freed)
90  *
91  * This method is called before the branch and bound process is freed.
92  * The conflict handler should use this call to clean up its branch and bound data.
93  *
94  * input:
95  * - scip : SCIP main data structure
96  * - conflicthdlr : the conflict handler itself
97  */
98 #define SCIP_DECL_CONFLICTEXITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONFLICTHDLR* conflicthdlr)
99 
100 /** conflict processing method of conflict handler (called when conflict was found)
101  *
102  * This method is called, when the conflict analysis found a conflict on variable bounds.
103  * The conflict handler may update its data accordingly and create a constraint out of the conflict set.
104  * If the parameter "resolved" is set, the conflict handler should not create a constraint, because
105  * a different conflict handler with higher priority already created a constraint.
106  * The bounds in the conflict set lead to a conflict (i.e. an infeasibility) when all enforced at the same time.
107  * Thus, a feasible conflict constraint must demand that at least one of the variables in the conflict
108  * set violates its corresponding bound, i.e., fulfills the negation of the bound change in the conflict set.
109  * For continuous variables, the negation has to be defined in a relaxed way: if, e.g., the bound in the conflict
110  * set is "x <= u", the negation to be used has to be "x >= u", and not "x > u".
111  * The given "bdchginfos" array representing the conflict set is only a reference to an internal
112  * buffer, that may be modified at any time by SCIP. The user must copy the needed information from the
113  * "bdchginfos" array to own data structures, if (s)he wants to use the information later.
114  * (S)he should not keep a pointer to the array or pointers to the single bdchginfos in the array, because these
115  * may get invalid afterwards.
116  *
117  * input:
118  * - scip : SCIP main data structure
119  * - conflicthdlr : the conflict handler itself
120  * - node : node to add resulting conflict constraint to (with SCIPaddConsNode())
121  * - validnode : node at which the conflict constraint is valid (should be passed to SCIPaddConsNode())
122  * - bdchginfos : array with bound changes that lead to a conflict
123  * - relaxedbds : array with relaxed bounds which are efficient to create a valid conflict
124  * - nbdchginfos : number of bound changes in the conflict set
125  * - separate : should the conflict constraint be separated?
126  * - local : is the conflict set only valid locally, i.e., should the constraint be created as local constraint?
127  * - dynamic : should the conflict constraint be made subject to aging?
128  * - removable : should the conflict's relaxation be made subject to LP aging and cleanup?
129  * - resolved : is the conflict set already used to create a constraint?
130  * - result : pointer to store the result of the conflict processing call
131  *
132  * possible return values for *result:
133  * - SCIP_CONSADDED : the conflict handler created a constraint out of the conflict set
134  * - SCIP_DIDNOTFIND : the conflict handler could not create a constraint out of the conflict set
135  * - SCIP_DIDNOTRUN : the conflict handler was skipped
136  */
137 #define SCIP_DECL_CONFLICTEXEC(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONFLICTHDLR* conflicthdlr, SCIP_NODE* node, \
138  SCIP_NODE* validnode, SCIP_BDCHGINFO** bdchginfos, SCIP_Real* relaxedbds, int nbdchginfos, \
139  SCIP_Bool separate, SCIP_Bool local, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool resolved, SCIP_RESULT* result)
140 
141 #ifdef __cplusplus
142 }
143 #endif
144 
145 #endif
type definitions for return codes for SCIP methods
struct SCIP_ConflicthdlrData SCIP_CONFLICTHDLRDATA
Definition: type_conflict.h:40
type definitions for problem variables
result codes for SCIP callback methods
common defines and data types used in all packages of SCIP