hyperrowcolgraph_def.h
Go to the documentation of this file.
35/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
68 * The function will create an node for every constraint, every variable and every nonzero entry of the matrix.
69 * One side of the bipartite graph are the nonzero entries (nodes), the constraints and variables are on the other side (hyperedges).
110 SCIPdebugMessage("Weight for cons <%s> is %d\n", SCIPconsGetName(conss[i-this->nvars]), weight);
135 /** @todo skip all variables that have a zero coeffient or where all coefficients add to zero */
156 SCIPdebugMessage("Cons <%s> (%d), var <%s> (%d), nonzero %d\n", SCIPconsGetName(conss[i]), i, SCIPvarGetName(var), varIndex, this->nnonzeroes);
184 vector<bool> varsBool(partialdec->getNVars(), false); /**< true, if the var will be part of the graph */
185 vector<bool> conssBool(partialdec->getNConss(), false); /**< true, if the cons will be part of the graph */
260 SCIPdebugMessage("Cons <%s> (%d), var <%s> (%d), nonzero %d\n", SCIPconsGetName(detprobdata->getCons(oldConsId)), i,
264 SCIP_CALL( this->graph.addEdge(oldToNewVarIndex[oldVarId], this->nvars+this->nconss+this->nnonzeroes) );
265 SCIP_CALL( this->graph.addEdge(this->nvars+oldToNewConsIndex[oldConsId], this->nvars+this->nconss+this->nnonzeroes) );
291 SCIPinfoMessage(scip, file, "%d %d %d\n", this->nvars+this->nconss, this->nnonzeroes+this->dummynodes, edgeweights ? 1 :0);
429 /* first, make sure that there are constraints in every block, otherwise the hole thing is useless */
492 SCIP_CALL( SCIPhashmapInsert(constoblock, (void*) (size_t)detprobdata->getIndexForCons(conss[i]), (void*) (size_t) (nblocks+1)) );
497 SCIP_CALL( SCIPhashmapInsert(constoblock, (void*) (size_t) detprobdata->getIndexForCons(conss[i]), (void*) (size_t) (block +1)) );
502 /* first, make sure that there are constraints in every block, otherwise the whole thing is useless */
587 vector<bool> conssBool(oldpartialdec->getNConss(), false); /**< true, if the cons will be part of the graph */
627 SCIP_CALL( SCIPhashmapInsert(constoblock, (void*) (size_t) conssForGraph[i], (void*) (size_t) (nblocks+1)) );
632 SCIP_CALL( SCIPhashmapInsert(constoblock, (void*) (size_t) conssForGraph[i], (void*) (size_t) (block +1)) );
637 /* first, make sure that there are constraints in every block, otherwise the hole thing is useless */
static SCIP_RETCODE partition(SCIP *scip, SCIP_VAR **J, int *Jsize, SCIP_Longint *priority, SCIP_VAR **F, int Fsize, SCIP_VAR **origvar, SCIP_Real *median)
Definition: branch_generic.c:910
SCIP_VAR * w
SCIP_Real * r
class storing partialdecs and the problem matrix
class storing (potentially incomplete) decompositions
Definition: class_detprobdata.h:110
GCG_EXPORT int getIndexForCons(SCIP_CONS *cons)
returns the constraint index related to a SCIP constraint
Definition: class_detprobdata.cpp:792
GCG_EXPORT int getNVarsForCons(int consIndex)
returns the number of variables for a given constraint
Definition: class_detprobdata.cpp:908
GCG_EXPORT SCIP_VAR * getVar(int varIndex)
returns SCIP variable related to a variable index
Definition: class_detprobdata.cpp:1015
GCG_EXPORT std::vector< int > & getVarsForCons(int consIndex)
returns the variable indices of the coefficient matrix for a constraint
Definition: class_detprobdata.cpp:1023
GCG_EXPORT SCIP_CONS * getCons(int consIndex)
returns the SCIP constraint related to a constraint index
Definition: class_detprobdata.cpp:746
GCG_EXPORT SCIP_Bool isAssignedToOrigProb()
returns true if the matrix structure corresponds to the presolved problem
Definition: class_detprobdata.cpp:1155
std::vector< int > getConsNonzeroNodes(int i)
Definition: hyperrowcolgraph_def.h:360
virtual SCIP_RETCODE createDecompFromPartition(GCG_DECOMP **decomp)
Definition: hyperrowcolgraph_def.h:388
virtual std::vector< int > getNeighbors(int i)
Definition: hyperrowcolgraph_def.h:323
virtual SCIP_RETCODE writeToFile(int fd, SCIP_Bool writeweights)
Definition: hyperrowcolgraph_def.h:280
SCIP_RETCODE createFromMatrix(SCIP_CONS **conss, SCIP_VAR **vars, int nconss, int nvars)
Definition: hyperrowcolgraph_def.h:75
virtual SCIP_RETCODE readPartition(const char *filename)
Definition: hyperrowcolgraph_def.h:674
virtual ~HyperrowcolGraph()
Definition: hyperrowcolgraph_def.h:59
virtual SCIP_RETCODE createFromPartialMatrix(DETPROBDATA *detprobdata, PARTIALDECOMP *partialdec)
Definition: hyperrowcolgraph_def.h:173
virtual SCIP_RETCODE createPartialdecFromPartition(PARTIALDECOMP **firstpartialdec, PARTIALDECOMP **secondpartialdec, DETPROBDATA *detprobdata)
Definition: hyperrowcolgraph_def.h:454
virtual std::vector< int > getHyperedgeNodes(int i)
Definition: hyperrowcolgraph_def.h:346
std::vector< int > getVarNonzeroNodes(int i)
Definition: hyperrowcolgraph_def.h:374
HyperrowcolGraph(GCG *gcg, Weights w)
Definition: hyperrowcolgraph_def.h:49
Definition: matrixgraph.h:55
GCG_EXPORT int getNOpenvars()
Gets size of vector containing variables not assigned yet.
Definition: class_partialdecomp.cpp:4509
GCG_EXPORT int getNOpenconss()
Gets size of vector containing constraints not assigned yet.
Definition: class_partialdecomp.cpp:4503
GCG_EXPORT std::vector< int > & getOpenconss()
Gets vector containing constraints not assigned yet.
Definition: class_partialdecomp.cpp:4558
GCG_EXPORT std::vector< int > & getOpenvars()
Gets vector containing variables not assigned yet.
Definition: class_partialdecomp.cpp:4564
Definition: weights.h:43
Definition: hyperrowcolgraph_def.h:315
SCIP_RETCODE GCGfilloutDecompFromConstoblock(GCG *gcg, GCG_DECOMP *decomp, SCIP_HASHMAP *constoblock, int nblocks, SCIP_Bool staircase)
Definition: decomp.c:1479
SCIP_RETCODE GCGdecompCreate(GCG *gcg, GCG_DECOMP **decdecomp)
Definition: decomp.c:480
#define SCIP_Bool
#define SCIP_CALL(x)
#define TRUE
#define FALSE
SCIP_STAGE SCIPgetStage(SCIP *scip)
SCIP_CONS ** SCIPgetConss(SCIP *scip)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPgetConsNVars(SCIP *scip, SCIP_CONS *cons, int *nvars, SCIP_Bool *success)
SCIP_RETCODE SCIPgetConsVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
const char * SCIPconsGetName(SCIP_CONS *cons)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
SCIP_VAR * SCIPvarGetProbvar(SCIP_VAR *var)
int SCIPvarGetProbindex(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
A hypergraph with row and column nodes.
#define NULL
#define BMSclearMemoryArray(ptr, num)
Definition: class_conspartition.cpp:44
#define SCIPerrorMessage
#define SCIPdebugMessage
various SCIP helper methods
Definition: struct_decomp.h:53
Definition: struct_gcg.h:55
int TCLIQUE_WEIGHT
SCIP_FILECREATEERROR
SCIP_READERROR
SCIP_INVALIDDATA
SCIP_WRITEERROR
SCIP_OKAY
enum SCIP_Retcode SCIP_RETCODE
SCIP_STAGE_TRANSFORMED