Scippy

GCG

Branch-and-Price & Column Generation for Everyone

decomp.c File Reference

Detailed Description

generic methods for working with different decomposition structures

Author
Martin Bergner
Michael Bastubbe

Various methods to work with the decomp structure

Definition in file decomp.c.

#include "decomp.h"
#include "gcg.h"
#include "cons_decomp.h"
#include "scip/scip.h"
#include "struct_decomp.h"
#include "scip_misc.h"
#include "relax_gcg.h"
#include <assert.h>

Go to the source code of this file.

Data Structures

struct  DEC_STATISTIC
 

Macros

#define ELEM_SWAP(a, b)   { register SCIP_Real t=(a);(a)=(b);(b)=t; }
 

Functions

static SCIP_Real quick_select_median (SCIP_Real arr[], int n)
 
static SCIP_RETCODE fillOutVarsFromVartoblock (SCIP *scip, DEC_DECOMP *decomp, SCIP_HASHMAP *vartoblock, int nblocks, SCIP_VAR **vars, int nvars, SCIP_Bool *haslinking)
 
static SCIP_RETCODE fillOutConsFromConstoblock (SCIP *scip, DEC_DECOMP *decomp, SCIP_HASHMAP *constoblock, int nblocks, SCIP_CONS **conss, int nconss, SCIP_Bool *haslinking)
 
static SCIP_RETCODE removeFromLinkingvars (SCIP *scip, DEC_DECOMP *decomp, SCIP_VAR *var, SCIP_Bool *success)
 
static SCIP_RETCODE assignConsvarsToBlock (SCIP *scip, DEC_DECOMP *decomp, SCIP_CONS *cons, int block)
 
const char * DECgetStrType (DEC_DECTYPE type)
 
SCIP_RETCODE DECdecompCreate (SCIP *scip, DEC_DECOMP **decdecomp)
 
SCIP_RETCODE DECdecompFree (SCIP *scip, DEC_DECOMP **decdecomp)
 
SCIP_RETCODE DECdecompSetType (DEC_DECOMP *decomp, DEC_DECTYPE type)
 
DEC_DECTYPE DECdecompGetType (DEC_DECOMP *decomp)
 
SCIP_Real DECdecompGetMaxwhiteScore (DEC_DECOMP *decomp)
 
void DECdecompSetPresolved (DEC_DECOMP *decomp, SCIP_Bool presolved)
 
SCIP_Bool DECdecompGetPresolved (DEC_DECOMP *decomp)
 
void DECdecompSetNBlocks (DEC_DECOMP *decomp, int nblocks)
 
int DECdecompGetNBlocks (DEC_DECOMP *decomp)
 
SCIP_RETCODE DECdecompSetSubscipvars (SCIP *scip, DEC_DECOMP *decomp, SCIP_VAR ***subscipvars, int *nsubscipvars)
 
SCIP_VAR *** DECdecompGetSubscipvars (DEC_DECOMP *decomp)
 
int * DECdecompGetNSubscipvars (DEC_DECOMP *decomp)
 
SCIP_RETCODE DECdecompSetSubscipconss (SCIP *scip, DEC_DECOMP *decomp, SCIP_CONS ***subscipconss, int *nsubscipconss)
 
SCIP_CONS *** DECdecompGetSubscipconss (DEC_DECOMP *decomp)
 
int * DECdecompGetNSubscipconss (DEC_DECOMP *decomp)
 
SCIP_RETCODE DECdecompSetLinkingconss (SCIP *scip, DEC_DECOMP *decomp, SCIP_CONS **linkingconss, int nlinkingconss)
 
SCIP_CONS ** DECdecompGetLinkingconss (DEC_DECOMP *decomp)
 
int DECdecompGetNLinkingconss (DEC_DECOMP *decomp)
 
SCIP_RETCODE DECdecompSetLinkingvars (SCIP *scip, DEC_DECOMP *decomp, SCIP_VAR **linkingvars, int nlinkingvars, int nfixedlinkingvars, int nmastervars)
 
SCIP_VAR ** DECdecompGetLinkingvars (DEC_DECOMP *decomp)
 
int DECdecompGetNLinkingvars (DEC_DECOMP *decomp)
 
int DECdecompGetNFixedLinkingvars (DEC_DECOMP *decomp)
 
int DECdecompGetNMastervars (DEC_DECOMP *decomp)
 
SCIP_RETCODE DECdecompSetStairlinkingvars (SCIP *scip, DEC_DECOMP *decomp, SCIP_VAR ***stairlinkingvars, int *nstairlinkingvars)
 
SCIP_VAR *** DECdecompGetStairlinkingvars (DEC_DECOMP *decomp)
 
int * DECdecompGetNStairlinkingvars (DEC_DECOMP *decomp)
 
int DECdecompGetNTotalStairlinkingvars (DEC_DECOMP *decomp)
 
void DECdecompSetVartoblock (DEC_DECOMP *decomp, SCIP_HASHMAP *vartoblock)
 
SCIP_HASHMAP * DECdecompGetVartoblock (DEC_DECOMP *decomp)
 
void DECdecompSetConstoblock (DEC_DECOMP *decomp, SCIP_HASHMAP *constoblock)
 
SCIP_HASHMAP * DECdecompGetConstoblock (DEC_DECOMP *decomp)
 
void DECdecompSetVarindex (DEC_DECOMP *decomp, SCIP_HASHMAP *varindex)
 
SCIP_HASHMAP * DECdecompGetVarindex (DEC_DECOMP *decomp)
 
void DECdecompSetConsindex (DEC_DECOMP *decomp, SCIP_HASHMAP *consindex)
 
SCIP_HASHMAP * DECdecompGetConsindex (DEC_DECOMP *decomp)
 
SCIP_RETCODE DECfilloutDecompFromHashmaps (SCIP *scip, DEC_DECOMP *decomp, SCIP_HASHMAP *vartoblock, SCIP_HASHMAP *constoblock, int nblocks, SCIP_Bool staircase)
 
SCIP_RETCODE DECfilloutDecompFromConstoblock (SCIP *scip, DEC_DECOMP *decomp, SCIP_HASHMAP *constoblock, int nblocks, SCIP_Bool staircase)
 
void DECdecompSetDetector (DEC_DECOMP *decomp, DEC_DETECTOR *detector)
 
DEC_DETECTORDECdecompGetDetector (DEC_DECOMP *decomp)
 
DEC_DETECTOR ** DECdecompGetDetectorChain (DEC_DECOMP *decomp)
 
SCIP_RETCODE DECdecompSetDetectorChain (SCIP *scip, DEC_DECOMP *decomp, DEC_DETECTOR **detectors, int ndetectors)
 
int DECdecompGetDetectorChainSize (DEC_DECOMP *decomp)
 
void DECdecompSetPartialdecID (DEC_DECOMP *decomp, int id)
 
int DECdecompGetPartialdecID (DEC_DECOMP *decomp)
 
void DECdecompSetDetectorClockTimes (SCIP *scip, DEC_DECOMP *decomp, SCIP_Real *detectorClockTimes)
 
SCIP_Real * DECdecompGetDetectorClockTimes (DEC_DECOMP *decomp)
 
SCIP_RETCODE DECdecompSetDetectorChainString (SCIP *scip, DEC_DECOMP *decomp, const char *detectorchainstring)
 
char * DECdecompGetDetectorChainString (SCIP *scip, DEC_DECOMP *decomp)
 
void DECdecompSetDetectorPctVarsToBorder (SCIP *scip, DEC_DECOMP *decomp, SCIP_Real *pctVarsToBorder)
 
SCIP_Real * DECdecompGetDetectorPctVarsToBorder (DEC_DECOMP *decomp)
 
void DECdecompSetDetectorPctConssToBorder (SCIP *scip, DEC_DECOMP *decomp, SCIP_Real *pctConssToBorder)
 
SCIP_Real * DECdecompGetDetectorPctConssToBorder (DEC_DECOMP *decomp)
 
void DECdecompSetDetectorPctVarsToBlock (SCIP *scip, DEC_DECOMP *decomp, SCIP_Real *pctVarsToBlock)
 
SCIP_Real * DECdecompGetDetectorPctVarsToBlock (DEC_DECOMP *decomp)
 
void DECdecompSetDetectorPctConssToBlock (SCIP *scip, DEC_DECOMP *decomp, SCIP_Real *pctConssToBlock)
 
SCIP_Real * DECdecompGetDetectorPctConssToBlock (DEC_DECOMP *decomp)
 
void DECdecompSetDetectorPctVarsFromOpen (SCIP *scip, DEC_DECOMP *decomp, SCIP_Real *pctVarsFromOpen)
 
SCIP_Real * DECdecompGetDetectorPctVarsFromOpen (DEC_DECOMP *decomp)
 
void DECdecompSetDetectorPctConssFromOpen (SCIP *scip, DEC_DECOMP *decomp, SCIP_Real *pctConssFromOpen)
 
SCIP_Real * DECdecompGetDetectorPctConssFromOpen (DEC_DECOMP *decomp)
 
void DECdecompSetNNewBlocks (SCIP *scip, DEC_DECOMP *decomp, int *nNewBlocks)
 
int * DECdecompGetNNewBlocks (DEC_DECOMP *decomp)
 
SCIP_RETCODE DECdecompTransform (SCIP *scip, DEC_DECOMP *decomp)
 
SCIP_RETCODE DECdecompRemoveDeletedConss (SCIP *scip, DEC_DECOMP *decdecomp)
 
SCIP_RETCODE DECdecompAddRemainingConss (SCIP *scip, DEC_DECOMP *decdecomp)
 
SCIP_RETCODE DECdecompCheckConsistency (SCIP *scip, DEC_DECOMP *decdecomp)
 
SCIP_RETCODE DECcreateBasicDecomp (SCIP *scip, DEC_DECOMP **decomp, SCIP_Bool solveorigprob)
 
static int processBlockRepresentatives (int maxblock, int *blockrepresentative)
 
static SCIP_RETCODE assignConstraintsToRepresentatives (SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool *consismaster, SCIP_HASHMAP *constoblock, int *vartoblock, int *nextblock, int *blockrepresentative)
 
static SCIP_RETCODE fillConstoblock (SCIP_CONS **conss, int nconss, SCIP_Bool *consismaster, int nblocks, SCIP_HASHMAP *constoblock, SCIP_HASHMAP *newconstoblock, int *blockrepresentative)
 
SCIP_RETCODE DECcreateDecompFromMasterconss (SCIP *scip, DEC_DECOMP **decomp, SCIP_CONS **masterconss, int nmasterconss)
 
static void incVarsData (SCIP_VAR *var, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars, int nproblems, int i)
 
void DECgetSubproblemVarsData (SCIP *scip, DEC_DECOMP *decomp, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars, int nproblems)
 
void DECgetLinkingVarsData (SCIP *scip, DEC_DECOMP *decomp, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
 
SCIP_RETCODE DECgetDensityData (SCIP *scip, DEC_DECOMP *decomp, SCIP_VAR **vars, int nvars, SCIP_CONS **conss, int nconss, int *varsubproblemdensity, int *varmasterdensity, int *conssubproblemdensity, int *consmasterdensity)
 
static void increaseLock (SCIP *scip, SCIP_Real lhs, SCIP_Real coef, SCIP_Real rhs, int *downlock, int *uplock)
 
SCIP_RETCODE DECgetVarLockData (SCIP *scip, DEC_DECOMP *decomp, SCIP_VAR **vars, int nvars, int nsubproblems, int **subsciplocksdown, int **subsciplocksup, int *masterlocksdown, int *masterlocksup)
 
void DECsetMaxWhiteScore (SCIP *scip, DEC_DECOMP *decdecomp, SCIP_Real maxwhitescore)
 
SCIP_Real DECgetMaxWhiteScore (SCIP *scip, DEC_DECOMP *decdecomp)
 
SCIP_RETCODE DECevaluateDecomposition (SCIP *scip, DEC_DECOMP *decdecomp, DEC_SCORES *score)
 
static SCIP_RETCODE computeVarDensities (SCIP *scip, DEC_DECOMP *decomp, int *varprobdensity, int *varmasterdensity, SCIP_VAR **vars, int nvars, DEC_STATISTIC *blockvardensities, DEC_STATISTIC *mastervardensity, int nblocks)
 
int DECdecompGetNConss (DEC_DECOMP *decomp)
 
static SCIP_RETCODE computeConssNzeros (SCIP *scip, DEC_DECOMP *decomp, SCIP_CONS *cons, int *nzeros, int *nintzeros, int *nbzeros, int *nintbzeros)
 
static SCIP_RETCODE computeNonzeros (SCIP *scip, DEC_DECOMP *decomp, int *mnzeros, int *mintnzeros, int *lnzeros, int *lintnzeros, int *nonzeros, int *intnzeros)
 
SCIP_RETCODE GCGprintDecompStatistics (SCIP *scip, FILE *file, DEC_DECOMP *decomp)
 
SCIP_Bool DECdecompositionsAreEqual (SCIP *scip, DEC_DECOMP *decomp1, DEC_DECOMP *decomp2)
 
int DECfilterSimilarDecompositions (SCIP *scip, DEC_DECOMP **decs, int ndecs)
 
SCIP_RETCODE DECdetermineConsBlock (SCIP *scip, DEC_DECOMP *decomp, SCIP_CONS *cons, int *block)
 
SCIP_RETCODE DECdecompMoveLinkingConsToPricing (SCIP *scip, DEC_DECOMP *decomp, int consindex, int block)
 
SCIP_RETCODE DECtryAssignMasterconssToExistingPricing (SCIP *scip, DEC_DECOMP *decomp, int *transferred)
 
SCIP_RETCODE DECtryAssignMasterconssToNewPricing (SCIP *scip, DEC_DECOMP *decomp, DEC_DECOMP **newdecomp, int *transferred)
 
SCIP_RETCODE DECcreatePolishedDecomp (SCIP *scip, DEC_DECOMP *decomp, DEC_DECOMP **newdecomp)
 
SCIP_RETCODE DECpermuteDecomp (SCIP *scip, DEC_DECOMP *decomp, SCIP_RANDNUMGEN *randnumgen)
 

Macro Definition Documentation

◆ ELEM_SWAP

#define ELEM_SWAP (   a,
 
)    { register SCIP_Real t=(a);(a)=(b);(b)=t; }

Definition at line 59 of file decomp.c.

Function Documentation

◆ quick_select_median()

static SCIP_Real quick_select_median ( SCIP_Real  arr[],
int  n 
)
static

Definition at line 62 of file decomp.c.

References ELEM_SWAP.

Referenced by computeVarDensities().

◆ fillOutVarsFromVartoblock()

static SCIP_RETCODE fillOutVarsFromVartoblock ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_HASHMAP *  vartoblock,
int  nblocks,
SCIP_VAR **  vars,
int  nvars,
SCIP_Bool *  haslinking 
)
static

fill out subscipvars arrays from the information from vartoblock

Parameters
scipSCIP data structure
decompdecomposition data structure
vartoblockvariable to block hashmap
nblocksnumber of blocks
varsvariable array
nvarsnumber of variables
haslinkingreturns whether there are linking variables

Definition at line 123 of file decomp.c.

References DECdecompSetLinkingvars(), DECdecompSetSubscipvars(), and DECdecompSetVartoblock().

Referenced by DECfilloutDecompFromHashmaps().

◆ fillOutConsFromConstoblock()

static SCIP_RETCODE fillOutConsFromConstoblock ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_HASHMAP *  constoblock,
int  nblocks,
SCIP_CONS **  conss,
int  nconss,
SCIP_Bool *  haslinking 
)
static

fill out subscipcons arrays from the information from constoblock

Parameters
scipSCIP data structure
decompdecomposition data structure
constoblockconstraint to block hashmap
nblocksnumber of blocks
conssconstraint array
nconssnumber of constraints
haslinkingreturns whether there are linking constraints

Definition at line 242 of file decomp.c.

References DecDecomp::constoblock, DECdecompSetConstoblock(), DECdecompSetLinkingconss(), and DECdecompSetSubscipconss().

Referenced by DECfilloutDecompFromHashmaps().

◆ removeFromLinkingvars()

static SCIP_RETCODE removeFromLinkingvars ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_VAR *  var,
SCIP_Bool *  success 
)
static

removes a variable from the linking variable array

Parameters
scipSCIP data structure
decompdecomposition data structure
varvariable to remove
successindicates whether the variable was successfully removed

Definition at line 355 of file decomp.c.

References DEC_DECTYPE_BORDERED, DEC_DECTYPE_DIAGONAL, DECdecompGetNLinkingconss(), DECdecompSetType(), DecDecomp::linkingvars, and DecDecomp::nlinkingvars.

Referenced by assignConsvarsToBlock().

◆ assignConsvarsToBlock()

static SCIP_RETCODE assignConsvarsToBlock ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_CONS *  cons,
int  block 
)
static

for a given constraint, check which of its variables were previously determined to be copied directly to the master, and assign them to the block to which the constraint belongs

Parameters
scipSCIP data structure
decompdecomposition data structure
consconstraint whose variables should be assigned to its block
blockblock to which the constraint has been assigned

Definition at line 410 of file decomp.c.

References DecDecomp::nblocks, DecDecomp::nsubscipvars, removeFromLinkingvars(), DecDecomp::subscipvars, and DecDecomp::vartoblock.

Referenced by DECdecompAddRemainingConss(), and DECdecompMoveLinkingConsToPricing().

◆ DECgetStrType()

const char* DECgetStrType ( DEC_DECTYPE  type)

converts the DEC_DECTYPE enum to a string

Definition at line 462 of file decomp.c.

Referenced by DECevaluateDecomposition(), GCGprintDecompStatistics(), and GCGwriteDecompositionData().

◆ DECdecompCreate()

SCIP_RETCODE DECdecompCreate ( SCIP *  scip,
DEC_DECOMP **  decdecomp 
)

initializes the decomposition to absolutely nothing

Parameters
scipSCIP data structure
decdecomppointer to the decomposition data structure

Definition at line 471 of file decomp.c.

References DecDecomp::consindex, DecDecomp::constoblock, DEC_DECTYPE_UNKNOWN, DecDecomp::detector, DecDecomp::detectorchain, DecDecomp::detectorchainstring, DecDecomp::detectorclocktimes, GCGconshdlrDecompIncreaseNCallsCreateDecomp(), DecDecomp::linkingconss, DecDecomp::linkingvars, DecDecomp::maxwhitescore, DecDecomp::nblocks, DecDecomp::nfixedlinkingvars, DecDecomp::nlinkingconss, DecDecomp::nlinkingvars, DecDecomp::nmastervars, DecDecomp::nnewblocks, DecDecomp::nstairlinkingvars, DecDecomp::nsubscipconss, DecDecomp::nsubscipvars, DecDecomp::partialdecid, DecDecomp::pctconssfromopen, DecDecomp::pctconsstoblock, DecDecomp::pctconsstoborder, DecDecomp::pctvarsfromopen, DecDecomp::pctvarstoblock, DecDecomp::pctvarstoborder, DecDecomp::presolved, DecDecomp::sizedetectorchain, DecDecomp::stairlinkingvars, DecDecomp::subscipconss, DecDecomp::subscipvars, DecDecomp::type, DecDecomp::varindex, and DecDecomp::vartoblock.

Referenced by createDecompFromPartialdec(), gcg::ColumnGraph< T >::createDecompFromPartition(), gcg::RowGraph< T >::createDecompFromPartition(), gcg::HyperrowcolGraph< T >::createDecompFromPartition(), gcg::HyperrowGraph< T >::createDecompFromPartition(), gcg::HypercolGraph< T >::createDecompFromPartition(), DECcreateBasicDecomp(), DECcreateDecompFromMasterconss(), DECtryAssignMasterconssToNewPricing(), readBLKFile(), and SCIPreadRef().

◆ DECdecompFree()

◆ DECdecompSetType()

SCIP_RETCODE DECdecompSetType ( DEC_DECOMP decomp,
DEC_DECTYPE  type 
)

◆ DECdecompGetType()

DEC_DECTYPE DECdecompGetType ( DEC_DECOMP decomp)

gets the type of the decomposition

Parameters
decompdecomposition data structure

Definition at line 691 of file decomp.c.

References DecDecomp::type.

Referenced by DECdecompCheckConsistency(), DECevaluateDecomposition(), DECgetLinkingVarsData(), DECgetSubproblemVarsData(), GCGprintDecompStatistics(), GCGwriteDecompositionData(), SCIP_DECL_DIALOGEXEC(), and solveMasterProblem().

◆ DECdecompGetMaxwhiteScore()

SCIP_Real DECdecompGetMaxwhiteScore ( DEC_DECOMP decomp)
Parameters
decompdecomposition data structure

Definition at line 701 of file decomp.c.

References DecDecomp::maxwhitescore.

Referenced by initRelaxator().

◆ DECdecompSetPresolved()

void DECdecompSetPresolved ( DEC_DECOMP decomp,
SCIP_Bool  presolved 
)

sets the presolved flag for decomposition

Parameters
decompdecomposition data structure
presolvedpresolved flag for decomposition

Definition at line 712 of file decomp.c.

References DecDecomp::presolved.

Referenced by createDecompFromPartialdec(), DECcreateBasicDecomp(), fillDecompStruct(), and readREFFile().

◆ DECdecompGetPresolved()

SCIP_Bool DECdecompGetPresolved ( DEC_DECOMP decomp)

gets the presolved flag for decomposition

Parameters
decompdecomposition data structure

Definition at line 723 of file decomp.c.

References DecDecomp::presolved.

◆ DECdecompSetNBlocks()

void DECdecompSetNBlocks ( DEC_DECOMP decomp,
int  nblocks 
)

sets the number of blocks for decomposition

Parameters
decompdecomposition data structure
nblocksnumber of blocks for decomposition

Definition at line 733 of file decomp.c.

References DecDecomp::nblocks.

Referenced by createDecompFromPartialdec(), DECfilloutDecompFromHashmaps(), fillDecompStruct(), and readREFFile().

◆ DECdecompGetNBlocks()

◆ DECdecompSetSubscipvars()

SCIP_RETCODE DECdecompSetSubscipvars ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_VAR ***  subscipvars,
int *  nsubscipvars 
)

copies the input subscipvars array to the given decomposition

Parameters
scipSCIP data structure
decompdecomposition data structure
subscipvarssubscipvars array
nsubscipvarsnumber of subscipvars per block

Definition at line 755 of file decomp.c.

References DecDecomp::nblocks, DecDecomp::nsubscipvars, and DecDecomp::subscipvars.

Referenced by createDecompFromPartialdec(), and fillOutVarsFromVartoblock().

◆ DECdecompGetSubscipvars()

SCIP_VAR*** DECdecompGetSubscipvars ( DEC_DECOMP decomp)

returns the subscipvars array of the given decomposition

Parameters
decompdecomposition data structure

Definition at line 823 of file decomp.c.

References DecDecomp::subscipvars.

Referenced by computeVarDensities(), convertStructToGCG(), DECdecompCheckConsistency(), DECgetSubproblemVarsData(), and DECpermuteDecomp().

◆ DECdecompGetNSubscipvars()

int* DECdecompGetNSubscipvars ( DEC_DECOMP decomp)

returns the nsubscipvars array of the given decomposition

Parameters
decompdecomposition data structure

Definition at line 833 of file decomp.c.

References DecDecomp::nsubscipvars.

Referenced by computeVarDensities(), convertStructToGCG(), DECdecompCheckConsistency(), DECevaluateDecomposition(), DECfilloutDecompFromHashmaps(), DECgetSubproblemVarsData(), DECpermuteDecomp(), and GCGwriteDecompositionData().

◆ DECdecompSetSubscipconss()

SCIP_RETCODE DECdecompSetSubscipconss ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_CONS ***  subscipconss,
int *  nsubscipconss 
)

copies the input subscipconss array to the given decomposition

Parameters
scipSCIP data structure
decompdecomposition data structure
subscipconsssubscipconss array
nsubscipconssnumber of subscipconss per block

Definition at line 843 of file decomp.c.

References DecDecomp::nblocks, DecDecomp::nsubscipconss, and DecDecomp::subscipconss.

Referenced by createDecompFromPartialdec(), and fillOutConsFromConstoblock().

◆ DECdecompGetSubscipconss()

SCIP_CONS*** DECdecompGetSubscipconss ( DEC_DECOMP decomp)

returns the subscipconss array of the given decomposition

Parameters
decompdecomposition data structure

Definition at line 908 of file decomp.c.

References DecDecomp::subscipconss.

Referenced by computeNonzeros(), convertStructToGCG(), createPricingprobConss(), DECdecompCheckConsistency(), DECevaluateDecomposition(), DECfilloutDecompFromHashmaps(), DECgetDensityData(), DECgetVarLockData(), DECpermuteDecomp(), and writeREFFile().

◆ DECdecompGetNSubscipconss()

int* DECdecompGetNSubscipconss ( DEC_DECOMP decomp)

◆ DECdecompSetLinkingconss()

SCIP_RETCODE DECdecompSetLinkingconss ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_CONS **  linkingconss,
int  nlinkingconss 
)

copies the input linkingconss array to the given decomposition

Parameters
scipSCIP data structure
decompdecomposition data structure
linkingconsslinkingconss array
nlinkingconssnumber of linkingconss per block

Definition at line 926 of file decomp.c.

References DecDecomp::linkingconss, and DecDecomp::nlinkingconss.

Referenced by createDecompFromPartialdec(), and fillOutConsFromConstoblock().

◆ DECdecompGetLinkingconss()

SCIP_CONS** DECdecompGetLinkingconss ( DEC_DECOMP decomp)

returns the linkingconss array of the given decomposition

Parameters
decompdecomposition data structure

Definition at line 967 of file decomp.c.

References DecDecomp::linkingconss.

Referenced by checkSetppcStructure(), computeNonzeros(), convertStructToGCG(), createMasterprobConss(), createPartialdecFromDecomp(), DECdecompCheckConsistency(), DECgetDensityData(), DECgetVarLockData(), and DECpermuteDecomp().

◆ DECdecompGetNLinkingconss()

◆ DECdecompSetLinkingvars()

SCIP_RETCODE DECdecompSetLinkingvars ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_VAR **  linkingvars,
int  nlinkingvars,
int  nfixedlinkingvars,
int  nmastervars 
)

copies the input linkingvars array to the given decdecomp structure

Parameters
scipSCIP data structure
decompdecomposition data structure
linkingvarslinkingvars array
nlinkingvarsnumber of total linkingvars (including fixed linking vars, )
nfixedlinkingvarsnumber of fixed linking variables
nmastervarsnumber of linking variables that are purely master variables

Definition at line 989 of file decomp.c.

References DecDecomp::linkingvars, DecDecomp::nfixedlinkingvars, DecDecomp::nlinkingvars, and DecDecomp::nmastervars.

Referenced by createDecompFromPartialdec(), and fillOutVarsFromVartoblock().

◆ DECdecompGetLinkingvars()

SCIP_VAR** DECdecompGetLinkingvars ( DEC_DECOMP decomp)

returns the linkingvars array of the given decomposition

Parameters
decompdecomposition data structure

Definition at line 1036 of file decomp.c.

References DecDecomp::linkingvars.

Referenced by convertStructToGCG(), DECdecompCheckConsistency(), DECgetLinkingVarsData(), and DECpermuteDecomp().

◆ DECdecompGetNLinkingvars()

int DECdecompGetNLinkingvars ( DEC_DECOMP decomp)

returns the nlinkingvars array of the given decomposition

Parameters
decompdecomposition data structure

Definition at line 1046 of file decomp.c.

References DecDecomp::nlinkingvars.

Referenced by convertStructToGCG(), createDecompFromPartialdec(), DECdecompCheckConsistency(), DECevaluateDecomposition(), DECgetLinkingVarsData(), DECgetVarLockData(), DECpermuteDecomp(), GCGwriteDecompositionData(), and initRelaxator().

◆ DECdecompGetNFixedLinkingvars()

int DECdecompGetNFixedLinkingvars ( DEC_DECOMP decomp)

returns the nlinkingvars array of the given decomposition

Parameters
decompdecomposition data structure

Definition at line 1057 of file decomp.c.

References DecDecomp::nfixedlinkingvars.

◆ DECdecompGetNMastervars()

int DECdecompGetNMastervars ( DEC_DECOMP decomp)

returns the number of linking variables that are purely master ("static") variables of the given decomposition

Parameters
decompdecomposition data structure

Definition at line 1069 of file decomp.c.

References DecDecomp::nmastervars.

Referenced by DECevaluateDecomposition(), GCGprintDecompStatistics(), and initRelaxator().

◆ DECdecompSetStairlinkingvars()

SCIP_RETCODE DECdecompSetStairlinkingvars ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_VAR ***  stairlinkingvars,
int *  nstairlinkingvars 
)

copies the input stairlinkingvars array to the given decomposition

Parameters
scipSCIP data structure
decompdecomposition data structure
stairlinkingvarsstairlinkingvars array
nstairlinkingvarsnumber of linkingvars per block

Definition at line 1081 of file decomp.c.

References DecDecomp::nblocks, DecDecomp::nstairlinkingvars, and DecDecomp::stairlinkingvars.

Referenced by createDecompFromPartialdec(), and DECfilloutDecompFromHashmaps().

◆ DECdecompGetStairlinkingvars()

SCIP_VAR*** DECdecompGetStairlinkingvars ( DEC_DECOMP decomp)

returns the stairlinkingvars array of the given decomposition

Parameters
decompdecomposition data structure

Definition at line 1151 of file decomp.c.

References DecDecomp::stairlinkingvars.

Referenced by createPartialdecFromDecomp().

◆ DECdecompGetNStairlinkingvars()

int* DECdecompGetNStairlinkingvars ( DEC_DECOMP decomp)

returns the nstairlinkingvars array of the given decomposition

Parameters
decompdecomposition data structure

Definition at line 1160 of file decomp.c.

References DecDecomp::nstairlinkingvars.

Referenced by createPartialdecFromDecomp(), and DECdecompGetNTotalStairlinkingvars().

◆ DECdecompGetNTotalStairlinkingvars()

int DECdecompGetNTotalStairlinkingvars ( DEC_DECOMP decomp)

returns the total number of stairlinkingvars array of the given decomposition

Parameters
decompdecomposition data structure

Definition at line 1170 of file decomp.c.

References DECdecompGetNBlocks(), and DECdecompGetNStairlinkingvars().

Referenced by DECdecompCheckConsistency().

◆ DECdecompSetVartoblock()

void DECdecompSetVartoblock ( DEC_DECOMP decomp,
SCIP_HASHMAP *  vartoblock 
)

sets the vartoblock hashmap of the given decomposition

Parameters
decompdecomposition data structure
vartoblockVartoblock hashmap

Definition at line 1187 of file decomp.c.

References DecDecomp::vartoblock.

Referenced by createDecompFromPartialdec(), and fillOutVarsFromVartoblock().

◆ DECdecompGetVartoblock()

SCIP_HASHMAP* DECdecompGetVartoblock ( DEC_DECOMP decomp)

returns the vartoblock hashmap of the given decomposition

Parameters
decompdecomposition data structure

Definition at line 1199 of file decomp.c.

References DecDecomp::vartoblock.

Referenced by computeConssNzeros(), computeVarDensities(), createPartialdecFromDecomp(), createPricingVariables(), DECdecompCheckConsistency(), DECdecompositionsAreEqual(), DECdetermineConsBlock(), DECevaluateDecomposition(), DECgetDensityData(), and DECgetVarLockData().

◆ DECdecompSetConstoblock()

void DECdecompSetConstoblock ( DEC_DECOMP decomp,
SCIP_HASHMAP *  constoblock 
)

sets the constoblock hashmap of the given decomposition

Parameters
decompdecomposition data structure
constoblockConstoblock hashmap

Definition at line 1209 of file decomp.c.

References DecDecomp::constoblock.

Referenced by createDecompFromPartialdec(), and fillOutConsFromConstoblock().

◆ DECdecompGetConstoblock()

SCIP_HASHMAP* DECdecompGetConstoblock ( DEC_DECOMP decomp)

returns the constoblock hashmap of the given decomposition

Parameters
decompdecomposition data structure

Definition at line 1221 of file decomp.c.

References DecDecomp::constoblock.

Referenced by createPartialdecFromDecomp(), DECdecompAddRemainingConss(), DECdecompCheckConsistency(), and DECdecompositionsAreEqual().

◆ DECdecompSetVarindex()

void DECdecompSetVarindex ( DEC_DECOMP decomp,
SCIP_HASHMAP *  varindex 
)

sets the varindex hashmap of the given decomposition

Parameters
decompdecomposition data structure
varindexVarindex hashmap

Definition at line 1231 of file decomp.c.

References DecDecomp::varindex.

Referenced by createDecompFromPartialdec(), and DECfilloutDecompFromHashmaps().

◆ DECdecompGetVarindex()

SCIP_HASHMAP* DECdecompGetVarindex ( DEC_DECOMP decomp)

returns the varindex hashmap of the given decomposition

Parameters
decompdecomposition data structure

Definition at line 1242 of file decomp.c.

References DecDecomp::varindex.

◆ DECdecompSetConsindex()

void DECdecompSetConsindex ( DEC_DECOMP decomp,
SCIP_HASHMAP *  consindex 
)

sets the consindex hashmap of the given decomposition

Parameters
decompdecomposition data structure
consindexConsindex hashmap

Definition at line 1251 of file decomp.c.

References DecDecomp::consindex.

Referenced by createDecompFromPartialdec(), and DECfilloutDecompFromHashmaps().

◆ DECdecompGetConsindex()

SCIP_HASHMAP* DECdecompGetConsindex ( DEC_DECOMP decomp)

returns the consindex hashmap of the given decomposition

Parameters
decompdecomposition data structure

Definition at line 1262 of file decomp.c.

References DecDecomp::consindex.

◆ DECfilloutDecompFromHashmaps()

SCIP_RETCODE DECfilloutDecompFromHashmaps ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_HASHMAP *  vartoblock,
SCIP_HASHMAP *  constoblock,
int  nblocks,
SCIP_Bool  staircase 
)

completely initializes decomposition structure from the values of the hashmaps

Parameters
scipSCIP data structure
decompdecomposition data structure
vartoblockvariable to block hashmap
constoblockconstraint to block hashmap
nblocksnumber of blocks
staircaseshould the decomposition be a staircase structure

Definition at line 1271 of file decomp.c.

References DEC_DECTYPE_ARROWHEAD, DEC_DECTYPE_BORDERED, DEC_DECTYPE_DIAGONAL, DEC_DECTYPE_STAIRCASE, DECdecompCheckConsistency(), DECdecompGetNSubscipconss(), DECdecompGetNSubscipvars(), DECdecompGetSubscipconss(), DECdecompSetConsindex(), DECdecompSetNBlocks(), DECdecompSetStairlinkingvars(), DECdecompSetType(), DECdecompSetVarindex(), fillOutConsFromConstoblock(), and fillOutVarsFromVartoblock().

Referenced by DECcreateBasicDecomp(), DECfilloutDecompFromConstoblock(), and readREFFile().

◆ DECfilloutDecompFromConstoblock()

SCIP_RETCODE DECfilloutDecompFromConstoblock ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_HASHMAP *  constoblock,
int  nblocks,
SCIP_Bool  staircase 
)

completely fills out decomposition structure from only the constraint partition in the following manner: given constraint block/border assignment (by constoblock), one gets the following assignment of probvars: let C(j) be the set of constraints containing variable j, set block of j to (i) constoblock(i) iff constoblock(i1) == constoblock(i2) for all i1,i2 in C(j) with constoblock(i1) != nblocks+1 && constoblock(i2) != nblocks+1 (ii) nblocks+2 ["linking var"] iff exists i1,i2 with constoblock(i1) != constoblock(i2) && constoblock(i1) != nblocks+1 && constoblock(i2) != nblocks+1 (iii) nblocks+1 ["master var"] iff constoblock(i) == nblocks+1 for all i in C(j)

Parameters
scipSCIP data structure
decompdecomposition data structure
constoblockconstraint to block hashmap, start with 1 for first block and nblocks+1 for linking constraints
nblocksnumber of blocks
staircaseshould the decomposition be a staircase structure

Definition at line 1455 of file decomp.c.

References DECfilloutDecompFromHashmaps().

Referenced by gcg::ColumnGraph< T >::createDecompFromPartition(), gcg::RowGraph< T >::createDecompFromPartition(), gcg::HyperrowcolGraph< T >::createDecompFromPartition(), gcg::HyperrowGraph< T >::createDecompFromPartition(), gcg::HypercolGraph< T >::createDecompFromPartition(), DECcreateDecompFromMasterconss(), DECtryAssignMasterconssToNewPricing(), and fillDecompStruct().

◆ DECdecompSetDetector()

void DECdecompSetDetector ( DEC_DECOMP decomp,
DEC_DETECTOR detector 
)

sets the detector for the given decomposition

Parameters
decompdecomposition data structure
detectordetector data structure

Definition at line 1579 of file decomp.c.

References DecDecomp::detector.

Referenced by createDecompFromPartialdec(), fillDecompStruct(), and readREFFile().

◆ DECdecompGetDetector()

DEC_DETECTOR* DECdecompGetDetector ( DEC_DECOMP decomp)

gets the detector for the given decomposition

Parameters
decompdecomposition data structure

Definition at line 1590 of file decomp.c.

References DecDecomp::detector.

Referenced by GCGwriteDecompositionData().

◆ DECdecompGetDetectorChain()

DEC_DETECTOR** DECdecompGetDetectorChain ( DEC_DECOMP decomp)

gets the detectors for the given decomposition

Parameters
decompdecomposition data structure

Definition at line 1600 of file decomp.c.

References DecDecomp::detectorchain.

Referenced by createPartialdecFromDecomp().

◆ DECdecompSetDetectorChain()

SCIP_RETCODE DECdecompSetDetectorChain ( SCIP *  scip,
DEC_DECOMP decomp,
DEC_DETECTOR **  detectors,
int  ndetectors 
)

sets the detectors for the given decomposition

Note
make sure you know what you are doing, only use at initialization

Definition at line 1610 of file decomp.c.

References DecDecomp::detectorchain, and DecDecomp::sizedetectorchain.

Referenced by createDecompFromPartialdec().

◆ DECdecompGetDetectorChainSize()

int DECdecompGetDetectorChainSize ( DEC_DECOMP decomp)

gets the number of detectors for the given decomposition

Parameters
decompdecomposition data structure

Definition at line 1637 of file decomp.c.

References DecDecomp::sizedetectorchain.

Referenced by createPartialdecFromDecomp().

◆ DECdecompSetPartialdecID()

void DECdecompSetPartialdecID ( DEC_DECOMP decomp,
int  id 
)

sets the id of the original partialdec

Parameters
decompdecomposition data structure
idID of partialdec

Definition at line 1648 of file decomp.c.

References DecDecomp::partialdecid.

Referenced by createDecompFromPartialdec().

◆ DECdecompGetPartialdecID()

int DECdecompGetPartialdecID ( DEC_DECOMP decomp)

gets the id of the original partialdec

Parameters
decompdecomposition data structure

Definition at line 1660 of file decomp.c.

References DecDecomp::partialdecid.

Referenced by checkIdenticalBlocks(), and pricingprobsAreIdenticalFromDetectionInfo().

◆ DECdecompSetDetectorClockTimes()

void DECdecompSetDetectorClockTimes ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_Real *  detectorClockTimes 
)

sets the detector clock times of the detectors of the detector chain

Parameters
scipSCIP data structure
decompdecomposition data structure
detectorClockTimestime used by the detectors

Definition at line 1671 of file decomp.c.

References DecDecomp::detectorclocktimes, and DecDecomp::sizedetectorchain.

Referenced by createDecompFromPartialdec().

◆ DECdecompGetDetectorClockTimes()

SCIP_Real* DECdecompGetDetectorClockTimes ( DEC_DECOMP decomp)

gets the detector clock times of the detectors of the detector chain

Parameters
decompdecomposition data structure

Definition at line 1696 of file decomp.c.

References DecDecomp::detectorclocktimes.

Referenced by createPartialdecFromDecomp().

◆ DECdecompSetDetectorChainString()

SCIP_RETCODE DECdecompSetDetectorChainString ( SCIP *  scip,
DEC_DECOMP decomp,
const char *  detectorchainstring 
)

sets the detector clock times of the detectors of the detector chain

Parameters
scipSCIP data structure
decompdecomposition data structure
detectorchainstringstring for the detector information working on that decomposition

Definition at line 1705 of file decomp.c.

References DecDecomp::detectorchainstring.

Referenced by createDecompFromPartialdec().

◆ DECdecompGetDetectorChainString()

char* DECdecompGetDetectorChainString ( SCIP *  scip,
DEC_DECOMP decomp 
)

sets the detector clock times of the detectors of the detector chain

Parameters
scipSCIP data structure
decompdecomposition data structure

Definition at line 1718 of file decomp.c.

References DecDecomp::detectorchainstring.

◆ DECdecompSetDetectorPctVarsToBorder()

void DECdecompSetDetectorPctVarsToBorder ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_Real *  pctVarsToBorder 
)

sets the percentages of variables assigned to the border of the corresponding detectors (of the detector chain) on this decomposition

Parameters
scipSCIP data structure
decompdecomposition data structure
pctVarsToBorderpercentage of variables assigned to border

Definition at line 1728 of file decomp.c.

References DecDecomp::pctvarstoborder, and DecDecomp::sizedetectorchain.

Referenced by createDecompFromPartialdec().

◆ DECdecompGetDetectorPctVarsToBorder()

SCIP_Real* DECdecompGetDetectorPctVarsToBorder ( DEC_DECOMP decomp)

gets the percentages of variables assigned to the border of the corresponding detectors (of the detector chain) on this decomposition

Parameters
decompdecomposition data structure

Definition at line 1756 of file decomp.c.

References DecDecomp::pctvarstoborder.

Referenced by createPartialdecFromDecomp().

◆ DECdecompSetDetectorPctConssToBorder()

void DECdecompSetDetectorPctConssToBorder ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_Real *  pctConssToBorder 
)

sets the percentages of constraints assigned to the border of the corresponding detectors (of the detector chain) on this decomposition

Parameters
scipSCIP data structure
decompdecomposition data structure
pctConssToBorderpercentage of constraints assigned to border

Definition at line 1764 of file decomp.c.

References DecDecomp::pctconsstoborder, and DecDecomp::sizedetectorchain.

Referenced by createDecompFromPartialdec().

◆ DECdecompGetDetectorPctConssToBorder()

SCIP_Real* DECdecompGetDetectorPctConssToBorder ( DEC_DECOMP decomp)

gets the percentages of constraints assigned to the border of the corresponding detectors (of the detector chain) on this decomposition

Parameters
decompdecomposition data structure

Definition at line 1791 of file decomp.c.

References DecDecomp::pctconsstoborder.

Referenced by createPartialdecFromDecomp().

◆ DECdecompSetDetectorPctVarsToBlock()

void DECdecompSetDetectorPctVarsToBlock ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_Real *  pctVarsToBlock 
)

sets the percentages of variables assigned to some block of the corresponding detectors (of the detector chain) on this decomposition

Parameters
scipSCIP data structure
decompdecomposition data structure
pctVarsToBlockpercentage of variables assigned to some block in the detector chain

Definition at line 1799 of file decomp.c.

References DecDecomp::pctvarstoblock, and DecDecomp::sizedetectorchain.

Referenced by createDecompFromPartialdec().

◆ DECdecompGetDetectorPctVarsToBlock()

SCIP_Real* DECdecompGetDetectorPctVarsToBlock ( DEC_DECOMP decomp)

gets the percentages of variables assigned to some block of the corresponding detectors (of the detector chain) on this decomposition

Parameters
decompdecomposition data structure

Definition at line 1826 of file decomp.c.

References DecDecomp::pctvarstoblock.

Referenced by createPartialdecFromDecomp().

◆ DECdecompSetDetectorPctConssToBlock()

void DECdecompSetDetectorPctConssToBlock ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_Real *  pctConssToBlock 
)

sets the percentages of constraints assigned to some block of the corresponding detectors (of the detector chain) on this decomposition

Parameters
scipSCIP data structure
decompdecomposition data structure
pctConssToBlockpercentage of constraints assigned to some block in the detector chain

Definition at line 1834 of file decomp.c.

References DecDecomp::pctconsstoblock, and DecDecomp::sizedetectorchain.

Referenced by createDecompFromPartialdec().

◆ DECdecompGetDetectorPctConssToBlock()

SCIP_Real* DECdecompGetDetectorPctConssToBlock ( DEC_DECOMP decomp)

gets the percentages of constraints assigned to some block of the corresponding detectors (of the detector chain) on this decomposition

Parameters
decompdecomposition data structure

Definition at line 1862 of file decomp.c.

References DecDecomp::pctconsstoblock.

Referenced by createPartialdecFromDecomp().

◆ DECdecompSetDetectorPctVarsFromOpen()

void DECdecompSetDetectorPctVarsFromOpen ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_Real *  pctVarsFromOpen 
)

sets the percentages of variables assigned to some block of the corresponding detectors (of the detector chain) on this decomposition

Parameters
scipSCIP data structure
decompdecomposition data structure
pctVarsFromOpenpercentage of open variables assigned to some block in the detector chain

Definition at line 1871 of file decomp.c.

References DecDecomp::pctvarsfromopen, and DecDecomp::sizedetectorchain.

Referenced by createDecompFromPartialdec().

◆ DECdecompGetDetectorPctVarsFromOpen()

SCIP_Real* DECdecompGetDetectorPctVarsFromOpen ( DEC_DECOMP decomp)

gets the percentages of variables assigned to some block of the corresponding detectors (of the detector chain) on this decomposition

Parameters
decompdecomposition data structure

Definition at line 1899 of file decomp.c.

References DecDecomp::pctvarsfromopen.

Referenced by createPartialdecFromDecomp().

◆ DECdecompSetDetectorPctConssFromOpen()

void DECdecompSetDetectorPctConssFromOpen ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_Real *  pctConssFromOpen 
)

sets the percentages of constraints assigned to some block of the corresponding detectors (of the detector chain) on this decomposition

Parameters
scipSCIP data structure
decompdecomposition data structure
pctConssFromOpenpercentage of open variables assigned to some block in the detector chain

Definition at line 1907 of file decomp.c.

References DecDecomp::pctconssfromopen, and DecDecomp::sizedetectorchain.

Referenced by createDecompFromPartialdec().

◆ DECdecompGetDetectorPctConssFromOpen()

SCIP_Real* DECdecompGetDetectorPctConssFromOpen ( DEC_DECOMP decomp)

gets the percentages of constraints assigned to some block of the corresponding detectors (of the detector chain) on this decomposition

Parameters
decompdecomposition data structure

Definition at line 1936 of file decomp.c.

References DecDecomp::pctconssfromopen.

Referenced by createPartialdecFromDecomp().

◆ DECdecompSetNNewBlocks()

void DECdecompSetNNewBlocks ( SCIP *  scip,
DEC_DECOMP decomp,
int *  nNewBlocks 
)

sets the number of new blocks of the corresponding detectors (of the detector chain) on this decomposition

Parameters
scipSCIP data structure
decompdecomposition data structure
nNewBlocksnumber of newly found blocks in this decomposition

Definition at line 1944 of file decomp.c.

References DecDecomp::nnewblocks, and DecDecomp::sizedetectorchain.

Referenced by createDecompFromPartialdec().

◆ DECdecompGetNNewBlocks()

int* DECdecompGetNNewBlocks ( DEC_DECOMP decomp)

gets the number of new blocks corresponding detectors (of the detector chain) on this decomposition

Parameters
decompdecomposition data structure

Definition at line 1970 of file decomp.c.

References DecDecomp::nnewblocks.

Referenced by createPartialdecFromDecomp().

◆ DECdecompTransform()

SCIP_RETCODE DECdecompTransform ( SCIP *  scip,
DEC_DECOMP decomp 
)

transforms all constraints and variables, updating the arrays

Parameters
scipSCIP data structure
decompdecomposition data structure

Definition at line 1982 of file decomp.c.

References DecDecomp::constoblock, DECdecompCheckConsistency(), DecDecomp::linkingconss, DecDecomp::linkingvars, DecDecomp::nblocks, DecDecomp::nlinkingconss, DecDecomp::nlinkingvars, DecDecomp::nsubscipconss, DecDecomp::nsubscipvars, DecDecomp::subscipconss, DecDecomp::subscipvars, and DecDecomp::vartoblock.

◆ DECdecompRemoveDeletedConss()

SCIP_RETCODE DECdecompRemoveDeletedConss ( SCIP *  scip,
DEC_DECOMP decdecomp 
)

Remove all those constraints that were removed from the problem after the decomposition had been created

Parameters
scipSCIP data structure
decdecompdecomposition data structure

Definition at line 2123 of file decomp.c.

References DecDecomp::linkingconss, DecDecomp::nblocks, DecDecomp::nlinkingconss, DecDecomp::nsubscipconss, and DecDecomp::subscipconss.

◆ DECdecompAddRemainingConss()

SCIP_RETCODE DECdecompAddRemainingConss ( SCIP *  scip,
DEC_DECOMP decdecomp 
)

Adds all those constraints that were added to the problem after the decomposition had been created

Parameters
scipSCIP data structure
decdecompdecomposition data structure

Definition at line 2179 of file decomp.c.

References assignConsvarsToBlock(), DecDecomp::constoblock, DEC_DECTYPE_ARROWHEAD, DEC_DECTYPE_BORDERED, DEC_DECTYPE_DIAGONAL, DEC_DECTYPE_STAIRCASE, DECdecompGetConstoblock(), DECdecompGetNBlocks(), DECdetermineConsBlock(), GCGisConsGCGCons(), DecDecomp::linkingconss, DecDecomp::nlinkingconss, DecDecomp::nsubscipconss, DecDecomp::subscipconss, and DecDecomp::type.

Referenced by convertStructToGCG(), and createDecompFromPartialdec().

◆ DECdecompCheckConsistency()

SCIP_RETCODE DECdecompCheckConsistency ( SCIP *  scip,
DEC_DECOMP decdecomp 
)

◆ DECcreateBasicDecomp()

SCIP_RETCODE DECcreateBasicDecomp ( SCIP *  scip,
DEC_DECOMP **  decomp,
SCIP_Bool  solveorigprob 
)

creates a decomposition with all constraints in the master

Parameters
scipSCIP data structure
decompdecomposition data structure
solveorigprobis the original problem being solved?

Definition at line 2388 of file decomp.c.

References DECdecompCreate(), DECdecompSetPresolved(), DECfilloutDecompFromHashmaps(), and GCGisConsGCGCons().

Referenced by initRelaxator().

◆ processBlockRepresentatives()

static int processBlockRepresentatives ( int  maxblock,
int *  blockrepresentative 
)
static

processes block representatives

Returns
returns the number of blocks
Parameters
maxblockmaximal number of blocks
blockrepresentativearray blockrepresentatives

Definition at line 2453 of file decomp.c.

Referenced by DECcreateDecompFromMasterconss().

◆ assignConstraintsToRepresentatives()

static SCIP_RETCODE assignConstraintsToRepresentatives ( SCIP *  scip,
SCIP_CONS **  conss,
int  nconss,
SCIP_Bool *  consismaster,
SCIP_HASHMAP *  constoblock,
int *  vartoblock,
int *  nextblock,
int *  blockrepresentative 
)
static
Parameters
scipSCIP data structure
conssarray of all constraints
nconssnumber of constraints
consismasterarray of flags whether a constraint belongs to the master problem
constoblockhashmap from constraints to block numbers, to be filled
vartoblockarray mapping variables to block numbers, initially all -1, to be set
nextblockindex of next free block to which no constraints have been assigned yet
blockrepresentativearray of blockrepresentatives

Definition at line 2488 of file decomp.c.

References GCGconsGetNVars(), GCGconsGetVars(), and GCGisConsGCGCons().

Referenced by DECcreateDecompFromMasterconss().

◆ fillConstoblock()

static SCIP_RETCODE fillConstoblock ( SCIP_CONS **  conss,
int  nconss,
SCIP_Bool *  consismaster,
int  nblocks,
SCIP_HASHMAP *  constoblock,
SCIP_HASHMAP *  newconstoblock,
int *  blockrepresentative 
)
static
Parameters
conssarray of all constraints
nconssnumber of constraints
consismasterarray of flags whether a constraint belongs to the master problem
nblocksnumber of blocks
constoblockcurrent hashmap from constraints to block numbers
newconstoblocknew hashmap from constraints to block numbers, to be filled
blockrepresentativearray of blockrepresentatives

Definition at line 2670 of file decomp.c.

References GCGisConsGCGCons().

Referenced by DECcreateDecompFromMasterconss().

◆ DECcreateDecompFromMasterconss()

SCIP_RETCODE DECcreateDecompFromMasterconss ( SCIP *  scip,
DEC_DECOMP **  decomp,
SCIP_CONS **  masterconss,
int  nmasterconss 
)

creates a decomposition with provided constraints in the master The function will put the remaining constraints in one or more pricing problems depending on whether the subproblems decompose with no variables in common.

Parameters
scipSCIP data structure
decompdecomposition data structure
masterconssconstraints to be put in the master
nmasterconssnumber of constraints in the master

Definition at line 2715 of file decomp.c.

References assignConstraintsToRepresentatives(), DECdecompCreate(), DECfilloutDecompFromConstoblock(), fillConstoblock(), GCGisConsGCGCons(), and processBlockRepresentatives().

◆ incVarsData()

static void incVarsData ( SCIP_VAR *  var,
int *  nbinvars,
int *  nintvars,
int *  nimplvars,
int *  ncontvars,
int  nproblems,
int  i 
)
static

increase the corresponding count of the variable stats

Parameters
varvariable to consider
nbinvarspointer to array of size nproblems to store number of binary subproblem vars
nintvarspointer to array of size nproblems to store number of integer subproblem vars
nimplvarspointer to array of size nproblems to store number of implied subproblem vars
ncontvarspointer to array of size nproblems to store number of continues subproblem vars
nproblemssize of the arrays
iindex of the array to increase

Definition at line 2798 of file decomp.c.

Referenced by DECgetLinkingVarsData(), and DECgetSubproblemVarsData().

◆ DECgetSubproblemVarsData()

void DECgetSubproblemVarsData ( SCIP *  scip,
DEC_DECOMP decomp,
int *  nvars,
int *  nbinvars,
int *  nintvars,
int *  nimplvars,
int *  ncontvars,
int  nproblems 
)

return the number of variables and binary, integer, implied integer, continuous variables of all subproblems

Parameters
scipSCIP data structure
decompdecomposition data structure
nvarspointer to array of size nproblems to store number of subproblem vars or NULL
nbinvarspointer to array of size nproblems to store number of binary subproblem vars or NULL
nintvarspointer to array of size nproblems to store number of integer subproblem vars or NULL
nimplvarspointer to array of size nproblems to store number of implied subproblem vars or NULL
ncontvarspointer to array of size nproblems to store number of continuous subproblem vars or NULL
nproblemssize of the arrays

Definition at line 2837 of file decomp.c.

References DEC_DECTYPE_UNKNOWN, DECdecompGetNSubscipvars(), DECdecompGetSubscipvars(), DECdecompGetType(), and incVarsData().

Referenced by GCGprintDecompStatistics().

◆ DECgetLinkingVarsData()

void DECgetLinkingVarsData ( SCIP *  scip,
DEC_DECOMP decomp,
int *  nvars,
int *  nbinvars,
int *  nintvars,
int *  nimplvars,
int *  ncontvars 
)

return the number of variables and binary, integer, implied integer, continuous variables of the master

Parameters
scipSCIP data structure
decompdecomposition data structure
nvarspointer to store number of linking vars or NULL
nbinvarspointer to store number of binary linking vars or NULL
nintvarspointer to store number of integer linking vars or NULL
nimplvarspointer to store number of implied linking vars or NULL
ncontvarspointer to store number of continuous linking vars or NULL

Definition at line 2886 of file decomp.c.

References DEC_DECTYPE_UNKNOWN, DECdecompGetLinkingvars(), DECdecompGetNLinkingvars(), DECdecompGetType(), and incVarsData().

Referenced by GCGprintDecompStatistics().

◆ DECgetDensityData()

SCIP_RETCODE DECgetDensityData ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_VAR **  vars,
int  nvars,
SCIP_CONS **  conss,
int  nconss,
int *  varsubproblemdensity,
int *  varmasterdensity,
int *  conssubproblemdensity,
int *  consmasterdensity 
)

returns the number of nonzeros of each column of the constraint matrix both in the subproblem and in the master

Note
For linking variables, the number of nonzeros in the subproblems corresponds to the number on nonzeros in the border
The arrays have to be allocated by the caller
Precondition
This function assumes that constraints are partitioned in the decomp structure, no constraint is present in more than one block
Parameters
scipSCIP data structure
decompdecomposition data structure
varspointer to array store variables belonging to density
nvarsnumber of variables
consspointer to array to store constraints belonging to the density
nconssnumber of constraints
varsubproblemdensitypointer to array to store the nonzeros for the subproblems
varmasterdensitypointer to array to store the nonzeros for the master
conssubproblemdensitypointer to array to store the nonzeros for the subproblems
consmasterdensitypointer to array to store the nonzeros for the master

Definition at line 2936 of file decomp.c.

References DECdecompGetLinkingconss(), DECdecompGetNBlocks(), DECdecompGetNLinkingconss(), DECdecompGetNSubscipconss(), DECdecompGetSubscipconss(), and DECdecompGetVartoblock().

Referenced by GCGprintDecompStatistics().

◆ increaseLock()

static void increaseLock ( SCIP *  scip,
SCIP_Real  lhs,
SCIP_Real  coef,
SCIP_Real  rhs,
int *  downlock,
int *  uplock 
)
static

helper function to increase correct lock

Parameters
scipSCIP data structure
lhsleft side of constraint
coefcoefficient of variable in constraint
rhsright side of constraint
downlockpointer to store downlock
uplockpointer to store uplock

Definition at line 3079 of file decomp.c.

Referenced by DECgetVarLockData().

◆ DECgetVarLockData()

SCIP_RETCODE DECgetVarLockData ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_VAR **  vars,
int  nvars,
int  nsubproblems,
int **  subsciplocksdown,
int **  subsciplocksup,
int *  masterlocksdown,
int *  masterlocksup 
)

calculates the number of up and down locks of variables for a given decomposition in both the original problem and the pricingproblems

Note
All arrays need to be allocated by the caller
Warning
This function needs a lot of memory (nvars*nblocks+1) array entries
Parameters
scipSCIP data structure
decompdecomposition data structure
varspointer to array store variables belonging to density
nvarsnumber of variables
nsubproblemsnumber of sub problems
subsciplocksdownpointer to two dimensional array to store the down locks for the subproblems
subsciplocksuppointer to two dimensional array to store the down locks for the subproblems
masterlocksdownpointer to array to store the down locks for the master
masterlocksuppointer to array to store the down locks for the master

Definition at line 3117 of file decomp.c.

References DECdecompGetLinkingconss(), DECdecompGetNBlocks(), DECdecompGetNLinkingvars(), DECdecompGetNSubscipconss(), DECdecompGetSubscipconss(), DECdecompGetVartoblock(), GCGconsGetLhs(), GCGconsGetRhs(), GCGconsGetVals(), and increaseLock().

◆ DECsetMaxWhiteScore()

void DECsetMaxWhiteScore ( SCIP *  scip,
DEC_DECOMP decdecomp,
SCIP_Real  maxwhitescore 
)

sets the score of the given decomposition based on the border, the average density score and the ratio of linking variables

Parameters
scipSCIP data structure
decdecompdecomposition data structure
maxwhitescorescore related to max white measure (i.e. fraction of white (nonblock and nonborder) matrix area )

Definition at line 3253 of file decomp.c.

References DecDecomp::maxwhitescore.

Referenced by createDecompFromPartialdec().

◆ DECgetMaxWhiteScore()

SCIP_Real DECgetMaxWhiteScore ( SCIP *  scip,
DEC_DECOMP decdecomp 
)

computes the score of the given decomposition based on the border, the average density score and the ratio of linking variables

Parameters
scipSCIP data structure
decdecompdecomposition data structure

Definition at line 3270 of file decomp.c.

References DECevaluateDecomposition(), and DecDecomp::maxwhitescore.

◆ DECevaluateDecomposition()

SCIP_RETCODE DECevaluateDecomposition ( SCIP *  scip,
DEC_DECOMP decdecomp,
DEC_SCORES score 
)

◆ computeVarDensities()

static SCIP_RETCODE computeVarDensities ( SCIP *  scip,
DEC_DECOMP decomp,
int *  varprobdensity,
int *  varmasterdensity,
SCIP_VAR **  vars,
int  nvars,
DEC_STATISTIC blockvardensities,
DEC_STATISTIC mastervardensity,
int  nblocks 
)
static

compute the density of variables in blocks and master

Parameters
scipSCIP data structure
decompdecomposition data structure
varprobdensitydensity information
varmasterdensitydensity information
varsarray of variables
nvarsnumber of variables
blockvardensitiesarray of statistic structs to store density information of each block
mastervardensitypointer to store density information of master variables
nblocksnumber of blocks

Definition at line 3512 of file decomp.c.

References DECdecompGetNLinkingconss(), DECdecompGetNSubscipconss(), DECdecompGetNSubscipvars(), DECdecompGetSubscipvars(), DECdecompGetVartoblock(), DEC_STATISTIC::max, DEC_STATISTIC::mean, DEC_STATISTIC::median, DEC_STATISTIC::min, and quick_select_median().

Referenced by GCGprintDecompStatistics().

◆ DECdecompGetNConss()

int DECdecompGetNConss ( DEC_DECOMP decomp)

returns the number of constraints saved in the decomposition

Parameters
decompdecomposition data structure

Definition at line 3650 of file decomp.c.

References DECdecompGetNBlocks(), DECdecompGetNLinkingconss(), and DECdecompGetNSubscipconss().

Referenced by GCGprintDecompStatistics().

◆ computeConssNzeros()

static SCIP_RETCODE computeConssNzeros ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_CONS *  cons,
int *  nzeros,
int *  nintzeros,
int *  nbzeros,
int *  nintbzeros 
)
static

computes nonzero elements of a given constraint, separated into linking variables and normal vars

Parameters
scipSCIP data structure
decompdecomposition data structure
consSCIP data structure
nzerospointer to store nonzero elements
nintzerospointer to store integer nonzeros
nbzerospointer to store border nonzero elements
nintbzerospointer to store border integer nonzeros

Definition at line 3667 of file decomp.c.

References DECdecompGetNBlocks(), DECdecompGetVartoblock(), GCGconsGetNVars(), GCGconsGetVals(), and GCGconsGetVars().

Referenced by computeNonzeros().

◆ computeNonzeros()

static SCIP_RETCODE computeNonzeros ( SCIP *  scip,
DEC_DECOMP decomp,
int *  mnzeros,
int *  mintnzeros,
int *  lnzeros,
int *  lintnzeros,
int *  nonzeros,
int *  intnzeros 
)
static

computes nonzero elements of the pricing problems and the master

Parameters
scipSCIP data structure
decompdecomposition data structure
mnzerosnumber of nonzero elements in row border
mintnzerosnumber of integral nonzero elements in row border
lnzerosnumber of nonzero elements in column border
lintnzerosnumber of integral nonzero elements in column border
nonzerosnumber of nonzero elements per pricing problem
intnzerosnumber of integral nonzero elements per pricing problem

Definition at line 3736 of file decomp.c.

References computeConssNzeros(), DECdecompGetLinkingconss(), DECdecompGetNBlocks(), DECdecompGetNLinkingconss(), DECdecompGetNSubscipconss(), and DECdecompGetSubscipconss().

Referenced by GCGprintDecompStatistics().

◆ GCGprintDecompStatistics()

◆ DECdecompositionsAreEqual()

SCIP_Bool DECdecompositionsAreEqual ( SCIP *  scip,
DEC_DECOMP decomp1,
DEC_DECOMP decomp2 
)

returns whether both structures lead to the same decomposition

Parameters
scipSCIP data structure
decomp1first decomp data structure
decomp2second decomp data structure

Definition at line 3939 of file decomp.c.

References DECdecompGetConstoblock(), DECdecompGetNBlocks(), and DECdecompGetVartoblock().

Referenced by DECfilterSimilarDecompositions().

◆ DECfilterSimilarDecompositions()

int DECfilterSimilarDecompositions ( SCIP *  scip,
DEC_DECOMP **  decs,
int  ndecs 
)

filters similar decompositions from a given list and moves them to the end

Returns
the number of unique decompositions
Parameters
scipSCIP data structure
decsarray of decompositions
ndecsnumber of decompositions

Definition at line 4004 of file decomp.c.

References DECdecompositionsAreEqual().

◆ DECdetermineConsBlock()

SCIP_RETCODE DECdetermineConsBlock ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_CONS *  cons,
int *  block 
)

returns the number of the block that the constraint is with respect to the decomposition; set *block = -2, if it has no variables *block = -1, if it has only variables belonging only to the master (meaning that this constraint should build a new block) *block in [0,...,nblocks-1] if it only contains variables of a particular block (plus linking variables) *block = nblocks, if it contains

  • either variables from more than one block (plus linking variables or master only variables)
  • or linking variables only
Parameters
scipSCIP data structure
decompdecomposition data structure
consconstraint to check
blockblock of the constraint (or nblocks for master)

Definition at line 4047 of file decomp.c.

References DECdecompGetNBlocks(), and DECdecompGetVartoblock().

Referenced by DECdecompAddRemainingConss(), DECtryAssignMasterconssToExistingPricing(), and DECtryAssignMasterconssToNewPricing().

◆ DECdecompMoveLinkingConsToPricing()

SCIP_RETCODE DECdecompMoveLinkingConsToPricing ( SCIP *  scip,
DEC_DECOMP decomp,
int  consindex,
int  block 
)

move a master constraint to pricing problem

Parameters
scipSCIP data structure
decompdecomposition data structure
consindexindex of constraint to move
blockblock of the pricing problem where to move

Definition at line 4137 of file decomp.c.

References assignConsvarsToBlock(), DecDecomp::constoblock, DecDecomp::linkingconss, DecDecomp::nlinkingconss, DecDecomp::nsubscipconss, and DecDecomp::subscipconss.

Referenced by DECtryAssignMasterconssToExistingPricing().

◆ DECtryAssignMasterconssToExistingPricing()

SCIP_RETCODE DECtryAssignMasterconssToExistingPricing ( SCIP *  scip,
DEC_DECOMP decomp,
int *  transferred 
)

tries to assign masterconss to pricing problem

Parameters
scipSCIP data structure
decompdecomposition data structure
transferrednumber of master constraints reassigned

Definition at line 4172 of file decomp.c.

References DECdecompGetNBlocks(), DECdecompMoveLinkingConsToPricing(), DECdetermineConsBlock(), DecDecomp::linkingconss, and DecDecomp::nlinkingconss.

Referenced by DECcreatePolishedDecomp().

◆ DECtryAssignMasterconssToNewPricing()

SCIP_RETCODE DECtryAssignMasterconssToNewPricing ( SCIP *  scip,
DEC_DECOMP decomp,
DEC_DECOMP **  newdecomp,
int *  transferred 
)

tries to assign masterconss to new pricing problem

Parameters
scipSCIP data structure
decompdecomposition data structure
newdecompnew decomposition, if successful
transferrednumber of master constraints reassigned

Definition at line 4220 of file decomp.c.

References DecDecomp::constoblock, DECdecompCreate(), DECdetermineConsBlock(), DECfilloutDecompFromConstoblock(), DecDecomp::linkingconss, DecDecomp::nblocks, and DecDecomp::nlinkingconss.

Referenced by DECcreatePolishedDecomp().

◆ DECcreatePolishedDecomp()

SCIP_RETCODE DECcreatePolishedDecomp ( SCIP *  scip,
DEC_DECOMP decomp,
DEC_DECOMP **  newdecomp 
)

polish the decomposition and try to greedily assign master constraints to pricing problem where useful

Parameters
scipSCIP data structure
decompdecomposition data structure
newdecompnew decomposition, if successful

Definition at line 4276 of file decomp.c.

References DECdecompFree(), DECdecompGetNBlocks(), DECtryAssignMasterconssToExistingPricing(), and DECtryAssignMasterconssToNewPricing().

◆ DECpermuteDecomp()

SCIP_RETCODE DECpermuteDecomp ( SCIP *  scip,
DEC_DECOMP decomp,
SCIP_RANDNUMGEN *  randnumgen 
)

permutes the decomposition according to the permutation seed

Parameters
scipSCIP data structure
decompdecomposition data structure
randnumgenrandom number generator

Definition at line 4323 of file decomp.c.

References DECdecompCheckConsistency(), DECdecompGetLinkingconss(), DECdecompGetLinkingvars(), DECdecompGetNBlocks(), DECdecompGetNLinkingconss(), DECdecompGetNLinkingvars(), DECdecompGetNSubscipconss(), DECdecompGetNSubscipvars(), DECdecompGetSubscipconss(), and DECdecompGetSubscipvars().

Referenced by initRelaxator().