Problem data for Stochastic Capacitated Facility Location problem.
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/scip.h"
#include "scip/scipdefplugins.h"
Go to the source code of this file.
Macros | |
#define | DEFAULT_SCALINGFACTOR 5000.0 |
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, SCIP_Bool quadcosts) |
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, SCIP_Bool quadcosts) |
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, SCIP_Bool quadcosts) |
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, SCIP_Bool quadcosts) |
int | SCIPprobdataGetNFacilities (SCIP_PROBDATA *probdata) |
int | SCIPprobdataGetNCustomers (SCIP_PROBDATA *probdata) |
SCIP_VAR ** | SCIPprobdataGetFacilityVars (SCIP_PROBDATA *probdata) |
#define DEFAULT_SCALINGFACTOR 5000.0 |
Definition at line 136 of file probdata_scflp.c.
Referenced by createOriginalproblem(), createSubproblems(), and SCIPprobdataCreate().
|
static |
creates the original problem
scip | SCIP data structure |
facilityvars | all variables representing facilities |
customervars | all variables representing the satisfaction of demand |
capconss | capacity constraints per facility |
demandconss | demand constraints per customer |
sufficientcap | ensuring sufficient capacity is provided to satisfy demand |
costs | the transportation costs from a facility to a customer |
demands | the customer demands |
capacity | the capacity of each facility |
fixedcost | the fixed cost of opening a facility |
ncustomers | the number of customers |
nfacilities | the number of facilities |
nscenarios | the number of scenarios |
quadcosts | should the problem be formulated with quadratic costs |
Definition at line 173 of file probdata_scflp.c.
References assert(), DEFAULT_SCALINGFACTOR, FALSE, i, NULL, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_BINARY, SCIP_VARTYPE_CONTINUOUS, SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddVar(), SCIPcreateConsBasicLinear(), SCIPcreateConsQuadraticNonlinear(), SCIPcreateVarBasic(), SCIPinfinity(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPsnprintf(), TRUE, and var.
Referenced by SCIPprobdataCreate().
|
static |
creates the Benders' decomposition master problem
scip | SCIP data structure |
facilityvars | all variables representing facilities |
sufficientcap | ensuring sufficient capacity is provided to satisfy demand |
capacity | the capacity of each facility |
fixedcost | the fixed cost of opening a facility |
demands | the customer demands |
ncustomers | the number of customers |
nfacilities | the number of facilities |
nscenarios | the number of scenarios |
Definition at line 333 of file probdata_scflp.c.
References assert(), i, NULL, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_BINARY, SCIP_VERBLEVEL_NORMAL, SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddVar(), SCIPcreateConsBasicLinear(), SCIPcreateVarBasic(), SCIPgetMessagehdlr(), SCIPgetVerbLevel(), SCIPinfinity(), SCIPmessagePrintVerbInfo(), SCIPsnprintf(), and var.
Referenced by SCIPprobdataCreate().
|
static |
creates the scenario subproblems
scip | SCIP data structure |
subproblems | the Benders' decomposition subproblems |
facilityvars | all variables representing facilities |
subfacilityvars | the copies of the facility variables in the subproblems |
customervars | all variables representing the satisfaction of demand |
capconss | capacity constraints per facility |
demandconss | demand constraints per customer |
costs | the transportation costs from a facility to a customer |
demands | the customer demands |
capacity | the capacity of each facility |
fixedcost | the fixed cost of opening a facility |
ncustomers | the number of customers |
nfacilities | the number of facilities |
nscenarios | the number of scenarios |
quadcosts | should the problem be formulated with quadratic costs |
Definition at line 395 of file probdata_scflp.c.
References assert(), DEFAULT_SCALINGFACTOR, FALSE, i, NULL, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIP_VERBLEVEL_NORMAL, SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddVar(), SCIPcreateConsBasicLinear(), SCIPcreateConsQuadraticNonlinear(), SCIPcreateVarBasic(), SCIPgetMessagehdlr(), SCIPgetVerbLevel(), SCIPinfinity(), SCIPmessagePrintVerbInfo(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPsnprintf(), TRUE, and var.
Referenced by SCIPprobdataCreate().
|
static |
creates problem data
scip | SCIP data structure |
probdata | pointer to problem data |
subproblems | the Benders' decomposition subproblems |
facilityvars | all variables representing facilities |
subfacilityvars | the copies of the facility variables in the subproblems |
customervars | all variables representing the satisfaction of demand |
capconss | capacity constraints per facility per scenario |
demandconss | demand constraints per customer per scenario |
sufficientcap | ensuring sufficient capacity is provided to satisfy demand |
costs | the transportation costs to a customer from a facility |
demands | the customer demands per scenario |
capacity | the capacity of each facility |
fixedcost | the fixed cost of opening a facility |
ncustomers | the number of customers |
nfacilities | the number of facilities |
nscenarios | the number of scenarios |
usebenders | whether Benders' decomposition is used |
quadcosts | should the problem be formulated with quadratic costs |
Definition at line 546 of file probdata_scflp.c.
References assert(), i, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBlockMemory, SCIPallocBlockMemoryArray, and SCIPduplicateBlockMemoryArray.
Referenced by SCIPprobdataCreate().
|
static |
frees the memory of the given problem data
scip | SCIP data structure |
probdata | pointer to problem data |
Definition at line 630 of file probdata_scflp.c.
References assert(), i, NULL, SCIP_CALL, SCIP_OKAY, SCIPfree(), SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, SCIPreleaseCons(), and SCIPreleaseVar().
Referenced by SCIP_DECL_PROBDELORIG().
|
static |
frees user data of original problem (called when the original problem is freed)
Definition at line 758 of file probdata_scflp.c.
References assert(), NULL, probdataFree(), SCIP_CALL, SCIP_OKAY, and SCIPdebugMsg.
|
static |
creates user data of transformed problem by transforming the original user problem data (called after problem was transformed)
Definition at line 773 of file probdata_scflp.c.
References SCIP_OKAY, and SCIPdebugMsg.
|
static |
frees user data of transformed problem (called when the transformed problem is freed)
Definition at line 782 of file probdata_scflp.c.
References SCIP_OKAY, and SCIPdebugMsg.
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, | ||
SCIP_Bool | quadcosts ) |
sets up the problem data
scip | SCIP data structure |
probname | problem name |
costs | the transportation costs from a facility to a customer |
demands | the customer demands |
capacity | the capacity of each facility |
fixedcost | the fixed cost of opening a facility |
ncustomers | the number of customers |
nfacilities | the number of facilities |
nscenarios | the number of Benders' decomposition scenarios |
usebenders | whether Benders' decomposition is used |
quadcosts | should the problem be formulated with quadratic costs |
Definition at line 798 of file probdata_scflp.c.
References assert(), createMasterproblem(), createOriginalproblem(), createSubproblems(), DEFAULT_SCALINGFACTOR, i, NULL, probdataCreate(), SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OBJSENSE_MINIMIZE, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcreate(), SCIPcreateBendersDefault(), SCIPcreateProbBasic(), SCIPfreeBufferArray, SCIPincludeDefaultPlugins(), SCIPinfoMessage(), SCIPsetBoolParam(), SCIPsetIntParam(), SCIPsetObjsense(), SCIPsetProbData(), SCIPsetProbDelorig(), SCIPsetProbDeltrans(), SCIPsetProbTrans(), SCIPsnprintf(), and TRUE.
int SCIPprobdataGetNFacilities | ( | SCIP_PROBDATA * | probdata | ) |
returns the number of facilities
probdata | problem data |
Definition at line 947 of file probdata_scflp.c.
int SCIPprobdataGetNCustomers | ( | SCIP_PROBDATA * | probdata | ) |
returns the number of customers
probdata | problem data |
Definition at line 957 of file probdata_scflp.c.
SCIP_VAR ** SCIPprobdataGetFacilityVars | ( | SCIP_PROBDATA * | probdata | ) |
returns the facility variables
probdata | problem data |
Definition at line 967 of file probdata_scflp.c.