Scippy

GCG

Branch-and-Price & Column Generation for Everyone

gcg::HyperrowcolGraph< T > Class Template Reference

Detailed Description

template<class T>
class gcg::HyperrowcolGraph< T >

Definition at line 45 of file hyperrowcolgraph.h.

#include <hyperrowcolgraph.h>

Public Member Functions

 HyperrowcolGraph (SCIP *scip, Weights w)
 
virtual ~HyperrowcolGraph ()
 
SCIP_RETCODE createFromMatrix (SCIP_CONS **conss, SCIP_VAR **vars, int nconss, int nvars)
 
virtual SCIP_RETCODE createFromPartialMatrix (DETPROBDATA *detprobdata, PARTIALDECOMP *partialdec)
 
virtual SCIP_RETCODE writeToFile (int fd, SCIP_Bool writeweights)
 
virtual SCIP_RETCODE createDecompFromPartition (DEC_DECOMP **decomp)
 
virtual SCIP_RETCODE createPartialdecFromPartition (PARTIALDECOMP **firstpartialdec, PARTIALDECOMP **secondpartialdec, DETPROBDATA *detprobdata)
 
virtual SCIP_RETCODE createPartialdecFromPartition (PARTIALDECOMP *oldpartialdec, PARTIALDECOMP **firstpartialdec, PARTIALDECOMP **secondpartialdec, DETPROBDATA *detprobdata)
 
virtual SCIP_RETCODE readPartition (const char *filename)
 
virtual std::vector< int > getNeighbors (int i)
 
virtual std::vector< int > getHyperedgeNodes (int i)
 
std::vector< int > getConsNonzeroNodes (int i)
 
std::vector< int > getVarNonzeroNodes (int i)
 
- Public Member Functions inherited from gcg::MatrixGraph< T >
 MatrixGraph (SCIP *scip, Weights w)
 
virtual ~MatrixGraph ()
 
void setDummynodes (int dummynodes_)
 
int getDummynodes () const
 
virtual std::vector< int > getPartition ()
 
virtual int getNNonzeroes () const
 

Additional Inherited Members

- Data Fields inherited from gcg::MatrixGraph< T >
std::string name
 
- Protected Attributes inherited from gcg::MatrixGraph< T >
SCIP * scip_
 
int nconss
 
int nvars
 
int dummynodes
 
Weights weights
 
GraphInterfacegraphiface
 
int nnonzeroes
 

Constructor & Destructor Documentation

◆ HyperrowcolGraph()

template<class T >
gcg::HyperrowcolGraph< T >::HyperrowcolGraph ( SCIP *  scip,
Weights  w 
)
Parameters
scipSCIP data structure
wweights for the given graph

Definition at line 48 of file hyperrowcolgraph_def.h.

References gcg::MatrixGraph< T >::graphiface, and gcg::MatrixGraph< T >::name.

◆ ~HyperrowcolGraph()

template<class T >
gcg::HyperrowcolGraph< T >::~HyperrowcolGraph
virtual

Definition at line 58 of file hyperrowcolgraph_def.h.

Member Function Documentation

◆ createFromMatrix()

template<class T >
SCIP_RETCODE gcg::HyperrowcolGraph< T >::createFromMatrix ( SCIP_CONS **  conss,
SCIP_VAR **  vars,
int  nconss_,
int  nvars_ 
)
virtual

Builds a bipartite representation of the hyperrowcol graph out of the matrix.

The function will create an node for every constraint, every variable and every nonzero entry of the matrix. One side of the bipartite graph are the nonzero entries (nodes), the constraints and variables are on the other side (hyperedges). A nonzero entry a_{ij} is incident to the constraint i and the variable j.

Parameters
conssconstraints for which graph should be created
varsvariables for which graph should be created
nconss_number of constraints
nvars_number of variables

Reimplemented from gcg::MatrixGraph< T >.

Definition at line 74 of file hyperrowcolgraph_def.h.

References GCGisVarRelevant().

◆ createFromPartialMatrix()

template<class T >
SCIP_RETCODE gcg::HyperrowcolGraph< T >::createFromPartialMatrix ( DETPROBDATA detprobdata,
PARTIALDECOMP partialdec 
)
virtual

creates a graph with open constraints and open variables of the partialdec

stores the conss included by the graph

stores the vars included by the graph

< true, if the var will be part of the graph

< true, if the cons will be part of the graph

add node for every var

add node for every cons

Parameters
detprobdatadetection process information and data
partialdecpartial decomposition to use for matrix

Reimplemented from gcg::MatrixGraph< T >.

Definition at line 171 of file hyperrowcolgraph_def.h.

References gcg::DETPROBDATA::getCons(), gcg::PARTIALDECOMP::getNConss(), gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), gcg::PARTIALDECOMP::getNVars(), gcg::DETPROBDATA::getNVarsForCons(), gcg::PARTIALDECOMP::getOpenconss(), gcg::PARTIALDECOMP::getOpenvars(), gcg::DETPROBDATA::getVar(), and gcg::DETPROBDATA::getVarsForCons().

◆ writeToFile()

template<class T >
SCIP_RETCODE gcg::HyperrowcolGraph< T >::writeToFile ( int  fd,
SCIP_Bool  edgeweights 
)
virtual

writes the graph to the given file. The format is graph dependent

Parameters
fdfile descriptor where the graph should be written to
edgeweightswhether to write weights

Reimplemented from gcg::MatrixGraph< T >.

Definition at line 278 of file hyperrowcolgraph_def.h.

◆ createDecompFromPartition()

template<class T >
SCIP_RETCODE gcg::HyperrowcolGraph< T >::createDecompFromPartition ( DEC_DECOMP **  decomp)
virtual
Parameters
decompdecomposition structure to generate

Reimplemented from gcg::MatrixGraph< T >.

Definition at line 385 of file hyperrowcolgraph_def.h.

References DECdecompCreate(), DECfilloutDecompFromConstoblock(), and partition().

◆ createPartialdecFromPartition() [1/2]

template<class T >
SCIP_RETCODE gcg::HyperrowcolGraph< T >::createPartialdecFromPartition ( PARTIALDECOMP **  firstpartialdec,
PARTIALDECOMP **  secondpartialdec,
DETPROBDATA detprobdata 
)
virtual

creates a new partialdec by dint of a graph created with all constraints and variables

Parameters
firstpartialdecpointer to buffer the new partialdec created by dint of the graph
secondpartialdecpointer to buffer the new partialdec whose border is amplified by dint of the graph
detprobdatadetection process information and data

Definition at line 451 of file hyperrowcolgraph_def.h.

References gcg::DETPROBDATA::getIndexForCons(), gcg::DETPROBDATA::isAssignedToOrigProb(), and partition().

◆ createPartialdecFromPartition() [2/2]

template<class T >
SCIP_RETCODE gcg::HyperrowcolGraph< T >::createPartialdecFromPartition ( PARTIALDECOMP oldpartialdec,
PARTIALDECOMP **  firstpartialdec,
PARTIALDECOMP **  secondpartialdec,
DETPROBDATA detprobdata 
)
virtual

amplifies a partialdec by dint of a graph created with open constraints and open variables of the partialdec

stores the conss included by the graph

< true, if the cons will be part of the graph

Parameters
oldpartialdecpartialdec which should be amplifies
firstpartialdecpointer to buffer the new partialdec amplified by dint of the graph
secondpartialdecpinter to buffer the new partialdec whose border is amplified by dint of the graph
detprobdatadetection process information and data

Reimplemented from gcg::MatrixGraph< T >.

Definition at line 541 of file hyperrowcolgraph_def.h.

References gcg::PARTIALDECOMP::getNConss(), gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), gcg::DETPROBDATA::getNVarsForCons(), gcg::PARTIALDECOMP::getOpenconss(), gcg::PARTIALDECOMP::getOpenvars(), gcg::DETPROBDATA::getVarsForCons(), and partition().

◆ readPartition()

template<class T >
SCIP_RETCODE gcg::HyperrowcolGraph< T >::readPartition ( const char *  filename)
virtual

reads the partition from the given file. The format is graph dependent. The default is a file with one line for each node a

Parameters
filenamefilename where the partition is stored

Reimplemented from gcg::MatrixGraph< T >.

Definition at line 651 of file hyperrowcolgraph_def.h.

◆ getNeighbors()

template<class T >
std::vector< int > gcg::HyperrowcolGraph< T >::getNeighbors ( int  i)
virtual

Definition at line 320 of file hyperrowcolgraph_def.h.

◆ getHyperedgeNodes()

template<class T >
std::vector< int > gcg::HyperrowcolGraph< T >::getHyperedgeNodes ( int  i)
virtual

Definition at line 343 of file hyperrowcolgraph_def.h.

◆ getConsNonzeroNodes()

template<class T >
std::vector< int > gcg::HyperrowcolGraph< T >::getConsNonzeroNodes ( int  i)

Definition at line 357 of file hyperrowcolgraph_def.h.

◆ getVarNonzeroNodes()

template<class T >
std::vector< int > gcg::HyperrowcolGraph< T >::getVarNonzeroNodes ( int  i)

Definition at line 371 of file hyperrowcolgraph_def.h.