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