cons_benderslp.c
Go to the documentation of this file.
20 * Two constraint handlers are implemented for the generation of Benders' decomposition cuts. When included in a
21 * problem, the Benders' decomposition constraint handlers generate cuts during the enforcement of LP and relaxation
22 * solutions. Additionally, Benders' decomposition cuts can be generated when checking the feasibility of solutions with
25 * This constraint handler has an enforcement priority that is greater than the integer constraint handler. This means
26 * that all LP solutions will be first checked for feasibility with respect to the Benders' decomposition second stage
27 * constraints before performing an integrality check. This is part of a multi-phase approach for solving mixed integer
30 * A parameter is available to control the depth at which the non-integer LP solution are enforced by solving the
31 * Benders' decomposition subproblems. This parameter is set to 0 by default, indicating that non-integer LP solutions
35 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
47 #define CONSHDLR_ENFOPRIORITY 10000000 /**< priority of the constraint handler for constraint enforcing */
48 #define CONSHDLR_CHECKPRIORITY 10000000 /**< priority of the constraint handler for checking feasibility */
49 #define CONSHDLR_EAGERFREQ 100 /**< frequency for using all instead of only the useful constraints in separation,
51 #define CONSHDLR_NEEDSCONS FALSE /**< should the constraint handler be skipped, if no constraints are available? */
54 #define DEFAULT_CONSBENDERSLP_MAXDEPTH 0/**< depth at which Benders' decomposition cuts are generated from the LP
93 /** destructor of constraint handler to free constraint handler data (called when SCIP is exiting) */
123 if( !conshdlrdata->active || (conshdlrdata->maxdepth >= 0 && SCIPgetDepth(scip) > conshdlrdata->maxdepth) )
126 SCIP_CALL( SCIPconsBendersEnforceSolution(scip, NULL, conshdlr, result, SCIP_BENDERSENFOTYPE_LP, FALSE) );
142 if( !conshdlrdata->active || (conshdlrdata->maxdepth >= 0 && SCIPgetDepth(scip) > conshdlrdata->maxdepth) )
145 SCIP_CALL( SCIPconsBendersEnforceSolution(scip, sol, conshdlr, result, SCIP_BENDERSENFOTYPE_RELAX, FALSE) );
161 if( !conshdlrdata->active || (conshdlrdata->maxdepth >= 0 && SCIPgetDepth(scip) > conshdlrdata->maxdepth) )
164 SCIP_CALL( SCIPconsBendersEnforceSolution(scip, NULL, conshdlr, result, SCIP_BENDERSENFOTYPE_PSEUDO, FALSE) );
171 * The feasibility check for Benders' decomposition is performed in cons_benders. As such, it is redundant to perform
172 * the feasibility check here. As such, the solution is flagged as feasible, which will then be corrected in
197 /** creates the handler for executing the Benders' decomposition subproblem solve on fractional LP solution and
201 )
226 "depth at which Benders' decomposition cuts are generated from the LP solution (-1: always, 0: only at root)",
227 &conshdlrdata->maxdepth, TRUE, DEFAULT_CONSBENDERSLP_MAXDEPTH, -1, SCIP_MAXTREEDEPTH, NULL, NULL) );
230 "constraints/" CONSHDLR_NAME "/active", "is the Benders' decomposition LP cut constraint handler active?",
constraint handler for Benders' decomposition
Definition: struct_scip.h:58
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
Definition: scip_cons.c:307
SCIP_RETCODE SCIPincludeConshdlrBasic(SCIP *scip, SCIP_CONSHDLR **conshdlrptr, const char *name, const char *desc, int enfopriority, int chckpriority, int eagerfreq, SCIP_Bool needscons, SCIP_DECL_CONSENFOLP((*consenfolp)), SCIP_DECL_CONSENFOPS((*consenfops)), SCIP_DECL_CONSCHECK((*conscheck)), SCIP_DECL_CONSLOCK((*conslock)), SCIP_CONSHDLRDATA *conshdlrdata)
Definition: scip_cons.c:165
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip_param.c:47
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopyBenderslp)
Definition: cons_benderslp.c:83
Definition: type_benders.h:37
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
Definition: scip_cons.c:356
Definition: type_benders.h:39
Definition: struct_cons.h:117
Definition: type_result.h:36
SCIP_RETCODE SCIPconsBendersEnforceSolution(SCIP *scip, SCIP_SOL *sol, SCIP_CONSHDLR *conshdlr, SCIP_RESULT *result, SCIP_BENDERSENFOTYPE type, SCIP_Bool checkint)
Definition: cons_benders.c:222
Definition: type_retcode.h:33
SCIP_RETCODE SCIPincludeConshdlrBenderslp(SCIP *scip)
Definition: cons_benderslp.c:201
static SCIP_DECL_CONSENFORELAX(consEnforelaxBenderslp)
Definition: cons_benderslp.c:136
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
Definition: scip_cons.c:331
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4211
Definition: type_benders.h:38
static SCIP_DECL_CONSENFOPS(consEnfopsBenderslp)
Definition: cons_benderslp.c:155
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip_param.c:73
constraint handler for benderslp decomposition
static SCIP_DECL_CONSENFOLP(consEnfolpBenderslp)
Definition: cons_benderslp.c:117
Definition: objbenders.h:33
SCIP callable library.