SCIP

    Solving Constraint Integer Programs

    probdata_binpacking.c
    Go to the documentation of this file.
    1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    2/* */
    3/* This file is part of the program and library */
    4/* SCIP --- Solving Constraint Integer Programs */
    5/* */
    6/* Copyright (c) 2002-2026 Zuse Institute Berlin (ZIB) */
    7/* */
    8/* Licensed under the Apache License, Version 2.0 (the "License"); */
    9/* you may not use this file except in compliance with the License. */
    10/* You may obtain a copy of the License at */
    11/* */
    12/* http://www.apache.org/licenses/LICENSE-2.0 */
    13/* */
    14/* Unless required by applicable law or agreed to in writing, software */
    15/* distributed under the License is distributed on an "AS IS" BASIS, */
    16/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
    17/* See the License for the specific language governing permissions and */
    18/* limitations under the License. */
    19/* */
    20/* You should have received a copy of the Apache-2.0 license */
    21/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
    22/* */
    23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    24
    25/**@file probdata_binpacking.c
    26 * @brief Problem data for binpacking problem
    27 * @author Timo Berthold
    28 * @author Stefan Heinz
    29 *
    30 * This file handles the main problem data used in that project. For more details see \ref BINPACKING_PROBLEMDATA page.
    31 *
    32 * @page BINPACKING_PROBLEMDATA Main problem data
    33 *
    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
    37 * structure SCIP_ProbData is shown below.
    38 *
    39 * \code
    40 * ** @brief Problem data which is accessible in all places
    41 * *
    42 * * This problem data is used to store the input of the binpacking instance, all variables which are created, and all
    43 * * constraints.
    44 * *
    45 * struct SCIP_ProbData
    46 * {
    47 * SCIP_VAR** vars; **< all exiting variables in the problem *
    48 * SCIP_CONS** conss; **< set partitioning constraints for each item exactly one *
    49 * SCIP_Longint* weights; **< array of item weights *
    50 * int* ids; **< array of item ids *
    51 * int nvars; **< number of generated variables *
    52 * int varssize; **< size of the variable array *
    53 * int nitems; **< number of items *
    54 * SCIP_Longint capacity; **< bin capacity *
    55 * };
    56 * \endcode
    57 *
    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.
    64 * See the body of the function SCIPprobdataCreate() for more details.
    65 *
    66 * A list of all interface methods can be found in probdata_binpacking.h.
    67 */
    68
    69/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    70
    71#include "probdata_binpacking.h"
    72#include "vardata_binpacking.h"
    73#include "pricer_binpacking.h"
    74
    75#include "scip/cons_setppc.h"
    76#include "scip/scip.h"
    77
    78/** @brief Problem data which is accessible in all places
    79 *
    80 * This problem data is used to store the input of the binpacking, all variables which are created, and all
    81 * constrsaints.
    82 */
    83struct SCIP_ProbData
    84{
    85 SCIP_VAR** vars; /**< all exiting variables in the problem */
    86 SCIP_CONS** conss; /**< set partitioning constraints for each item exactly one */
    87 SCIP_Longint* weights; /**< array of item weights */
    88 int* ids; /**< array of item ids */
    89 int nvars; /**< number of generated variables */
    90 int varssize; /**< size of the variable array */
    91 int nitems; /**< number of items */
    92 SCIP_Longint capacity; /**< bin capacity */
    93};
    94
    95
    96/**@name Event handler properties
    97 *
    98 * @{
    99 */
    100
    101#define EVENTHDLR_NAME "addedvar"
    102#define EVENTHDLR_DESC "event handler for catching added variables"
    103
    104/**@} */
    105
    106/**@name Callback methods of event handler
    107 *
    108 * @{
    109 */
    110
    111/** execution method of event handler */
    112static
    113SCIP_DECL_EVENTEXEC(eventExecAddedVar)
    114{ /*lint --e{715}*/
    115 assert(eventhdlr != NULL);
    116 assert(event != NULL);
    118
    120
    121 SCIPdebugMsg(scip, "exec method of event handler for added variable to probdata\n");
    122
    123 /* add new variable to probdata */
    125
    126 return SCIP_OKAY;
    127}
    128
    129/**@} */
    130
    131
    132/**@name Local methods
    133 *
    134 * @{
    135 */
    136
    137/** creates problem data */
    138static
    140 SCIP* scip, /**< SCIP data structure */
    141 SCIP_PROBDATA** probdata, /**< pointer to problem data */
    142 SCIP_VAR** vars, /**< all exist variables */
    143 SCIP_CONS** conss, /**< set partitioning constraints for each job exactly one */
    144 SCIP_Longint* weights, /**< array containing the item weights */
    145 int* ids, /**< array of item ids */
    146 int nvars, /**< number of variables */
    147 int nitems, /**< number of items */
    148 SCIP_Longint capacity /**< bin capacity */
    149 )
    150{
    151 assert(scip != NULL);
    152 assert(probdata != NULL);
    153
    154 /* allocate memory */
    155 SCIP_CALL( SCIPallocBlockMemory(scip, probdata) );
    156
    157 if( nvars > 0 )
    158 {
    159 /* copy variable array */
    160 SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &(*probdata)->vars, vars, nvars) );
    161 }
    162 else
    163 (*probdata)->vars = NULL;
    164
    165 /* duplicate arrays */
    166 SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &(*probdata)->conss, conss, nitems) );
    167 SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &(*probdata)->weights, weights, nitems) );
    168 SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &(*probdata)->ids, ids, nitems) );
    169
    170 (*probdata)->nvars = nvars;
    171 (*probdata)->varssize = nvars;
    172 (*probdata)->nitems = nitems;
    173 (*probdata)->capacity = capacity;
    174
    175 return SCIP_OKAY;
    176}
    177
    178/** frees the memory of the given problem data */
    179static
    181 SCIP* scip, /**< SCIP data structure */
    182 SCIP_PROBDATA** probdata /**< pointer to problem data */
    183 )
    184{
    185 int i;
    186
    187 assert(scip != NULL);
    188 assert(probdata != NULL);
    189
    190 /* release all variables */
    191 for( i = 0; i < (*probdata)->nvars; ++i )
    192 {
    193 SCIP_CALL( SCIPreleaseVar(scip, &(*probdata)->vars[i]) );
    194 }
    195
    196 /* release all constraints */
    197 for( i = 0; i < (*probdata)->nitems; ++i )
    198 {
    199 SCIP_CALL( SCIPreleaseCons(scip, &(*probdata)->conss[i]) );
    200 }
    201
    202 /* free memory of arrays */
    203 SCIPfreeBlockMemoryArray(scip, &(*probdata)->vars, (*probdata)->varssize);
    204 SCIPfreeBlockMemoryArray(scip, &(*probdata)->conss, (*probdata)->nitems);
    205 SCIPfreeBlockMemoryArray(scip, &(*probdata)->weights, (*probdata)->nitems);
    206 SCIPfreeBlockMemoryArray(scip, &(*probdata)->ids, (*probdata)->nitems);
    207
    208 /* free probdata */
    209 SCIPfreeBlockMemory(scip, probdata);
    210
    211 return SCIP_OKAY;
    212}
    213
    214/** create initial columns */
    215static
    217 SCIP* scip, /**< SCIP data structure */
    218 SCIP_PROBDATA* probdata /**< problem data */
    219 )
    220{
    221 SCIP_CONS** conss;
    222 SCIP_VARDATA* vardata;
    223 SCIP_VAR* var;
    224 char name[SCIP_MAXSTRLEN];
    225
    226 int* ids;
    227 int nitems;
    228
    229 int i;
    230
    231 conss = probdata->conss;
    232 ids = probdata->ids;
    233 nitems = probdata->nitems;
    234
    235 /* create start solution each item in exactly one bin */
    236 for( i = 0; i < nitems; ++i )
    237 {
    238 int a;
    239
    240 (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "item_%d", ids[i]);
    241
    242 SCIPdebugMsg(scip, "create variable for item %d with weight = %"SCIP_LONGINT_FORMAT"\n", ids[i], probdata->weights[i]);
    243
    244 /* create variable for the packing pattern which contains only this item */
    245 SCIP_CALL( SCIPcreateVarBinpacking(scip, &var, name, 1.0, TRUE, TRUE, NULL) );
    246
    247 /* add variable to the problem */
    248 SCIP_CALL( SCIPaddVar(scip, var) );
    249
    250 /* store variable in the problme data */
    251 SCIP_CALL( SCIPprobdataAddVar(scip, probdata, var) );
    252
    253 /* add variable to corresponding set covering constraint */
    254 SCIP_CALL( SCIPaddCoefSetppc(scip, conss[i], var) );
    255
    256 /* create the variable data for the variable; the variable data contains the information in which constraints the
    257 * variable appears */
    258 a = i;
    259 SCIP_CALL( SCIPvardataCreateBinpacking(scip, &vardata, &a, 1) );
    260
    261 /* add the variable data to the variable */
    262 SCIPvarSetData(var, vardata);
    263
    264 /* change the upper bound of the binary variable to lazy since the upper bound is already enforced
    265 * due to the objective function the set covering constraint;
    266 * The reason for doing is that, is to avoid the bound of x <= 1 in the LP relaxation since this bound
    267 * constraint would produce a dual variable which might have a positive reduced cost
    268 */
    269 SCIP_CALL( SCIPchgVarUbLazy(scip, var, 1.0) );
    270
    271 /* release variable */
    272 SCIP_CALL( SCIPreleaseVar(scip, &var) );
    273 }
    274
    275 return SCIP_OKAY;
    276}
    277
    278/**@} */
    279
    280/**@name Callback methods of problem data
    281 *
    282 * @{
    283 */
    284
    285/** frees user data of original problem (called when the original problem is freed) */
    286static
    287SCIP_DECL_PROBDELORIG(probdelorigBinpacking)
    288{
    289 SCIPdebugMsg(scip, "free original problem data\n");
    290
    291 SCIP_CALL( probdataFree(scip, probdata) );
    292
    293 return SCIP_OKAY;
    294}
    295
    296/** creates user data of transformed problem by transforming the original user problem data
    297 * (called after problem was transformed) */
    298static
    299SCIP_DECL_PROBTRANS(probtransBinpacking)
    300{
    301 /* create transform probdata */
    302 SCIP_CALL( probdataCreate(scip, targetdata, sourcedata->vars, sourcedata->conss, sourcedata->weights, sourcedata->ids,
    303 sourcedata->nvars, sourcedata->nitems, sourcedata->capacity) );
    304
    305 /* transform all constraints */
    306 SCIP_CALL( SCIPtransformConss(scip, (*targetdata)->nitems, (*targetdata)->conss, (*targetdata)->conss) );
    307
    308 /* transform all variables */
    309 SCIP_CALL( SCIPtransformVars(scip, (*targetdata)->nvars, (*targetdata)->vars, (*targetdata)->vars) );
    310
    311 return SCIP_OKAY;
    312}
    313
    314/** frees user data of transformed problem (called when the transformed problem is freed) */
    315static
    316SCIP_DECL_PROBDELTRANS(probdeltransBinpacking)
    317{
    318 SCIPdebugMsg(scip, "free transformed problem data\n");
    319
    320 SCIP_CALL( probdataFree(scip, probdata) );
    321
    322 return SCIP_OKAY;
    323}
    324
    325/** solving process initialization method of transformed data (called before the branch and bound process begins) */
    326static
    327SCIP_DECL_PROBINITSOL(probinitsolBinpacking)
    328{
    329 SCIP_EVENTHDLR* eventhdlr;
    330
    331 assert(probdata != NULL);
    332
    333 /* catch variable added event */
    334 eventhdlr = SCIPfindEventhdlr(scip, "addedvar");
    335 assert(eventhdlr != NULL);
    336
    338
    339 return SCIP_OKAY;
    340}
    341
    342/** solving process deinitialization method of transformed data (called before the branch and bound data is freed) */
    343static
    344SCIP_DECL_PROBEXITSOL(probexitsolBinpacking)
    345{ /*lint --e{715}*/
    346 SCIP_EVENTHDLR* eventhdlr;
    347
    348 assert(probdata != NULL);
    349
    350 /* drop variable added event */
    351 eventhdlr = SCIPfindEventhdlr(scip, "addedvar");
    352 assert(eventhdlr != NULL);
    353
    355
    356 return SCIP_OKAY;
    357}
    358
    359/**@} */
    360
    361
    362/**@name Interface methods
    363 *
    364 * @{
    365 */
    366
    367/** sets up the problem data */
    369 SCIP* scip, /**< SCIP data structure */
    370 const char* probname, /**< problem name */
    371 int* ids, /**< array of item ids */
    372 SCIP_Longint* weights, /**< array containing the item weights */
    373 int nitems, /**< number of items */
    374 SCIP_Longint capacity /**< bin capacity */
    375 )
    376{
    377 SCIP_PROBDATA* probdata;
    378 SCIP_CONS** conss;
    379 char name[SCIP_MAXSTRLEN];
    380 int i;
    381
    382 assert(scip != NULL);
    383
    384 /* create event handler if it does not exist yet */
    386 {
    388 }
    389
    390 /* create problem in SCIP and add non-NULL callbacks via setter functions */
    391 SCIP_CALL( SCIPcreateProbBasic(scip, probname) );
    392
    393 SCIP_CALL( SCIPsetProbDelorig(scip, probdelorigBinpacking) );
    394 SCIP_CALL( SCIPsetProbTrans(scip, probtransBinpacking) );
    395 SCIP_CALL( SCIPsetProbDeltrans(scip, probdeltransBinpacking) );
    396 SCIP_CALL( SCIPsetProbInitsol(scip, probinitsolBinpacking) );
    397 SCIP_CALL( SCIPsetProbExitsol(scip, probexitsolBinpacking) );
    398
    399 /* set objective sense */
    401
    402 /* tell SCIP that the objective will be always integral */
    404
    405 SCIP_CALL( SCIPallocBufferArray(scip, &conss, nitems) );
    406
    407 /* create set covering constraints for each item */
    408 for( i = 0; i < nitems; ++i )
    409 {
    410 (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "item_%d", ids[i]);
    411
    412 SCIP_CALL( SCIPcreateConsBasicSetcover(scip, &conss[i], name, 0, NULL) );
    413
    414 /* declare constraint modifiable for adding variables during pricing */
    416 SCIP_CALL( SCIPaddCons(scip, conss[i]) );
    417 }
    418
    419 /* create problem data */
    420 SCIP_CALL( probdataCreate(scip, &probdata, NULL, conss, weights, ids, 0, nitems, capacity) );
    421
    422 SCIP_CALL( createInitialColumns(scip, probdata) );
    423
    424 /* set user problem data */
    425 SCIP_CALL( SCIPsetProbData(scip, probdata) );
    426
    427 SCIP_CALL( SCIPpricerBinpackingActivate(scip, conss, weights, ids, nitems, capacity) );
    428
    429 /* free local buffer arrays */
    430 SCIPfreeBufferArray(scip, &conss);
    431
    432 return SCIP_OKAY;
    433}
    434
    435/** returns array of item ids */
    437 SCIP_PROBDATA* probdata /**< problem data */
    438 )
    439{
    440 return probdata->ids;
    441}
    442
    443/** returns array of item weights */
    445 SCIP_PROBDATA* probdata /**< problem data */
    446 )
    447{
    448 return probdata->weights;
    449}
    450
    451/** returns number of items */
    453 SCIP_PROBDATA* probdata /**< problem data */
    454 )
    455{
    456 return probdata->nitems;
    457}
    458
    459/** returns bin capacity */
    461 SCIP_PROBDATA* probdata /**< problem data */
    462 )
    463{
    464 return probdata->capacity;
    465}
    466
    467/** returns array of all variables itemed in the way they got generated */
    469 SCIP_PROBDATA* probdata /**< problem data */
    470 )
    471{
    472 return probdata->vars;
    473}
    474
    475/** returns number of variables */
    477 SCIP_PROBDATA* probdata /**< problem data */
    478 )
    479{
    480 return probdata->nvars;
    481}
    482
    483/** returns array of set partitioning constrains */
    485 SCIP_PROBDATA* probdata /**< problem data */
    486 )
    487{
    488 return probdata->conss;
    489}
    490
    491/** adds given variable to the problem data */
    493 SCIP* scip, /**< SCIP data structure */
    494 SCIP_PROBDATA* probdata, /**< problem data */
    495 SCIP_VAR* var /**< variables to add */
    496 )
    497{
    498 /* check if enough memory is left */
    499 if( probdata->varssize == probdata->nvars )
    500 {
    501 int newsize;
    502 newsize = MAX(100, probdata->varssize * 2);
    503 SCIP_CALL( SCIPreallocBlockMemoryArray(scip, &probdata->vars, probdata->varssize, newsize) );
    504 probdata->varssize = newsize;
    505 }
    506
    507 /* caputure variables */
    509
    510 probdata->vars[probdata->nvars] = var;
    511 probdata->nvars++;
    512
    513 SCIPdebugMsg(scip, "added variable to probdata; nvars = %d\n", probdata->nvars);
    514
    515 return SCIP_OKAY;
    516}
    517
    518/**@} */
    SCIP_VAR * a
    Definition: circlepacking.c:66
    Constraint handler for the set partitioning / packing / covering constraints .
    #define NULL
    Definition: def.h:257
    #define SCIP_MAXSTRLEN
    Definition: def.h:278
    #define SCIP_Longint
    Definition: def.h:150
    #define SCIP_STRINGEQ(name, reference, retcode)
    Definition: def.h:454
    #define TRUE
    Definition: def.h:102
    #define MAX(x, y)
    Definition: def.h:229
    #define SCIP_LONGINT_FORMAT
    Definition: def.h:157
    #define SCIP_CALL(x)
    Definition: def.h:364
    SCIP_RETCODE SCIPcreateConsBasicSetcover(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars)
    Definition: cons_setppc.c:9649
    SCIP_RETCODE SCIPaddCoefSetppc(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
    Definition: cons_setppc.c:9664
    SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
    Definition: scip_prob.c:1907
    SCIP_RETCODE SCIPsetObjIntegral(SCIP *scip)
    Definition: scip_prob.c:1758
    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 SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
    Definition: scip_prob.c:3274
    SCIP_PROBDATA * SCIPgetProbData(SCIP *scip)
    Definition: scip_prob.c:1139
    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
    #define SCIPdebugMsg
    Definition: scip_message.h:78
    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_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
    Definition: event.c:1194
    SCIP_VAR * SCIPeventGetVar(SCIP_EVENT *event)
    Definition: event.c:1217
    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 SCIPfreeBlockMemoryArray(scip, ptr, num)
    Definition: scip_mem.h:110
    #define SCIPallocBufferArray(scip, ptr, num)
    Definition: scip_mem.h:124
    #define SCIPfreeBufferArray(scip, ptr)
    Definition: scip_mem.h:136
    #define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
    Definition: scip_mem.h:99
    #define SCIPfreeBlockMemory(scip, ptr)
    Definition: scip_mem.h:108
    #define SCIPallocBlockMemory(scip, ptr)
    Definition: scip_mem.h:89
    #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 SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
    Definition: scip_var.c:1887
    void SCIPvarSetData(SCIP_VAR *var, SCIP_VARDATA *vardata)
    Definition: var.c:23329
    SCIP_RETCODE SCIPchgVarUbLazy(SCIP *scip, SCIP_VAR *var, SCIP_Real lazyub)
    Definition: scip_var.c:6362
    SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
    Definition: scip_var.c:1853
    int SCIPsnprintf(char *t, int len, const char *s,...)
    Definition: misc.c:10827
    SCIP_RETCODE SCIPpricerBinpackingActivate(SCIP *scip, SCIP_CONS **conss, SCIP_Longint *weights, int *ids, int nitems, SCIP_Longint capacity)
    Binpacking variable pricer.
    static SCIP_DECL_PROBEXITSOL(probexitsolBinpacking)
    SCIP_Longint SCIPprobdataGetCapacity(SCIP_PROBDATA *probdata)
    static SCIP_DECL_EVENTEXEC(eventExecAddedVar)
    static SCIP_DECL_PROBDELTRANS(probdeltransBinpacking)
    static SCIP_DECL_PROBDELORIG(probdelorigBinpacking)
    static SCIP_DECL_PROBTRANS(probtransBinpacking)
    SCIP_Longint * SCIPprobdataGetWeights(SCIP_PROBDATA *probdata)
    SCIP_CONS ** SCIPprobdataGetConss(SCIP_PROBDATA *probdata)
    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_DECL_PROBINITSOL(probinitsolBinpacking)
    SCIP_RETCODE SCIPprobdataAddVar(SCIP *scip, SCIP_PROBDATA *probdata, SCIP_VAR *var)
    int * SCIPprobdataGetIds(SCIP_PROBDATA *probdata)
    static SCIP_RETCODE createInitialColumns(SCIP *scip, SCIP_PROBDATA *probdata)
    SCIP_RETCODE SCIPprobdataCreate(SCIP *scip, const char *probname, int *ids, SCIP_Longint *weights, int nitems, SCIP_Longint capacity)
    int SCIPprobdataGetNVars(SCIP_PROBDATA *probdata)
    #define EVENTHDLR_DESC
    SCIP_VAR ** SCIPprobdataGetVars(SCIP_PROBDATA *probdata)
    static SCIP_RETCODE probdataFree(SCIP *scip, SCIP_PROBDATA **probdata)
    #define EVENTHDLR_NAME
    int SCIPprobdataGetNItems(SCIP_PROBDATA *probdata)
    Problem data for binpacking problem.
    SCIP callable library.
    #define SCIP_EVENTTYPE_VARADDED
    Definition: type_event.h:70
    struct SCIP_ProbData SCIP_PROBDATA
    Definition: type_prob.h:53
    @ SCIP_OBJSENSE_MINIMIZE
    Definition: type_prob.h:48
    @ SCIP_OKAY
    Definition: type_retcode.h:42
    @ SCIP_INVALIDCALL
    Definition: type_retcode.h:51
    enum SCIP_Retcode SCIP_RETCODE
    Definition: type_retcode.h:63
    struct SCIP_VarData SCIP_VARDATA
    Definition: type_var.h:167
    SCIP_RETCODE SCIPcreateVarBinpacking(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real obj, SCIP_Bool initial, SCIP_Bool removable, SCIP_VARDATA *vardata)
    SCIP_RETCODE SCIPvardataCreateBinpacking(SCIP *scip, SCIP_VARDATA **vardata, int *consids, int nconsids)
    Variable data containing the ids of constraints in which the variable appears.