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-2017 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 /** types of conflicts */
47 {
48  SCIP_CONFTYPE_UNKNOWN = 0, /**< unknown type */
49  SCIP_CONFTYPE_PROPAGATION = 1, /**< conflict results from propagation */
50  SCIP_CONFTYPE_INFEASLP = 2, /**< conflict results from an infeasible LP relaxation */
51  SCIP_CONFTYPE_BNDEXCEEDING = 3 /**< conflict results from a boundexceeding LP relaxation */
52 };
54 
55 /** copy method for conflict handler plugins (called when SCIP copies plugins)
56  *
57  * input:
58  * - scip : SCIP main data structure
59  * - conflicthdlr : the conflict handler itself
60  */
61 #define SCIP_DECL_CONFLICTCOPY(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONFLICTHDLR* conflicthdlr)
62 
63 /** destructor of conflict handler to free conflict handler data (called when SCIP is exiting)
64  *
65  * input:
66  * - scip : SCIP main data structure
67  * - conflicthdlr : the conflict handler itself
68  */
69 #define SCIP_DECL_CONFLICTFREE(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONFLICTHDLR* conflicthdlr)
70 
71 /** initialization method of conflict handler (called after problem was transformed)
72  *
73  * input:
74  * - scip : SCIP main data structure
75  * - conflicthdlr : the conflict handler itself
76  */
77 #define SCIP_DECL_CONFLICTINIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONFLICTHDLR* conflicthdlr)
78 
79 /** deinitialization method of conflict handler (called before transformed problem is freed)
80  *
81  * input:
82  * - scip : SCIP main data structure
83  * - conflicthdlr : the conflict handler itself
84  */
85 #define SCIP_DECL_CONFLICTEXIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONFLICTHDLR* conflicthdlr)
86 
87 /** solving process initialization method of conflict handler (called when branch and bound process is about to begin)
88  *
89  * This method is called when the presolving was finished and the branch and bound process is about to begin.
90  * The conflict handler may use this call to initialize its branch and bound specific data.
91  *
92  * input:
93  * - scip : SCIP main data structure
94  * - conflicthdlr : the conflict handler itself
95  */
96 #define SCIP_DECL_CONFLICTINITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONFLICTHDLR* conflicthdlr)
97 
98 /** solving process deinitialization method of conflict handler (called before branch and bound process data is freed)
99  *
100  * This method is called before the branch and bound process is freed.
101  * The conflict handler should use this call to clean up its branch and bound data.
102  *
103  * input:
104  * - scip : SCIP main data structure
105  * - conflicthdlr : the conflict handler itself
106  */
107 #define SCIP_DECL_CONFLICTEXITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONFLICTHDLR* conflicthdlr)
108 
109 /** conflict processing method of conflict handler (called when conflict was found)
110  *
111  * This method is called, when the conflict analysis found a conflict on variable bounds.
112  * The conflict handler may update its data accordingly and create a constraint out of the conflict set.
113  * If the parameter "resolved" is set, the conflict handler should not create a constraint, because
114  * a different conflict handler with higher priority already created a constraint.
115  * The bounds in the conflict set lead to a conflict (i.e. an infeasibility) when all enforced at the same time.
116  * Thus, a feasible conflict constraint must demand that at least one of the variables in the conflict
117  * set violates its corresponding bound, i.e., fulfills the negation of the bound change in the conflict set.
118  * For continuous variables, the negation has to be defined in a relaxed way: if, e.g., the bound in the conflict
119  * set is "x <= u", the negation to be used has to be "x >= u", and not "x > u".
120  * The given "bdchginfos" array representing the conflict set is only a reference to an internal
121  * buffer, that may be modified at any time by SCIP. The user must copy the needed information from the
122  * "bdchginfos" array to own data structures, if (s)he wants to use the information later.
123  * (S)he should not keep a pointer to the array or pointers to the single bdchginfos in the array, because these
124  * may get invalid afterwards.
125  *
126  * input:
127  * - scip : SCIP main data structure
128  * - conflicthdlr : the conflict handler itself
129  * - node : node to add resulting conflict constraint to (with SCIPaddConsNode())
130  * - validnode : node at which the conflict constraint is valid (should be passed to SCIPaddConsNode())
131  * - bdchginfos : array with bound changes that lead to a conflict
132  * - relaxedbds : array with relaxed bounds which are efficient to create a valid conflict
133  * - nbdchginfos : number of bound changes in the conflict set
134  * -.primalbound : the current primal bound, or -infininity if the conflict arises from an infeasible LP
135  * - separate : should the conflict constraint be separated?
136  * - local : is the conflict set only valid locally, i.e., should the constraint be created as local constraint?
137  * - dynamic : should the conflict constraint be made subject to aging?
138  * - removable : should the conflict's relaxation be made subject to LP aging and cleanup?
139  * - resolved : is the conflict set already used to create a constraint?
140  * - result : pointer to store the result of the conflict processing call
141  *
142  * possible return values for *result:
143  * - SCIP_CONSADDED : the conflict handler created a constraint out of the conflict set
144  * - SCIP_DIDNOTFIND : the conflict handler could not create a constraint out of the conflict set
145  * - SCIP_DIDNOTRUN : the conflict handler was skipped
146  */
147 #define SCIP_DECL_CONFLICTEXEC(x) SCIP_RETCODE x (SCIP* scip, SCIP_CONFLICTHDLR* conflicthdlr, SCIP_NODE* node, \
148  SCIP_NODE* validnode, SCIP_BDCHGINFO** bdchginfos, SCIP_Real* relaxedbds, int nbdchginfos, SCIP_CONFTYPE conftype, \
149  SCIP_Bool cutoffinvolved, SCIP_Bool separate, SCIP_Bool local, SCIP_Bool dynamic, SCIP_Bool removable, \
150  SCIP_Bool resolved, SCIP_RESULT* result)
151 
152 #ifdef __cplusplus
153 }
154 #endif
155 
156 #endif
type definitions for return codes for SCIP methods
SCIP_ConflictType
Definition: type_conflict.h:46
struct SCIP_ConflicthdlrData SCIP_CONFLICTHDLRDATA
Definition: type_conflict.h:40
type definitions for problem variables
result codes for SCIP callback methods
enum SCIP_ConflictType SCIP_CONFTYPE
Definition: type_conflict.h:53
common defines and data types used in all packages of SCIP