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_RETCODE SCIPbenderscutGetAddedConss (SCIP_BENDERSCUT *benderscut, SCIP_CONS ***addedconss, int *naddedconss)
 
SCIP_RETCODE SCIPbenderscutGetAddedCuts (SCIP_BENDERSCUT *benderscut, SCIP_ROW ***addedcuts, int *naddedcuts)
 
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 SCIPstoreBenderscutCons (SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_CONS *cons)
 
SCIP_RETCODE SCIPstoreBenderscutCut (SCIP *scip, SCIP_BENDERSCUT *benderscut, SCIP_ROW *cut)
 

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 45 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 57 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 410 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 489 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 499 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 509 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 530 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 540 of file benderscut.c.

References SCIP_Benderscut::nfound, and NULL.

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

◆ SCIPbenderscutIsInitialized()

SCIP_Bool SCIPbenderscutIsInitialized ( SCIP_BENDERSCUT benderscut)

is the Benders' decomposition cut initialized?

Parameters
benderscutBenders' decomposition cut

Definition at line 550 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 560 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 570 of file benderscut.c.

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

Referenced by SCIPprintBendersStatistics().

◆ SCIPbenderscutGetAddedConss()

SCIP_RETCODE SCIPbenderscutGetAddedConss ( SCIP_BENDERSCUT benderscut,
SCIP_CONS ***  addedconss,
int *  naddedconss 
)

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

Parameters
benderscutBenders' decomposition cut
addedconsspointer to store the constraint array, can be NULL
naddedconsspointer to store the number of added constraints, can be NULL

Definition at line 580 of file benderscut.c.

References SCIP_Benderscut::addedconss, SCIP_Benderscut::naddedconss, NULL, and SCIP_OKAY.

Referenced by transferBendersCuts().

◆ SCIPbenderscutGetAddedCuts()

SCIP_RETCODE SCIPbenderscutGetAddedCuts ( SCIP_BENDERSCUT benderscut,
SCIP_ROW ***  addedcuts,
int *  naddedcuts 
)

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

Parameters
benderscutBenders' decomposition cut
addedcutspointer to store the cuts array, can be NULL
naddedcutspointer to store the number of added cut, can be NULL

Definition at line 598 of file benderscut.c.

References SCIP_Benderscut::addedcuts, SCIP_Benderscut::naddedcuts, NULL, and SCIP_OKAY.

Referenced by transferBendersCuts().

◆ SCIPbenderscutIsLPCut()

SCIP_Bool SCIPbenderscutIsLPCut ( SCIP_BENDERSCUT benderscut)

returns whether the Benders' cut uses the LP information

Parameters
benderscutBenders' decomposition cut

Definition at line 677 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 687 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 1066 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 1119 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_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 1161 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 1185 of file scip_benders.c.

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

Referenced by 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 1209 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 1233 of file scip_benders.c.

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

Referenced by 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 1257 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 1281 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 1305 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().

◆ SCIPstoreBenderscutCons()

SCIP_RETCODE SCIPstoreBenderscutCons ( SCIP scip,
SCIP_BENDERSCUT benderscut,
SCIP_CONS cons 
)

adds the generated constraint to the Benders' decomposition 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
consthe constraint to be added to the Benders' cut storage

Definition at line 1347 of file scip_benders.c.

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

Referenced by generateAndApplyBendersCuts(), and generateAndApplyBendersIntegerCuts().

◆ SCIPstoreBenderscutCut()

SCIP_RETCODE SCIPstoreBenderscutCut ( SCIP scip,
SCIP_BENDERSCUT benderscut,
SCIP_ROW cut 
)

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
cutthe cut to be added to the Benders' cut storage

Definition at line 1380 of file scip_benders.c.

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

Referenced by generateAndApplyBendersCuts(), and generateAndApplyBendersIntegerCuts().