Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

methods for Benders' decomposition cuts plugins

Functions

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

Function Documentation

◆ SCIP_DECL_SORTPTRCOMP() [1/2]

SCIP_EXPORT 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 45 of file benderscut.c.

References NULL, and SCIP_Benderscut::priority.

◆ SCIP_DECL_SORTPTRCOMP() [2/2]

SCIP_EXPORT 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 57 of file benderscut.c.

References SCIPbenderscutGetName().

◆ SCIPbenderscutGetData()

◆ SCIPbenderscutSetData()

SCIP_EXPORT 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 429 of file benderscut.c.

References SCIP_Benderscut::benderscutdata, and NULL.

Referenced by SCIP_DECL_BENDERSCUTFREE().

◆ SCIPbenderscutGetName()

SCIP_EXPORT const char* SCIPbenderscutGetName ( SCIP_BENDERSCUT benderscut)

gets name of the Benders' decomposition cut

Parameters
benderscutBenders' decomposition cut

Definition at line 508 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()

SCIP_EXPORT const char* SCIPbenderscutGetDesc ( SCIP_BENDERSCUT benderscut)

gets description of the Benders' decomposition cut

Parameters
benderscutBenders' decomposition cut

Definition at line 518 of file benderscut.c.

References SCIP_Benderscut::desc, and NULL.

◆ SCIPbenderscutGetPriority()

SCIP_EXPORT int SCIPbenderscutGetPriority ( SCIP_BENDERSCUT benderscut)

gets priority of the Benders' decomposition cut

Parameters
benderscutBenders' decomposition cut

Definition at line 528 of file benderscut.c.

References NULL, and SCIP_Benderscut::priority.

◆ SCIPbenderscutGetNCalls()

SCIP_EXPORT 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 549 of file benderscut.c.

References SCIP_Benderscut::ncalls, and NULL.

Referenced by SCIPprintBendersStatistics().

◆ SCIPbenderscutGetNFound()

SCIP_EXPORT 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 559 of file benderscut.c.

References SCIP_Benderscut::nfound, and NULL.

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

◆ SCIPbenderscutIsInitialized()

SCIP_EXPORT SCIP_Bool SCIPbenderscutIsInitialized ( SCIP_BENDERSCUT benderscut)

is the Benders' decomposition cut initialized?

Parameters
benderscutBenders' decomposition cut

Definition at line 569 of file benderscut.c.

References SCIP_Benderscut::initialized, and NULL.

◆ SCIPbenderscutGetSetupTime()

SCIP_EXPORT 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 579 of file benderscut.c.

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

Referenced by SCIPprintBendersStatistics().

◆ SCIPbenderscutGetTime()

SCIP_EXPORT SCIP_Real SCIPbenderscutGetTime ( SCIP_BENDERSCUT benderscut)

gets time in seconds used in this Benders' decomposition cut

Parameters
benderscutBenders' decomposition cut

Definition at line 589 of file benderscut.c.

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

Referenced by SCIPprintBendersStatistics().

◆ SCIPbenderscutGetNAddedCuts()

SCIP_EXPORT int SCIPbenderscutGetNAddedCuts ( SCIP_BENDERSCUT benderscut)

returns the number of cuts that have been added for storage

Parameters
benderscutBenders' decomposition cut

Definition at line 599 of file benderscut.c.

References SCIP_Benderscut::naddedcuts, and NULL.

Referenced by transferBendersCuts().

◆ SCIPbenderscutGetAddedCutData()

SCIP_EXPORT SCIP_RETCODE SCIPbenderscutGetAddedCutData ( SCIP_BENDERSCUT benderscut,
int  cutidx,
SCIP_VAR ***  vars,
SCIP_Real **  vals,
SCIP_Real lhs,
SCIP_Real rhs,
int *  nvars 
)

returns the data for the cuts that have been added by the Benders' cut plugin

returns the cuts that have been added by the Benders' cut plugin

Parameters
benderscutBenders' decomposition cut
cutidxthe index for the cut data that is requested
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 609 of file benderscut.c.

References SCIP_Benderscut::addedcuts, SCIP_BenderscutCut::lhs, NULL, SCIP_BenderscutCut::nvars, SCIP_BenderscutCut::rhs, SCIP_OKAY, SCIP_BenderscutCut::vals, and SCIP_BenderscutCut::vars.

Referenced by transferBendersCuts().

◆ SCIPbenderscutIsLPCut()

SCIP_EXPORT SCIP_Bool SCIPbenderscutIsLPCut ( SCIP_BENDERSCUT benderscut)

returns whether the Benders' cut uses the LP information

Parameters
benderscutBenders' decomposition cut

Definition at line 685 of file benderscut.c.

References SCIP_Benderscut::islpcut, and NULL.

Referenced by generateBendersCuts().

◆ SCIPbenderscutSetEnabled()

SCIP_EXPORT 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 695 of file benderscut.c.

References SCIP_Benderscut::enabled, and NULL.

Referenced by SCIP_DECL_BENDERSCUTEXEC().

◆ SCIPincludeBenderscut()

SCIP_EXPORT 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 985 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_EXPORT 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 1038 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(), SCIPincludeBenderscutInt(), SCIPincludeBenderscutNogood(), and SCIPincludeBenderscutOpt().

◆ SCIPsetBenderscutCopy()

SCIP_EXPORT 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 1080 of file scip_benders.c.

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

◆ SCIPsetBenderscutFree()

SCIP_EXPORT 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 1104 of file scip_benders.c.

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

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

◆ SCIPsetBenderscutInit()

SCIP_EXPORT 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 1128 of file scip_benders.c.

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

Referenced by SCIPincludeBenderscutInt().

◆ SCIPsetBenderscutExit()

SCIP_EXPORT 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 1152 of file scip_benders.c.

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

Referenced by SCIPincludeBenderscutInt().

◆ SCIPsetBenderscutInitsol()

SCIP_EXPORT 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 1176 of file scip_benders.c.

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

◆ SCIPsetBenderscutExitsol()

SCIP_EXPORT 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 1200 of file scip_benders.c.

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

◆ SCIPsetBenderscutPriority()

SCIP_EXPORT 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 1224 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().

◆ SCIPstoreBenderscutCut()

SCIP_EXPORT SCIP_RETCODE SCIPstoreBenderscutCut ( SCIP scip,
SCIP_BENDERSCUT benderscut,
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
benderscutBenders' decomposition cuts
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 1266 of file scip_benders.c.

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

Referenced by generateAndApplyBendersCuts().