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
245 SCIPdebugMsg(scip, "create variable for item %d with weight = %"SCIP_LONGINT_FORMAT"\n", ids[i], weights[i]);
259 /* create the variable data for the variable; the variable data contains the information in which constraints the
267 /* change the upper bound of the binary variable to lazy since the upper bound is already enforced
269 * The reason for doing is that, is to avoid the bound of x <= 1 in the LP relaxation since this bound
305 SCIP_CALL( probdataCreate(scip, targetdata, sourcedata->vars, sourcedata->conss, sourcedata->weights, sourcedata->ids,
309 SCIP_CALL( SCIPtransformConss(scip, (*targetdata)->nitems, (*targetdata)->conss, (*targetdata)->conss) );
312 SCIP_CALL( SCIPtransformVars(scip, (*targetdata)->nvars, (*targetdata)->vars, (*targetdata)->vars) );
328/** solving process initialization method of transformed data (called before the branch and bound process begins) */
345/** solving process deinitialization method of transformed data (called before the branch and bound data is freed) */
390 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:9507
SCIP_RETCODE SCIPaddCoefSetppc(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
Definition: cons_setppc.c:9522
SCIP_RETCODE SCIPsetProbDeltrans(SCIP *scip, SCIP_DECL_PROBDELTRANS((*probdeltrans)))
Definition: scip_prob.c:242
SCIP_RETCODE SCIPsetProbExitsol(SCIP *scip, SCIP_DECL_PROBEXITSOL((*probexitsol)))
Definition: scip_prob.c:285
SCIP_RETCODE SCIPsetProbTrans(SCIP *scip, SCIP_DECL_PROBTRANS((*probtrans)))
Definition: scip_prob.c:221
SCIP_RETCODE SCIPsetProbDelorig(SCIP *scip, SCIP_DECL_PROBDELORIG((*probdelorig)))
Definition: scip_prob.c:200
SCIP_RETCODE SCIPsetProbInitsol(SCIP *scip, SCIP_DECL_PROBINITSOL((*probinitsol)))
Definition: scip_prob.c:263
SCIP_RETCODE SCIPsetObjsense(SCIP *scip, SCIP_OBJSENSE objsense)
Definition: scip_prob.c:1242
SCIP_RETCODE SCIPcreateProbBasic(SCIP *scip, const char *name)
Definition: scip_prob.c:180
SCIP_RETCODE SCIPsetProbData(SCIP *scip, SCIP_PROBDATA *probdata)
Definition: scip_prob.c:1014
SCIP_RETCODE SCIPtransformConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
Definition: scip_cons.c:1626
SCIP_RETCODE SCIPsetConsModifiable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool modifiable)
Definition: scip_cons.c:1425
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition: scip_cons.c:1174
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:104
SCIP_EVENTHDLR * SCIPfindEventhdlr(SCIP *scip, const char *name)
Definition: scip_event.c:234
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:324
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip_event.c:286
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip_event.c:320
#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:1389
SCIP_RETCODE SCIPchgVarUbLazy(SCIP *scip, SCIP_VAR *var, SCIP_Real lazyub)
Definition: scip_var.c:5164
Definition: objbenders.h:44
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:347
SCIP_Longint SCIPprobdataGetCapacity(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:463
static SCIP_DECL_EVENTEXEC(eventExecAddedVar)
Definition: probdata_binpacking.c:115
static SCIP_DECL_PROBDELTRANS(probdeltransBinpacking)
Definition: probdata_binpacking.c:319
static SCIP_DECL_PROBDELORIG(probdelorigBinpacking)
Definition: probdata_binpacking.c:290
static SCIP_DECL_PROBTRANS(probtransBinpacking)
Definition: probdata_binpacking.c:302
SCIP_Longint * SCIPprobdataGetWeights(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:447
SCIP_CONS ** SCIPprobdataGetConss(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:487
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:330
SCIP_RETCODE SCIPprobdataAddVar(SCIP *scip, SCIP_PROBDATA *probdata, SCIP_VAR *var)
Definition: probdata_binpacking.c:495
int * SCIPprobdataGetIds(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:439
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:371
int SCIPprobdataGetNVars(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:479
SCIP_VAR ** SCIPprobdataGetVars(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:471
static SCIP_RETCODE probdataFree(SCIP *scip, SCIP_PROBDATA **probdata)
Definition: probdata_binpacking.c:181
int SCIPprobdataGetNItems(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:455
Problem data for binpacking problem.
SCIP callable library.
Definition: struct_cons.h:47
Definition: struct_event.h:205
Definition: struct_var.h:208
Definition: struct_scip.h:70
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.