probdata_binpacking.c
Go to the documentation of this file.
21 * This file handles the main problem data used in that project. For more details see \ref BINPACKING_PROBLEMDATA page.
25 * The problem data is accessible in all plugins. The function SCIPgetProbData() returns the pointer to that
26 * structure. We use this data structure to store all the information of the binpacking problem. Since this structure is
27 * not visible in the other plugins, we implemented setter and getter functions to access this data. The problem data
33 * * This problem data is used to store the input of the binpacking instance, all variables which are created, and all
49 * The function SCIPprobdataCreate(), which is called in the \ref reader_bpa.c "reader plugin" after the input file was
50 * parsed, initializes the problem data structure and creates the problem in the SCIP environment. For this, it creates
51 * for each item of the binpacking problem one set covering constraint and creates an initial set of variables for the
52 * packings. Note that the set covering constraints have to have the <code>modifiable</code>-flag set to TRUE. This is
53 * necessary to tell the solver that these constraints are not completed yet. This means, during the search new
54 * variables/packings might be added. The solver needs this information because certain reductions are not allowed.
60 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
73 * This problem data is used to store the input of the binpacking, all variables which are created, and all
236 SCIPdebugMsg(scip, "create variable for item %d with weight = %"SCIP_LONGINT_FORMAT"\n", ids[i], weights[i]);
250 /* create the variable data for the variable; the variable data contains the information in which constraints the
258 /* change the upper bound of the binary variable to lazy since the upper bound is already enforced
260 * The reason for doing is that, is to avoid the bound of x <= 1 in the LP relaxation since this bound
296 SCIP_CALL( probdataCreate(scip, targetdata, sourcedata->vars, sourcedata->conss, sourcedata->weights, sourcedata->ids,
300 SCIP_CALL( SCIPtransformConss(scip, (*targetdata)->nitems, (*targetdata)->conss, (*targetdata)->conss) );
303 SCIP_CALL( SCIPtransformVars(scip, (*targetdata)->nvars, (*targetdata)->vars, (*targetdata)->vars) );
319 /** solving process initialization method of transformed data (called before the branch and bound process begins) */
336 /** solving process deinitialization method of transformed data (called before the branch and bound data is freed) */
381 SCIP_CALL( SCIPincludeEventhdlrBasic(scip, NULL, EVENTHDLR_NAME, EVENTHDLR_DESC, eventExecAddedVar, NULL) );
SCIP_RETCODE SCIPpricerBinpackingActivate(SCIP *scip, SCIP_CONS **conss, SCIP_Longint *weights, int *ids, int nitems, SCIP_Longint capacity)
Definition: pricer_binpacking.c:751
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
Definition: scip_mem.h:86
Definition: struct_scip.h:58
static SCIP_DECL_PROBDELTRANS(probdeltransBinpacking)
Definition: probdata_binpacking.c:310
SCIP_EVENTHDLR * SCIPfindEventhdlr(SCIP *scip, const char *name)
Definition: scip_event.c:224
SCIP_RETCODE SCIPsetObjsense(SCIP *scip, SCIP_OBJSENSE objsense)
Definition: scip_prob.c:1241
SCIP_RETCODE SCIPaddCoefSetppc(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
Definition: cons_setppc.c:9232
Definition: struct_var.h:198
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
Definition: event.c:314
Binpacking variable pricer.
SCIP_RETCODE SCIPprobdataCreate(SCIP *scip, const char *probname, int *ids, SCIP_Longint *weights, int nitems, SCIP_Longint capacity)
Definition: probdata_binpacking.c:362
static SCIP_DECL_PROBEXITSOL(probexitsolBinpacking)
Definition: probdata_binpacking.c:338
Variable data containing the ids of constraints in which the variable appears.
SCIP_RETCODE SCIPchgVarUbLazy(SCIP *scip, SCIP_VAR *var, SCIP_Real lazyub)
Definition: scip_var.c:5087
Constraint handler for the set partitioning / packing / covering constraints .
SCIP_VAR ** SCIPprobdataGetVars(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:462
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:131
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
Definition: scip_mem.h:92
static SCIP_DECL_PROBTRANS(probtransBinpacking)
Definition: probdata_binpacking.c:293
SCIP_RETCODE SCIPsetProbData(SCIP *scip, SCIP_PROBDATA *probdata)
Definition: scip_prob.c:1013
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:142
Definition: struct_cons.h:37
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip_event.c:276
SCIP_Longint * SCIPprobdataGetWeights(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:438
static SCIP_DECL_EVENTEXEC(eventExecAddedVar)
Definition: probdata_binpacking.c:106
SCIP_Longint SCIPprobdataGetCapacity(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:454
Definition: type_retcode.h:33
static SCIP_DECL_PROBINITSOL(probinitsolBinpacking)
Definition: probdata_binpacking.c:321
SCIP_RETCODE SCIPvardataCreateBinpacking(SCIP *scip, SCIP_VARDATA **vardata, int *consids, int nconsids)
Definition: vardata_binpacking.c:103
SCIP_RETCODE SCIPsetProbDelorig(SCIP *scip, SCIP_DECL_PROBDELORIG((*probdelorig)))
Definition: scip_prob.c:186
SCIP_RETCODE SCIPsetConsModifiable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool modifiable)
Definition: scip_cons.c:1360
int * SCIPprobdataGetIds(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:430
Problem data for binpacking problem.
int SCIPprobdataGetNItems(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:446
SCIP_RETCODE SCIPsetProbInitsol(SCIP *scip, SCIP_DECL_PROBINITSOL((*probinitsol)))
Definition: scip_prob.c:249
SCIP_CONS ** SCIPprobdataGetConss(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:478
SCIP_RETCODE SCIPprobdataAddVar(SCIP *scip, SCIP_PROBDATA *probdata, SCIP_VAR *var)
Definition: probdata_binpacking.c:486
SCIP_EXPORT void SCIPvarSetData(SCIP_VAR *var, SCIP_VARDATA *vardata)
Definition: var.c:16768
int SCIPprobdataGetNVars(SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:470
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:94
SCIP_RETCODE SCIPsetProbTrans(SCIP *scip, SCIP_DECL_PROBTRANS((*probtrans)))
Definition: scip_prob.c:207
SCIP_RETCODE SCIPsetProbExitsol(SCIP *scip, SCIP_DECL_PROBEXITSOL((*probexitsol)))
Definition: scip_prob.c:271
static SCIP_RETCODE probdataFree(SCIP *scip, SCIP_PROBDATA **probdata)
Definition: probdata_binpacking.c:172
static SCIP_DECL_PROBDELORIG(probdelorigBinpacking)
Definition: probdata_binpacking.c:281
SCIP_RETCODE SCIPcreateConsBasicSetcover(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars)
Definition: cons_setppc.c:9217
SCIP_RETCODE SCIPtransformConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
Definition: scip_cons.c:1561
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip_event.c:310
static SCIP_RETCODE createInitialColumns(SCIP *scip, SCIP_PROBDATA *probdata)
Definition: probdata_binpacking.c:208
Definition: type_prob.h:39
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition: scip_cons.c:1109
Definition: objbenders.h:33
SCIP_RETCODE SCIPsetProbDeltrans(SCIP *scip, SCIP_DECL_PROBDELTRANS((*probdeltrans)))
Definition: scip_prob.c:228
Definition: struct_event.h:186
SCIP_RETCODE SCIPcreateProbBasic(SCIP *scip, const char *name)
Definition: scip_prob.c:166
SCIP callable library.
SCIP_RETCODE SCIPtransformVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
Definition: scip_var.c:1392