Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

methods for Benders' decomposition plugins

Functions

 SCIP_DECL_SORTPTRCOMP (SCIPbendersComp)
 
 SCIP_DECL_SORTPTRCOMP (SCIPbendersCompName)
 
SCIP_BENDERSDATASCIPbendersGetData (SCIP_BENDERS *benders)
 
void SCIPbendersSetData (SCIP_BENDERS *benders, SCIP_BENDERSDATA *bendersdata)
 
const char * SCIPbendersGetName (SCIP_BENDERS *benders)
 
const char * SCIPbendersGetDesc (SCIP_BENDERS *benders)
 
int SCIPbendersGetPriority (SCIP_BENDERS *benders)
 
int SCIPbendersGetNSubproblems (SCIP_BENDERS *benders)
 
SCIPSCIPbendersSubproblem (SCIP_BENDERS *benders, int probnumber)
 
int SCIPbendersGetNCalls (SCIP_BENDERS *benders)
 
int SCIPbendersGetNCutsFound (SCIP_BENDERS *benders)
 
SCIP_Real SCIPbendersGetSetupTime (SCIP_BENDERS *benders)
 
SCIP_Real SCIPbendersGetTime (SCIP_BENDERS *benders)
 
SCIP_Bool SCIPbendersIsInitialized (SCIP_BENDERS *benders)
 
SCIP_Bool SCIPbendersIsActive (SCIP_BENDERS *benders)
 
SCIP_Bool SCIPbendersOnlyCheckConvexRelax (SCIP_BENDERS *benders)
 
SCIP_Bool SCIPbendersCutLP (SCIP_BENDERS *benders)
 
SCIP_Bool SCIPbendersCutPseudo (SCIP_BENDERS *benders)
 
SCIP_Bool SCIPbendersCutRelaxation (SCIP_BENDERS *benders)
 
SCIP_Bool SCIPbendersShareAuxVars (SCIP_BENDERS *benders)
 
SCIP_VARSCIPbendersGetAuxiliaryVar (SCIP_BENDERS *benders, int probnumber)
 
SCIP_VAR ** SCIPbendersGetAuxiliaryVars (SCIP_BENDERS *benders)
 
void SCIPbendersSetSubproblemObjval (SCIP_BENDERS *benders, int probnumber, SCIP_Real objval)
 
SCIP_Real SCIPbendersGetSubproblemObjval (SCIP_BENDERS *benders, int probnumber)
 
SCIP_BENDERSCUTSCIPfindBenderscut (SCIP_BENDERS *benders, const char *name)
 
SCIP_BENDERSCUT ** SCIPbendersGetBenderscuts (SCIP_BENDERS *benders)
 
int SCIPbendersGetNBenderscuts (SCIP_BENDERS *benders)
 
SCIP_RETCODE SCIPbendersSetBenderscutPriority (SCIP_BENDERS *benders, SCIP_BENDERSCUT *benderscut, int priority)
 
void SCIPbendersSetSubproblemIsConvex (SCIP_BENDERS *benders, int probnumber, SCIP_Bool isconvex)
 
SCIP_Bool SCIPbendersSubproblemIsConvex (SCIP_BENDERS *benders, int probnumber)
 
int SCIPbendersGetNConvexSubproblems (SCIP_BENDERS *benders)
 
SCIP_RETCODE SCIPbendersSolveSubproblemLP (SCIP *scip, SCIP_BENDERS *benders, int probnumber, SCIP_Bool *infeasible)
 
SCIP_RETCODE SCIPbendersSolveSubproblemCIP (SCIP *scip, SCIP_BENDERS *benders, int probnumber, SCIP_Bool *infeasible, SCIP_BENDERSENFOTYPE type, SCIP_Bool solvecip)
 
int SCIPbendersGetNTransferredCuts (SCIP_BENDERS *benders)
 
void SCIPbendersUpdateSubproblemLowerbound (SCIP_BENDERS *benders, int probnumber, SCIP_Real lowerbound)
 
SCIP_Real SCIPbendersGetSubproblemLowerbound (SCIP_BENDERS *benders, int probnumber)
 
void SCIPbendersSetSubproblemIsIndependent (SCIP_BENDERS *benders, int probnumber, SCIP_Bool isindep)
 
SCIP_Bool SCIPbendersSubproblemIsIndependent (SCIP_BENDERS *benders, int probnumber)
 
SCIP_Bool SCIPbendersSubproblemIsEnabled (SCIP_BENDERS *benders, int probnumber)
 
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)
 
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)
 
SCIP_RETCODE SCIPsetBendersCopy (SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSCOPY((*benderscopy)))
 
SCIP_RETCODE SCIPsetBendersFree (SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSFREE((*bendersfree)))
 
SCIP_RETCODE SCIPsetBendersInit (SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSINIT((*bendersinit)))
 
SCIP_RETCODE SCIPsetBendersExit (SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSEXIT((*bendersexit)))
 
SCIP_RETCODE SCIPsetBendersInitpre (SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSINITPRE((*bendersinitpre)))
 
SCIP_RETCODE SCIPsetBendersExitpre (SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSEXITPRE((*bendersexitpre)))
 
SCIP_RETCODE SCIPsetBendersInitsol (SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSINITSOL((*bendersinitsol)))
 
SCIP_RETCODE SCIPsetBendersExitsol (SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSEXITSOL((*bendersexitsol)))
 
SCIP_RETCODE SCIPsetBendersPresubsolve (SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSPRESUBSOLVE((*benderspresubsolve)))
 
SCIP_RETCODE SCIPsetBendersSolveAndFreesub (SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSSOLVESUBCONVEX((*benderssolvesubconvex)), SCIP_DECL_BENDERSSOLVESUB((*benderssolvesub)), SCIP_DECL_BENDERSFREESUB((*bendersfreesub)))
 
SCIP_RETCODE SCIPsetBendersPostsolve (SCIP *scip, SCIP_BENDERS *benders, SCIP_DECL_BENDERSPOSTSOLVE((*benderspostsolve)))
 
SCIP_BENDERSSCIPfindBenders (SCIP *scip, const char *name)
 
SCIP_BENDERS ** SCIPgetBenders (SCIP *scip)
 
int SCIPgetNBenders (SCIP *scip)
 
int SCIPgetNActiveBenders (SCIP *scip)
 
SCIP_RETCODE SCIPactivateBenders (SCIP *scip, SCIP_BENDERS *benders, int nsubproblems)
 
SCIP_RETCODE SCIPdeactivateBenders (SCIP *scip, SCIP_BENDERS *benders)
 
void SCIPsetBendersPriority (SCIP *scip, SCIP_BENDERS *benders, int priority)
 
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)
 
SCIP_RETCODE SCIPgetBendersMasterVar (SCIP *scip, SCIP_BENDERS *benders, SCIP_VAR *var, SCIP_VAR **mappedvar)
 
SCIP_RETCODE SCIPgetBendersSubproblemVar (SCIP *scip, SCIP_BENDERS *benders, SCIP_VAR *var, SCIP_VAR **mappedvar, int probnumber)
 
int SCIPgetBendersNSubproblems (SCIP *scip, SCIP_BENDERS *benders)
 
SCIP_RETCODE SCIPaddBendersSubproblem (SCIP *scip, SCIP_BENDERS *benders, SCIP *subproblem)
 
SCIP_RETCODE SCIPsetupBendersSubproblem (SCIP *scip, SCIP_BENDERS *benders, SCIP_SOL *sol, int probnumber)
 
SCIP_RETCODE SCIPsolveBendersSubproblem (SCIP *scip, SCIP_BENDERS *benders, SCIP_SOL *sol, int probnumber, SCIP_Bool *infeasible, SCIP_BENDERSENFOTYPE type, SCIP_Bool solvecip, SCIP_Real *objective)
 
SCIP_RETCODE SCIPfreeBendersSubproblem (SCIP *scip, SCIP_BENDERS *benders, int probnumber)
 
SCIP_RETCODE SCIPcheckBendersSubproblemOptimality (SCIP *scip, SCIP_BENDERS *benders, SCIP_SOL *sol, int probnumber, SCIP_Bool *optimal)
 
SCIP_Real SCIPgetBendersAuxiliaryVarVal (SCIP *scip, SCIP_BENDERS *benders, SCIP_SOL *sol, int probnumber)
 
SCIP_RETCODE SCIPcomputeBendersSubproblemLowerbound (SCIP *scip, SCIP_BENDERS *benders, int probnumber, SCIP_Real *lowerbound, SCIP_Bool *infeasible)
 
SCIP_RETCODE SCIPmergeBendersSubproblemIntoMaster (SCIP *scip, SCIP_BENDERS *benders, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, int probnumber)
 

Function Documentation

◆ SCIP_DECL_SORTPTRCOMP() [1/2]

SCIP_DECL_SORTPTRCOMP ( SCIPbendersComp  )

compares two benderss w. r. to their priority

compares two Benders' decompositions w. r. to their priority

Definition at line 709 of file benders.c.

◆ SCIP_DECL_SORTPTRCOMP() [2/2]

SCIP_DECL_SORTPTRCOMP ( SCIPbendersCompName  )

comparison method for sorting benderss w.r.t. to their name

comparison method for sorting Benders' decompositions w.r.t. to their name

Definition at line 715 of file benders.c.

References SCIPbendersGetName().

◆ SCIPbendersGetData()

◆ SCIPbendersSetData()

void SCIPbendersSetData ( SCIP_BENDERS benders,
SCIP_BENDERSDATA bendersdata 
)

sets user data of Benders' decomposition; user has to free old data in advance!

Parameters
bendersBenders' decomposition
bendersdatanew Benders' decomposition user data

Definition at line 4040 of file benders.c.

References SCIP_Benders::bendersdata, and NULL.

Referenced by SCIP_DECL_BENDERSFREE().

◆ SCIPbendersGetName()

◆ SCIPbendersGetDesc()

const char* SCIPbendersGetDesc ( SCIP_BENDERS benders)

gets description of Benders' decomposition

Parameters
bendersBenders' decomposition

Definition at line 4204 of file benders.c.

References SCIP_Benders::desc, and NULL.

Referenced by SCIP_DECL_DIALOGEXEC().

◆ SCIPbendersGetPriority()

int SCIPbendersGetPriority ( SCIP_BENDERS benders)

gets priority of Benders' decomposition

Parameters
bendersBenders' decomposition

Definition at line 4214 of file benders.c.

References NULL, and SCIP_Benders::priority.

Referenced by SCIP_DECL_DIALOGEXEC().

◆ SCIPbendersGetNSubproblems()

int SCIPbendersGetNSubproblems ( SCIP_BENDERS benders)

gets the number of subproblems for the Benders' decomposition

Parameters
bendersthe Benders' decomposition data structure

Definition at line 4238 of file benders.c.

References SCIP_Benders::nsubproblems, and NULL.

Referenced by addAuxiliaryVariablesToMaster(), assignAuxiliaryVariables(), checkSubproblemIndependence(), constructValidSolution(), createSubproblems(), generateBendersCuts(), initialiseLPSubproblem(), initialiseSubproblem(), numSubproblemsToCheck(), resetSubproblemObjectiveValue(), SCIP_DECL_BENDERSCUTEXEC(), SCIP_DECL_BENDERSCUTINIT(), SCIP_DECL_CONSPRESOL(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_EVENTEXEC(), SCIPbendersChgMastervarsToCont(), SCIPbendersDeactivate(), SCIPbendersExec(), SCIPbendersExit(), SCIPbendersExitsol(), SCIPbendersGetAuxiliaryVar(), SCIPbendersGetMastervarsCont(), SCIPbendersGetSubproblemLowerbound(), SCIPbendersGetSubproblemObjval(), SCIPbendersSetMastervarsCont(), SCIPbendersSetSubproblemEnabled(), SCIPbendersSetSubproblemIsConvex(), SCIPbendersSetSubproblemIsIndependent(), SCIPbendersSetSubproblemIsSetup(), SCIPbendersSetSubproblemObjval(), SCIPbendersSetupSubproblem(), SCIPbendersSolveSubproblem(), SCIPbendersSubproblemIsConvex(), SCIPbendersSubproblemIsEnabled(), SCIPbendersSubproblemIsIndependent(), SCIPbendersSubproblemIsSetup(), SCIPbendersUpdateSubproblemLowerbound(), SCIPcheckBendersSubproblemOptimality(), SCIPgetBendersAuxiliaryVarVal(), SCIPgetBendersNSubproblems(), solveBendersSubproblems(), updateAuxiliaryVarLowerbound(), and updateSubproblemLowerbound().

◆ SCIPbendersSubproblem()

◆ SCIPbendersGetNCalls()

int SCIPbendersGetNCalls ( SCIP_BENDERS benders)

gets the number of times, the Bender' decomposition was called and tried to find a violated second stage constraint

gets the number of times, the Benders' decomposition was called and tried to find a variable with negative reduced costs

Parameters
bendersBenders' decomposition

Definition at line 4260 of file benders.c.

References SCIP_Benders::ncalls, and NULL.

Referenced by SCIP_DECL_BENDERSCUTEXEC(), and SCIPprintBendersStatistics().

◆ SCIPbendersGetNCutsFound()

int SCIPbendersGetNCutsFound ( SCIP_BENDERS benders)

gets the number of optimality cuts found by the collection of Benders' decomposition subproblems

Parameters
bendersBenders' decomposition

Definition at line 4270 of file benders.c.

References SCIP_Benders::ncutsfound, and NULL.

Referenced by SCIPprintBendersStatistics().

◆ SCIPbendersGetSetupTime()

SCIP_Real SCIPbendersGetSetupTime ( SCIP_BENDERS benders)

gets time in seconds used in this Benders' decomposition for setting up for next stages

Parameters
bendersBenders' decomposition

Definition at line 4280 of file benders.c.

References NULL, SCIPclockGetTime(), and SCIP_Benders::setuptime.

Referenced by SCIPprintBendersStatistics().

◆ SCIPbendersGetTime()

SCIP_Real SCIPbendersGetTime ( SCIP_BENDERS benders)

gets execution time in seconds used in this Benders' decomposition

gets time in seconds used in this Benders' decomposition

Parameters
bendersBenders' decomposition

Definition at line 4290 of file benders.c.

References SCIP_Benders::bendersclock, NULL, and SCIPclockGetTime().

Referenced by SCIPprintBendersStatistics().

◆ SCIPbendersIsInitialized()

SCIP_Bool SCIPbendersIsInitialized ( SCIP_BENDERS benders)

Is Benders' decomposition initialized?

is Benders' decomposition initialized?

Parameters
bendersBenders' decomposition

Definition at line 4312 of file benders.c.

References SCIP_Benders::initialized, and NULL.

◆ SCIPbendersIsActive()

SCIP_Bool SCIPbendersIsActive ( SCIP_BENDERS benders)

returns whether the given Benders' decomposition is in use in the current problem

Parameters
bendersthe Benders' decomposition structure

Definition at line 1932 of file benders.c.

References SCIP_Benders::active, and NULL.

Referenced by SCIP_DECL_BENDERSCOPY(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_EVENTINITSOL(), SCIPbendersCopyInclude(), and SCIPprintBendersStatistics().

◆ SCIPbendersOnlyCheckConvexRelax()

SCIP_Bool SCIPbendersOnlyCheckConvexRelax ( SCIP_BENDERS benders)

Returns whether only the convex relaxations will be checked in this solve loop when Benders' is used in the LNS heuristics, only the convex relaxations of the master/subproblems are checked, i.e. no integer cuts are generated. In this case, then Benders' decomposition is performed under the assumption that all subproblems are convex relaxations.

Parameters
bendersBenders' decomposition

Definition at line 2001 of file benders.c.

References SCIP_Benders::iscopy, and SCIP_Benders::lnscheck.

Referenced by executeUserDefinedSolvesub(), generateBendersCuts(), numSubproblemsToCheck(), SCIP_DECL_EVENTINITSOL(), SCIPbendersExec(), and solveBendersSubproblems().

◆ SCIPbendersCutLP()

SCIP_Bool SCIPbendersCutLP ( SCIP_BENDERS benders)

Are Benders' cuts generated from the LP solutions?

Parameters
bendersBenders' decomposition

Definition at line 4322 of file benders.c.

References SCIP_Benders::cutlp, and NULL.

Referenced by SCIPconsBendersEnforceSolution().

◆ SCIPbendersCutPseudo()

SCIP_Bool SCIPbendersCutPseudo ( SCIP_BENDERS benders)

Are Benders' cuts generated from the pseudo solutions?

Parameters
bendersBenders' decomposition

Definition at line 4332 of file benders.c.

References SCIP_Benders::cutpseudo, and NULL.

Referenced by SCIPconsBendersEnforceSolution().

◆ SCIPbendersCutRelaxation()

SCIP_Bool SCIPbendersCutRelaxation ( SCIP_BENDERS benders)

Are Benders' cuts generated from the relaxation solutions?

Parameters
bendersBenders' decomposition

Definition at line 4342 of file benders.c.

References SCIP_Benders::cutrelax, and NULL.

Referenced by SCIPconsBendersEnforceSolution().

◆ SCIPbendersShareAuxVars()

SCIP_Bool SCIPbendersShareAuxVars ( SCIP_BENDERS benders)

Should this Benders' use the auxiliary variables from the highest priority Benders'?

should this Benders' use the auxiliary variables from the highest priority Benders'

Parameters
bendersBenders' decomposition

Definition at line 4352 of file benders.c.

References NULL, and SCIP_Benders::shareauxvars.

Referenced by addAuxiliaryVariablesToMaster(), and assignAuxiliaryVariables().

◆ SCIPbendersGetAuxiliaryVar()

SCIP_VAR* SCIPbendersGetAuxiliaryVar ( SCIP_BENDERS benders,
int  probnumber 
)

returns the auxiliary variable for the given subproblem

Parameters
bendersBenders' decomposition
probnumberthe subproblem number

Definition at line 4392 of file benders.c.

References SCIP_Benders::auxiliaryvars, NULL, and SCIPbendersGetNSubproblems().

Referenced by addAuxiliaryVariablesToMaster(), addAuxiliaryVariableToCut(), SCIP_DECL_CONSPRESOL(), SCIPbendersGetAuxiliaryVarVal(), SCIPbendersMergeSubproblemIntoMaster(), updateAuxiliaryVarLowerbound(), and updateSubproblemLowerbound().

◆ SCIPbendersGetAuxiliaryVars()

SCIP_VAR** SCIPbendersGetAuxiliaryVars ( SCIP_BENDERS benders)

returns all auxiliary variables

Parameters
bendersBenders' decomposition

Definition at line 4404 of file benders.c.

References SCIP_Benders::auxiliaryvars, and NULL.

Referenced by constructValidSolution().

◆ SCIPbendersSetSubproblemObjval()

void SCIPbendersSetSubproblemObjval ( SCIP_BENDERS benders,
int  probnumber,
SCIP_Real  objval 
)

stores the objective function value of the subproblem for use in cut generation

Parameters
bendersthe Benders' decomposition structure
probnumberthe subproblem number
objvalthe objective function value for the subproblem

Definition at line 4414 of file benders.c.

References SCIP_Benders::bestsubprobobjval, NULL, SCIPbendersGetNSubproblems(), and SCIP_Benders::subprobobjval.

Referenced by resetSubproblemObjectiveValue(), SCIPbendersExecSubproblemSolve(), and solveBendersSubproblems().

◆ SCIPbendersGetSubproblemObjval()

SCIP_Real SCIPbendersGetSubproblemObjval ( SCIP_BENDERS benders,
int  probnumber 
)

returns the objective function value of the subproblem for use in cut generation

Parameters
bendersBenders' decomposition
probnumberthe subproblem number

Definition at line 4431 of file benders.c.

References NULL, SCIPbendersGetNSubproblems(), and SCIP_Benders::subprobobjval.

Referenced by computeStandardIntegerOptCut(), constructValidSolution(), SCIPbendersCheckSubproblemOptimality(), and solveBendersSubproblems().

◆ SCIPfindBenderscut()

SCIP_BENDERSCUT* SCIPfindBenderscut ( SCIP_BENDERS benders,
const char *  name 
)

returns the Benders' cut of the given name, or NULL if not existing

Parameters
bendersBenders' decomposition
namename of Benderscut' decomposition

Definition at line 4799 of file benders.c.

References SCIP_Benders::benderscuts, SCIP_Benders::nbenderscuts, NULL, and SCIPbenderscutGetName().

Referenced by SCIPfindObjBenderscut(), SCIPincludeBenderscut(), and SCIPincludeBenderscutBasic().

◆ SCIPbendersGetBenderscuts()

SCIP_BENDERSCUT** SCIPbendersGetBenderscuts ( SCIP_BENDERS benders)

returns the array of currently available Benders' cuts; active Benders' decomposition are in the first slots of the array

Parameters
bendersBenders' decomposition

Definition at line 4821 of file benders.c.

References SCIP_Benders::benderscuts, SCIP_Benders::benderscutsnamessorted, SCIP_Benders::benderscutssorted, FALSE, SCIP_Benders::nbenderscuts, NULL, SCIPsortPtr(), and TRUE.

Referenced by generateBendersCuts(), and SCIPprintBendersStatistics().

◆ SCIPbendersGetNBenderscuts()

int SCIPbendersGetNBenderscuts ( SCIP_BENDERS benders)

returns the number of currently available Benders' cuts

Parameters
bendersBenders' decomposition

Definition at line 4838 of file benders.c.

References SCIP_Benders::nbenderscuts, and NULL.

Referenced by generateBendersCuts(), and SCIPprintBendersStatistics().

◆ SCIPbendersSetBenderscutPriority()

SCIP_RETCODE SCIPbendersSetBenderscutPriority ( SCIP_BENDERS benders,
SCIP_BENDERSCUT benderscut,
int  priority 
)

sets the priority of a Benders' decomposition

Parameters
bendersBenders' decomposition
benderscutBenders' cut
prioritynew priority of the Benders' decomposition

Definition at line 4848 of file benders.c.

References SCIP_Benders::benderscutssorted, FALSE, NULL, SCIP_Benderscut::priority, and SCIP_OKAY.

◆ SCIPbendersSetSubproblemIsConvex()

void SCIPbendersSetSubproblemIsConvex ( SCIP_BENDERS benders,
int  probnumber,
SCIP_Bool  isconvex 
)

sets the flag indicating whether a subproblem is convex

It is possible that this can change during the solving process. One example is when the three-phase method is employed, where the first phase solves the convex relaxation of both the master and subproblems, the second phase reintroduces the integrality constraints to the master problem and the third phase then reintroduces integrality constraints to the subproblems.

Parameters
bendersBenders' decomposition
probnumberthe subproblem number
isconvexflag to indicate whether the subproblem is convex

Definition at line 4449 of file benders.c.

References SCIP_Benders::nconvexsubprobs, SCIP_Benders::nsubproblems, NULL, SCIPbendersGetNSubproblems(), and SCIP_Benders::subprobisconvex.

Referenced by createSubproblems(), SCIPbendersChgMastervarsToCont(), and SCIPbendersSetMastervarsCont().

◆ SCIPbendersSubproblemIsConvex()

SCIP_Bool SCIPbendersSubproblemIsConvex ( SCIP_BENDERS benders,
int  probnumber 
)

returns whether the subproblem is convex

This means that the dual solution can be used to generate cuts.

Parameters
bendersBenders' decomposition
probnumberthe subproblem number

Definition at line 4472 of file benders.c.

References NULL, SCIPbendersGetNSubproblems(), and SCIP_Benders::subprobisconvex.

Referenced by generateBendersCuts(), SCIP_DECL_DIALOGEXEC(), SCIPbendersComputeSubproblemLowerbound(), SCIPbendersExecSubproblemSolve(), SCIPbendersFreeSubproblem(), SCIPbendersSetupSubproblem(), SCIPbendersSolveSubproblem(), and solveBendersSubproblems().

◆ SCIPbendersGetNConvexSubproblems()

int SCIPbendersGetNConvexSubproblems ( SCIP_BENDERS benders)

returns the number of subproblems that are convex

Parameters
bendersBenders' decomposition

Definition at line 4484 of file benders.c.

References SCIP_Benders::nconvexsubprobs, and NULL.

Referenced by generateBendersCuts(), SCIP_DECL_EVENTEXEC(), and SCIPbendersExec().

◆ SCIPbendersSolveSubproblemLP()

SCIP_RETCODE SCIPbendersSolveSubproblemLP ( SCIP scip,
SCIP_BENDERS benders,
int  probnumber,
SCIP_Bool infeasible 
)

solves the LP of the Benders' decomposition subproblem

This requires that the subproblem is in probing mode.

Parameters
scipthe SCIP data structure
bendersthe Benders' decomposition data structure
probnumberthe subproblem number
infeasiblea flag to indicate whether all subproblems are feasible

Definition at line 3445 of file benders.c.

References FALSE, NULL, resetOrigSubproblemParams(), SCIP_Bool, SCIP_CALL, SCIP_LPSOLSTAT_ERROR, SCIP_LPSOLSTAT_INFEASIBLE, SCIP_LPSOLSTAT_NOTSOLVED, SCIP_LPSOLSTAT_OPTIMAL, SCIP_LPSOLSTAT_TIMELIMIT, SCIP_LPSOLSTAT_UNBOUNDEDRAY, SCIP_OKAY, SCIPABORT, SCIPallocBlockMemory, SCIPbendersSubproblem(), SCIPbendersSubproblemIsSetup(), SCIPerrorMessage, SCIPfreeBlockMemory, SCIPgetLPSolstat(), SCIPinProbing(), SCIPisLPConstructed(), SCIPsolveProbingLP(), setSubproblemParams(), storeOrigSubproblemParams(), and TRUE.

Referenced by SCIPbendersExecSubproblemSolve(), and SCIPbendersSolveSubproblem().

◆ SCIPbendersSolveSubproblemCIP()

SCIP_RETCODE SCIPbendersSolveSubproblemCIP ( SCIP scip,
SCIP_BENDERS benders,
int  probnumber,
SCIP_Bool infeasible,
SCIP_BENDERSENFOTYPE  type,
SCIP_Bool  solvecip 
)

◆ SCIPbendersGetNTransferredCuts()

int SCIPbendersGetNTransferredCuts ( SCIP_BENDERS benders)

returns the number of cuts that have been transferred from sub SCIPs to the master SCIP

Parameters
bendersthe Benders' decomposition data structure

Definition at line 4720 of file benders.c.

References SCIP_Benders::ntransferred, and NULL.

Referenced by createAndAddTransferredCut(), and SCIPprintBendersStatistics().

◆ SCIPbendersUpdateSubproblemLowerbound()

void SCIPbendersUpdateSubproblemLowerbound ( SCIP_BENDERS benders,
int  probnumber,
SCIP_Real  lowerbound 
)

updates the lower bound for the subproblem. If the lower bound is not greater than the previously stored lowerbound, then no update occurs.

Parameters
bendersBenders' decomposition
probnumberthe subproblem number
lowerboundthe lower bound

Definition at line 4732 of file benders.c.

References NULL, SCIPbendersGetNSubproblems(), SCIPdebugMessage, and SCIP_Benders::subproblowerbound.

Referenced by SCIP_DECL_CONSPRESOL(), updateAuxiliaryVarLowerbound(), and updateSubproblemLowerbound().

◆ SCIPbendersGetSubproblemLowerbound()

SCIP_Real SCIPbendersGetSubproblemLowerbound ( SCIP_BENDERS benders,
int  probnumber 
)

returns the stored lower bound for the given subproblem

Parameters
bendersBenders' decomposition
probnumberthe subproblem number

Definition at line 4751 of file benders.c.

References NULL, SCIPbendersGetNSubproblems(), and SCIP_Benders::subproblowerbound.

Referenced by generateAndApplyBendersIntegerCuts(), solveBendersSubproblems(), and updateSubproblemLowerbound().

◆ SCIPbendersSetSubproblemIsIndependent()

void SCIPbendersSetSubproblemIsIndependent ( SCIP_BENDERS benders,
int  probnumber,
SCIP_Bool  isindep 
)

sets the independent subproblem flag

Parameters
bendersBenders' decomposition
probnumberthe subproblem number
isindepflag to indicate whether the subproblem is independent

Definition at line 4589 of file benders.c.

References SCIP_Benders::indepsubprob, SCIP_Benders::nactivesubprobs, SCIP_Benders::name, NULL, SCIP_Bool, SCIPABORT, SCIPbendersGetNSubproblems(), SCIPerrorMessage, and subproblemIsActive().

Referenced by checkSubproblemIndependence(), and SCIPbendersExitsol().

◆ SCIPbendersSubproblemIsIndependent()

SCIP_Bool SCIPbendersSubproblemIsIndependent ( SCIP_BENDERS benders,
int  probnumber 
)

returns whether the subproblem is independent

Parameters
bendersBenders' decomposition
probnumberthe subproblem number

Definition at line 4629 of file benders.c.

References SCIP_Benders::indepsubprob, NULL, and SCIPbendersGetNSubproblems().

Referenced by SCIPbendersComputeSubproblemLowerbound(), SCIPbendersExitsol(), SCIPbendersSolveSubproblem(), and subproblemIsActive().

◆ SCIPbendersSubproblemIsEnabled()

SCIP_Bool SCIPbendersSubproblemIsEnabled ( SCIP_BENDERS benders,
int  probnumber 
)

returns whether the subproblem is enabled, i.e. the subproblem is still solved in the solving loop.

Parameters
bendersBenders' decomposition
probnumberthe subproblem number

Definition at line 4669 of file benders.c.

References NULL, SCIPbendersGetNSubproblems(), and SCIP_Benders::subprobenabled.

Referenced by subproblemIsActive().

◆ SCIPincludeBenders()

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 
)

creates a Benders' decomposition and includes it in SCIP

To use the Benders' decomposition for solving a problem, it first has to be activated with a call to SCIPactivateBenders(). This should be done during the problem creation stage.

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Note
method has all Benders' decomposition callbacks as arguments and is thus changed every time a new callback is added in future releases; consider using SCIPincludeBendersBasic() and setter functions if you seek for a method which is less likely to change in future releases
Parameters
scipSCIP data structure
namename of Benders' decomposition
descdescription of Benders' decomposition
prioritypriority of the Benders' decomposition
cutlpshould Benders' cuts be generated for LP solutions
cutpseudoshould Benders' cuts be generated for pseudo solutions
cutrelaxshould Benders' cuts be generated for relaxation solutions
shareauxvarsshould this Benders' use the highest priority Benders aux vars
bendersdataBenders' decomposition data

Definition at line 143 of file scip_benders.c.

References FALSE, Scip::mem, Scip::messagehdlr, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPbendersCreate(), SCIPcheckStage(), SCIPerrorMessage, SCIPfindBenders(), SCIPsetIncludeBenders(), Scip::set, SCIP_Mem::setmem, and TRUE.

Referenced by SCIPincludeObjBenders().

◆ SCIPincludeBendersBasic()

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 
)

creates a Benders' decomposition and includes it in SCIP with all non-fundamental callbacks set to NULL

If needed, the non-fundamental callbacks can be added afterwards via setter functions SCIPsetBendersCopy(), SCIPsetBendersFree(), SCIPsetBendersInity(), SCIPsetBendersExit(), SCIPsetBendersInitsol(), SCIPsetBendersExitsol(), SCIPsetBendersFarkas().

To use the Benders' decomposition for solving a problem, it first has to be activated with a call to SCIPactivateBenders(). This should be done during the problem creation stage.

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Note
if you want to set all callbacks with a single method call, consider using SCIPincludeBenders() instead
Parameters
scipSCIP data structure
bendersptrreference to a benders, or NULL
namename of Benders' decomposition
descdescription of Benders' decomposition
prioritypriority of the Benders' decomposition
cutlpshould Benders' cuts be generated for LP solutions
cutpseudoshould Benders' cuts be generated for pseudo solutions
cutrelaxshould Benders' cuts be generated for relaxation solutions
shareauxvarsshould this Benders' use the highest priority Benders aux vars
bendersdataBenders' decomposition data

Definition at line 218 of file scip_benders.c.

References FALSE, Scip::mem, Scip::messagehdlr, NULL, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPbendersCreate(), SCIPcheckStage(), SCIPerrorMessage, SCIPfindBenders(), SCIPsetIncludeBenders(), Scip::set, SCIP_Mem::setmem, and TRUE.

Referenced by SCIPincludeBendersDefault().

◆ SCIPsetBendersCopy()

SCIP_RETCODE SCIPsetBendersCopy ( SCIP scip,
SCIP_BENDERS benders,
SCIP_DECL_BENDERSCOPY((*benderscopy))   
)

sets copy method of benders

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition

Definition at line 264 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersSetCopy(), SCIPcheckStage(), and TRUE.

Referenced by SCIPincludeBendersDefault().

◆ SCIPsetBendersFree()

SCIP_RETCODE SCIPsetBendersFree ( SCIP scip,
SCIP_BENDERS benders,
SCIP_DECL_BENDERSFREE((*bendersfree))   
)

sets destructor method of benders

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition

Definition at line 288 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersSetFree(), SCIPcheckStage(), and TRUE.

Referenced by SCIPincludeBendersDefault().

◆ SCIPsetBendersInit()

SCIP_RETCODE SCIPsetBendersInit ( SCIP scip,
SCIP_BENDERS benders,
SCIP_DECL_BENDERSINIT((*bendersinit))   
)

sets initialization method of benders

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition

Definition at line 312 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersSetInit(), SCIPcheckStage(), and TRUE.

Referenced by SCIPincludeBendersDefault().

◆ SCIPsetBendersExit()

SCIP_RETCODE SCIPsetBendersExit ( SCIP scip,
SCIP_BENDERS benders,
SCIP_DECL_BENDERSEXIT((*bendersexit))   
)

sets deinitialization method of benders

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition

Definition at line 336 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersSetExit(), SCIPcheckStage(), and TRUE.

◆ SCIPsetBendersInitpre()

SCIP_RETCODE SCIPsetBendersInitpre ( SCIP scip,
SCIP_BENDERS benders,
SCIP_DECL_BENDERSINITPRE((*bendersinitpre))   
)

sets presolving initialization method of benders

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition

Definition at line 360 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersSetInitpre(), SCIPcheckStage(), and TRUE.

◆ SCIPsetBendersExitpre()

SCIP_RETCODE SCIPsetBendersExitpre ( SCIP scip,
SCIP_BENDERS benders,
SCIP_DECL_BENDERSEXITPRE((*bendersexitpre))   
)

sets presolving deinitialization method of benders

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition

Definition at line 384 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersSetExitpre(), SCIPcheckStage(), and TRUE.

◆ SCIPsetBendersInitsol()

SCIP_RETCODE SCIPsetBendersInitsol ( SCIP scip,
SCIP_BENDERS benders,
SCIP_DECL_BENDERSINITSOL((*bendersinitsol))   
)

sets solving process initialization method of benders

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition

Definition at line 408 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersSetInitsol(), SCIPcheckStage(), and TRUE.

◆ SCIPsetBendersExitsol()

SCIP_RETCODE SCIPsetBendersExitsol ( SCIP scip,
SCIP_BENDERS benders,
SCIP_DECL_BENDERSEXITSOL((*bendersexitsol))   
)

sets solving process deinitialization method of benders

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition

Definition at line 432 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersSetExitsol(), SCIPcheckStage(), and TRUE.

◆ SCIPsetBendersPresubsolve()

SCIP_RETCODE SCIPsetBendersPresubsolve ( SCIP scip,
SCIP_BENDERS benders,
SCIP_DECL_BENDERSPRESUBSOLVE((*benderspresubsolve))   
)

sets the method called prior to solving the subproblems for benders

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition

Definition at line 456 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersSetPresubsolve(), SCIPcheckStage(), and TRUE.

◆ SCIPsetBendersSolveAndFreesub()

SCIP_RETCODE SCIPsetBendersSolveAndFreesub ( SCIP scip,
SCIP_BENDERS benders,
SCIP_DECL_BENDERSSOLVESUBCONVEX((*benderssolvesubconvex))  ,
SCIP_DECL_BENDERSSOLVESUB((*benderssolvesub))  ,
SCIP_DECL_BENDERSFREESUB((*bendersfreesub))   
)

sets the subproblem solving and freeing methods for Benders' decomposition

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition

Definition at line 480 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPbendersGetName(), SCIPbendersSetFreesub(), SCIPbendersSetSolvesub(), SCIPbendersSetSolvesubconvex(), SCIPcheckStage(), SCIPerrorMessage, and TRUE.

◆ SCIPsetBendersPostsolve()

SCIP_RETCODE SCIPsetBendersPostsolve ( SCIP scip,
SCIP_BENDERS benders,
SCIP_DECL_BENDERSPOSTSOLVE((*benderspostsolve))   
)

sets the post solving methods for benders

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition

Definition at line 520 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersSetPostsolve(), SCIPcheckStage(), and TRUE.

◆ SCIPfindBenders()

SCIP_BENDERS* SCIPfindBenders ( SCIP scip,
const char *  name 
)

returns the Benders' decomposition of the given name, or NULL if not existing

Parameters
scipSCIP data structure
namename of Benders' decomposition

Definition at line 536 of file scip_benders.c.

References NULL, SCIPsetFindBenders(), and Scip::set.

Referenced by createAndAddTransferredCut(), SCIPcreateBendersDefault(), SCIPfindObjBenders(), SCIPfindObjBenderscut(), SCIPincludeBenders(), SCIPincludeBendersBasic(), SCIPincludeObjBenderscut(), and transferBendersCuts().

◆ SCIPgetBenders()

SCIP_BENDERS** SCIPgetBenders ( SCIP scip)

returns the array of currently available Benders' decomposition; active Benders' decomposition are in the first slots of the array

Parameters
scipSCIP data structure

Definition at line 551 of file scip_benders.c.

References SCIP_Set::benders, NULL, SCIPsetSortBenders(), and Scip::set.

Referenced by addAuxiliaryVariablesToMaster(), assignAuxiliaryVariables(), constructValidSolution(), SCIP_DECL_CONSCHECK(), SCIP_DECL_CONSPRESOL(), SCIP_DECL_DIALOGEXEC(), SCIPconsBendersEnforceSolution(), SCIPprintBendersStatistics(), and SCIPsetBenderscutPriority().

◆ SCIPgetNBenders()

int SCIPgetNBenders ( SCIP scip)

returns the number of currently available Benders' decomposition

Parameters
scipSCIP data structure

Definition at line 564 of file scip_benders.c.

References SCIP_Set::nbenders, NULL, and Scip::set.

Referenced by SCIP_DECL_DIALOGEXEC(), SCIPprintBendersStatistics(), and SCIPsetBenderscutPriority().

◆ SCIPgetNActiveBenders()

int SCIPgetNActiveBenders ( SCIP scip)

returns the number of currently active Benders' decomposition

Parameters
scipSCIP data structure

Definition at line 575 of file scip_benders.c.

References SCIP_Set::nactivebenders, NULL, and Scip::set.

Referenced by constructValidSolution(), SCIP_DECL_CONSCHECK(), SCIP_DECL_CONSPRESOL(), SCIP_DECL_DIALOGEXEC(), SCIPconsBendersEnforceSolution(), and SCIPprintBendersStatistics().

◆ SCIPactivateBenders()

SCIP_RETCODE SCIPactivateBenders ( SCIP scip,
SCIP_BENDERS benders,
int  nsubproblems 
)

activates the Benders' decomposition to be used for the current problem

This method should be called during the problem creation stage for all pricers that are necessary to solve the problem model.

Note
The Benders' decompositions are automatically deactivated when the problem is freed.
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersthe Benders' decomposition structure
nsubproblemsthe number of subproblems in the Benders' decomposition

Definition at line 598 of file scip_benders.c.

References FALSE, SCIP_CALL, SCIP_OKAY, SCIPbendersActivate(), SCIPcheckStage(), Scip::set, and TRUE.

Referenced by SCIPcreateBendersDefault().

◆ SCIPdeactivateBenders()

SCIP_RETCODE SCIPdeactivateBenders ( SCIP scip,
SCIP_BENDERS benders 
)

deactivates the Benders' decomposition

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersthe Benders' decomposition structure

Definition at line 620 of file scip_benders.c.

References FALSE, SCIP_CALL, SCIP_OKAY, SCIPbendersDeactivate(), SCIPcheckStage(), Scip::set, and TRUE.

◆ SCIPsetBendersPriority()

void SCIPsetBendersPriority ( SCIP scip,
SCIP_BENDERS benders,
int  priority 
)

sets the priority of a Benders' decomposition

Parameters
scipSCIP data structure
bendersBenders' decomposition
prioritynew priority of the Benders' decomposition

Definition at line 633 of file scip_benders.c.

References NULL, SCIPbendersSetPriority(), and Scip::set.

Referenced by SCIP_DECL_PARAMCHGD().

◆ SCIPsolveBendersSubproblems()

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 
)

calls the exec method of Benders' decomposition to solve the subproblems

The checkint flag indicates whether integer feasibility can be assumed. If it is not assumed, i.e. checkint == FALSE, then only the convex relaxations of the subproblems are solved. If integer feasibility is assumed, i.e. checkint == TRUE, then the convex relaxations and the full CIP are solved to generate Benders' cuts and check solution feasibility.

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition
solprimal CIP solution, can be NULL
resultresult of the pricing process
infeasibleis the master problem infeasible with respect to the Benders' cuts?
auxviolset to TRUE only if the solution is feasible but the aux vars are violated
typethe type of solution being enforced
checkintshould the integer solution be checked by the subproblems

Definition at line 665 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersExec(), SCIPcheckStage(), Scip::set, and TRUE.

Referenced by SCIP_DECL_CONSCHECK(), and SCIPconsBendersEnforceSolution().

◆ SCIPgetBendersMasterVar()

SCIP_RETCODE SCIPgetBendersMasterVar ( SCIP scip,
SCIP_BENDERS benders,
SCIP_VAR var,
SCIP_VAR **  mappedvar 
)

returns the master problem variable for the given subproblem variable

This function is used as part of the cut generation process.

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition
varthe subproblem variable
mappedvarpointer to store the master variable that var is mapped to

Definition at line 703 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersGetVar(), SCIPcheckStage(), Scip::set, and TRUE.

Referenced by computeStandardFeasibilityCut(), computeStandardOptimalityCut(), and SCIPbendersMergeSubproblemIntoMaster().

◆ SCIPgetBendersSubproblemVar()

SCIP_RETCODE SCIPgetBendersSubproblemVar ( SCIP scip,
SCIP_BENDERS benders,
SCIP_VAR var,
SCIP_VAR **  mappedvar,
int  probnumber 
)

returns the subproblem problem variable for the given master variable

This function is used as part of the cut generation process.

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition
varthe master variable
mappedvarpointer to store the subproblem variable that var is mapped to
probnumberthe subproblem number

Definition at line 739 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersGetVar(), SCIPcheckStage(), SCIPgetBendersNSubproblems(), Scip::set, and TRUE.

Referenced by checkSubproblemIndependence(), and computeStandardIntegerOptCut().

◆ SCIPgetBendersNSubproblems()

int SCIPgetBendersNSubproblems ( SCIP scip,
SCIP_BENDERS benders 
)

returns the number of subproblems that are stored in the given Benders' decomposition

Returns
the number of subproblems in the Benders' decomposition
Parameters
scipSCIP data structure
bendersBenders' decomposition

Definition at line 765 of file scip_benders.c.

References NULL, and SCIPbendersGetNSubproblems().

Referenced by SCIPcomputeBendersSubproblemLowerbound(), SCIPfreeBendersSubproblem(), SCIPgetBendersSubproblemVar(), SCIPmergeBendersSubproblemIntoMaster(), SCIPsetupBendersSubproblem(), and SCIPsolveBendersSubproblem().

◆ SCIPaddBendersSubproblem()

SCIP_RETCODE SCIPaddBendersSubproblem ( SCIP scip,
SCIP_BENDERS benders,
SCIP subproblem 
)

registers the Benders' decomposition subproblem with the Benders' decomposition struct.

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:

registers the Benders' decomposition subproblem with the Benders' decomposition struct

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition
subproblemBenders' decomposition subproblem

Definition at line 784 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersAddSubproblem(), SCIPcheckStage(), and TRUE.

Referenced by SCIP_DECL_BENDERSCREATESUB().

◆ SCIPsetupBendersSubproblem()

SCIP_RETCODE SCIPsetupBendersSubproblem ( SCIP scip,
SCIP_BENDERS benders,
SCIP_SOL sol,
int  probnumber 
)

calls the generic subproblem setup method for a Benders' decomposition subproblem

This is called if the user requires to solve the Benders' decomposition subproblem separately from the main Benders' solving loop. This could be in the case of enhancement techniques.

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:

calls the generic subproblem setup method for a Benders' decomposition subproblem

This is called if the user requires to solve the Benders' decomposition subproblem separately from the main Benders' solving loop. This could be in the case of enhancement techniques.

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersthe Benders' decomposition data structure
solprimal solution used to setup the problem, NULL for LP solution
probnumberthe subproblem number

Definition at line 819 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersSetupSubproblem(), SCIPcheckStage(), SCIPgetBendersNSubproblems(), Scip::set, and TRUE.

Referenced by SCIP_DECL_DIALOGEXEC().

◆ SCIPsolveBendersSubproblem()

SCIP_RETCODE SCIPsolveBendersSubproblem ( SCIP scip,
SCIP_BENDERS benders,
SCIP_SOL sol,
int  probnumber,
SCIP_Bool infeasible,
SCIP_BENDERSENFOTYPE  type,
SCIP_Bool  solvecip,
SCIP_Real objective 
)

calls the solving method for a single Benders' decomposition subproblem

The method either calls the users solve subproblem method or calls the generic method. In the case of the generic method, the user must set up the subproblem prior to calling this method.

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:

calls the solving method for a single Benders' decomposition subproblem

The method either calls the users solve subproblem method or calls the generic method. In the case of the generic method, the user must set up the subproblem prior to calling this method.

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition
solprimal CIP solution, can be NULL for the current LP/Pseudo solution
probnumberthe subproblem number
infeasiblereturns whether the current subproblem is infeasible
typethe enforcement type calling this function
solvecipdirectly solve the CIP subproblem
objectivethe objective function value of the subproblem, can be NULL

Definition at line 856 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersSolveSubproblem(), SCIPcheckStage(), SCIPgetBendersNSubproblems(), Scip::set, and TRUE.

Referenced by SCIP_DECL_DIALOGEXEC().

◆ SCIPfreeBendersSubproblem()

SCIP_RETCODE SCIPfreeBendersSubproblem ( SCIP scip,
SCIP_BENDERS benders,
int  probnumber 
)

frees the subproblem after calling the solve subproblem method

This will either call the user defined free subproblem callback for Benders' decomposition or the default freeing methods. In the default case, if the subproblem is an LP, then SCIPendProbing is called. If the subproblem is a MIP, then SCIPfreeTransform is called.

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:

frees the subproblem after calling the solve subproblem method

This will either call the user defined free subproblem callback for Benders' decomposition or the default freeing methods. In the default case, if the subproblem is an LP, then SCIPendProbing is called. If the subproblem is a MIP, then SCIPfreeTransform is called.

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
Parameters
scipSCIP data structure
bendersBenders' decomposition
probnumberthe subproblem number

Definition at line 900 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersFreeSubproblem(), SCIPcheckStage(), SCIPgetBendersNSubproblems(), Scip::set, and TRUE.

Referenced by SCIP_DECL_DIALOGEXEC().

◆ SCIPcheckBendersSubproblemOptimality()

SCIP_RETCODE SCIPcheckBendersSubproblemOptimality ( SCIP scip,
SCIP_BENDERS benders,
SCIP_SOL sol,
int  probnumber,
SCIP_Bool optimal 
)

checks the optimality of a Benders' decomposition subproblem by comparing the objective function value against the value of the corresponding auxiliary variable

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
This method can be called if requested subproblem is in one of the following stages:

checks the optimality of a Benders' decomposition subproblem by comparing the objective function value against the value of the corresponding auxiliary variable

Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Precondition
This method can be called if SCIP is in one of the following stages:
This method can be called if requested subproblem is in one of the following stages:
Parameters
scipSCIP data structure
bendersthe benders' decomposition structure
solprimal CIP solution, can be NULL for the current LP solution
probnumberthe number of the pricing problem
optimalflag to indicate whether the current subproblem is optimal for the master

Definition at line 934 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersCheckSubproblemOptimality(), SCIPbendersGetNSubproblems(), SCIPbendersSubproblem(), SCIPcheckStage(), Scip::set, and TRUE.

Referenced by generateAndApplyBendersCuts(), and generateAndApplyBendersIntegerCuts().

◆ SCIPgetBendersAuxiliaryVarVal()

SCIP_Real SCIPgetBendersAuxiliaryVarVal ( SCIP scip,
SCIP_BENDERS benders,
SCIP_SOL sol,
int  probnumber 
)

returns the value of the auxiliary variable for a given subproblem

returns the value of the auxiliary variable for a given subproblem

Returns
the value of the auxiliary variable for the given subproblem
Parameters
scipSCIP data structure
bendersthe benders' decomposition structure
solprimal CIP solution, can be NULL for the current LP solution
probnumberthe number of the pricing problem

Definition at line 960 of file scip_benders.c.

References NULL, SCIPbendersGetAuxiliaryVarVal(), SCIPbendersGetNSubproblems(), and Scip::set.

◆ SCIPcomputeBendersSubproblemLowerbound()

SCIP_RETCODE SCIPcomputeBendersSubproblemLowerbound ( SCIP scip,
SCIP_BENDERS benders,
int  probnumber,
SCIP_Real lowerbound,
SCIP_Bool infeasible 
)

solves an independent subproblem to identify its lower bound and updates the lower bound of the corresponding auxiliary variable

Precondition
This method can be called if SCIP is in one of the following stages:
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Parameters
scipthe SCIP data structure
bendersBenders' decomposition
probnumberthe subproblem to be evaluated
lowerboundthe lowerbound for the subproblem
infeasiblewas the subproblem found to be infeasible?

Definition at line 988 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersComputeSubproblemLowerbound(), SCIPcheckStage(), SCIPgetBendersNSubproblems(), Scip::set, and TRUE.

Referenced by SCIP_DECL_CONSPRESOL().

◆ SCIPmergeBendersSubproblemIntoMaster()

SCIP_RETCODE SCIPmergeBendersSubproblemIntoMaster ( SCIP scip,
SCIP_BENDERS benders,
SCIP_HASHMAP varmap,
SCIP_HASHMAP consmap,
int  probnumber 
)

merges a subproblem into the master problem.

This process just adds a copy of the subproblem variables and constraints to the master problem, but keeps the subproblem stored in the Benders' decomposition data structure. The reason for keeping the subproblem available is for when it is queried for solutions after the problem is solved.

Once the subproblem is merged into the master problem, then the subproblem is flagged as disabled. This means that it will not be solved in the subsequent subproblem solving loops.

The associated auxiliary variables are kept in the master problem. The objective function of the merged subproblem is added as an underestimator constraint.

Precondition
This method can be called if SCIP is in one of the following stages:
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.

Merges a subproblem into the master problem. This process just adds a copy of the subproblem variables and constraints to the master problem, but keeps the subproblem stored in the Benders' decomposition data structure. The reason for keeping the subproblem available is for when it is queried for solutions after the problem is solved.

Once the subproblem is merged into the master problem, then the subproblem is flagged as disabled. This means that it will not be solved in the subsequent subproblem solving loops.

The associated auxiliary variables are kept in the master problem. The objective function of the merged subproblem is added as an underestimator constraint.

Precondition
This method can be called if SCIP is in one of the following stages:
Returns
SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
Parameters
scipthe SCIP data structure
bendersBenders' decomposition
varmapa hashmap to store the mapping of subproblem variables corresponding to the newly created master variables, or NULL
consmapa hashmap to store the mapping of subproblem constraints to the corresponding newly created constraints, or NULL
probnumberthe number of the subproblem that will be merged into the master problem

Definition at line 1028 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbendersMergeSubproblemIntoMaster(), SCIPcheckStage(), SCIPgetBendersNSubproblems(), Scip::set, and TRUE.