Scippy

SCIP

Solving Constraint Integer Programs

probdata_scflp.c File Reference

Detailed Description

Problem data for Stochastic Capacitated Facility Location problem.

Author
Stephen J. Maher

This file handles the main problem data used in that project. For more details see The global problem data page.

Definition in file probdata_scflp.c.

#include <string.h>
#include "probdata_scflp.h"
#include "scip/cons_linear.h"
#include "scip/benders_default.h"
#include "scip/scip.h"
#include "scip/scipdefplugins.h"

Go to the source code of this file.

Functions

Local methods
static SCIP_RETCODE createOriginalproblem (SCIP *scip, SCIP_VAR **facilityvars, SCIP_VAR ****customervars, SCIP_CONS ***capconss, SCIP_CONS ***demandconss, SCIP_CONS **sufficientcap, SCIP_Real **costs, SCIP_Real **demands, SCIP_Real *capacity, SCIP_Real *fixedcost, int ncustomers, int nfacilities, int nscenarios)
 
static SCIP_RETCODE createMasterproblem (SCIP *scip, SCIP_VAR **facilityvars, SCIP_CONS **sufficientcap, SCIP_Real *capacity, SCIP_Real *fixedcost, SCIP_Real **demands, int ncustomers, int nfacilities, int nscenarios)
 
static SCIP_RETCODE createSubproblems (SCIP *scip, SCIP **subproblems, SCIP_VAR **facilityvars, SCIP_VAR ***subfacilityvars, SCIP_VAR ****customervars, SCIP_CONS ***capconss, SCIP_CONS ***demandconss, SCIP_Real **costs, SCIP_Real **demands, SCIP_Real *capacity, SCIP_Real *fixedcost, int ncustomers, int nfacilities, int nscenarios)
 
static SCIP_RETCODE probdataCreate (SCIP *scip, SCIP_PROBDATA **probdata, SCIP **subproblems, SCIP_VAR **facilityvars, SCIP_VAR ***subfacilityvars, SCIP_VAR ****customervars, SCIP_CONS ***capconss, SCIP_CONS ***demandconss, SCIP_CONS *sufficientcap, SCIP_Real **costs, SCIP_Real **demands, SCIP_Real *capacity, SCIP_Real *fixedcost, int ncustomers, int nfacilities, int nscenarios, SCIP_Bool usebenders)
 
static SCIP_RETCODE probdataFree (SCIP *scip, SCIP_PROBDATA **probdata)
 
Callback methods of problem data
static SCIP_DECL_PROBDELORIG (probdelorigScflp)
 
static SCIP_DECL_PROBTRANS (probtransScflp)
 
static SCIP_DECL_PROBDELTRANS (probdeltransScflp)
 
Interface methods
SCIP_RETCODE SCIPprobdataCreate (SCIP *scip, const char *probname, SCIP_Real **costs, SCIP_Real **demands, SCIP_Real *capacity, SCIP_Real *fixedcost, int ncustomers, int nfacilities, int nscenarios, SCIP_Bool usebenders)
 
int SCIPprobdataGetNFacilities (SCIP_PROBDATA *probdata)
 
int SCIPprobdataGetNCustomers (SCIP_PROBDATA *probdata)
 
SCIP_VAR ** SCIPprobdataGetFacilityVars (SCIP_PROBDATA *probdata)
 

Function Documentation

◆ createOriginalproblem()

static SCIP_RETCODE createOriginalproblem ( SCIP scip,
SCIP_VAR **  facilityvars,
SCIP_VAR ****  customervars,
SCIP_CONS ***  capconss,
SCIP_CONS ***  demandconss,
SCIP_CONS **  sufficientcap,
SCIP_Real **  costs,
SCIP_Real **  demands,
SCIP_Real capacity,
SCIP_Real fixedcost,
int  ncustomers,
int  nfacilities,
int  nscenarios 
)
static

creates the original problem

Parameters
scipSCIP data structure
facilityvarsall variables representing facilities
customervarsall variables representing the satisfaction of demand
capconsscapacity constraints per facility
demandconssdemand constraints per customer
sufficientcapensuring sufficient capacity is provided to satisfy demand
coststhe transportation costs from a facility to a customer
demandsthe customer demands
capacitythe capacity of each facility
fixedcostthe fixed cost of opening a facility
ncustomersthe number of customers
nfacilitiesthe number of facilities
nscenariosthe number of scenarios

Definition at line 161 of file probdata_scflp.c.

References NULL, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_BINARY, SCIP_VARTYPE_CONTINUOUS, SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddVar(), SCIPcreateConsBasicLinear(), SCIPcreateVarBasic(), SCIPinfinity(), and SCIPsnprintf().

Referenced by SCIPprobdataCreate().

◆ createMasterproblem()

static SCIP_RETCODE createMasterproblem ( SCIP scip,
SCIP_VAR **  facilityvars,
SCIP_CONS **  sufficientcap,
SCIP_Real capacity,
SCIP_Real fixedcost,
SCIP_Real **  demands,
int  ncustomers,
int  nfacilities,
int  nscenarios 
)
static

creates the Benders' decomposition master problem

Parameters
scipSCIP data structure
facilityvarsall variables representing facilities
sufficientcapensuring sufficient capacity is provided to satisfy demand
capacitythe capacity of each facility
fixedcostthe fixed cost of opening a facility
demandsthe customer demands
ncustomersthe number of customers
nfacilitiesthe number of facilities
nscenariosthe number of scenarios

Definition at line 283 of file probdata_scflp.c.

References NULL, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_BINARY, SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddVar(), SCIPcreateConsBasicLinear(), SCIPcreateVarBasic(), SCIPinfinity(), and SCIPsnprintf().

Referenced by SCIPprobdataCreate().

◆ createSubproblems()

static SCIP_RETCODE createSubproblems ( SCIP scip,
SCIP **  subproblems,
SCIP_VAR **  facilityvars,
SCIP_VAR ***  subfacilityvars,
SCIP_VAR ****  customervars,
SCIP_CONS ***  capconss,
SCIP_CONS ***  demandconss,
SCIP_Real **  costs,
SCIP_Real **  demands,
SCIP_Real capacity,
SCIP_Real fixedcost,
int  ncustomers,
int  nfacilities,
int  nscenarios 
)
static

creates the scenario subproblems

Parameters
scipSCIP data structure
subproblemsthe Benders' decomposition subproblems
facilityvarsall variables representing facilities
subfacilityvarsthe copies of the facility variables in the subproblems
customervarsall variables representing the satisfaction of demand
capconsscapacity constraints per facility
demandconssdemand constraints per customer
coststhe transportation costs from a facility to a customer
demandsthe customer demands
capacitythe capacity of each facility
fixedcostthe fixed cost of opening a facility
ncustomersthe number of customers
nfacilitiesthe number of facilities
nscenariosthe number of scenarios

Definition at line 339 of file probdata_scflp.c.

References NULL, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddVar(), SCIPcreateConsBasicLinear(), SCIPcreateVarBasic(), SCIPinfinity(), and SCIPsnprintf().

Referenced by SCIPprobdataCreate().

◆ probdataCreate()

static SCIP_RETCODE probdataCreate ( SCIP scip,
SCIP_PROBDATA **  probdata,
SCIP **  subproblems,
SCIP_VAR **  facilityvars,
SCIP_VAR ***  subfacilityvars,
SCIP_VAR ****  customervars,
SCIP_CONS ***  capconss,
SCIP_CONS ***  demandconss,
SCIP_CONS sufficientcap,
SCIP_Real **  costs,
SCIP_Real **  demands,
SCIP_Real capacity,
SCIP_Real fixedcost,
int  ncustomers,
int  nfacilities,
int  nscenarios,
SCIP_Bool  usebenders 
)
static

creates problem data

Parameters
scipSCIP data structure
probdatapointer to problem data
subproblemsthe Benders' decomposition subproblems
facilityvarsall variables representing facilities
subfacilityvarsthe copies of the facility variables in the subproblems
customervarsall variables representing the satisfaction of demand
capconsscapacity constraints per facility per scenario
demandconssdemand constraints per customer per scenario
sufficientcapensuring sufficient capacity is provided to satisfy demand
coststhe transportation costs to a customer from a facility
demandsthe customer demands per scenario
capacitythe capacity of each facility
fixedcostthe fixed cost of opening a facility
ncustomersthe number of customers
nfacilitiesthe number of facilities
nscenariosthe number of scenarios
usebenderswhether Benders' decomposition is used

Definition at line 444 of file probdata_scflp.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPallocBlockMemoryArray, and SCIPduplicateBlockMemoryArray.

Referenced by SCIPprobdataCreate().

◆ probdataFree()

static SCIP_RETCODE probdataFree ( SCIP scip,
SCIP_PROBDATA **  probdata 
)
static

frees the memory of the given problem data

Parameters
scipSCIP data structure
probdatapointer to problem data

Definition at line 526 of file probdata_scflp.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPfree(), SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, SCIPreleaseCons(), and SCIPreleaseVar().

Referenced by SCIP_DECL_PROBDELORIG().

◆ SCIP_DECL_PROBDELORIG()

static SCIP_DECL_PROBDELORIG ( probdelorigScflp  )
static

frees user data of original problem (called when the original problem is freed)

Definition at line 654 of file probdata_scflp.c.

References NULL, probdataFree(), SCIP_CALL, SCIP_OKAY, and SCIPdebugMsg.

◆ SCIP_DECL_PROBTRANS()

static SCIP_DECL_PROBTRANS ( probtransScflp  )
static

creates user data of transformed problem by transforming the original user problem data (called after problem was transformed)

Definition at line 669 of file probdata_scflp.c.

References SCIP_OKAY, and SCIPdebugMsg.

◆ SCIP_DECL_PROBDELTRANS()

static SCIP_DECL_PROBDELTRANS ( probdeltransScflp  )
static

frees user data of transformed problem (called when the transformed problem is freed)

Definition at line 678 of file probdata_scflp.c.

References SCIP_OKAY, and SCIPdebugMsg.

◆ SCIPprobdataCreate()

SCIP_RETCODE SCIPprobdataCreate ( SCIP scip,
const char *  probname,
SCIP_Real **  costs,
SCIP_Real **  demands,
SCIP_Real capacity,
SCIP_Real fixedcost,
int  ncustomers,
int  nfacilities,
int  nscenarios,
SCIP_Bool  usebenders 
)

sets up the problem data

Parameters
scipSCIP data structure
probnameproblem name
coststhe transportation costs from a facility to a customer
demandsthe customer demands
capacitythe capacity of each facility
fixedcostthe fixed cost of opening a facility
ncustomersthe number of customers
nfacilitiesthe number of facilities
nscenariosthe number of Benders' decomposition scenarios
usebenderswill Benders' decomposition be used to solve the problem

Definition at line 694 of file probdata_scflp.c.

References createMasterproblem(), createOriginalproblem(), createSubproblems(), NULL, probdataCreate(), SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OBJSENSE_MINIMIZE, SCIP_OKAY, SCIPallocBufferArray, SCIPcreate(), SCIPcreateBendersDefault(), SCIPcreateProbBasic(), SCIPfreeBufferArray, SCIPincludeDefaultPlugins(), SCIPsetBoolParam(), SCIPsetIntParam(), SCIPsetObjsense(), SCIPsetProbData(), SCIPsetProbDelorig(), SCIPsetProbDeltrans(), SCIPsetProbTrans(), SCIPsnprintf(), and TRUE.

◆ SCIPprobdataGetNFacilities()

int SCIPprobdataGetNFacilities ( SCIP_PROBDATA probdata)

returns the number of facilities

Parameters
probdataproblem data

Definition at line 834 of file probdata_scflp.c.

References NULL.

◆ SCIPprobdataGetNCustomers()

int SCIPprobdataGetNCustomers ( SCIP_PROBDATA probdata)

returns the number of customers

Parameters
probdataproblem data

Definition at line 844 of file probdata_scflp.c.

References NULL.

◆ SCIPprobdataGetFacilityVars()

SCIP_VAR** SCIPprobdataGetFacilityVars ( SCIP_PROBDATA probdata)

returns the facility variables

Parameters
probdataproblem data

Definition at line 854 of file probdata_scflp.c.

References NULL.