probdata_binpacking.c
Go to the documentation of this file.
30 * This file handles the main problem data used in that project. For more details see \ref BINPACKING_PROBLEMDATA page.
34 * The problem data is accessible in all plugins. The function SCIPgetProbData() returns the pointer to that
35 * structure. We use this data structure to store all the information of the binpacking problem. Since this structure is
36 * not visible in the other plugins, we implemented setter and getter functions to access this data. The problem data
42 * * This problem data is used to store the input of the binpacking instance, all variables which are created, and all
58 * The function SCIPprobdataCreate(), which is called in the \ref reader_bpa.c "reader plugin" after the input file was
59 * parsed, initializes the problem data structure and creates the problem in the SCIP environment. For this, it creates
60 * for each item of the binpacking problem one set covering constraint and creates an initial set of variables for the
61 * packings. Note that the set covering constraints have to have the <code>modifiable</code>-flag set to TRUE. This is
62 * necessary to tell the solver that these constraints are not completed yet. This means, during the search new
63 * variables/packings might be added. The solver needs this information because certain reductions are not allowed.
69/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
82 * This problem data is used to store the input of the binpacking, all variables which are created, and all
243 SCIPdebugMsg(scip, "create variable for item %d with weight = %"SCIP_LONGINT_FORMAT"\n", ids[i], probdata->weights[i]);
257 /* create the variable data for the variable; the variable data contains the information in which constraints the
265 /* change the upper bound of the binary variable to lazy since the upper bound is already enforced
267 * The reason for doing is that, is to avoid the bound of x <= 1 in the LP relaxation since this bound
303 SCIP_CALL( probdataCreate(scip, targetdata, sourcedata->vars, sourcedata->conss, sourcedata->weights, sourcedata->ids,
307 SCIP_CALL( SCIPtransformConss(scip, (*targetdata)->nitems, (*targetdata)->conss, (*targetdata)->conss) );
310 SCIP_CALL( SCIPtransformVars(scip, (*targetdata)->nvars, (*targetdata)->vars, (*targetdata)->vars) );
326/** solving process initialization method of transformed data (called before the branch and bound process begins) */
343/** solving process deinitialization method of transformed data (called before the branch and bound data is freed) */
388 SCIP_CALL( SCIPincludeEventhdlrBasic(scip, NULL, EVENTHDLR_NAME, EVENTHDLR_DESC, eventExecAddedVar, NULL) );
Constraint handler for the set partitioning / packing / covering constraints .
SCIP_RETCODE SCIPcreateConsBasicSetcover(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars)
Definition: cons_setppc.c:9558
SCIP_RETCODE SCIPaddCoefSetppc(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
Definition: cons_setppc.c:9573
SCIP_RETCODE SCIPsetProbDeltrans(SCIP *scip, SCIP_DECL_PROBDELTRANS((*probdeltrans)))
Definition: scip_prob.c:244
SCIP_RETCODE SCIPsetProbExitsol(SCIP *scip, SCIP_DECL_PROBEXITSOL((*probexitsol)))
Definition: scip_prob.c:287
SCIP_RETCODE SCIPsetProbTrans(SCIP *scip, SCIP_DECL_PROBTRANS((*probtrans)))
Definition: scip_prob.c:223
SCIP_RETCODE SCIPsetProbDelorig(SCIP *scip, SCIP_DECL_PROBDELORIG((*probdelorig)))
Definition: scip_prob.c:202
SCIP_RETCODE SCIPsetProbInitsol(SCIP *scip, SCIP_DECL_PROBINITSOL((*probinitsol)))
Definition: scip_prob.c:265
SCIP_RETCODE SCIPsetObjsense(SCIP *scip, SCIP_OBJSENSE objsense)
Definition: scip_prob.c:1417
SCIP_RETCODE SCIPcreateProbBasic(SCIP *scip, const char *name)
Definition: scip_prob.c:182
SCIP_RETCODE SCIPsetProbData(SCIP *scip, SCIP_PROBDATA *probdata)
Definition: scip_prob.c:1189
SCIP_RETCODE SCIPtransformConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
Definition: scip_cons.c:1625
SCIP_RETCODE SCIPsetConsModifiable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool modifiable)
Definition: scip_cons.c:1424
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition: scip_cons.c:1173
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
Definition: scip_event.c:111
SCIP_EVENTHDLR * SCIPfindEventhdlr(SCIP *scip, const char *name)
Definition: scip_event.c:241
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:396
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip_event.c:293
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip_event.c:333
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
Definition: scip_mem.h:99
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
Definition: scip_mem.h:105
SCIP_RETCODE SCIPtransformVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
Definition: scip_var.c:2028
SCIP_RETCODE SCIPchgVarUbLazy(SCIP *scip, SCIP_VAR *var, SCIP_Real lazyub)
Definition: scip_var.c:6362
Definition: multiprecision.hpp:66
SCIP_RETCODE SCIPpricerBinpackingActivate(SCIP *scip, SCIP_CONS **conss, SCIP_Longint *weights, int *ids, int nitems, SCIP_Longint capacity)
Definition: pricer_binpacking.c:750
Binpacking variable pricer.
static SCIP_DECL_PROBEXITSOL(probexitsolBinpacking)
Definition: probdata_binpacking.c:345
SCIP_Longint SCIPprobdataGetCapacity(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:461
static SCIP_DECL_EVENTEXEC(eventExecAddedVar)
Definition: probdata_binpacking.c:115
static SCIP_DECL_PROBDELTRANS(probdeltransBinpacking)
Definition: probdata_binpacking.c:317
static SCIP_DECL_PROBDELORIG(probdelorigBinpacking)
Definition: probdata_binpacking.c:288
static SCIP_DECL_PROBTRANS(probtransBinpacking)
Definition: probdata_binpacking.c:300
SCIP_Longint * SCIPprobdataGetWeights(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:445
SCIP_CONS ** SCIPprobdataGetConss(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:485
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)
Definition: probdata_binpacking.c:140
static SCIP_DECL_PROBINITSOL(probinitsolBinpacking)
Definition: probdata_binpacking.c:328
SCIP_RETCODE SCIPprobdataAddVar(SCIP *scip, SCIP_PROBDATA *probdata, SCIP_VAR *var)
Definition: probdata_binpacking.c:493
int * SCIPprobdataGetIds(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:437
static SCIP_RETCODE createInitialColumns(SCIP *scip, SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:217
SCIP_RETCODE SCIPprobdataCreate(SCIP *scip, const char *probname, int *ids, SCIP_Longint *weights, int nitems, SCIP_Longint capacity)
Definition: probdata_binpacking.c:369
int SCIPprobdataGetNVars(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:477
SCIP_VAR ** SCIPprobdataGetVars(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:469
static SCIP_RETCODE probdataFree(SCIP *scip, SCIP_PROBDATA **probdata)
Definition: probdata_binpacking.c:181
int SCIPprobdataGetNItems(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:453
Problem data for binpacking problem.
SCIP callable library.
Definition: struct_cons.h:47
Definition: struct_event.h:218
Definition: struct_var.h:262
Definition: struct_scip.h:72
SCIP_RETCODE SCIPcreateVarBinpacking(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real obj, SCIP_Bool initial, SCIP_Bool removable, SCIP_VARDATA *vardata)
Definition: vardata_binpacking.c:151
SCIP_RETCODE SCIPvardataCreateBinpacking(SCIP *scip, SCIP_VARDATA **vardata, int *consids, int nconsids)
Definition: vardata_binpacking.c:112
Variable data containing the ids of constraints in which the variable appears.