Scippy

SCIP

Solving Constraint Integer Programs

probdata_binpacking.c File Reference

Detailed Description

Problem data for binpacking problem.

Author
Timo Berthold
Stefan Heinz

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 <string.h>
#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)
 

Macro Definition Documentation

#define EVENTHDLR_DESC   "event handler for catching added variables"

Definition at line 95 of file probdata_binpacking.c.

Referenced by SCIPprobdataCreate().

#define EVENTHDLR_NAME   "addedvar"

Definition at line 94 of file probdata_binpacking.c.

Referenced by SCIP_DECL_EVENTEXEC(), and SCIPprobdataCreate().

Function Documentation

static SCIP_RETCODE createInitialColumns ( SCIP *  scip,
SCIP_PROBDATA *  probdata 
)
static

create initial columns

Parameters
scipSCIP data structure
probdataproblem data

Definition at line 208 of file probdata_binpacking.c.

References SCIP_ProbData::conss, SCIP_ProbData::ids, SCIP_ProbData::nitems, SCIPcreateVarBinpacking(), SCIPprobdataAddVar(), SCIPvardataCreateBinpacking(), and SCIP_ProbData::weights.

Referenced by SCIPprobdataCreate().

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

creates problem data

Parameters
scipSCIP data structure
probdatapointer to problem data
varsall exist variables
conssset partitioning constraints for each job exactly one
weightsarray containing the item weights
idsarray of item ids
nvarsnumber of variables
nitemsnumber of items
capacitybin capacity

Definition at line 131 of file probdata_binpacking.c.

References SCIP_ProbData::capacity, SCIP_ProbData::nitems, and SCIP_ProbData::nvars.

Referenced by SCIP_DECL_PROBTRANS(), and SCIPprobdataCreate().

static SCIP_RETCODE probdataFree ( SCIP *  scip,
SCIP_PROBDATA **  probdata 
)
static

frees the memory of the given problem data

Parameters
scipSCIP data structure
probdatapointer to problem data

Definition at line 172 of file probdata_binpacking.c.

Referenced by SCIP_DECL_PROBDELORIG(), and SCIP_DECL_PROBDELTRANS().

static SCIP_DECL_EVENTEXEC ( eventExecAddedVar  )
static

execution method of event handler

Definition at line 106 of file probdata_binpacking.c.

References EVENTHDLR_NAME, and SCIPprobdataAddVar().

static SCIP_DECL_PROBDELORIG ( probdelorigBinpacking  )
static

frees user data of original problem (called when the original problem is freed)

Definition at line 281 of file probdata_binpacking.c.

References probdataFree().

static SCIP_DECL_PROBDELTRANS ( probdeltransBinpacking  )
static

frees user data of transformed problem (called when the transformed problem is freed)

Definition at line 310 of file probdata_binpacking.c.

References probdataFree().

static SCIP_DECL_PROBEXITSOL ( probexitsolBinpacking  )
static

solving process deinitialization method of transformed data (called before the branch and bound data is freed)

Definition at line 338 of file probdata_binpacking.c.

static SCIP_DECL_PROBINITSOL ( probinitsolBinpacking  )
static

solving process initialization method of transformed data (called before the branch and bound process begins)

Definition at line 321 of file probdata_binpacking.c.

static SCIP_DECL_PROBTRANS ( probtransBinpacking  )
static

creates user data of transformed problem by transforming the original user problem data (called after problem was transformed)

Definition at line 293 of file probdata_binpacking.c.

References probdataCreate().

SCIP_RETCODE SCIPprobdataAddVar ( SCIP *  scip,
SCIP_PROBDATA *  probdata,
SCIP_VAR *  var 
)

adds given variable to the problem data

Parameters
scipSCIP data structure
probdataproblem data
varvariables to add

Definition at line 487 of file probdata_binpacking.c.

Referenced by createInitialColumns(), and SCIP_DECL_EVENTEXEC().

SCIP_RETCODE SCIPprobdataCreate ( SCIP *  scip,
const char *  probname,
int *  ids,
SCIP_Longint *  weights,
int  nitems,
SCIP_Longint  capacity 
)

sets up the problem data

Parameters
scipSCIP data structure
probnameproblem name
idsarray of item ids
weightsarray containing the item weights
nitemsnumber of items
capacitybin capacity

Definition at line 363 of file probdata_binpacking.c.

References SCIP_ProbData::conss, createInitialColumns(), EVENTHDLR_DESC, EVENTHDLR_NAME, SCIP_ProbData::nitems, probdataCreate(), and SCIPpricerBinpackingActivate().

Referenced by SCIP_DECL_READERREAD().

SCIP_Longint SCIPprobdataGetCapacity ( SCIP_PROBDATA *  probdata)

returns bin capacity

Parameters
probdataproblem data

Definition at line 455 of file probdata_binpacking.c.

SCIP_CONS** SCIPprobdataGetConss ( SCIP_PROBDATA *  probdata)

returns array of set partitioning constrains

Parameters
probdataproblem data

Definition at line 479 of file probdata_binpacking.c.

int* SCIPprobdataGetIds ( SCIP_PROBDATA *  probdata)

returns array of item ids

Parameters
probdataproblem data

Definition at line 431 of file probdata_binpacking.c.

Referenced by addBranchingDecisionConss(), consdataPrint(), SCIP_DECL_BRANCHEXECLP(), and SCIPvardataPrint().

int SCIPprobdataGetNItems ( SCIP_PROBDATA *  probdata)

returns number of items

Parameters
probdataproblem data

Definition at line 447 of file probdata_binpacking.c.

Referenced by SCIP_DECL_BRANCHEXECLP().

int SCIPprobdataGetNVars ( SCIP_PROBDATA *  probdata)

returns number of variables

Parameters
probdataproblem data

Definition at line 471 of file probdata_binpacking.c.

Referenced by consdataCheck(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSDEACTIVE(), and SCIP_DECL_CONSPROP().

SCIP_VAR** SCIPprobdataGetVars ( SCIP_PROBDATA *  probdata)

returns array of all variables itemed in the way they got generated

Parameters
probdataproblem data

Definition at line 463 of file probdata_binpacking.c.

Referenced by consdataCheck(), and SCIP_DECL_CONSPROP().

SCIP_Longint* SCIPprobdataGetWeights ( SCIP_PROBDATA *  probdata)

returns array of item weights

Parameters
probdataproblem data

Definition at line 439 of file probdata_binpacking.c.