gcg::BipartiteGraph< T > Class Template Reference

Detailed Description

template<class T>
class gcg::BipartiteGraph< T >

Definition at line 44 of file bipartitegraph.h.

#include <bipartitegraph.h>

Public Member Functions

 BipartiteGraph (SCIP *scip, Weights w)
 
virtual ~BipartiteGraph ()
 
virtual SCIP_RETCODE createFromMatrix (SCIP_CONS **conss, SCIP_VAR **vars, int nconss_, int nvars_)
 
virtual SCIP_RETCODE createFromPartialMatrix (Seeedpool *seeedpool, Seeed *seeed)
 
int getNConsNodes ()
 
int getNVarNodes ()
 
- Public Member Functions inherited from gcg::MatrixGraph< T >
 MatrixGraph (SCIP *scip, Weights w)
 
virtual ~MatrixGraph ()
 
virtual SCIP_RETCODE writeToFile (int fd, SCIP_Bool writeweights)
 
virtual SCIP_RETCODE createDecompFromPartition (DEC_DECOMP **decomp)
 
virtual SCIP_RETCODE createSeeedFromPartition (Seeed *oldSeeed, Seeed **firstSeeed, Seeed **secondSeeed, Seeedpool *seeedpool)
 
virtual SCIP_RETCODE readPartition (const char *filename)
 
void setDummynodes (int dummynodes_)
 
int getDummynodes () const
 
virtual std::vector< int > getPartition ()
 
virtual int getNNonzeroes () const
 

Additional Inherited Members

- Public Attributes 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

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

Definition at line 44 of file bipartitegraph_def.h.

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

template<class T >
gcg::BipartiteGraph< T >::~BipartiteGraph ( )
virtual

Definition at line 54 of file bipartitegraph_def.h.

Member Function Documentation

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

Builds a bipartite graph structure out of the matrix.

The function will create an node for every constraint and every variable. A constraint and a variable are adjacent if the variable appears in the constraint variable array.

Todo:
The nonzeroness is not checked, all variables in the variable array are considered
Todo:
skip all variables that have a zero coeffient or where all coefficients add to zero
Todo:
Do more then one entry per variable actually work?
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 69 of file bipartitegraph_def.h.

References gcg::Weights::calculate(), GCGisVarRelevant(), gcg::MatrixGraph< T >::nconss, gcg::MatrixGraph< T >::nvars, gcg::MatrixGraph< T >::scip_, and gcg::MatrixGraph< T >::weights.

template<class T >
SCIP_RETCODE gcg::BipartiteGraph< T >::createFromPartialMatrix ( Seeedpool seeedpool,
Seeed seeed 
)
virtual

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

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

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

stores the conss included by the graph

stores the vars included by the graph

add node for every var

add node for every cons

Reimplemented from gcg::MatrixGraph< T >.

Definition at line 151 of file bipartitegraph_def.h.

References gcg::Weights::calculate(), gcg::Seeedpool::getConsForIndex(), gcg::Seeed::getNConss(), gcg::Seeed::getNOpenconss(), gcg::Seeed::getNOpenvars(), gcg::Seeed::getNVars(), gcg::Seeedpool::getNVarsForCons(), gcg::Seeed::getOpenconss(), gcg::Seeed::getOpenvars(), gcg::Seeedpool::getVarForIndex(), gcg::Seeedpool::getVarsForCons(), gcg::MatrixGraph< T >::nconss, gcg::MatrixGraph< T >::nvars, and gcg::MatrixGraph< T >::weights.

template<class T >
int gcg::BipartiteGraph< T >::getNConsNodes ( )

Definition at line 245 of file bipartitegraph_def.h.

References gcg::MatrixGraph< T >::nconss.

template<class T >
int gcg::BipartiteGraph< T >::getNVarNodes ( )

Definition at line 251 of file bipartitegraph_def.h.

References gcg::MatrixGraph< T >::nvars.