Scippy

SCIP

Solving Constraint Integer Programs

benders.c File Reference

Detailed Description

run Benders algorithm

Author
Marc Pfetsch

Run Benders algorithm using an oracle for solving the subproblems and solving the master problem to optimality.

Definition in file benders.c.

#include "benders.h"

Go to the source code of this file.

Macros

#define MAXITERATIONS   10000
 

Functions

static SCIP_RETCODE printStatus (SCIP *masterscip, SCIP_STATUS status)
 
static SCIP_RETCODE printShortStatistics (SCIP *masterscip, SCIP_STATUS status, SCIP_CLOCK *totaltimeclock, SCIP_Real primalbound, SCIP_Real dualbound, SCIP_Longint ntotalnodes, int niter)
 
static SCIP_RETCODE printLongStatistics (SCIP *masterscip, SCIP_STATUS status, SCIP_CLOCK *totaltimeclock, SCIP_CLOCK *oracletimeclock, SCIP_CLOCK *mastertimeclock, SCIP_Real primalbound, SCIP_Real dualbound, SCIP_Longint ntotalnodes, SCIP_Longint ntotalcuts, int niter)
 
SCIP_RETCODE runBenders (SCIP *masterscip, BENDERS_CUTORACLE((*Oracle)), BENDERS_DATA *data, SCIP_Real timelimit, SCIP_Real memlimit, int dispfreq, SCIP_Bool usereopt, SCIP_Bool solvemasterapprox, SCIP_Longint masterstallnodes, SCIP_Real mastergaplimit, SCIP_VERBLEVEL verblevel, SCIP_STATUS *status)
 

Macro Definition Documentation

◆ MAXITERATIONS

#define MAXITERATIONS   10000

maximal number of iterations of main loop

Definition at line 26 of file benders.c.

Referenced by runBenders().

Function Documentation

◆ printStatus()

◆ printShortStatistics()

static SCIP_RETCODE printShortStatistics ( SCIP masterscip,
SCIP_STATUS  status,
SCIP_CLOCK totaltimeclock,
SCIP_Real  primalbound,
SCIP_Real  dualbound,
SCIP_Longint  ntotalnodes,
int  niter 
)
static

output short statistics

Parameters
masterscipmaster problem SCIP instance
statussolution status
totaltimeclockclock for total time
primalboundprimal bound
dualbounddual bound
ntotalnodestotal number of nodes
niternumber of iterations

Definition at line 88 of file benders.c.

References NULL, printStatus(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPgetClockTime(), SCIPinfoMessage(), and SCIPisInfinity().

Referenced by runBenders().

◆ printLongStatistics()

static SCIP_RETCODE printLongStatistics ( SCIP masterscip,
SCIP_STATUS  status,
SCIP_CLOCK totaltimeclock,
SCIP_CLOCK oracletimeclock,
SCIP_CLOCK mastertimeclock,
SCIP_Real  primalbound,
SCIP_Real  dualbound,
SCIP_Longint  ntotalnodes,
SCIP_Longint  ntotalcuts,
int  niter 
)
static

output long statistics

Parameters
masterscipmaster problem SCIP instance
statussolution status
totaltimeclockclock for total time
oracletimeclockclock for oracle
mastertimeclockclock for master problem
primalboundprimal bound
dualbounddual bound
ntotalnodestotal number of nodes
ntotalcutstotal number of cuts
niternumber of iterations

Definition at line 124 of file benders.c.

References NULL, printStatus(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPgetClockTime(), SCIPgetNBinVars(), SCIPgetNConss(), SCIPgetNContVars(), SCIPgetNImplVars(), SCIPgetNIntVars(), SCIPgetNOrigConss(), SCIPgetNOrigVars(), SCIPgetNVars(), SCIPgetProbName(), SCIPinfoMessage(), and SCIPisInfinity().

Referenced by runBenders().

◆ runBenders()

SCIP_RETCODE runBenders ( SCIP masterscip,
BENDERS_CUTORACLE((*Oracle))  ,
BENDERS_DATA data,
SCIP_Real  timelimit,
SCIP_Real  memlimit,
int  dispfreq,
SCIP_Bool  usereopt,
SCIP_Bool  solvemasterapprox,
SCIP_Longint  masterstallnodes,
SCIP_Real  mastergaplimit,
SCIP_VERBLEVEL  verblevel,
SCIP_STATUS status 
)

run Benders algorithm using an oracle for the subproblems

Parameters
masterscipmaster SCIP instance
datauser data for oracle
timelimittime limit read from arguments
memlimitmemory limit read from arguments
dispfreqdisplay frequency
usereoptUse reoptimization?
solvemasterapproxSolve master problem approximately?
masterstallnodesstall nodes for master problem if solvemasterapprox is true
mastergaplimitgap limit for master problem if solvemasterapprox is true
verblevelverbosity level for output
statusstatus of optimization

Definition at line 198 of file benders.c.

References BENDERS_STATUS_ADDEDCUT, BENDERS_STATUS_SUCESS, BENDERS_STATUS_TIMELIMIT, BENDERS_STATUS_UNKNOWN, BENDERS_STATUS_USERINTERRUPT, FALSE, MAX, MAXITERATIONS, NULL, printLongStatistics(), printShortStatistics(), SCIP_Bool, SCIP_CALL, SCIP_ERROR, SCIP_Longint, SCIP_OKAY, SCIP_Real, SCIP_STATUS_GAPLIMIT, SCIP_STATUS_INFEASIBLE, SCIP_STATUS_OPTIMAL, SCIP_STATUS_STALLNODELIMIT, SCIP_STATUS_TIMELIMIT, SCIP_STATUS_TOTALNODELIMIT, SCIP_STATUS_UNBOUNDED, SCIP_STATUS_UNKNOWN, SCIP_STATUS_USERINTERRUPT, SCIP_VERBLEVEL_NORMAL, SCIPallocClearBlockMemoryArray, SCIPcreateClock(), SCIPdebugMessage, SCIPdispInt(), SCIPdispLongint(), SCIPdispTime(), SCIPenableReoptimization(), SCIPerrorMessage, SCIPfreeBlockMemoryArray, SCIPfreeClock(), SCIPfreeReoptSolve(), SCIPfreeTransform(), SCIPgetBestSol(), SCIPgetClockTime(), SCIPgetDualbound(), SCIPgetGap(), SCIPgetMessagehdlr(), SCIPgetNIntVars(), SCIPgetNOrigConss(), SCIPgetNOrigVars(), SCIPgetNTotalNodes(), SCIPgetOrigVarsData(), SCIPgetSolOrigObj(), SCIPgetSolVal(), SCIPgetStatus(), SCIPinfinity(), SCIPinfoMessage(), SCIPisInfinity(), SCIPisIntegral(), SCIPmessageFPrintInfo(), SCIPsetIntParam(), SCIPsetLongintParam(), SCIPsetRealParam(), SCIPsolve(), SCIPstartClock(), SCIPstopClock(), and TRUE.

Referenced by solveClassification(), and solveMinIISC().