Detailed Description
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) |
Macro Definition Documentation
◆ DEFAULT_SCALINGFACTOR
#define DEFAULT_SCALINGFACTOR 5000.0 |
Definition at line 127 of file probdata_scflp.c.
Referenced by createOriginalproblem(), createSubproblems(), and SCIPprobdataCreate().
Function Documentation
◆ createOriginalproblem()
|
static |
creates the original problem
- Parameters
-
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 164 of file probdata_scflp.c.
References DEFAULT_SCALINGFACTOR, NULL, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_BINARY, SCIP_VARTYPE_CONTINUOUS, SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddVar(), SCIPcreateConsBasicLinear(), SCIPcreateConsBasicQuadratic(), SCIPcreateVarBasic(), SCIPinfinity(), SCIPreleaseCons(), SCIPreleaseVar(), and SCIPsnprintf().
Referenced by SCIPprobdataCreate().
◆ createMasterproblem()
|
static |
creates the Benders' decomposition master problem
- Parameters
-
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 324 of file probdata_scflp.c.
References NULL, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_BINARY, SCIP_VERBLEVEL_NORMAL, SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddVar(), SCIPcreateConsBasicLinear(), SCIPcreateVarBasic(), SCIPgetMessagehdlr(), SCIPgetVerbLevel(), SCIPinfinity(), SCIPmessagePrintVerbInfo(), and SCIPsnprintf().
Referenced by SCIPprobdataCreate().
◆ createSubproblems()
|
static |
creates the scenario subproblems
- Parameters
-
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 386 of file probdata_scflp.c.
References DEFAULT_SCALINGFACTOR, NULL, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIP_VERBLEVEL_NORMAL, SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddVar(), SCIPcreateConsBasicLinear(), SCIPcreateConsBasicQuadratic(), SCIPcreateVarBasic(), SCIPgetMessagehdlr(), SCIPgetVerbLevel(), SCIPinfinity(), SCIPmessagePrintVerbInfo(), SCIPreleaseCons(), SCIPreleaseVar(), and SCIPsnprintf().
Referenced by SCIPprobdataCreate().
◆ probdataCreate()
|
static |
creates problem data
- Parameters
-
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 537 of file probdata_scflp.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPallocBlockMemoryArray, and SCIPduplicateBlockMemoryArray.
Referenced by SCIPprobdataCreate().
◆ probdataFree()
|
static |
frees the memory of the given problem data
- Parameters
-
scip SCIP data structure probdata pointer to problem data
Definition at line 621 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 |
frees user data of original problem (called when the original problem is freed)
Definition at line 749 of file probdata_scflp.c.
References NULL, probdataFree(), SCIP_CALL, SCIP_OKAY, and SCIPdebugMsg.
◆ SCIP_DECL_PROBTRANS()
|
static |
creates user data of transformed problem by transforming the original user problem data (called after problem was transformed)
Definition at line 764 of file probdata_scflp.c.
References SCIP_OKAY, and SCIPdebugMsg.
◆ SCIP_DECL_PROBDELTRANS()
|
static |
frees user data of transformed problem (called when the transformed problem is freed)
Definition at line 773 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, | ||
SCIP_Bool | quadcosts | ||
) |
sets up the problem data
- Parameters
-
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 789 of file probdata_scflp.c.
References createMasterproblem(), createOriginalproblem(), createSubproblems(), DEFAULT_SCALINGFACTOR, NULL, probdataCreate(), SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OBJSENSE_MINIMIZE, SCIP_OKAY, SCIPallocBufferArray, SCIPcreate(), SCIPcreateBendersDefault(), SCIPcreateProbBasic(), SCIPfreeBufferArray, SCIPincludeDefaultPlugins(), SCIPinfoMessage(), SCIPsetBoolParam(), SCIPsetIntParam(), SCIPsetObjsense(), SCIPsetProbData(), SCIPsetProbDelorig(), SCIPsetProbDeltrans(), SCIPsetProbTrans(), SCIPsnprintf(), and TRUE.
◆ SCIPprobdataGetNFacilities()
int SCIPprobdataGetNFacilities | ( | SCIP_PROBDATA * | probdata | ) |
returns the number of facilities
- Parameters
-
probdata problem data
Definition at line 938 of file probdata_scflp.c.
References NULL.
◆ SCIPprobdataGetNCustomers()
int SCIPprobdataGetNCustomers | ( | SCIP_PROBDATA * | probdata | ) |
returns the number of customers
- Parameters
-
probdata problem data
Definition at line 948 of file probdata_scflp.c.
References NULL.
◆ SCIPprobdataGetFacilityVars()
SCIP_VAR** SCIPprobdataGetFacilityVars | ( | SCIP_PROBDATA * | probdata | ) |
returns the facility variables
- Parameters
-
probdata problem data
Definition at line 958 of file probdata_scflp.c.
References NULL.