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-2022 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_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 Leona 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 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 /**@addtogroup PublicBendersMethods
52  *
53  * @{
54  */
55 
56 /** creates a Benders' decomposition and includes it in SCIP
57  *
58  * To use the Benders' decomposition for solving a problem, it first has to be activated with a call to SCIPactivateBenders().
59  * This should be done during the problem creation stage.
60  *
61  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
62  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
63  *
64  * @pre This method can be called if SCIP is in one of the following stages:
65  * - \ref SCIP_STAGE_INIT
66  * - \ref SCIP_STAGE_PROBLEM
67  *
68  * @note method has all Benders' decomposition callbacks as arguments and is thus changed every time a new callback is
69  * added in future releases; consider using SCIPincludeBendersBasic() and setter functions
70  * if you seek for a method which is less likely to change in future releases
71  */
72 SCIP_EXPORT
74  SCIP* scip, /**< SCIP data structure */
75  const char* name, /**< name of Benders' decomposition */
76  const char* desc, /**< description of Benders' decomposition */
77  int priority, /**< priority of the Benders' decomposition */
78  SCIP_Bool cutlp, /**< should Benders' cuts be generated for LP solutions */
79  SCIP_Bool cutpseudo, /**< should Benders' cuts be generated for pseudo solutions */
80  SCIP_Bool cutrelax, /**< should Benders' cuts be generated for relaxation solutions */
81  SCIP_Bool shareauxvars, /**< should this Benders' use the highest priority Benders aux vars */
82  SCIP_DECL_BENDERSCOPY ((*benderscopy)), /**< copy method of Benders' decomposition or NULL if you don't want to copy your plugin into sub-SCIPs */
83  SCIP_DECL_BENDERSFREE ((*bendersfree)), /**< destructor of Benders' decomposition */
84  SCIP_DECL_BENDERSINIT ((*bendersinit)), /**< initialize Benders' decomposition */
85  SCIP_DECL_BENDERSEXIT ((*bendersexit)), /**< deinitialize Benders' decomposition */
86  SCIP_DECL_BENDERSINITPRE((*bendersinitpre)),/**< presolving initialization method for Benders' decomposition */
87  SCIP_DECL_BENDERSEXITPRE((*bendersexitpre)),/**< presolving deinitialization method for Benders' decomposition */
88  SCIP_DECL_BENDERSINITSOL((*bendersinitsol)),/**< solving process initialization method of Benders' decomposition */
89  SCIP_DECL_BENDERSEXITSOL((*bendersexitsol)),/**< solving process deinitialization method of Benders' decomposition */
90  SCIP_DECL_BENDERSGETVAR((*bendersgetvar)),/**< returns the master variable for a given subproblem variable */
91  SCIP_DECL_BENDERSCREATESUB((*benderscreatesub)),/**< creates a Benders' decomposition subproblem */
92  SCIP_DECL_BENDERSPRESUBSOLVE((*benderspresubsolve)),/**< the execution method of the Benders' decomposition algorithm */
93  SCIP_DECL_BENDERSSOLVESUBCONVEX((*benderssolvesubconvex)),/**< the solving method for convex Benders' decomposition subproblems */
94  SCIP_DECL_BENDERSSOLVESUB((*benderssolvesub)),/**< the solving method for the Benders' decomposition subproblems */
95  SCIP_DECL_BENDERSPOSTSOLVE((*benderspostsolve)),/**< called after the subproblems are solved. */
96  SCIP_DECL_BENDERSFREESUB((*bendersfreesub)),/**< the freeing method for the Benders' decomposition subproblems */
97  SCIP_BENDERSDATA* bendersdata /**< Benders' decomposition data */
98  );
99 
100 /** creates a Benders' decomposition and includes it in SCIP with all non-fundamental callbacks set to NULL
101  *
102  * If needed, the non-fundamental callbacks can be added afterwards via setter functions SCIPsetBendersCopy(),
103  * SCIPsetBendersFree(), SCIPsetBendersInity(), SCIPsetBendersExit(), SCIPsetBendersInitsol(), SCIPsetBendersExitsol(),
104  * SCIPsetBendersFarkas().
105  *
106  * To use the Benders' decomposition for solving a problem, it first has to be activated with a call to SCIPactivateBenders().
107  * This should be done during the problem creation stage.
108  *
109  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
110  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
111  *
112  * @pre This method can be called if SCIP is in one of the following stages:
113  * - \ref SCIP_STAGE_INIT
114  * - \ref SCIP_STAGE_PROBLEM
115  *
116  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeBenders() instead
117  */
118 SCIP_EXPORT
120  SCIP* scip, /**< SCIP data structure */
121  SCIP_BENDERS** bendersptr, /**< reference to a benders, or NULL */
122  const char* name, /**< name of Benders' decomposition */
123  const char* desc, /**< description of Benders' decomposition */
124  int priority, /**< priority of the Benders' decomposition */
125  SCIP_Bool cutlp, /**< should Benders' cuts be generated for LP solutions */
126  SCIP_Bool cutpseudo, /**< should Benders' cuts be generated for pseudo solutions */
127  SCIP_Bool cutrelax, /**< should Benders' cuts be generated for relaxation solutions */
128  SCIP_Bool shareauxvars, /**< should this Benders' use the highest priority Benders aux vars */
129  SCIP_DECL_BENDERSGETVAR((*bendersgetvar)),/**< returns the master variable for a given subproblem variable */
130  SCIP_DECL_BENDERSCREATESUB((*benderscreatesub)),/**< creates a Benders' decomposition subproblem */
131  SCIP_BENDERSDATA* bendersdata /**< Benders' decomposition data */
132  );
133 
134 /** sets copy method of benders
135  *
136  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
137  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
138  *
139  * @pre This method can be called if SCIP is in one of the following stages:
140  * - \ref SCIP_STAGE_INIT
141  * - \ref SCIP_STAGE_PROBLEM
142  */
143 SCIP_EXPORT
145  SCIP* scip, /**< SCIP data structure */
146  SCIP_BENDERS* benders, /**< Benders' decomposition */
147  SCIP_DECL_BENDERSCOPY((*benderscopy)) /**< copy method of Benders' decomposition or NULL if you don't want to copy your plugin into sub-SCIPs */
148  );
149 
150 /** sets destructor method of benders
151  *
152  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
153  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
154  *
155  * @pre This method can be called if SCIP is in one of the following stages:
156  * - \ref SCIP_STAGE_INIT
157  * - \ref SCIP_STAGE_PROBLEM
158  */
159 SCIP_EXPORT
161  SCIP* scip, /**< SCIP data structure */
162  SCIP_BENDERS* benders, /**< Benders' decomposition */
163  SCIP_DECL_BENDERSFREE((*bendersfree)) /**< destructor of Benders' decomposition */
164  );
165 
166 /** sets initialization method of benders
167  *
168  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
169  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
170  *
171  * @pre This method can be called if SCIP is in one of the following stages:
172  * - \ref SCIP_STAGE_INIT
173  * - \ref SCIP_STAGE_PROBLEM
174  */
175 SCIP_EXPORT
177  SCIP* scip, /**< SCIP data structure */
178  SCIP_BENDERS* benders, /**< Benders' decomposition */
179  SCIP_DECL_BENDERSINIT ((*bendersinit)) /**< initialize Benders' decomposition */
180  );
181 
182 /** sets deinitialization method of benders
183  *
184  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
185  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
186  *
187  * @pre This method can be called if SCIP is in one of the following stages:
188  * - \ref SCIP_STAGE_INIT
189  * - \ref SCIP_STAGE_PROBLEM
190  */
191 SCIP_EXPORT
193  SCIP* scip, /**< SCIP data structure */
194  SCIP_BENDERS* benders, /**< Benders' decomposition */
195  SCIP_DECL_BENDERSEXIT ((*bendersexit)) /**< deinitialize Benders' decomposition */
196  );
197 
198 /** sets presolving initialization method of benders
199  *
200  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
201  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
202  *
203  * @pre This method can be called if SCIP is in one of the following stages:
204  * - \ref SCIP_STAGE_INIT
205  * - \ref SCIP_STAGE_PROBLEM
206  */
207 SCIP_EXPORT
209  SCIP* scip, /**< SCIP data structure */
210  SCIP_BENDERS* benders, /**< Benders' decomposition */
211  SCIP_DECL_BENDERSINITPRE((*bendersinitpre))/**< presolving initialization method of Benders' decomposition */
212  );
213 
214 /** sets presolving deinitialization method of benders
215  *
216  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
217  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
218  *
219  * @pre This method can be called if SCIP is in one of the following stages:
220  * - \ref SCIP_STAGE_INIT
221  * - \ref SCIP_STAGE_PROBLEM
222  */
223 SCIP_EXPORT
225  SCIP* scip, /**< SCIP data structure */
226  SCIP_BENDERS* benders, /**< Benders' decomposition */
227  SCIP_DECL_BENDERSEXITPRE((*bendersexitpre))/**< presolving deinitialization method of Benders' decomposition */
228  );
229 
230 /** sets solving process initialization method of benders
231  *
232  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
233  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
234  *
235  * @pre This method can be called if SCIP is in one of the following stages:
236  * - \ref SCIP_STAGE_INIT
237  * - \ref SCIP_STAGE_PROBLEM
238  */
239 SCIP_EXPORT
241  SCIP* scip, /**< SCIP data structure */
242  SCIP_BENDERS* benders, /**< Benders' decomposition */
243  SCIP_DECL_BENDERSINITSOL((*bendersinitsol))/**< solving process initialization method of Benders' decomposition */
244  );
245 
246 /** sets solving process deinitialization method of benders
247  *
248  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
249  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
250  *
251  * @pre This method can be called if SCIP is in one of the following stages:
252  * - \ref SCIP_STAGE_INIT
253  * - \ref SCIP_STAGE_PROBLEM
254  */
255 SCIP_EXPORT
257  SCIP* scip, /**< SCIP data structure */
258  SCIP_BENDERS* benders, /**< Benders' decomposition */
259  SCIP_DECL_BENDERSEXITSOL((*bendersexitsol))/**< solving process deinitialization method of Benders' decomposition */
260  );
261 
262 /** sets the method called prior to solving the subproblems for benders
263  *
264  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
265  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
266  *
267  * @pre This method can be called if SCIP is in one of the following stages:
268  * - \ref SCIP_STAGE_INIT
269  * - \ref SCIP_STAGE_PROBLEM
270  */
271 SCIP_EXPORT
273  SCIP* scip, /**< SCIP data structure */
274  SCIP_BENDERS* benders, /**< Benders' decomposition */
275  SCIP_DECL_BENDERSPRESUBSOLVE((*benderspresubsolve))/**< method called prior to solving the subproblems */
276  );
277 
278 /** sets the subproblem solving and freeing methods for Benders' decomposition
279  *
280  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
281  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
282  *
283  * @pre This method can be called if SCIP is in one of the following stages:
284  * - \ref SCIP_STAGE_INIT
285  * - \ref SCIP_STAGE_PROBLEM
286  */
287 SCIP_EXPORT
289  SCIP* scip, /**< SCIP data structure */
290  SCIP_BENDERS* benders, /**< Benders' decomposition */
291  SCIP_DECL_BENDERSSOLVESUBCONVEX((*benderssolvesubconvex)),/**< the solving method for convex Benders' decomposition subproblems */
292  SCIP_DECL_BENDERSSOLVESUB((*benderssolvesub)),/**< solving method for a Benders' decomposition subproblem */
293  SCIP_DECL_BENDERSFREESUB((*bendersfreesub))/**< the subproblem freeing method for Benders' decomposition */
294  );
295 
296 /** sets the post solving methods for benders
297  *
298  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
299  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
300  *
301  * @pre This method can be called if SCIP is in one of the following stages:
302  * - \ref SCIP_STAGE_INIT
303  * - \ref SCIP_STAGE_PROBLEM
304  */
305 SCIP_EXPORT
307  SCIP* scip, /**< SCIP data structure */
308  SCIP_BENDERS* benders, /**< Benders' decomposition */
309  SCIP_DECL_BENDERSPOSTSOLVE((*benderspostsolve))/**< solving process deinitialization method of Benders' decomposition */
310  );
311 
312 /** sets the subproblem comparison method for determining the solving order in Benders' decomposition
313  *
314  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
315  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
316  *
317  * @pre This method can be called if SCIP is in one of the following stages:
318  * - \ref SCIP_STAGE_INIT
319  * - \ref SCIP_STAGE_PROBLEM
320  */
321 SCIP_EXPORT
323  SCIP* scip, /**< SCIP data structure */
324  SCIP_BENDERS* benders, /**< Benders' decomposition */
325  SCIP_DECL_SORTPTRCOMP((*benderssubcomp)) /**< a comparator for defining the solving order of the subproblems */
326  );
327 
328 /** returns the Benders' decomposition of the given name, or NULL if not existing */
329 SCIP_EXPORT
331  SCIP* scip, /**< SCIP data structure */
332  const char* name /**< name of Benders' decomposition */
333  );
334 
335 /** returns the array of currently available Benders' decomposition; active Benders' decomposition are in the first
336  * slots of the array
337  */
338 SCIP_EXPORT
340  SCIP* scip /**< SCIP data structure */
341  );
342 
343 /** returns the number of currently available Benders' decomposition */
344 SCIP_EXPORT
345 int SCIPgetNBenders(
346  SCIP* scip /**< SCIP data structure */
347  );
348 
349 /** returns the number of currently active Benders' decomposition */
350 SCIP_EXPORT
352  SCIP* scip /**< SCIP data structure */
353  );
354 
355 /** activates the Benders' decomposition to be used for the current problem
356  *
357  * This method should be called during the problem creation stage for all pricers that are necessary to solve
358  * the problem model.
359  *
360  * @note The Benders' decompositions are automatically deactivated when the problem is freed.
361  *
362  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
363  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
364  *
365  * @pre This method can be called if SCIP is in one of the following stages:
366  * - \ref SCIP_STAGE_PROBLEM
367  */
368 SCIP_EXPORT
370  SCIP* scip, /**< SCIP data structure */
371  SCIP_BENDERS* benders, /**< the Benders' decomposition structure */
372  int nsubproblems /**< the number of subproblems in the Benders' decomposition */
373  );
374 
375 /** deactivates the Benders' decomposition
376  *
377  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
378  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
379  *
380  * @pre This method can be called if SCIP is in one of the following stages:
381  * - \ref SCIP_STAGE_PROBLEM
382  * - \ref SCIP_STAGE_EXITSOLVE
383  */
384 SCIP_EXPORT
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 SCIP_EXPORT
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 SCIP_EXPORT
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 SCIP_EXPORT
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 SCIP_EXPORT
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 SCIP_EXPORT
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 SCIP_EXPORT
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 SCIP_EXPORT
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  SCIP_BENDERSENFOTYPE type /**< the enforcement type calling this function */
528  );
529 
530 /** calls the solving method for a single Benders' decomposition subproblem
531  *
532  * The method either calls the users solve subproblem method or calls the generic method. In the case of the generic
533  * method, the user must set up the subproblem prior to calling this method.
534  *
535  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
536  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
537  *
538  * @pre This method can be called if SCIP is in one of the following stages:
539  * - \ref SCIP_STAGE_INITPRESOLVE
540  * - \ref SCIP_STAGE_PRESOLVING
541  * - \ref SCIP_STAGE_EXITPRESOLVE
542  * - \ref SCIP_STAGE_PRESOLVED
543  * - \ref SCIP_STAGE_INITSOLVE
544  * - \ref SCIP_STAGE_SOLVING
545  * - \ref SCIP_STAGE_SOLVED
546  */
547 SCIP_EXPORT
549  SCIP* scip, /**< SCIP data structure */
550  SCIP_BENDERS* benders, /**< Benders' decomposition */
551  SCIP_SOL* sol, /**< primal CIP solution, can be NULL for the current LP/Pseudo solution */
552  int probnumber, /**< the subproblem number */
553  SCIP_Bool* infeasible, /**< returns whether the current subproblem is infeasible */
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 SCIP_EXPORT
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 SCIP_EXPORT
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 SCIP_EXPORT
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  */
632 SCIP_EXPORT
634  SCIP* scip, /**< the SCIP data structure */
635  SCIP_BENDERS* benders, /**< Benders' decomposition */
636  int probnumber, /**< the subproblem to be evaluated */
637  SCIP_Real* lowerbound, /**< the lowerbound for the subproblem */
638  SCIP_Bool* infeasible /**< was the subproblem found to be infeasible? */
639  );
640 
641 /** merges a subproblem into the master problem.
642  *
643  * This process just adds a copy of the subproblem variables and constraints to the master problem, but keeps the
644  * subproblem stored in the Benders' decomposition data structure. The reason for keeping the subproblem available is
645  * for when it is queried for solutions after the problem is solved.
646  *
647  * Once the subproblem is merged into the master problem, then the subproblem is flagged as disabled. This means that
648  * it will not be solved in the subsequent subproblem solving loops.
649  *
650  * The associated auxiliary variables are kept in the master problem. The objective function of the merged subproblem
651  * is added as an underestimator constraint.
652  *
653  * @pre This method can be called if SCIP is in one of the following stages:
654  * - \ref SCIP_STAGE_INITPRESOLVE
655  * - \ref SCIP_STAGE_PRESOLVING
656  * - \ref SCIP_STAGE_EXITPRESOLVE
657  * - \ref SCIP_STAGE_PRESOLVED
658  * - \ref SCIP_STAGE_INITSOLVE
659  * - \ref SCIP_STAGE_SOLVING
660  *
661  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
662  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
663  */
664 SCIP_EXPORT
666  SCIP* scip, /**< the SCIP data structure */
667  SCIP_BENDERS* benders, /**< Benders' decomposition */
668  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of subproblem variables corresponding
669  * to the newly created master variables, or NULL */
670  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of subproblem constraints to the
671  corresponding newly created constraints, or NULL */
672  int probnumber /**< the number of the subproblem that will be merged into the master problem*/
673  );
674 
675 /** applies a Benders' decomposition to the selected decomposition from the decomposition store
676  *
677  * @pre This method can be called if SCIP is in one of the following stages:
678  * - \ref SCIP_STAGE_PROBLEM
679  * - \ref SCIP_STAGE_TRANSFORMED
680  * - \ref SCIP_STAGE_INITPRESOLVE
681  * - \ref SCIP_STAGE_PRESOLVING
682  * - \ref SCIP_STAGE_EXITPRESOLVE
683  * - \ref SCIP_STAGE_PRESOLVED
684  * - \ref SCIP_STAGE_INITSOLVE
685  *
686  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
687  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
688  */
689 SCIP_EXPORT
691  SCIP* scip, /**< the SCIP data structure */
692  int decompindex /**< the index of the decomposition that will be applied */
693  );
694 
695 /** @} */
696 
697 /**@addtogroup PublicBenderscutsMethods
698  *
699  * @{
700  */
701 
702 /** creates a Benders' cut algorithms and includes it in the associated Benders' decomposition
703  *
704  * This should be called from the SCIPincludeBendersXyz for the associated Benders' decomposition. It is only possible
705  * to include a Benders' cut algorithm if a Benders' decomposition has already been included
706  * This should be done during the problem creation stage.
707  *
708  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
709  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
710  *
711  * @pre This method can be called if SCIP is in one of the following stages:
712  * - \ref SCIP_STAGE_INIT
713  * - \ref SCIP_STAGE_PROBLEM
714  *
715  * @note method has all Benders' decomposition callbacks as arguments and is thus changed every time a new callback is
716  * added in future releases; consider using SCIPincludeBendersBasic() and setter functions
717  * if you seek for a method which is less likely to change in future releases
718  */
719 SCIP_EXPORT
721  SCIP* scip, /**< SCIP data structure */
722  SCIP_BENDERS* benders, /**< Benders' decomposition */
723  const char* name, /**< name of Benders' decomposition cuts */
724  const char* desc, /**< description of Benders' decomposition cuts */
725  int priority, /**< priority of the Benders' decomposition cuts */
726  SCIP_Bool islpcut, /**< indicates whether the cut is generated from the LP solution */
727  SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)),/**< copy method of Benders' decomposition cuts or NULL if you don't want to copy your plugin into sub-SCIPs */
728  SCIP_DECL_BENDERSCUTFREE((*benderscutfree)),/**< destructor of Benders' decomposition cuts */
729  SCIP_DECL_BENDERSCUTINIT((*benderscutinit)),/**< initialize Benders' decomposition cuts */
730  SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)),/**< deinitialize Benders' decomposition cuts */
731  SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)),/**< solving process initialization method of Benders' decomposition cuts */
732  SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)),/**< solving process deinitialization method of Benders' decomposition cuts */
733  SCIP_DECL_BENDERSCUTEXEC((*benderscutexec)),/**< execution method of Benders' decomposition cuts */
734  SCIP_BENDERSCUTDATA* benderscutdata /**< Benders' decomposition cuts data */
735  );
736 
737 /** creates a Benders' cut and includes it an associated Benders' decomposition with all non-fundamental callbacks set to NULL
738  *
739  * If needed, the non-fundamental callbacks can be added afterwards via setter functions SCIPsetBenderscutCopy(),
740  * SCIPsetBenderscutFree(), SCIPsetBenderscutInit(), SCIPsetBenderscutExit(), SCIPsetBenderscutInitsol(),
741  * SCIPsetBenderscutExitsol().
742  *
743  * This should be done during the problem creation stage.
744  *
745  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
746  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
747  *
748  * @pre This method can be called if SCIP is in one of the following stages:
749  * - \ref SCIP_STAGE_INIT
750  * - \ref SCIP_STAGE_PROBLEM
751  *
752  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeBenders() instead
753  */
754 SCIP_EXPORT
756  SCIP* scip, /**< SCIP data structure */
757  SCIP_BENDERS* benders, /**< Benders' decomposition */
758  SCIP_BENDERSCUT** benderscutptr, /**< reference to a Benders' decomposition cut, or NULL */
759  const char* name, /**< name of Benders' decomposition */
760  const char* desc, /**< description of Benders' decomposition */
761  int priority, /**< priority of the Benders' decomposition */
762  SCIP_Bool islpcut, /**< indicates whether the cut is generated from the LP solution */
763  SCIP_DECL_BENDERSCUTEXEC((*benderscutexec)),/**< the execution method of the Benders' cut algorithm */
764  SCIP_BENDERSCUTDATA* benderscutdata /**< Benders' cut data */
765  );
766 
767 /** sets copy method of Benders' decomposition cut
768  *
769  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
770  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
771  *
772  * @pre This method can be called if SCIP is in one of the following stages:
773  * - \ref SCIP_STAGE_INIT
774  * - \ref SCIP_STAGE_PROBLEM
775  */
776 SCIP_EXPORT
778  SCIP* scip, /**< SCIP data structure */
779  SCIP_BENDERSCUT* benderscut, /**< Benders' decomposition cut */
780  SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy))/**< copy method of benderscut or NULL if you don't want to copy your plugin into sub-SCIPs */
781  );
782 
783 /** sets destructor method of benderscut
784  *
785  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
786  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
787  *
788  * @pre This method can be called if SCIP is in one of the following stages:
789  * - \ref SCIP_STAGE_INIT
790  * - \ref SCIP_STAGE_PROBLEM
791  */
792 SCIP_EXPORT
794  SCIP* scip, /**< SCIP data structure */
795  SCIP_BENDERSCUT* benderscut, /**< benderscut */
796  SCIP_DECL_BENDERSCUTFREE((*benderscutfree))/**< destructor of benderscut */
797  );
798 
799 /** sets initialization method of benderscut
800  *
801  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
802  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
803  *
804  * @pre This method can be called if SCIP is in one of the following stages:
805  * - \ref SCIP_STAGE_INIT
806  * - \ref SCIP_STAGE_PROBLEM
807  */
808 SCIP_EXPORT
810  SCIP* scip, /**< SCIP data structure */
811  SCIP_BENDERSCUT* benderscut, /**< benderscut */
812  SCIP_DECL_BENDERSCUTINIT((*benderscutinit))/**< initialize benderscut */
813  );
814 
815 /** sets deinitialization method of benderscut
816  *
817  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
818  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
819  *
820  * @pre This method can be called if SCIP is in one of the following stages:
821  * - \ref SCIP_STAGE_INIT
822  * - \ref SCIP_STAGE_PROBLEM
823  */
824 SCIP_EXPORT
826  SCIP* scip, /**< SCIP data structure */
827  SCIP_BENDERSCUT* benderscut, /**< benderscut */
828  SCIP_DECL_BENDERSCUTEXIT((*benderscutexit))/**< deinitialize benderscut */
829  );
830 
831 /** sets solving process initialization method of benderscut
832  *
833  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
834  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
835  *
836  * @pre This method can be called if SCIP is in one of the following stages:
837  * - \ref SCIP_STAGE_INIT
838  * - \ref SCIP_STAGE_PROBLEM
839  */
840 SCIP_EXPORT
842  SCIP* scip, /**< SCIP data structure */
843  SCIP_BENDERSCUT* benderscut, /**< benderscut */
844  SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol))/**< solving process initialization method of benderscut */
845  );
846 
847 /** sets solving process deinitialization method of benderscut
848  *
849  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
850  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
851  *
852  * @pre This method can be called if SCIP is in one of the following stages:
853  * - \ref SCIP_STAGE_INIT
854  * - \ref SCIP_STAGE_PROBLEM
855  */
856 SCIP_EXPORT
858  SCIP* scip, /**< SCIP data structure */
859  SCIP_BENDERSCUT* benderscut, /**< benderscut */
860  SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol))/**< solving process deinitialization method of benderscut */
861  );
862 
863 /** sets the priority of a Benders' decomposition cut algorithm
864  *
865  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
866  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
867  *
868  * @pre This method can be called if SCIP is in one of the following stages:
869  * - \ref SCIP_STAGE_INIT
870  * - \ref SCIP_STAGE_PROBLEM
871  */
872 SCIP_EXPORT
874  SCIP* scip, /**< SCIP data structure */
875  SCIP_BENDERSCUT* benderscut, /**< benderscut */
876  int priority /**< new priority of the Benders' decomposition */
877  );
878 
879 /** adds the generated cuts to the Benders' cut storage
880  *
881  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
882  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
883  *
884  * @pre This method can be called if SCIP is in one of the following stages:
885  * - \ref SCIP_STAGE_INITPRESOLVE
886  * - \ref SCIP_STAGE_PRESOLVING
887  * - \ref SCIP_STAGE_EXITPRESOLVE
888  * - \ref SCIP_STAGE_PRESOLVED
889  * - \ref SCIP_STAGE_INITSOLVE
890  * - \ref SCIP_STAGE_SOLVING
891  */
892 SCIP_EXPORT
894  SCIP* scip, /**< the SCIP data structure */
895  SCIP_BENDERS* benders, /**< Benders' decomposition */
896  SCIP_VAR** vars, /**< the variables that have non-zero coefficients in the cut */
897  SCIP_Real* vals, /**< the coefficients of the variables in the cut */
898  SCIP_Real lhs, /**< the left hand side of the cut */
899  SCIP_Real rhs, /**< the right hand side of the cut */
900  int nvars /**< the number of variables with non-zero coefficients in the cut */
901  );
902 
903 /** applies the Benders' decomposition cuts in storage to the input SCIP instance
904  *
905  * When calling the function, the user must be sure that the variables are associated with the input SCIP instance.
906  * The main use of this method is to transfer Benders' cuts between solvers in ParaSCIP.
907  *
908  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
909  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
910  *
911  * @pre This method can be called if SCIP is in one of the following stages:
912  * - \ref SCIP_STAGE_INITPRESOLVE
913  * - \ref SCIP_STAGE_PRESOLVING
914  * - \ref SCIP_STAGE_EXITPRESOLVE
915  * - \ref SCIP_STAGE_PRESOLVED
916  * - \ref SCIP_STAGE_INITSOLVE
917  * - \ref SCIP_STAGE_SOLVING
918  */
920  SCIP* scip, /**< the SCIP data structure */
921  SCIP_BENDERS* benders /**< Benders' decomposition */
922  );
923 
924 /** @} */
925 
926 #ifdef __cplusplus
927 }
928 #endif
929 
930 #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:380
SCIP_RETCODE SCIPsetBendersSolveAndFreesub(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSSOLVESUBCONVEX((*benderssolvesubconvex)), SCIP_DECL_BENDERSSOLVESUB((*benderssolvesub)), SCIP_DECL_BENDERSFREESUB((*bendersfreesub)))
Definition: scip_benders.c:404
#define SCIP_DECL_BENDERSCREATESUB(x)
Definition: type_benders.h:185
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)
Definition: scip_benders.c:990
SCIP_RETCODE SCIPfreeBendersSubproblem(SCIP *scip, SCIP_BENDERS *benders, int probnumber)
Definition: scip_benders.c:852
void SCIPsetBendersPriority(SCIP *scip, SCIP_BENDERS *benders, int priority)
Definition: scip_benders.c:581
type definitions for miscellaneous datastructures
struct SCIP_BenderscutData SCIP_BENDERSCUTDATA
#define SCIP_DECL_BENDERSINITSOL(x)
Definition: type_benders.h:142
#define SCIP_DECL_BENDERSFREE(x)
Definition: type_benders.h:94
SCIP_RETCODE SCIPgetBendersMasterVar(SCIP *scip, SCIP_BENDERS *benders, SCIP_VAR *var, SCIP_VAR **mappedvar)
Definition: scip_benders.c:651
#define SCIP_DECL_BENDERSINITPRE(x)
Definition: type_benders.h:123
#define SCIP_DECL_BENDERSCUTFREE(x)
SCIP_RETCODE SCIPsetBendersSubproblemComp(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_SORTPTRCOMP((*benderssubcomp)))
Definition: scip_benders.c:468
SCIP_RETCODE SCIPsetBendersExitsol(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSEXITSOL((*bendersexitsol)))
Definition: scip_benders.c:356
#define SCIP_DECL_BENDERSGETVAR(x)
Definition: type_benders.h:357
SCIP_RETCODE SCIPsetBendersInit(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSINIT((*bendersinit)))
Definition: scip_benders.c:236
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
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:922
#define SCIP_DECL_BENDERSINIT(x)
Definition: type_benders.h:103
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:687
#define SCIP_DECL_BENDERSCUTINIT(x)
int SCIPgetNActiveBenders(SCIP *scip)
Definition: scip_benders.c:523
type definitions for LP management
SCIP_RETCODE SCIPsetBendersExit(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSEXIT((*bendersexit)))
Definition: scip_benders.c:260
SCIP_RETCODE SCIPcomputeBendersSubproblemLowerbound(SCIP *scip, SCIP_BENDERS *benders, int probnumber, SCIP_Real *lowerbound, SCIP_Bool *infeasible)
Definition: scip_benders.c:950
#define SCIP_DECL_BENDERSFREESUB(x)
Definition: type_benders.h:341
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:67
#define SCIP_DECL_BENDERSEXIT(x)
Definition: type_benders.h:112
SCIP_RETCODE SCIPsetupBendersSubproblem(SCIP *scip, SCIP_BENDERS *benders, SCIP_SOL *sol, int probnumber, SCIP_BENDERSENFOTYPE type)
Definition: scip_benders.c:771
#define SCIP_DECL_BENDERSSOLVESUB(x)
Definition: type_benders.h:283
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:142
#define SCIP_DECL_BENDERSCUTEXIT(x)
struct SCIP_BendersData SCIP_BENDERSDATA
Definition: type_benders.h:73
SCIP_RETCODE SCIPsetBenderscutExit(SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)))
#define SCIP_DECL_BENDERSSOLVESUBCONVEX(x)
Definition: type_benders.h:250
type definitions for problem variables
SCIP_RETCODE SCIPsetBenderscutPriority(SCIP *scip, SCIP_BENDERSCUT *benderscut, int priority)
SCIP_RETCODE SCIPstoreBendersCut(SCIP *scip, SCIP_BENDERS *benders, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, int nvars)
#define SCIP_DECL_BENDERSCOPY(x)
Definition: type_benders.h:86
SCIP_BENDERS * SCIPfindBenders(SCIP *scip, const char *name)
Definition: scip_benders.c:484
#define SCIP_Bool
Definition: def.h:84
SCIP_BENDERS ** SCIPgetBenders(SCIP *scip)
Definition: scip_benders.c:499
SCIP_RETCODE SCIPapplyBendersStoredCuts(SCIP *scip, SCIP_BENDERS *benders)
SCIP_RETCODE SCIPapplyBendersDecomposition(SCIP *scip, int decompindex)
SCIP_RETCODE SCIPsetBendersCopy(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSCOPY((*benderscopy)))
Definition: scip_benders.c:188
SCIP_RETCODE SCIPdeactivateBenders(SCIP *scip, SCIP_BENDERS *benders)
Definition: scip_benders.c:568
SCIP_RETCODE SCIPaddBendersSubproblem(SCIP *scip, SCIP_BENDERS *benders, SCIP *subproblem)
Definition: scip_benders.c:737
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:883
int SCIPgetNBenders(SCIP *scip)
Definition: scip_benders.c:512
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:444
SCIP_RETCODE SCIPsetBenderscutInit(SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTINIT((*benderscutinit)))
SCIP_RETCODE SCIPsetBendersInitsol(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSINITSOL((*bendersinitsol)))
Definition: scip_benders.c:332
SCIP_RETCODE SCIPsetBenderscutInitsol(SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)))
SCIP_RETCODE SCIPsetBenderscutCopy(SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)))
#define SCIP_DECL_SORTPTRCOMP(x)
Definition: type_misc.h:179
#define SCIP_DECL_BENDERSEXITSOL(x)
Definition: type_benders.h:153
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:212
#define SCIP_Real
Definition: def.h:177
result codes for SCIP callback methods
SCIP_RETCODE SCIPsolveBendersSubproblem(SCIP *scip, SCIP_BENDERS *benders, SCIP_SOL *sol, int probnumber, SCIP_Bool *infeasible, SCIP_Bool solvecip, SCIP_Real *objective)
Definition: scip_benders.c:809
#define SCIP_DECL_BENDERSCUTEXITSOL(x)
SCIP_RETCODE SCIPsetBenderscutFree(SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTFREE((*benderscutfree)))
int SCIPgetBendersNSubproblems(SCIP *scip, SCIP_BENDERS *benders)
Definition: scip_benders.c:713
#define SCIP_DECL_BENDERSPOSTSOLVE(x)
Definition: type_benders.h:319
#define SCIP_DECL_BENDERSEXITPRE(x)
Definition: type_benders.h:131
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:546
SCIP_RETCODE SCIPsetBendersExitpre(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSEXITPRE((*bendersexitpre)))
Definition: scip_benders.c:308
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:613
SCIP_RETCODE SCIPsetBendersInitpre(SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSINITPRE((*bendersinitpre)))
Definition: scip_benders.c:284
#define SCIP_DECL_BENDERSCUTINITSOL(x)
type definitions for constraints and constraint handlers
#define SCIP_DECL_BENDERSPRESUBSOLVE(x)
Definition: type_benders.h:209