Scippy

SCIP

Solving Constraint Integer Programs

scip_benders.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-2019 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 scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_benders.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for Benders decomposition
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 Robert Lion Gottwald
27  */
28 
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
30 
31 #ifndef __SCIP_SCIP_BENDERS_H__
32 #define __SCIP_SCIP_BENDERS_H__
33 
34 
35 #include "scip/def.h"
36 #include "scip/type_benderscut.h"
37 #include "scip/type_benders.h"
38 #include "scip/type_cons.h"
39 #include "scip/type_lp.h"
40 #include "scip/type_misc.h"
41 #include "scip/type_result.h"
42 #include "scip/type_retcode.h"
43 #include "scip/type_scip.h"
44 #include "scip/type_sol.h"
45 #include "scip/type_var.h"
46 
47 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
48  * this structure except the interface methods in scip.c.
49  * In optimized mode, the structure is included in scip.h, because some of the methods
50  * are implemented as defines for performance reasons (e.g. the numerical comparisons).
51  * Additionally, the internal "set.h" is included, such that the defines in set.h are
52  * available in optimized mode.
53  */
54 #ifdef NDEBUG
55 #include "scip/struct_scip.h"
56 #include "scip/struct_stat.h"
57 #include "scip/set.h"
58 #include "scip/tree.h"
59 #include "scip/misc.h"
60 #include "scip/var.h"
61 #include "scip/cons.h"
62 #include "scip/solve.h"
63 #include "scip/debug.h"
64 #endif
65 
66 #ifdef __cplusplus
67 extern "C" {
68 #endif
69 
70 /**@addtogroup PublicBendersMethods
71  *
72  * @{
73  */
74 
75 /** creates a Benders' decomposition and includes it in SCIP
76  *
77  * To use the Benders' decomposition for solving a problem, it first has to be activated with a call to SCIPactivateBenders().
78  * This should be done during the problem creation stage.
79  *
80  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
81  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
82  *
83  * @pre This method can be called if SCIP is in one of the following stages:
84  * - \ref SCIP_STAGE_INIT
85  * - \ref SCIP_STAGE_PROBLEM
86  *
87  * @note method has all Benders' decomposition callbacks as arguments and is thus changed every time a new callback is
88  * added in future releases; consider using SCIPincludeBendersBasic() and setter functions
89  * if you seek for a method which is less likely to change in future releases
90  */
91 extern
93  SCIP* scip, /**< SCIP data structure */
94  const char* name, /**< name of Benders' decomposition */
95  const char* desc, /**< description of Benders' decomposition */
96  int priority, /**< priority of the Benders' decomposition */
97  SCIP_Bool cutlp, /**< should Benders' cuts be generated for LP solutions */
98  SCIP_Bool cutpseudo, /**< should Benders' cuts be generated for pseudo solutions */
99  SCIP_Bool cutrelax, /**< should Benders' cuts be generated for relaxation solutions */
100  SCIP_Bool shareauxvars, /**< should this Benders' use the highest priority Benders aux vars */
101  SCIP_DECL_BENDERSCOPY ((*benderscopy)), /**< copy method of Benders' decomposition or NULL if you don't want to copy your plugin into sub-SCIPs */
102  SCIP_DECL_BENDERSFREE ((*bendersfree)), /**< destructor of Benders' decomposition */
103  SCIP_DECL_BENDERSINIT ((*bendersinit)), /**< initialize Benders' decomposition */
104  SCIP_DECL_BENDERSEXIT ((*bendersexit)), /**< deinitialize Benders' decomposition */
105  SCIP_DECL_BENDERSINITPRE((*bendersinitpre)),/**< presolving initialization method for Benders' decomposition */
106  SCIP_DECL_BENDERSEXITPRE((*bendersexitpre)),/**< presolving deinitialization method for Benders' decomposition */
107  SCIP_DECL_BENDERSINITSOL((*bendersinitsol)),/**< solving process initialization method of Benders' decomposition */
108  SCIP_DECL_BENDERSEXITSOL((*bendersexitsol)),/**< solving process deinitialization method of Benders' decomposition */
109  SCIP_DECL_BENDERSGETVAR((*bendersgetvar)),/**< returns the master variable for a given subproblem variable */
110  SCIP_DECL_BENDERSCREATESUB((*benderscreatesub)),/**< creates a Benders' decomposition subproblem */
111  SCIP_DECL_BENDERSPRESUBSOLVE((*benderspresubsolve)),/**< the execution method of the Benders' decomposition algorithm */
112  SCIP_DECL_BENDERSSOLVESUBCONVEX((*benderssolvesubconvex)),/**< the solving method for convex Benders' decomposition subproblems */
113  SCIP_DECL_BENDERSSOLVESUB((*benderssolvesub)),/**< the solving method for the Benders' decomposition subproblems */
114  SCIP_DECL_BENDERSPOSTSOLVE((*benderspostsolve)),/**< called after the subproblems are solved. */
115  SCIP_DECL_BENDERSFREESUB((*bendersfreesub)),/**< the freeing method for the Benders' decomposition subproblems */
116  SCIP_BENDERSDATA* bendersdata /**< Benders' decomposition data */
117  );
118 
119 /** creates a Benders' decomposition and includes it in SCIP with all non-fundamental callbacks set to NULL
120  *
121  * If needed, the non-fundamental callbacks can be added afterwards via setter functions SCIPsetBendersCopy(),
122  * SCIPsetBendersFree(), SCIPsetBendersInity(), SCIPsetBendersExit(), SCIPsetBendersInitsol(), SCIPsetBendersExitsol(),
123  * SCIPsetBendersFarkas().
124  *
125  * To use the Benders' decomposition for solving a problem, it first has to be activated with a call to SCIPactivateBenders().
126  * This should be done during the problem creation stage.
127  *
128  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
129  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
130  *
131  * @pre This method can be called if SCIP is in one of the following stages:
132  * - \ref SCIP_STAGE_INIT
133  * - \ref SCIP_STAGE_PROBLEM
134  *
135  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeBenders() instead
136  */
137 extern
139  SCIP* scip, /**< SCIP data structure */
140  SCIP_BENDERS** bendersptr, /**< reference to a benders, or NULL */
141  const char* name, /**< name of Benders' decomposition */
142  const char* desc, /**< description of Benders' decomposition */
143  int priority, /**< priority of the Benders' decomposition */
144  SCIP_Bool cutlp, /**< should Benders' cuts be generated for LP solutions */
145  SCIP_Bool cutpseudo, /**< should Benders' cuts be generated for pseudo solutions */
146  SCIP_Bool cutrelax, /**< should Benders' cuts be generated for relaxation solutions */
147  SCIP_Bool shareauxvars, /**< should this Benders' use the highest priority Benders aux vars */
148  SCIP_DECL_BENDERSGETVAR((*bendersgetvar)),/**< returns the master variable for a given subproblem variable */
149  SCIP_DECL_BENDERSCREATESUB((*benderscreatesub)),/**< creates a Benders' decomposition subproblem */
150  SCIP_BENDERSDATA* bendersdata /**< Benders' decomposition data */
151  );
152 
153 /** sets copy method of benders
154  *
155  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
156  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
157  *
158  * @pre This method can be called if SCIP is in one of the following stages:
159  * - \ref SCIP_STAGE_INIT
160  * - \ref SCIP_STAGE_PROBLEM
161  */
162 extern
164  SCIP* scip, /**< SCIP data structure */
165  SCIP_BENDERS* benders, /**< Benders' decomposition */
166  SCIP_DECL_BENDERSCOPY((*benderscopy)) /**< copy method of Benders' decomposition or NULL if you don't want to copy your plugin into sub-SCIPs */
167  );
168 
169 /** sets destructor method of benders
170  *
171  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
172  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
173  *
174  * @pre This method can be called if SCIP is in one of the following stages:
175  * - \ref SCIP_STAGE_INIT
176  * - \ref SCIP_STAGE_PROBLEM
177  */
178 extern
180  SCIP* scip, /**< SCIP data structure */
181  SCIP_BENDERS* benders, /**< Benders' decomposition */
182  SCIP_DECL_BENDERSFREE((*bendersfree)) /**< destructor of Benders' decomposition */
183  );
184 
185 /** sets initialization method of benders
186  *
187  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
188  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
189  *
190  * @pre This method can be called if SCIP is in one of the following stages:
191  * - \ref SCIP_STAGE_INIT
192  * - \ref SCIP_STAGE_PROBLEM
193  */
194 extern
196  SCIP* scip, /**< SCIP data structure */
197  SCIP_BENDERS* benders, /**< Benders' decomposition */
198  SCIP_DECL_BENDERSINIT ((*bendersinit)) /**< initialize Benders' decomposition */
199  );
200 
201 /** sets deinitialization method of benders
202  *
203  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
204  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
205  *
206  * @pre This method can be called if SCIP is in one of the following stages:
207  * - \ref SCIP_STAGE_INIT
208  * - \ref SCIP_STAGE_PROBLEM
209  */
210 extern
212  SCIP* scip, /**< SCIP data structure */
213  SCIP_BENDERS* benders, /**< Benders' decomposition */
214  SCIP_DECL_BENDERSEXIT ((*bendersexit)) /**< deinitialize Benders' decomposition */
215  );
216 
217 /** sets presolving initialization method of benders
218  *
219  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
220  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
221  *
222  * @pre This method can be called if SCIP is in one of the following stages:
223  * - \ref SCIP_STAGE_INIT
224  * - \ref SCIP_STAGE_PROBLEM
225  */
226 extern
228  SCIP* scip, /**< SCIP data structure */
229  SCIP_BENDERS* benders, /**< Benders' decomposition */
230  SCIP_DECL_BENDERSINITPRE((*bendersinitpre))/**< presolving initialization method of Benders' decomposition */
231  );
232 
233 /** sets presolving deinitialization method of benders
234  *
235  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
236  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
237  *
238  * @pre This method can be called if SCIP is in one of the following stages:
239  * - \ref SCIP_STAGE_INIT
240  * - \ref SCIP_STAGE_PROBLEM
241  */
242 extern
244  SCIP* scip, /**< SCIP data structure */
245  SCIP_BENDERS* benders, /**< Benders' decomposition */
246  SCIP_DECL_BENDERSEXITPRE((*bendersexitpre))/**< presolving deinitialization method of Benders' decomposition */
247  );
248 
249 /** sets solving process initialization method of benders
250  *
251  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
252  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
253  *
254  * @pre This method can be called if SCIP is in one of the following stages:
255  * - \ref SCIP_STAGE_INIT
256  * - \ref SCIP_STAGE_PROBLEM
257  */
258 extern
260  SCIP* scip, /**< SCIP data structure */
261  SCIP_BENDERS* benders, /**< Benders' decomposition */
262  SCIP_DECL_BENDERSINITSOL((*bendersinitsol))/**< solving process initialization method of Benders' decomposition */
263  );
264 
265 /** sets solving process deinitialization method of benders
266  *
267  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
268  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
269  *
270  * @pre This method can be called if SCIP is in one of the following stages:
271  * - \ref SCIP_STAGE_INIT
272  * - \ref SCIP_STAGE_PROBLEM
273  */
274 extern
276  SCIP* scip, /**< SCIP data structure */
277  SCIP_BENDERS* benders, /**< Benders' decomposition */
278  SCIP_DECL_BENDERSEXITSOL((*bendersexitsol))/**< solving process deinitialization method of Benders' decomposition */
279  );
280 
281 /** sets the method called prior to solving the subproblems for benders
282  *
283  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
284  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
285  *
286  * @pre This method can be called if SCIP is in one of the following stages:
287  * - \ref SCIP_STAGE_INIT
288  * - \ref SCIP_STAGE_PROBLEM
289  */
290 extern
292  SCIP* scip, /**< SCIP data structure */
293  SCIP_BENDERS* benders, /**< Benders' decomposition */
294  SCIP_DECL_BENDERSPRESUBSOLVE((*benderspresubsolve))/**< method called prior to solving the subproblems */
295  );
296 
297 /** sets the subproblem solving and freeing methods for Benders' decomposition
298  *
299  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
300  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
301  *
302  * @pre This method can be called if SCIP is in one of the following stages:
303  * - \ref SCIP_STAGE_INIT
304  * - \ref SCIP_STAGE_PROBLEM
305  */
306 extern
308  SCIP* scip, /**< SCIP data structure */
309  SCIP_BENDERS* benders, /**< Benders' decomposition */
310  SCIP_DECL_BENDERSSOLVESUBCONVEX((*benderssolvesubconvex)),/**< the solving method for convex Benders' decomposition subproblems */
311  SCIP_DECL_BENDERSSOLVESUB((*benderssolvesub)),/**< solving method for a Benders' decomposition subproblem */
312  SCIP_DECL_BENDERSFREESUB((*bendersfreesub))/**< the subproblem freeing method for Benders' decomposition */
313  );
314 
315 /** sets the post solving methods for benders
316  *
317  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
318  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
319  *
320  * @pre This method can be called if SCIP is in one of the following stages:
321  * - \ref SCIP_STAGE_INIT
322  * - \ref SCIP_STAGE_PROBLEM
323  */
324 extern
326  SCIP* scip, /**< SCIP data structure */
327  SCIP_BENDERS* benders, /**< Benders' decomposition */
328  SCIP_DECL_BENDERSPOSTSOLVE((*benderspostsolve))/**< solving process deinitialization method of Benders' decomposition */
329  );
330 
331 /** returns the Benders' decomposition of the given name, or NULL if not existing */
332 extern
334  SCIP* scip, /**< SCIP data structure */
335  const char* name /**< name of Benders' decomposition */
336  );
337 
338 /** returns the array of currently available Benders' decomposition; active Benders' decomposition are in the first
339  * slots of the array
340  */
341 extern
343  SCIP* scip /**< SCIP data structure */
344  );
345 
346 /** returns the number of currently available Benders' decomposition */
347 extern
348 int SCIPgetNBenders(
349  SCIP* scip /**< SCIP data structure */
350  );
351 
352 /** returns the number of currently active Benders' decomposition */
354  SCIP* scip /**< SCIP data structure */
355  );
356 
357 /** activates the Benders' decomposition to be used for the current problem
358  *
359  * This method should be called during the problem creation stage for all pricers that are necessary to solve
360  * the problem model.
361  *
362  * @note The Benders' decompositions are automatically deactivated when the problem is freed.
363  *
364  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
365  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
366  *
367  * @pre This method can be called if SCIP is in one of the following stages:
368  * - \ref SCIP_STAGE_PROBLEM
369  */
371  SCIP* scip, /**< SCIP data structure */
372  SCIP_BENDERS* benders, /**< the Benders' decomposition structure */
373  int nsubproblems /**< the number of subproblems in the Benders' decomposition */
374  );
375 
376 /** deactivates the Benders' decomposition
377  *
378  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
379  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
380  *
381  * @pre This method can be called if SCIP is in one of the following stages:
382  * - \ref SCIP_STAGE_PROBLEM
383  * - \ref SCIP_STAGE_EXITSOLVE
384  */
386  SCIP* scip, /**< SCIP data structure */
387  SCIP_BENDERS* benders /**< the Benders' decomposition structure */
388  );
389 
390 /** sets the priority of a Benders' decomposition */
391 extern
393  SCIP* scip, /**< SCIP data structure */
394  SCIP_BENDERS* benders, /**< Benders' decomposition */
395  int priority /**< new priority of the Benders' decomposition */
396  );
397 
398 /** calls the exec method of Benders' decomposition to solve the subproblems
399  *
400  * The checkint flag indicates whether integer feasibility can be assumed. If it is not assumed, i.e. checkint ==
401  * FALSE, then only the convex relaxations of the subproblems are solved. If integer feasibility is assumed, i.e.
402  * checkint == TRUE, then the convex relaxations and the full CIP are solved to generate Benders' cuts and check
403  * solution feasibility.
404  *
405  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
406  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
407  *
408  * @pre This method can be called if SCIP is in one of the following stages:
409  * - \ref SCIP_STAGE_INITPRESOLVE
410  * - \ref SCIP_STAGE_PRESOLVING
411  * - \ref SCIP_STAGE_EXITPRESOLVE
412  * - \ref SCIP_STAGE_PRESOLVED
413  * - \ref SCIP_STAGE_INITSOLVE
414  * - \ref SCIP_STAGE_SOLVING
415  * - \ref SCIP_STAGE_SOLVED
416  */
417 extern
419  SCIP* scip, /**< SCIP data structure */
420  SCIP_BENDERS* benders, /**< Benders' decomposition */
421  SCIP_SOL* sol, /**< primal CIP solution, can be NULL */
422  SCIP_RESULT* result, /**< result of the pricing process */
423  SCIP_Bool* infeasible, /**< is the master problem infeasible with respect to the Benders' cuts? */
424  SCIP_Bool* auxviol, /**< set to TRUE only if the solution is feasible but the aux vars are violated */
425  SCIP_BENDERSENFOTYPE type, /**< the type of solution being enforced */
426  SCIP_Bool checkint /**< should the integer solution be checked by the subproblems */
427  );
428 
429 /** returns the master problem variable for the given subproblem variable
430  *
431  * This function is used as part of the cut generation process.
432  *
433  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
434  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
435  *
436  * @pre This method can be called if SCIP is in one of the following stages:
437  * - \ref SCIP_STAGE_INITPRESOLVE
438  * - \ref SCIP_STAGE_PRESOLVING
439  * - \ref SCIP_STAGE_EXITPRESOLVE
440  * - \ref SCIP_STAGE_PRESOLVED
441  * - \ref SCIP_STAGE_INITSOLVE
442  * - \ref SCIP_STAGE_SOLVING
443  * - \ref SCIP_STAGE_SOLVED
444  */
445 extern
447  SCIP* scip, /**< SCIP data structure */
448  SCIP_BENDERS* benders, /**< Benders' decomposition */
449  SCIP_VAR* var, /**< the subproblem variable */
450  SCIP_VAR** mappedvar /**< pointer to store the master variable that var is mapped to */
451  );
452 
453 /** returns the subproblem problem variable for the given master variable
454  *
455  * This function is used as part of the cut generation process.
456  *
457  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
458  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
459  *
460  * @pre This method can be called if SCIP is in one of the following stages:
461  * - \ref SCIP_STAGE_INITPRESOLVE
462  * - \ref SCIP_STAGE_PRESOLVING
463  * - \ref SCIP_STAGE_EXITPRESOLVE
464  * - \ref SCIP_STAGE_PRESOLVED
465  * - \ref SCIP_STAGE_INITSOLVE
466  * - \ref SCIP_STAGE_SOLVING
467  * - \ref SCIP_STAGE_SOLVED
468  */
469 extern
471  SCIP* scip, /**< SCIP data structure */
472  SCIP_BENDERS* benders, /**< Benders' decomposition */
473  SCIP_VAR* var, /**< the master variable */
474  SCIP_VAR** mappedvar, /**< pointer to store the subproblem variable that var is mapped to */
475  int probnumber /**< the subproblem number */
476  );
477 
478 /** returns the number of subproblems that are stored in the given Benders' decomposition
479  *
480  * @return the number of subproblems in the Benders' decomposition
481  */
482 extern
484  SCIP* scip, /**< SCIP data structure */
485  SCIP_BENDERS* benders /**< Benders' decomposition */
486  );
487 
488 /** registers the Benders' decomposition subproblem with the Benders' decomposition struct.
489  *
490  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
491  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
492  *
493  * @pre This method can be called if SCIP is in one of the following stages:
494  * - \ref SCIP_STAGE_INIT
495  * - \ref SCIP_STAGE_PROBLEM
496  */
497 extern
499  SCIP* scip, /**< SCIP data structure */
500  SCIP_BENDERS* benders, /**< Benders' decomposition */
501  SCIP* subproblem /**< Benders' decomposition subproblem */
502  );
503 
504 /** calls the generic subproblem setup method for a Benders' decomposition subproblem
505  *
506  * This is called if the user requires to solve the Benders' decomposition subproblem separately from the main Benders'
507  * solving loop. This could be in the case of enhancement techniques.
508  *
509  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
510  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
511  *
512  * @pre This method can be called if SCIP is in one of the following stages:
513  * - \ref SCIP_STAGE_INITPRESOLVE
514  * - \ref SCIP_STAGE_PRESOLVING
515  * - \ref SCIP_STAGE_EXITPRESOLVE
516  * - \ref SCIP_STAGE_PRESOLVED
517  * - \ref SCIP_STAGE_INITSOLVE
518  * - \ref SCIP_STAGE_SOLVING
519  * - \ref SCIP_STAGE_SOLVED
520  */
521 extern
523  SCIP* scip, /**< SCIP data structure */
524  SCIP_BENDERS* benders, /**< the Benders' decomposition data structure */
525  SCIP_SOL* sol, /**< primal solution used to setup tht problem, NULL for LP solution */
526  int probnumber /**< the subproblem number */
527  );
528 
529 /** calls the solving method for a single Benders' decomposition subproblem
530  *
531  * The method either calls the users solve subproblem method or calls the generic method. In the case of the generic
532  * method, the user must set up the subproblem prior to calling this method.
533  *
534  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
535  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
536  *
537  * @pre This method can be called if SCIP is in one of the following stages:
538  * - \ref SCIP_STAGE_INITPRESOLVE
539  * - \ref SCIP_STAGE_PRESOLVING
540  * - \ref SCIP_STAGE_EXITPRESOLVE
541  * - \ref SCIP_STAGE_PRESOLVED
542  * - \ref SCIP_STAGE_INITSOLVE
543  * - \ref SCIP_STAGE_SOLVING
544  * - \ref SCIP_STAGE_SOLVED
545  */
546 extern
548  SCIP* scip, /**< SCIP data structure */
549  SCIP_BENDERS* benders, /**< Benders' decomposition */
550  SCIP_SOL* sol, /**< primal CIP solution, can be NULL for the current LP/Pseudo solution */
551  int probnumber, /**< the subproblem number */
552  SCIP_Bool* infeasible, /**< returns whether the current subproblem is infeasible */
553  SCIP_BENDERSENFOTYPE type, /**< the enforcement type calling this function */
554  SCIP_Bool solvecip, /**< directly solve the CIP subproblem */
555  SCIP_Real* objective /**< the objective function value of the subproblem, can be NULL */
556  );
557 
558 /** frees the subproblem after calling the solve subproblem method
559  *
560  * This will either call the user defined free
561  * subproblem callback for Benders' decomposition or the default freeing methods. In the default case, if the
562  * subproblem is an LP, then SCIPendProbing is called. If the subproblem is a MIP, then SCIPfreeTransform is called.
563  *
564  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
565  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
566  *
567  * @pre This method can be called if SCIP is in one of the following stages:
568  * - \ref SCIP_STAGE_INITPRESOLVE
569  * - \ref SCIP_STAGE_PRESOLVING
570  * - \ref SCIP_STAGE_EXITPRESOLVE
571  * - \ref SCIP_STAGE_PRESOLVED
572  * - \ref SCIP_STAGE_INITSOLVE
573  * - \ref SCIP_STAGE_SOLVING
574  * - \ref SCIP_STAGE_SOLVED
575  * - \ref SCIP_STAGE_EXITSOLVE
576  * - \ref SCIP_STAGE_FREETRANS
577  */
578 extern
580  SCIP* scip, /**< SCIP data structure */
581  SCIP_BENDERS* benders, /**< Benders' decomposition */
582  int probnumber /**< the subproblem number */
583  );
584 
585 /** checks the optimality of a Benders' decomposition subproblem by comparing the objective function value against the
586  * value of the corresponding auxiliary variable
587  *
588  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
589  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
590  *
591  * @pre This method can be called if SCIP is in one of the following stages:
592  * - \ref SCIP_STAGE_PRESOLVING
593  * - \ref SCIP_STAGE_SOLVING
594  * - \ref SCIP_STAGE_SOLVED
595  *
596  * @pre This method can be called if requested subproblem is in one of the following stages:
597  * - \ref SCIP_STAGE_SOLVING
598  * - \ref SCIP_STAGE_SOLVED
599  */
600 extern
602  SCIP* scip, /**< SCIP data structure */
603  SCIP_BENDERS* benders, /**< the benders' decomposition structure */
604  SCIP_SOL* sol, /**< primal CIP solution, can be NULL for the current LP solution */
605  int probnumber, /**< the number of the pricing problem */
606  SCIP_Bool* optimal /**< flag to indicate whether the current subproblem is optimal for the master */
607  );
608 
609 /** returns the value of the auxiliary variable for a given subproblem */
610 extern
612  SCIP* scip, /**< SCIP data structure */
613  SCIP_BENDERS* benders, /**< the benders' decomposition structure */
614  SCIP_SOL* sol, /**< primal CIP solution, can be NULL for the current LP solution */
615  int probnumber /**< the number of the pricing problem */
616  );
617 
618 /** solves an independent subproblem to identify its lower bound and updates the lower bound of the corresponding
619  * auxiliary variable
620  *
621  * @pre This method can be called if SCIP is in one of the following stages:
622  * - \ref SCIP_STAGE_INITPRESOLVE
623  * - \ref SCIP_STAGE_PRESOLVING
624  * - \ref SCIP_STAGE_EXITPRESOLVE
625  * - \ref SCIP_STAGE_PRESOLVED
626  * - \ref SCIP_STAGE_INITSOLVE
627  * - \ref SCIP_STAGE_SOLVING
628  *
629  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
630  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
631  */
633  SCIP* scip, /**< the SCIP data structure */
634  SCIP_BENDERS* benders, /**< Benders' decomposition */
635  int probnumber, /**< the subproblem to be evaluated */
636  SCIP_Real* lowerbound, /**< the lowerbound for the subproblem */
637  SCIP_Bool* infeasible /**< was the subproblem found to be infeasible? */
638  );
639 
640 /** merges a subproblem into the master problem.
641  *
642  * This process just adds a copy of the subproblem variables and constraints to the master problem, but keeps the
643  * subproblem stored in the Benders' decomposition data structure. The reason for keeping the subproblem available is
644  * for when it is queried for solutions after the problem is solved.
645  *
646  * Once the subproblem is merged into the master problem, then the subproblem is flagged as disabled. This means that
647  * it will not be solved in the subsequent subproblem solving loops.
648  *
649  * The associated auxiliary variables are kept in the master problem. The objective function of the merged subproblem
650  * is added as an underestimator constraint.
651  *
652  * @pre This method can be called if SCIP is in one of the following stages:
653  * - \ref SCIP_STAGE_INITPRESOLVE
654  * - \ref SCIP_STAGE_PRESOLVING
655  * - \ref SCIP_STAGE_EXITPRESOLVE
656  * - \ref SCIP_STAGE_PRESOLVED
657  * - \ref SCIP_STAGE_INITSOLVE
658  * - \ref SCIP_STAGE_SOLVING
659  *
660  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
661  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
662  */
663 extern
665  SCIP* scip, /**< the SCIP data structure */
666  SCIP_BENDERS* benders, /**< Benders' decomposition */
667  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of subproblem variables corresponding
668  * to the newly created master variables, or NULL */
669  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of subproblem constraints to the
670  corresponding newly created constraints, or NULL */
671  int probnumber /**< the number of the subproblem that will be merged into the master problem*/
672  );
673 
674 /* @} */
675 
676 /**@addtogroup PublicBenderscutsMethods
677  *
678  * @{
679  */
680 
681 /** creates a Benders' cut algorithms and includes it in the associated Benders' decomposition
682  *
683  * This should be called from the SCIPincludeBendersXyz for the associated Benders' decomposition. It is only possible
684  * to include a Benders' cut algorithm if a Benders' decomposition has already been included
685  * This should be done during the problem creation stage.
686  *
687  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
688  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
689  *
690  * @pre This method can be called if SCIP is in one of the following stages:
691  * - \ref SCIP_STAGE_INIT
692  * - \ref SCIP_STAGE_PROBLEM
693  *
694  * @note method has all Benders' decomposition callbacks as arguments and is thus changed every time a new callback is
695  * added in future releases; consider using SCIPincludeBendersBasic() and setter functions
696  * if you seek for a method which is less likely to change in future releases
697  */
698 extern
700  SCIP* scip, /**< SCIP data structure */
701  SCIP_BENDERS* benders, /**< Benders' decomposition */
702  const char* name, /**< name of Benders' decomposition cuts */
703  const char* desc, /**< description of Benders' decomposition cuts */
704  int priority, /**< priority of the Benders' decomposition cuts */
705  SCIP_Bool islpcut, /**< indicates whether the cut is generated from the LP solution */
706  SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)),/**< copy method of Benders' decomposition cuts or NULL if you don't want to copy your plugin into sub-SCIPs */
707  SCIP_DECL_BENDERSCUTFREE((*benderscutfree)),/**< destructor of Benders' decomposition cuts */
708  SCIP_DECL_BENDERSCUTINIT((*benderscutinit)),/**< initialize Benders' decomposition cuts */
709  SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)),/**< deinitialize Benders' decomposition cuts */
710  SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)),/**< solving process initialization method of Benders' decomposition cuts */
711  SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)),/**< solving process deinitialization method of Benders' decomposition cuts */
712  SCIP_DECL_BENDERSCUTEXEC((*benderscutexec)),/**< execution method of Benders' decomposition cuts */
713  SCIP_BENDERSCUTDATA* benderscutdata /**< Benders' decomposition cuts data */
714  );
715 
716 /** creates a Benders' cut and includes it an associated Benders' decomposition with all non-fundamental callbacks set to NULL
717  *
718  * If needed, the non-fundamental callbacks can be added afterwards via setter functions SCIPsetBenderscutCopy(),
719  * SCIPsetBenderscutFree(), SCIPsetBenderscutInit(), SCIPsetBenderscutExit(), SCIPsetBenderscutInitsol(),
720  * SCIPsetBenderscutExitsol().
721  *
722  * This should be done during the problem creation stage.
723  *
724  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
725  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
726  *
727  * @pre This method can be called if SCIP is in one of the following stages:
728  * - \ref SCIP_STAGE_INIT
729  * - \ref SCIP_STAGE_PROBLEM
730  *
731  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeBenders() instead
732  */
733 extern
735  SCIP* scip, /**< SCIP data structure */
736  SCIP_BENDERS* benders, /**< Benders' decomposition */
737  SCIP_BENDERSCUT** benderscutptr, /**< reference to a Benders' decomposition cut, or NULL */
738  const char* name, /**< name of Benders' decomposition */
739  const char* desc, /**< description of Benders' decomposition */
740  int priority, /**< priority of the Benders' decomposition */
741  SCIP_Bool islpcut, /**< indicates whether the cut is generated from the LP solution */
742  SCIP_DECL_BENDERSCUTEXEC((*benderscutexec)),/**< the execution method of the Benders' cut algorithm */
743  SCIP_BENDERSCUTDATA* benderscutdata /**< Benders' cut data */
744  );
745 
746 /** sets copy method of Benders' decomposition cut
747  *
748  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
749  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
750  *
751  * @pre This method can be called if SCIP is in one of the following stages:
752  * - \ref SCIP_STAGE_INIT
753  * - \ref SCIP_STAGE_PROBLEM
754  */
755 extern
757  SCIP* scip, /**< SCIP data structure */
758  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
759  SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy))/**< copy method of benderscut or NULL if you don't want to copy your plugin into sub-SCIPs */
760  );
761 
762 /** sets destructor method of benderscut
763  *
764  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
765  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
766  *
767  * @pre This method can be called if SCIP is in one of the following stages:
768  * - \ref SCIP_STAGE_INIT
769  * - \ref SCIP_STAGE_PROBLEM
770  */
771 extern
773  SCIP* scip, /**< SCIP data structure */
774  SCIP_BENDERSCUT* benderscut, /**< benderscut */
775  SCIP_DECL_BENDERSCUTFREE((*benderscutfree))/**< destructor of benderscut */
776  );
777 
778 /** sets initialization method of benderscut
779  *
780  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
781  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
782  *
783  * @pre This method can be called if SCIP is in one of the following stages:
784  * - \ref SCIP_STAGE_INIT
785  * - \ref SCIP_STAGE_PROBLEM
786  */
787 extern
789  SCIP* scip, /**< SCIP data structure */
790  SCIP_BENDERSCUT* benderscut, /**< benderscut */
791  SCIP_DECL_BENDERSCUTINIT((*benderscutinit))/**< initialize benderscut */
792  );
793 
794 /** sets deinitialization method of benderscut
795  *
796  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
797  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
798  *
799  * @pre This method can be called if SCIP is in one of the following stages:
800  * - \ref SCIP_STAGE_INIT
801  * - \ref SCIP_STAGE_PROBLEM
802  */
803 extern
805  SCIP* scip, /**< SCIP data structure */
806  SCIP_BENDERSCUT* benderscut, /**< benderscut */
807  SCIP_DECL_BENDERSCUTEXIT((*benderscutexit))/**< deinitialize benderscut */
808  );
809 
810 /** sets solving process initialization method of benderscut
811  *
812  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
813  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
814  *
815  * @pre This method can be called if SCIP is in one of the following stages:
816  * - \ref SCIP_STAGE_INIT
817  * - \ref SCIP_STAGE_PROBLEM
818  */
819 extern
821  SCIP* scip, /**< SCIP data structure */
822  SCIP_BENDERSCUT* benderscut, /**< benderscut */
823  SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol))/**< solving process initialization method of benderscut */
824  );
825 
826 /** sets solving process deinitialization method of benderscut
827  *
828  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
829  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
830  *
831  * @pre This method can be called if SCIP is in one of the following stages:
832  * - \ref SCIP_STAGE_INIT
833  * - \ref SCIP_STAGE_PROBLEM
834  */
835 extern
837  SCIP* scip, /**< SCIP data structure */
838  SCIP_BENDERSCUT* benderscut, /**< benderscut */
839  SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol))/**< solving process deinitialization method of benderscut */
840  );
841 
842 /** sets the priority of a Benders' decomposition cut algorithm
843  *
844  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
845  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
846  *
847  * @pre This method can be called if SCIP is in one of the following stages:
848  * - \ref SCIP_STAGE_INIT
849  * - \ref SCIP_STAGE_PROBLEM
850  */
851 extern
853  SCIP* scip, /**< SCIP data structure */
854  SCIP_BENDERSCUT* benderscut, /**< benderscut */
855  int priority /**< new priority of the Benders' decomposition */
856  );
857 
858 /** adds the generated cuts to the Benders' cut storage
859  *
860  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
861  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
862  *
863  * @pre This method can be called if SCIP is in one of the following stages:
864  * - \ref SCIP_STAGE_INITPRESOLVE
865  * - \ref SCIP_STAGE_PRESOLVING
866  * - \ref SCIP_STAGE_EXITPRESOLVE
867  * - \ref SCIP_STAGE_PRESOLVED
868  * - \ref SCIP_STAGE_INITSOLVE
869  * - \ref SCIP_STAGE_SOLVING
870  */
871 extern
873  SCIP* scip, /**< the SCIP data structure */
874  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cuts */
875  SCIP_VAR** vars, /**< the variables that have non-zero coefficients in the cut */
876  SCIP_Real* vals, /**< the coefficients of the variables in the cut */
877  SCIP_Real lhs, /**< the left hand side of the cut */
878  SCIP_Real rhs, /**< the right hand side of the cut */
879  int nvars /**< the number of variables with non-zero coefficients in the cut */
880  );
881 
882 /* @} */
883 
884 #ifdef __cplusplus
885 }
886 #endif
887 
888 #endif
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
SCIP_RETCODE SCIPsetBendersPresubsolve(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSPRESUBSOLVE((*benderspresubsolve)))
Definition: scip_benders.c:456
SCIP_RETCODE SCIPsetBendersSolveAndFreesub(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSSOLVESUBCONVEX((*benderssolvesubconvex)), SCIP_DECL_BENDERSSOLVESUB((*benderssolvesub)), SCIP_DECL_BENDERSFREESUB((*bendersfreesub)))
Definition: scip_benders.c:480
#define SCIP_DECL_BENDERSCREATESUB(x)
Definition: type_benders.h:170
SCIP_RETCODE SCIPincludeBenderscutBasic(SCIP *scip, SCIP_BENDERS *benders, SCIP_BENDERSCUT **benderscutptr, const char *name, const char *desc, int priority, SCIP_Bool islpcut, SCIP_DECL_BENDERSCUTEXEC((*benderscutexec)), SCIP_BENDERSCUTDATA *benderscutdata)
SCIP_RETCODE SCIPmergeBendersSubproblemIntoMaster(SCIP *scip, SCIP_BENDERS *benders, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, int probnumber)
SCIP_RETCODE SCIPfreeBendersSubproblem(SCIP *scip, SCIP_BENDERS *benders, int probnumber)
Definition: scip_benders.c:900
void SCIPsetBendersPriority(SCIP *scip, SCIP_BENDERS *benders, int priority)
Definition: scip_benders.c:633
internal methods for branch and bound tree
type definitions for miscellaneous datastructures
struct SCIP_BenderscutData SCIP_BENDERSCUTDATA
#define SCIP_DECL_BENDERSINITSOL(x)
Definition: type_benders.h:130
#define SCIP_DECL_BENDERSFREE(x)
Definition: type_benders.h:82
SCIP_RETCODE SCIPgetBendersMasterVar(SCIP *scip, SCIP_BENDERS *benders, SCIP_VAR *var, SCIP_VAR **mappedvar)
Definition: scip_benders.c:703
#define SCIP_DECL_BENDERSINITPRE(x)
Definition: type_benders.h:111
#define SCIP_DECL_BENDERSCUTFREE(x)
SCIP_RETCODE SCIPsetBendersExitsol(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSEXITSOL((*bendersexitsol)))
Definition: scip_benders.c:432
#define SCIP_DECL_BENDERSGETVAR(x)
Definition: type_benders.h:339
SCIP_RETCODE SCIPsetBendersInit(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSINIT((*bendersinit)))
Definition: scip_benders.c:312
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
enum SCIP_BendersEnfoType SCIP_BENDERSENFOTYPE
Definition: type_benders.h:42
SCIP_RETCODE SCIPincludeBenderscut(SCIP *scip, SCIP_BENDERS *benders, const char *name, const char *desc, int priority, SCIP_Bool islpcut, SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)), SCIP_DECL_BENDERSCUTFREE((*benderscutfree)), SCIP_DECL_BENDERSCUTINIT((*benderscutinit)), SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)), SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)), SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)), SCIP_DECL_BENDERSCUTEXEC((*benderscutexec)), SCIP_BENDERSCUTDATA *benderscutdata)
SCIP_Real SCIPgetBendersAuxiliaryVarVal(SCIP *scip, SCIP_BENDERS *benders, SCIP_SOL *sol, int probnumber)
Definition: scip_benders.c:960
#define SCIP_DECL_BENDERSINIT(x)
Definition: type_benders.h:91
type definitions for return codes for SCIP methods
#define SCIP_DECL_BENDERSCUTEXEC(x)
#define SCIP_DECL_BENDERSCUTCOPY(x)
SCIP_RETCODE SCIPgetBendersSubproblemVar(SCIP *scip, SCIP_BENDERS *benders, SCIP_VAR *var, SCIP_VAR **mappedvar, int probnumber)
Definition: scip_benders.c:739
#define SCIP_DECL_BENDERSCUTINIT(x)
int SCIPgetNActiveBenders(SCIP *scip)
Definition: scip_benders.c:575
type definitions for LP management
SCIP_RETCODE SCIPsetBendersExit(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSEXIT((*bendersexit)))
Definition: scip_benders.c:336
SCIP_RETCODE SCIPcomputeBendersSubproblemLowerbound(SCIP *scip, SCIP_BENDERS *benders, int probnumber, SCIP_Real *lowerbound, SCIP_Bool *infeasible)
Definition: scip_benders.c:988
#define SCIP_DECL_BENDERSFREESUB(x)
Definition: type_benders.h:323
SCIP_RETCODE SCIPincludeBenders(SCIP *scip, const char *name, const char *desc, int priority, SCIP_Bool cutlp, SCIP_Bool cutpseudo, SCIP_Bool cutrelax, SCIP_Bool shareauxvars, SCIP_DECL_BENDERSCOPY((*benderscopy)), SCIP_DECL_BENDERSFREE((*bendersfree)), SCIP_DECL_BENDERSINIT((*bendersinit)), SCIP_DECL_BENDERSEXIT((*bendersexit)), SCIP_DECL_BENDERSINITPRE((*bendersinitpre)), SCIP_DECL_BENDERSEXITPRE((*bendersexitpre)), SCIP_DECL_BENDERSINITSOL((*bendersinitsol)), SCIP_DECL_BENDERSEXITSOL((*bendersexitsol)), SCIP_DECL_BENDERSGETVAR((*bendersgetvar)), SCIP_DECL_BENDERSCREATESUB((*benderscreatesub)), SCIP_DECL_BENDERSPRESUBSOLVE((*benderspresubsolve)), SCIP_DECL_BENDERSSOLVESUBCONVEX((*benderssolvesubconvex)), SCIP_DECL_BENDERSSOLVESUB((*benderssolvesub)), SCIP_DECL_BENDERSPOSTSOLVE((*benderspostsolve)), SCIP_DECL_BENDERSFREESUB((*bendersfreesub)), SCIP_BENDERSDATA *bendersdata)
Definition: scip_benders.c:143
SCIP_RETCODE SCIPsetupBendersSubproblem(SCIP *scip, SCIP_BENDERS *benders, SCIP_SOL *sol, int probnumber)
Definition: scip_benders.c:819
#define SCIP_DECL_BENDERSEXIT(x)
Definition: type_benders.h:100
#define SCIP_DECL_BENDERSSOLVESUB(x)
Definition: type_benders.h:265
type definitions for SCIP&#39;s main datastructure
SCIP_RETCODE SCIPincludeBendersBasic(SCIP *scip, SCIP_BENDERS **bendersptr, const char *name, const char *desc, int priority, SCIP_Bool cutlp, SCIP_Bool cutpseudo, SCIP_Bool cutrelax, SCIP_Bool shareauxvars, SCIP_DECL_BENDERSGETVAR((*bendersgetvar)), SCIP_DECL_BENDERSCREATESUB((*benderscreatesub)), SCIP_BENDERSDATA *bendersdata)
Definition: scip_benders.c:218
internal miscellaneous methods
#define SCIP_DECL_BENDERSCUTEXIT(x)
struct SCIP_BendersData SCIP_BENDERSDATA
Definition: type_benders.h:63
internal methods for global SCIP settings
SCIP main data structure.
SCIP_RETCODE SCIPsetBenderscutExit(SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)))
#define SCIP_DECL_BENDERSSOLVESUBCONVEX(x)
Definition: type_benders.h:232
type definitions for problem variables
SCIP_RETCODE SCIPsetBenderscutPriority(SCIP *scip, SCIP_BENDERSCUT *benderscut, int priority)
internal methods for problem variables
#define SCIP_DECL_BENDERSCOPY(x)
Definition: type_benders.h:74
SCIP_BENDERS * SCIPfindBenders(SCIP *scip, const char *name)
Definition: scip_benders.c:536
#define SCIP_Bool
Definition: def.h:69
SCIP_BENDERS ** SCIPgetBenders(SCIP *scip)
Definition: scip_benders.c:551
methods for debugging
SCIP_RETCODE SCIPsetBendersCopy(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSCOPY((*benderscopy)))
Definition: scip_benders.c:264
SCIP_RETCODE SCIPdeactivateBenders(SCIP *scip, SCIP_BENDERS *benders)
Definition: scip_benders.c:620
SCIP_RETCODE SCIPaddBendersSubproblem(SCIP *scip, SCIP_BENDERS *benders, SCIP *subproblem)
Definition: scip_benders.c:784
datastructures for problem statistics
type definitions for Benders&#39; decomposition methods
SCIP_RETCODE SCIPcheckBendersSubproblemOptimality(SCIP *scip, SCIP_BENDERS *benders, SCIP_SOL *sol, int probnumber, SCIP_Bool *optimal)
Definition: scip_benders.c:934
int SCIPgetNBenders(SCIP *scip)
Definition: scip_benders.c:564
type definitions for storing primal CIP solutions
type definitions for Benders&#39; decomposition cut
SCIP_RETCODE SCIPsetBendersPostsolve(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSPOSTSOLVE((*benderspostsolve)))
Definition: scip_benders.c:520
SCIP_RETCODE SCIPsetBenderscutInit(SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTINIT((*benderscutinit)))
SCIP_RETCODE SCIPsolveBendersSubproblem(SCIP *scip, SCIP_BENDERS *benders, SCIP_SOL *sol, int probnumber, SCIP_Bool *infeasible, SCIP_BENDERSENFOTYPE type, SCIP_Bool solvecip, SCIP_Real *objective)
Definition: scip_benders.c:856
SCIP_RETCODE SCIPsetBendersInitsol(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSINITSOL((*bendersinitsol)))
Definition: scip_benders.c:408
SCIP_RETCODE SCIPsetBenderscutInitsol(SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)))
SCIP_RETCODE SCIPsetBenderscutCopy(SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)))
internal methods for main solving loop and node processing
#define SCIP_DECL_BENDERSEXITSOL(x)
Definition: type_benders.h:141
SCIP_RETCODE SCIPsetBenderscutExitsol(SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)))
SCIP_RETCODE SCIPsetBendersFree(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSFREE((*bendersfree)))
Definition: scip_benders.c:288
#define SCIP_Real
Definition: def.h:157
result codes for SCIP callback methods
#define SCIP_DECL_BENDERSCUTEXITSOL(x)
internal methods for constraints and constraint handlers
SCIP_RETCODE SCIPsetBenderscutFree(SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTFREE((*benderscutfree)))
int SCIPgetBendersNSubproblems(SCIP *scip, SCIP_BENDERS *benders)
Definition: scip_benders.c:765
#define SCIP_DECL_BENDERSPOSTSOLVE(x)
Definition: type_benders.h:301
#define SCIP_DECL_BENDERSEXITPRE(x)
Definition: type_benders.h:119
SCIP_RETCODE SCIPstoreBenderscutCut(SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, int nvars)
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPactivateBenders(SCIP *scip, SCIP_BENDERS *benders, int nsubproblems)
Definition: scip_benders.c:598
SCIP_RETCODE SCIPsetBendersExitpre(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSEXITPRE((*bendersexitpre)))
Definition: scip_benders.c:384
SCIP_RETCODE SCIPsolveBendersSubproblems(SCIP *scip, SCIP_BENDERS *benders, SCIP_SOL *sol, SCIP_RESULT *result, SCIP_Bool *infeasible, SCIP_Bool *auxviol, SCIP_BENDERSENFOTYPE type, SCIP_Bool checkint)
Definition: scip_benders.c:665
SCIP_RETCODE SCIPsetBendersInitpre(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSINITPRE((*bendersinitpre)))
Definition: scip_benders.c:360
#define SCIP_DECL_BENDERSCUTINITSOL(x)
type definitions for constraints and constraint handlers
#define SCIP_DECL_BENDERSPRESUBSOLVE(x)
Definition: type_benders.h:192