Problem data for binpacking problem.
This file handles the main problem data used in that project. For more details see Main problem data page.
Definition in file probdata_binpacking.c.
#include "probdata_binpacking.h"#include "vardata_binpacking.h"#include "pricer_binpacking.h"#include "scip/cons_setppc.h"#include "scip/scip.h"Go to the source code of this file.
Macros | |
Event handler properties | |
| #define | EVENTHDLR_NAME "addedvar" |
| #define | EVENTHDLR_DESC "event handler for catching added variables" |
Functions | |
Callback methods of event handler | |
| static | SCIP_DECL_EVENTEXEC (eventExecAddedVar) |
Local methods | |
| static SCIP_RETCODE | probdataCreate (SCIP *scip, SCIP_PROBDATA **probdata, SCIP_VAR **vars, SCIP_CONS **conss, SCIP_Longint *weights, int *ids, int nvars, int nitems, SCIP_Longint capacity) |
| static SCIP_RETCODE | probdataFree (SCIP *scip, SCIP_PROBDATA **probdata) |
| static SCIP_RETCODE | createInitialColumns (SCIP *scip, SCIP_PROBDATA *probdata) |
Callback methods of problem data | |
| static | SCIP_DECL_PROBDELORIG (probdelorigBinpacking) |
| static | SCIP_DECL_PROBTRANS (probtransBinpacking) |
| static | SCIP_DECL_PROBDELTRANS (probdeltransBinpacking) |
| static | SCIP_DECL_PROBINITSOL (probinitsolBinpacking) |
| static | SCIP_DECL_PROBEXITSOL (probexitsolBinpacking) |
Interface methods | |
| SCIP_RETCODE | SCIPprobdataCreate (SCIP *scip, const char *probname, int *ids, SCIP_Longint *weights, int nitems, SCIP_Longint capacity) |
| int * | SCIPprobdataGetIds (SCIP_PROBDATA *probdata) |
| SCIP_Longint * | SCIPprobdataGetWeights (SCIP_PROBDATA *probdata) |
| int | SCIPprobdataGetNItems (SCIP_PROBDATA *probdata) |
| SCIP_Longint | SCIPprobdataGetCapacity (SCIP_PROBDATA *probdata) |
| SCIP_VAR ** | SCIPprobdataGetVars (SCIP_PROBDATA *probdata) |
| int | SCIPprobdataGetNVars (SCIP_PROBDATA *probdata) |
| SCIP_CONS ** | SCIPprobdataGetConss (SCIP_PROBDATA *probdata) |
| SCIP_RETCODE | SCIPprobdataAddVar (SCIP *scip, SCIP_PROBDATA *probdata, SCIP_VAR *var) |
| #define EVENTHDLR_NAME "addedvar" |
Definition at line 101 of file probdata_binpacking.c.
| #define EVENTHDLR_DESC "event handler for catching added variables" |
Definition at line 102 of file probdata_binpacking.c.
|
static |
execution method of event handler
Definition at line 113 of file probdata_binpacking.c.
References assert(), EVENTHDLR_NAME, NULL, SCIP_CALL, SCIP_DECL_EVENTEXEC, SCIP_EVENTTYPE_VARADDED, SCIP_INVALIDCALL, SCIP_OKAY, SCIP_STRINGEQ, SCIPdebugMsg, SCIPeventGetType(), SCIPeventGetVar(), SCIPeventhdlrGetName(), SCIPgetProbData(), and SCIPprobdataAddVar().
|
static |
creates problem data
| scip | SCIP data structure |
| probdata | pointer to problem data |
| vars | all exist variables |
| conss | set partitioning constraints for each job exactly one |
| weights | array containing the item weights |
| ids | array of item ids |
| nvars | number of variables |
| nitems | number of items |
| capacity | bin capacity |
Definition at line 139 of file probdata_binpacking.c.
References assert(), NULL, nvars, probdataCreate(), SCIP_CALL, SCIP_Longint, SCIP_OKAY, SCIPallocBlockMemory, SCIPduplicateBlockMemoryArray, and vars.
|
static |
frees the memory of the given problem data
| scip | SCIP data structure |
| probdata | pointer to problem data |
Definition at line 180 of file probdata_binpacking.c.
References assert(), i, NULL, probdataFree(), SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, SCIPreleaseCons(), and SCIPreleaseVar().
|
static |
create initial columns
| scip | SCIP data structure |
| probdata | problem data |
Definition at line 216 of file probdata_binpacking.c.
References a, createInitialColumns(), i, NULL, SCIP_CALL, SCIP_LONGINT_FORMAT, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPaddCoefSetppc(), SCIPaddVar(), SCIPchgVarUbLazy(), SCIPcreateVarBinpacking(), SCIPdebugMsg, SCIPprobdataAddVar(), SCIPreleaseVar(), SCIPsnprintf(), SCIPvardataCreateBinpacking(), SCIPvarSetData(), TRUE, and var.
Referenced by createInitialColumns(), and SCIPprobdataCreate().
|
static |
frees user data of original problem (called when the original problem is freed)
Definition at line 287 of file probdata_binpacking.c.
References probdataFree(), SCIP_CALL, SCIP_DECL_PROBDELORIG, 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 299 of file probdata_binpacking.c.
References probdataCreate(), SCIP_CALL, SCIP_DECL_PROBTRANS, SCIP_OKAY, SCIPtransformConss(), and SCIPtransformVars().
|
static |
frees user data of transformed problem (called when the transformed problem is freed)
Definition at line 316 of file probdata_binpacking.c.
References probdataFree(), SCIP_CALL, SCIP_DECL_PROBDELTRANS, SCIP_OKAY, and SCIPdebugMsg.
|
static |
solving process initialization method of transformed data (called before the branch and bound process begins)
Definition at line 327 of file probdata_binpacking.c.
References assert(), NULL, SCIP_CALL, SCIP_DECL_PROBINITSOL, SCIP_EVENTTYPE_VARADDED, SCIP_OKAY, SCIPcatchEvent(), and SCIPfindEventhdlr().
|
static |
solving process deinitialization method of transformed data (called before the branch and bound data is freed)
Definition at line 344 of file probdata_binpacking.c.
References assert(), NULL, SCIP_CALL, SCIP_DECL_PROBEXITSOL, SCIP_EVENTTYPE_VARADDED, SCIP_OKAY, SCIPdropEvent(), and SCIPfindEventhdlr().
| SCIP_RETCODE SCIPprobdataCreate | ( | SCIP * | scip, |
| const char * | probname, | ||
| int * | ids, | ||
| SCIP_Longint * | weights, | ||
| int | nitems, | ||
| SCIP_Longint | capacity ) |
sets up the problem data
| scip | SCIP data structure |
| probname | problem name |
| ids | array of item ids |
| weights | array containing the item weights |
| nitems | number of items |
| capacity | bin capacity |
Definition at line 368 of file probdata_binpacking.c.
References assert(), createInitialColumns(), EVENTHDLR_DESC, EVENTHDLR_NAME, i, NULL, probdataCreate(), SCIP_CALL, SCIP_Longint, SCIP_MAXSTRLEN, SCIP_OBJSENSE_MINIMIZE, SCIP_OKAY, SCIPaddCons(), SCIPallocBufferArray, SCIPcreateConsBasicSetcover(), SCIPcreateProbBasic(), SCIPfindEventhdlr(), SCIPfreeBufferArray, SCIPincludeEventhdlrBasic(), SCIPpricerBinpackingActivate(), SCIPprobdataCreate(), SCIPsetConsModifiable(), SCIPsetObjIntegral(), SCIPsetObjsense(), SCIPsetProbData(), SCIPsetProbDelorig(), SCIPsetProbDeltrans(), SCIPsetProbExitsol(), SCIPsetProbInitsol(), SCIPsetProbTrans(), SCIPsnprintf(), and TRUE.
| int * SCIPprobdataGetIds | ( | SCIP_PROBDATA * | probdata | ) |
returns array of item ids
| probdata | problem data |
Definition at line 436 of file probdata_binpacking.c.
References SCIPprobdataGetIds().
Referenced by addBranchingDecisionConss(), consdataPrint(), SCIP_DECL_BRANCHEXECLP(), SCIPprobdataGetIds(), and SCIPvardataPrint().
| SCIP_Longint * SCIPprobdataGetWeights | ( | SCIP_PROBDATA * | probdata | ) |
returns array of item weights
| probdata | problem data |
Definition at line 444 of file probdata_binpacking.c.
References SCIP_Longint, and SCIPprobdataGetWeights().
Referenced by SCIPprobdataGetWeights().
| int SCIPprobdataGetNItems | ( | SCIP_PROBDATA * | probdata | ) |
returns number of items
| probdata | problem data |
Definition at line 452 of file probdata_binpacking.c.
References SCIPprobdataGetNItems().
Referenced by SCIP_DECL_BRANCHEXECLP(), and SCIPprobdataGetNItems().
| SCIP_Longint SCIPprobdataGetCapacity | ( | SCIP_PROBDATA * | probdata | ) |
returns bin capacity
| probdata | problem data |
Definition at line 460 of file probdata_binpacking.c.
References SCIP_Longint, and SCIPprobdataGetCapacity().
Referenced by SCIPprobdataGetCapacity().
| SCIP_VAR ** SCIPprobdataGetVars | ( | SCIP_PROBDATA * | probdata | ) |
returns array of all variables itemed in the way they got generated
returns array of all variables ordered in the way they got generated
| probdata | problem data |
Definition at line 468 of file probdata_binpacking.c.
References SCIPprobdataGetVars().
Referenced by consdataCheck(), SCIP_DECL_CONSPROP(), and SCIPprobdataGetVars().
| int SCIPprobdataGetNVars | ( | SCIP_PROBDATA * | probdata | ) |
returns number of variables
| probdata | problem data |
Definition at line 476 of file probdata_binpacking.c.
References SCIPprobdataGetNVars().
Referenced by consdataCheck(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSDEACTIVE(), SCIP_DECL_CONSPROP(), and SCIPprobdataGetNVars().
| SCIP_CONS ** SCIPprobdataGetConss | ( | SCIP_PROBDATA * | probdata | ) |
returns array of set partitioning constrains
| probdata | problem data |
Definition at line 484 of file probdata_binpacking.c.
References SCIPprobdataGetConss().
Referenced by SCIPprobdataGetConss().
| SCIP_RETCODE SCIPprobdataAddVar | ( | SCIP * | scip, |
| SCIP_PROBDATA * | probdata, | ||
| SCIP_VAR * | var ) |
adds given variable to the problem data
| scip | SCIP data structure |
| probdata | problem data |
| var | variables to add |
Definition at line 492 of file probdata_binpacking.c.
References MAX, SCIP_CALL, SCIP_OKAY, SCIPcaptureVar(), SCIPdebugMsg, SCIPprobdataAddVar(), SCIPreallocBlockMemoryArray, and var.