Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

methods for Benders' decomposition cuts plugins

Functions

 SCIP_DECL_SORTPTRCOMP (SCIPbenderscutComp)
 
 SCIP_DECL_SORTPTRCOMP (SCIPbenderscutCompName)
 
SCIP_BENDERSCUTDATASCIPbenderscutGetData (SCIP_BENDERSCUT *benderscut)
 
void SCIPbenderscutSetData (SCIP_BENDERSCUT *benderscut, SCIP_BENDERSCUTDATA *benderscutdata)
 
const char * SCIPbenderscutGetName (SCIP_BENDERSCUT *benderscut)
 
const char * SCIPbenderscutGetDesc (SCIP_BENDERSCUT *benderscut)
 
int SCIPbenderscutGetPriority (SCIP_BENDERSCUT *benderscut)
 
SCIP_Longint SCIPbenderscutGetNCalls (SCIP_BENDERSCUT *benderscut)
 
SCIP_Longint SCIPbenderscutGetNFound (SCIP_BENDERSCUT *benderscut)
 
SCIP_Bool SCIPbenderscutIsInitialized (SCIP_BENDERSCUT *benderscut)
 
SCIP_Real SCIPbenderscutGetSetupTime (SCIP_BENDERSCUT *benderscut)
 
SCIP_Real SCIPbenderscutGetTime (SCIP_BENDERSCUT *benderscut)
 
SCIP_Bool SCIPbenderscutIsLPCut (SCIP_BENDERSCUT *benderscut)
 
void SCIPbenderscutSetEnabled (SCIP_BENDERSCUT *benderscut, SCIP_Bool enabled)
 
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 SCIPsetBenderscutCopy (SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy)))
 
SCIP_RETCODE SCIPsetBenderscutFree (SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTFREE((*benderscutfree)))
 
SCIP_RETCODE SCIPsetBenderscutInit (SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTINIT((*benderscutinit)))
 
SCIP_RETCODE SCIPsetBenderscutExit (SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTEXIT((*benderscutexit)))
 
SCIP_RETCODE SCIPsetBenderscutInitsol (SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol)))
 
SCIP_RETCODE SCIPsetBenderscutExitsol (SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol)))
 
SCIP_RETCODE SCIPsetBenderscutPriority (SCIP *scip, SCIP_BENDERSCUT *benderscut, int priority)
 
SCIP_RETCODE SCIPstoreBendersCut (SCIP *scip, SCIP_BENDERS *benders, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, int nvars)
 
SCIP_RETCODE SCIPapplyBendersStoredCuts (SCIP *scip, SCIP_BENDERS *benders)
 

Function Documentation

◆ SCIP_DECL_SORTPTRCOMP() [1/2]

SCIP_DECL_SORTPTRCOMP ( SCIPbenderscutComp  )

compares two Benders' decomposition cuts w. r. to their priority

compares two Benders' cuts w. r. to their delay positions and their priority

Definition at line 44 of file benderscut.c.

References NULL, and SCIP_Benderscut::priority.

◆ SCIP_DECL_SORTPTRCOMP() [2/2]

SCIP_DECL_SORTPTRCOMP ( SCIPbenderscutCompName  )

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

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

Definition at line 56 of file benderscut.c.

References SCIPbenderscutGetName().

◆ SCIPbenderscutGetData()

◆ SCIPbenderscutSetData()

void SCIPbenderscutSetData ( SCIP_BENDERSCUT benderscut,
SCIP_BENDERSCUTDATA benderscutdata 
)

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

Parameters
benderscutBenders' decomposition cut
benderscutdatanew Benders' decomposition cut user data

Definition at line 404 of file benderscut.c.

References SCIP_Benderscut::benderscutdata, and NULL.

Referenced by SCIP_DECL_BENDERSCUTFREE().

◆ SCIPbenderscutGetName()

const char* SCIPbenderscutGetName ( SCIP_BENDERSCUT benderscut)

gets name of the Benders' decomposition cut

Parameters
benderscutBenders' decomposition cut

Definition at line 483 of file benderscut.c.

References SCIP_Benderscut::name, and NULL.

Referenced by SCIP_DECL_BENDERSCUTEXIT(), SCIP_DECL_BENDERSCUTFREE(), SCIP_DECL_BENDERSCUTINIT(), SCIP_DECL_SORTPTRCOMP(), SCIPbenderscutCopyInclude(), SCIPfindBenderscut(), and SCIPprintBendersStatistics().

◆ SCIPbenderscutGetDesc()

const char* SCIPbenderscutGetDesc ( SCIP_BENDERSCUT benderscut)

gets description of the Benders' decomposition cut

Parameters
benderscutBenders' decomposition cut

Definition at line 493 of file benderscut.c.

References SCIP_Benderscut::desc, and NULL.

◆ SCIPbenderscutGetPriority()

int SCIPbenderscutGetPriority ( SCIP_BENDERSCUT benderscut)

gets priority of the Benders' decomposition cut

Parameters
benderscutBenders' decomposition cut

Definition at line 503 of file benderscut.c.

References NULL, and SCIP_Benderscut::priority.

◆ SCIPbenderscutGetNCalls()

SCIP_Longint SCIPbenderscutGetNCalls ( SCIP_BENDERSCUT benderscut)

gets the number of times, the Benders' decomposition cut was called and tried to find a violated cut

gets the number of times, the heuristic was called and tried to find a solution

Parameters
benderscutBenders' decomposition cut

Definition at line 524 of file benderscut.c.

References SCIP_Benderscut::ncalls, and NULL.

Referenced by SCIPprintBendersStatistics().

◆ SCIPbenderscutGetNFound()

SCIP_Longint SCIPbenderscutGetNFound ( SCIP_BENDERSCUT benderscut)

gets the number of the cuts found by this Benders' decomposition cut

gets the number of Benders' cuts found by this Benders' decomposition cut

Parameters
benderscutBenders' decomposition cut

Definition at line 534 of file benderscut.c.

References SCIP_Benderscut::nfound, and NULL.

Referenced by generateAndApplyBendersCuts(), generateAndApplyBendersIntegerCuts(), generateAndApplyBendersNogoodCut(), generateBendersCuts(), SCIP_DECL_BENDERSCUTEXEC(), and SCIPprintBendersStatistics().

◆ SCIPbenderscutIsInitialized()

SCIP_Bool SCIPbenderscutIsInitialized ( SCIP_BENDERSCUT benderscut)

is the Benders' decomposition cut initialized?

Parameters
benderscutBenders' decomposition cut

Definition at line 544 of file benderscut.c.

References SCIP_Benderscut::initialized, and NULL.

◆ SCIPbenderscutGetSetupTime()

SCIP_Real SCIPbenderscutGetSetupTime ( SCIP_BENDERSCUT benderscut)

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

gets time in seconds used by this Benders' decomposition cut for setting up

Parameters
benderscutBenders' decomposition cut

Definition at line 554 of file benderscut.c.

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

Referenced by SCIPprintBendersStatistics().

◆ SCIPbenderscutGetTime()

SCIP_Real SCIPbenderscutGetTime ( SCIP_BENDERSCUT benderscut)

gets time in seconds used in this Benders' decomposition cut

Parameters
benderscutBenders' decomposition cut

Definition at line 564 of file benderscut.c.

References SCIP_Benderscut::benderscutclock, NULL, and SCIPclockGetTime().

Referenced by SCIPprintBendersStatistics().

◆ SCIPbenderscutIsLPCut()

SCIP_Bool SCIPbenderscutIsLPCut ( SCIP_BENDERSCUT benderscut)

returns whether the Benders' cut uses the LP information

Parameters
benderscutBenders' decomposition cut

Definition at line 574 of file benderscut.c.

References SCIP_Benderscut::islpcut, and NULL.

Referenced by generateBendersCuts().

◆ SCIPbenderscutSetEnabled()

void SCIPbenderscutSetEnabled ( SCIP_BENDERSCUT benderscut,
SCIP_Bool  enabled 
)

sets the enabled flag of the Benders' decomposition cut method

Parameters
benderscutBenders' decomposition cut
enabledflag to indicate whether the Benders' decomposition cut is enabled

Definition at line 584 of file benderscut.c.

References SCIP_Benderscut::enabled, and NULL.

Referenced by SCIP_DECL_BENDERSCUTEXEC().

◆ SCIPincludeBenderscut()

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 
)

creates a Benders' cut algorithms and includes it in the associated Benders' decomposition

This should be called from the SCIPincludeBendersXyz for the associated Benders' decomposition. It is only possible to include a Benders' cut algorithm if a Benders' decomposition has already been included 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
bendersBenders' decomposition
namename of Benders' decomposition cuts
descdescription of Benders' decomposition cuts
prioritypriority of the Benders' decomposition cuts
islpcutindicates whether the cut is generated from the LP solution
benderscutdataBenders' decomposition cuts data

Definition at line 1076 of file scip_benders.c.

References FALSE, Scip::mem, Scip::messagehdlr, NULL, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPbenderscutCreate(), SCIPbendersIncludeBenderscut(), SCIPcheckStage(), SCIPerrorMessage, SCIPfindBenderscut(), Scip::set, SCIP_Mem::setmem, and TRUE.

Referenced by SCIPincludeObjBenderscut().

◆ SCIPincludeBenderscutBasic()

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 
)

creates a Benders' cut and includes it an associated Benders' decomposition with all non-fundamental callbacks set to NULL

If needed, the non-fundamental callbacks can be added afterwards via setter functions SCIPsetBenderscutCopy(), SCIPsetBenderscutFree(), SCIPsetBenderscutInit(), SCIPsetBenderscutExit(), SCIPsetBenderscutInitsol(), SCIPsetBenderscutExitsol().

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
bendersBenders' decomposition
benderscutptrreference to a Benders' decomposition cut, or NULL
namename of Benders' decomposition
descdescription of Benders' decomposition
prioritypriority of the Benders' decomposition
islpcutindicates whether the cut is generated from the LP solution
benderscutdataBenders' cut data

Definition at line 1129 of file scip_benders.c.

References FALSE, Scip::mem, Scip::messagehdlr, NULL, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPbenderscutCreate(), SCIPbendersIncludeBenderscut(), SCIPcheckStage(), SCIPerrorMessage, SCIPfindBenderscut(), Scip::set, SCIP_Mem::setmem, and TRUE.

Referenced by SCIPincludeBenderscutFeas(), SCIPincludeBenderscutFeasalt(), SCIPincludeBenderscutInt(), SCIPincludeBenderscutNogood(), and SCIPincludeBenderscutOpt().

◆ SCIPsetBenderscutCopy()

SCIP_RETCODE SCIPsetBenderscutCopy ( SCIP scip,
SCIP_BENDERSCUT benderscut,
SCIP_DECL_BENDERSCUTCOPY((*benderscutcopy))   
)

sets copy method of Benders' decomposition cut

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
benderscutBenders' decomposition cut

Definition at line 1171 of file scip_benders.c.

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

◆ SCIPsetBenderscutFree()

SCIP_RETCODE SCIPsetBenderscutFree ( SCIP scip,
SCIP_BENDERSCUT benderscut,
SCIP_DECL_BENDERSCUTFREE((*benderscutfree))   
)

sets destructor method of benderscut

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
benderscutbenderscut

Definition at line 1195 of file scip_benders.c.

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

Referenced by SCIPincludeBenderscutFeasalt(), SCIPincludeBenderscutInt(), SCIPincludeBenderscutNogood(), and SCIPincludeBenderscutOpt().

◆ SCIPsetBenderscutInit()

SCIP_RETCODE SCIPsetBenderscutInit ( SCIP scip,
SCIP_BENDERSCUT benderscut,
SCIP_DECL_BENDERSCUTINIT((*benderscutinit))   
)

sets initialization method of benderscut

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
benderscutbenderscut

Definition at line 1219 of file scip_benders.c.

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

Referenced by SCIPincludeBenderscutInt().

◆ SCIPsetBenderscutExit()

SCIP_RETCODE SCIPsetBenderscutExit ( SCIP scip,
SCIP_BENDERSCUT benderscut,
SCIP_DECL_BENDERSCUTEXIT((*benderscutexit))   
)

sets deinitialization method of benderscut

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
benderscutbenderscut

Definition at line 1243 of file scip_benders.c.

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

Referenced by SCIPincludeBenderscutFeasalt(), and SCIPincludeBenderscutInt().

◆ SCIPsetBenderscutInitsol()

SCIP_RETCODE SCIPsetBenderscutInitsol ( SCIP scip,
SCIP_BENDERSCUT benderscut,
SCIP_DECL_BENDERSCUTINITSOL((*benderscutinitsol))   
)

sets solving process initialization method of benderscut

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
benderscutbenderscut

Definition at line 1267 of file scip_benders.c.

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

◆ SCIPsetBenderscutExitsol()

SCIP_RETCODE SCIPsetBenderscutExitsol ( SCIP scip,
SCIP_BENDERSCUT benderscut,
SCIP_DECL_BENDERSCUTEXITSOL((*benderscutexitsol))   
)

sets solving process deinitialization method of benderscut

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
benderscutbenderscut

Definition at line 1291 of file scip_benders.c.

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

◆ SCIPsetBenderscutPriority()

SCIP_RETCODE SCIPsetBenderscutPriority ( SCIP scip,
SCIP_BENDERSCUT benderscut,
int  priority 
)

sets the priority of a Benders' decomposition cut algorithm

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
benderscutbenderscut
prioritynew priority of the Benders' decomposition

Definition at line 1315 of file scip_benders.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPbenderscutSetPriority(), SCIPbendersSetBenderscutsSorted(), SCIPcheckStage(), SCIPgetBenders(), SCIPgetNBenders(), Scip::set, and TRUE.

Referenced by SCIP_DECL_PARAMCHGD().

◆ SCIPstoreBendersCut()

SCIP_RETCODE SCIPstoreBendersCut ( SCIP scip,
SCIP_BENDERS benders,
SCIP_VAR **  vars,
SCIP_Real vals,
SCIP_Real  lhs,
SCIP_Real  rhs,
int  nvars 
)

adds the generated cuts to the Benders' cut storage

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
scipthe SCIP data structure
bendersBenders' decomposition
varsthe variables that have non-zero coefficients in the cut
valsthe coefficients of the variables in the cut
lhsthe left hand side of the cut
rhsthe right hand side of the cut
nvarsthe number of variables with non-zero coefficients in the cut

Definition at line 1357 of file scip_benders.c.

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

Referenced by SCIPgenerateAndApplyBendersOptCut().

◆ SCIPapplyBendersStoredCuts()

SCIP_RETCODE SCIPapplyBendersStoredCuts ( SCIP scip,
SCIP_BENDERS benders 
)

applies the Benders' decomposition cuts in storage to the input SCIP instance

When calling the function, the user must be sure that the variables are associated with the input SCIP instance. The main use of this method is to transfer Benders' cuts between solvers in ParaSCIP.

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:

applies the Benders' decomposition cuts in storage to the input SCIP instance

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
scipthe SCIP data structure
bendersBenders' decomposition

Definition at line 1425 of file scip_benders.c.

References createAndApplyStoredBendersCut(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPbendersGetNStoredCuts(), and SCIPbendersGetStoredCutData().