GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
gcg::RowGraphWeighted< T > Class Template Reference

Detailed Description

template<class T>
class gcg::RowGraphWeighted< T >

Definition at line 64 of file rowgraph_weighted.h.

#include <rowgraph_weighted.h>

Public Member Functions

 RowGraphWeighted (GCG *gcg, Weights w)
virtual ~RowGraphWeighted ()
virtual SCIP_RETCODE createFromMatrix (SCIP_CONS **conss, SCIP_VAR **vars, int nconss_, int nvars_, DISTANCE_MEASURE dist, WEIGHT_TYPE w_type)
virtual SCIP_RETCODE createFromPartialMatrix (DETPROBDATA *detprobdata, PARTIALDECOMP *partialdec, DISTANCE_MEASURE dist, WEIGHT_TYPE w_type)
virtual SCIP_RETCODE computePartitionDBSCAN (double eps, bool postprocenable)
virtual SCIP_RETCODE computePartitionDBSCANForPartialGraph (gcg::DETPROBDATA *detprobdata, gcg::PARTIALDECOMP *partialdec, double eps, bool postprocenable)
virtual SCIP_RETCODE computePartitionMST (double eps, bool postprocenable)
virtual SCIP_RETCODE computePartitionMSTForPartialGraph (gcg::DETPROBDATA *detprobdata, gcg::PARTIALDECOMP *partialdec, double eps, bool postprocenable)
virtual SCIP_RETCODE computePartitionMCL (int &stoppedAfter, double inflatefactor, bool postprocenable)
virtual SCIP_RETCODE computePartitionMCLForPartialGraph (gcg::DETPROBDATA *detprobdata, gcg::PARTIALDECOMP *partialdec, int &stoppedAfter, double inflatefactor, bool postprocenable)
virtual SCIP_RETCODE getNBlocks (int &_n_blocks)
virtual SCIP_RETCODE nonClustered (int &_non_cl)
virtual double getEdgeWeightPercentile (double q)
SCIP_RETCODE computePartitionDBSCAN (double eps, bool postprocenable)
SCIP_RETCODE computePartitionDBSCANForPartialGraph (gcg::DETPROBDATA *detprobdata, gcg::PARTIALDECOMP *partialdec, double eps, bool postprocenable)
SCIP_RETCODE computePartitionMST (double eps, bool postprocenable)
SCIP_RETCODE computePartitionMSTForPartialGraph (gcg::DETPROBDATA *detprobdata, gcg::PARTIALDECOMP *partialdec, double eps, bool postprocenable)
SCIP_RETCODE computePartitionMCL (int &stoppedAfter, double inflatefactor, bool postprocenable)
SCIP_RETCODE computePartitionMCLForPartialGraph (gcg::DETPROBDATA *detprobdata, gcg::PARTIALDECOMP *partialdec, int &stoppedAfter, double inflatefactor, bool postprocenable)
Public Member Functions inherited from gcg::RowGraph< T >
 RowGraph (GCG *gcg, Weights w)
virtual ~RowGraph ()
virtual SCIP_RETCODE createDecompFromPartition (GCG_DECOMP **decomp)
virtual SCIP_RETCODE createPartialdecFromPartition (PARTIALDECOMP *oldpartialdec, PARTIALDECOMP **firstpartialdec, PARTIALDECOMP **secondpartialdec, DETPROBDATA *detprobdata)
virtual SCIP_RETCODE createFromMatrix (SCIP_CONS **conss, SCIP_VAR **vars, int nconss_, int nvars_)
Public Member Functions inherited from gcg::MatrixGraph< T >
 MatrixGraph (GCG *gcgstruct, Weights w)
virtual ~MatrixGraph ()
virtual SCIP_RETCODE writeToFile (int fd, SCIP_Bool writeweights)
virtual SCIP_RETCODE readPartition (const char *filename)
void setDummynodes (int dummynodes_)
int getDummynodes () const
virtual std::vector< int > getPartition ()
virtual SCIP_RETCODE createFromPartialMatrix (DETPROBDATA *detprobdata, PARTIALDECOMP *partialdec)
virtual int getNNonzeroes () const

Static Public Member Functions

static double calculateSimilarity (int a, int b, int c, DISTANCE_MEASURE dist, WEIGHT_TYPE w_type, bool itself)

Additional Inherited Members

Data Fields inherited from gcg::MatrixGraph< T >
std::string name
Protected Attributes inherited from gcg::RowGraph< T >
gcg::Graph< T > graph
Protected Attributes inherited from gcg::MatrixGraph< T >
GCG * gcg
int nconss
int nvars
int dummynodes
Weights weights
GraphInterface * graphiface
int nnonzeroes

Constructor & Destructor Documentation

◆ RowGraphWeighted()

template<class T>
gcg::RowGraphWeighted< T >::RowGraphWeighted ( GCG * gcg,
Weights w )
Parameters
gcgGCG data structure
wweights for the given graph

Definition at line 58 of file rowgraph_weighted_def.h.

References gcg::MatrixGraph< T >::name, and gcg::RowGraph< T >::RowGraph().

◆ ~RowGraphWeighted()

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

Definition at line 69 of file rowgraph_weighted_def.h.

Member Function Documentation

◆ createFromMatrix()

template<class T>
SCIP_RETCODE gcg::RowGraphWeighted< T >::createFromMatrix ( SCIP_CONS ** conss,
SCIP_VAR ** vars,
int nconss_,
int nvars_,
DISTANCE_MEASURE dist,
WEIGHT_TYPE w_type )
virtual
Parameters
conssconstraints for which graph should be created
varsvariables for which graph should be created
nconss_number of constraints
nvars_number of variables
distHere we define the distance measure between two rows
w_typeDepending on the algorithm we can build distance or similarity graph

Definition at line 76 of file rowgraph_weighted_def.h.

References assert(), c, calculateSimilarity(), gcg::DIST, GCGgetOrigprob(), GCGisVarRelevant(), gcg::RowGraph< T >::graph, i, gcg::INTERSECTION, j, gcg::MatrixGraph< T >::nconss, gcg::MatrixGraph< T >::nvars, SCIP_CALL(), SCIPfreeBufferArray(), success, and vars.

◆ createFromPartialMatrix()

template<class T>
SCIP_RETCODE gcg::RowGraphWeighted< T >::createFromPartialMatrix ( DETPROBDATA * detprobdata,
PARTIALDECOMP * partialdec,
DISTANCE_MEASURE dist,
WEIGHT_TYPE w_type )
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

stores new index of the conss

stores new index of the vars

Parameters
detprobdatadetection process information and data
partialdecpartial decomposition to use for matrix
distHere we define the distance measure between two rows
w_typeDepending on the algorithm we can build distance or similarity graph

Definition at line 222 of file rowgraph_weighted_def.h.

References assert(), c, calculateSimilarity(), gcg::DIST, gcg::PARTIALDECOMP::getNConss(), gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), gcg::PARTIALDECOMP::getNVars(), gcg::DETPROBDATA::getNVarsForCons(), gcg::PARTIALDECOMP::getOpenconss(), gcg::PARTIALDECOMP::getOpenvars(), gcg::DETPROBDATA::getVarsForCons(), gcg::RowGraph< T >::graph, i, gcg::INTERSECTION, j, gcg::MatrixGraph< T >::nconss, gcg::MatrixGraph< T >::nvars, SCIP_CALL(), and var.

Referenced by GCG_DECL_PROPAGATEPARTIALDEC(), and GCG_DECL_PROPAGATEPARTIALDEC().

◆ calculateSimilarity()

template<class T>
double gcg::RowGraphWeighted< T >::calculateSimilarity ( int a,
int b,
int c,
DISTANCE_MEASURE dist,
WEIGHT_TYPE w_type,
bool itself )
static
Parameters
anumber of common variables in two rows
bnumber of variables that appear only in the 2nd row
cnumber of variables that appear only in the 1st row
distHere we define the distance measure between two rows
w_typeDepending on the algorithm we can build distance or similarity graph
itselftrue if we calculate similarity between the row itself

Definition at line 369 of file rowgraph_weighted_def.h.

References assert(), c, gcg::COSINE, gcg::DIST, gcg::INTERSECTION, gcg::JACCARD, gcg::JOHNSON, result, and gcg::SIMPSON.

Referenced by createFromMatrix(), and createFromPartialMatrix().

◆ computePartitionDBSCAN() [1/2]

template<class T>
virtual SCIP_RETCODE gcg::RowGraphWeighted< T >::computePartitionDBSCAN ( double eps,
bool postprocenable )
virtual

return a partition of the nodes with the help of DBSCAN

◆ computePartitionDBSCANForPartialGraph() [1/2]

template<class T>
virtual SCIP_RETCODE gcg::RowGraphWeighted< T >::computePartitionDBSCANForPartialGraph ( gcg::DETPROBDATA * detprobdata,
gcg::PARTIALDECOMP * partialdec,
double eps,
bool postprocenable )
virtual

return a partition of the nodes with the help of DBSCAN

Referenced by GCG_DECL_PROPAGATEPARTIALDEC().

◆ computePartitionMST() [1/2]

template<class T>
virtual SCIP_RETCODE gcg::RowGraphWeighted< T >::computePartitionMST ( double eps,
bool postprocenable )
virtual

return a partition of the nodes with the help of MST

◆ computePartitionMSTForPartialGraph() [1/2]

template<class T>
virtual SCIP_RETCODE gcg::RowGraphWeighted< T >::computePartitionMSTForPartialGraph ( gcg::DETPROBDATA * detprobdata,
gcg::PARTIALDECOMP * partialdec,
double eps,
bool postprocenable )
virtual

return a partition of the nodes with the help of MST

Referenced by GCG_DECL_PROPAGATEPARTIALDEC().

◆ computePartitionMCL() [1/2]

template<class T>
virtual SCIP_RETCODE gcg::RowGraphWeighted< T >::computePartitionMCL ( int & stoppedAfter,
double inflatefactor,
bool postprocenable )
virtual

return a partition of the nodes with the help of MST

◆ computePartitionMCLForPartialGraph() [1/2]

template<class T>
virtual SCIP_RETCODE gcg::RowGraphWeighted< T >::computePartitionMCLForPartialGraph ( gcg::DETPROBDATA * detprobdata,
gcg::PARTIALDECOMP * partialdec,
int & stoppedAfter,
double inflatefactor,
bool postprocenable )
virtual

return a partition of the nodes with the help of MST

References getEdgeWeightPercentile(), getNBlocks(), and nonClustered().

◆ getNBlocks()

template<class T>
SCIP_RETCODE gcg::RowGraphWeighted< T >::getNBlocks ( int & _n_blocks)
virtual

return the number of clusters after post-processing

Definition at line 1303 of file rowgraph_weighted_def.h.

Referenced by computePartitionMCLForPartialGraph(), GCG_DECL_PROPAGATEPARTIALDEC(), and GCG_DECL_PROPAGATEPARTIALDEC().

◆ nonClustered()

template<class T>
SCIP_RETCODE gcg::RowGraphWeighted< T >::nonClustered ( int & _non_cl)
virtual

◆ getEdgeWeightPercentile()

template<class T>
double gcg::RowGraphWeighted< T >::getEdgeWeightPercentile ( double q)
virtual

Definition at line 1317 of file rowgraph_weighted_def.h.

References gcg::RowGraph< T >::graph.

Referenced by computePartitionMCLForPartialGraph().

◆ computePartitionDBSCAN() [2/2]

SCIP_RETCODE gcg::RowGraphWeighted< GraphGCG >::computePartitionDBSCAN ( double eps,
bool postprocenable )

◆ computePartitionDBSCANForPartialGraph() [2/2]

SCIP_RETCODE gcg::RowGraphWeighted< GraphGCG >::computePartitionDBSCANForPartialGraph ( gcg::DETPROBDATA * detprobdata,
gcg::PARTIALDECOMP * partialdec,
double eps,
bool postprocenable )

◆ computePartitionMST() [2/2]

SCIP_RETCODE gcg::RowGraphWeighted< GraphGCG >::computePartitionMST ( double eps,
bool postprocenable )

◆ computePartitionMSTForPartialGraph() [2/2]

SCIP_RETCODE gcg::RowGraphWeighted< GraphGCG >::computePartitionMSTForPartialGraph ( gcg::DETPROBDATA * detprobdata,
gcg::PARTIALDECOMP * partialdec,
double eps,
bool postprocenable )

◆ computePartitionMCL() [2/2]

SCIP_RETCODE gcg::RowGraphWeighted< GraphGCG >::computePartitionMCL ( int & stoppedAfter,
double inflatefactor,
bool postprocenable )

◆ computePartitionMCLForPartialGraph() [2/2]

SCIP_RETCODE gcg::RowGraphWeighted< GraphGCG >::computePartitionMCLForPartialGraph ( gcg::DETPROBDATA * detprobdata,
gcg::PARTIALDECOMP * partialdec,
int & stoppedAfter,
double inflatefactor,
bool postprocenable )