GCG 4.1.1 (dev)

Generic Column Generation

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

Detailed Description

template<class T>
class gcg::GraphAlgorithms< T >

Definition at line 54 of file graphalgorithms.h.

#include <graphalgorithms.h>

Static Public Member Functions

static SCIP_Real computeSoed (Hypergraph< T > &graph)
static SCIP_Real computeMincut (Hypergraph< T > &graph)
static SCIP_Real computekMetric (Hypergraph< T > &graph)
static std::vector< int > dbscan (Graph< GraphGCG > &graph, double eps, int minPts=4)
static std::vector< int > mst (Graph< GraphGCG > &graph, double cutoff, int minPts=4)
static std::vector< int > mcl (Graph< GraphGCG > &graph, int &stoppedAfter, double inflatefac, int maxiters=25, int expandfac=2)
static void expandCluster (Graph< T > &graph, std::vector< bool > &visited, std::vector< bool > &is_core, std::vector< int > &labels, int point, std::vector< int > &NeighborPts, int curr_cluster, double eps, int minPts)
static bool cutoffif (EdgeGCG &a)
static int weightComp (const void *a, const void *b)
static int mstfind (std::vector< subset > &subsets, int i)
static void mstunion (std::vector< subset > &subsets, int x, int y)

Static Public Attributes

static double cutoff

Member Function Documentation

◆ computeSoed()

template<class T>
double gcg::GraphAlgorithms< T >::computeSoed ( Hypergraph< T > & graph)
static

compute weighted sum of external degrees

Parameters
graphthe hypergraph

Definition at line 60 of file graphalgorithms_def.h.

References gcg::Hypergraph< T >::getHyperedgeNodes(), gcg::Hypergraph< T >::getHyperedgeWeight(), gcg::Hypergraph< T >::getNHyperedges(), gcg::GraphInterface::getPartition(), and i.

◆ computeMincut()

template<class T>
double gcg::GraphAlgorithms< T >::computeMincut ( Hypergraph< T > & graph)
static

◆ computekMetric()

template<class T>
double gcg::GraphAlgorithms< T >::computekMetric ( Hypergraph< T > & graph)
static

◆ dbscan()

template<class T>
std::vector< int > gcg::GraphAlgorithms< T >::dbscan ( Graph< GraphGCG > & graph,
double eps,
int minPts = 4 )
static

run DBSCAN on the distance graph

Parameters
graphthe graph with weighted edges
epsradius in which we search for the neighbors
minPtsminimum number of neighbors needed to define a core point (can be fixed to 4 as stated in the paper)

Definition at line 136 of file graphalgorithms_def.h.

References expandCluster(), gcg::Graph< T >::getNeighborWeights(), gcg::Graph< T >::getNNodes(), i, and j.

Referenced by gcg::RowGraphWeighted< T >::computePartitionDBSCAN(), and gcg::RowGraphWeighted< T >::computePartitionDBSCANForPartialGraph().

◆ mst()

template<class T>
std::vector< int > gcg::GraphAlgorithms< T >::mst ( Graph< GraphGCG > & graph,
double cutoff,
int minPts = 4 )
static

run MST on the distance graph

Parameters
graphthe graph with weighted edges
cutoffthreshold below which we cut the edges
minPtsminimum number of points needed in a cluster

Definition at line 261 of file graphalgorithms_def.h.

References assert(), cutoff, cutoffif(), gcg::EdgeGCG::dest, gcg::Graph< T >::getEdges(), gcg::Graph< T >::getNEdges(), gcg::Graph< T >::getNNodes(), i, j, mstfind(), mstunion(), nnodes, gcg::EdgeGCG::src, and weightComp().

Referenced by gcg::RowGraphWeighted< T >::computePartitionMST(), and gcg::RowGraphWeighted< T >::computePartitionMSTForPartialGraph().

◆ mcl()

template<class T>
std::vector< int > gcg::GraphAlgorithms< T >::mcl ( Graph< GraphGCG > & graph,
int & stoppedAfter,
double inflatefac,
int maxiters = 25,
int expandfac = 2 )
static

run MCL on the similarity graph

Parameters
graphthe graph with weighted edges
stoppedAfternumber of iterations after which the clustering terminated
inflatefacinflate factor
maxitersmax number of iterations, set to 25 per default
expandfacexpand factor, should be always set to 2

Definition at line 435 of file graphalgorithms_def.h.

References assert(), and i.

Referenced by gcg::RowGraphWeighted< T >::computePartitionMCL(), and gcg::RowGraphWeighted< T >::computePartitionMCLForPartialGraph().

◆ expandCluster()

template<class T>
void gcg::GraphAlgorithms< T >::expandCluster ( Graph< T > & graph,
std::vector< bool > & visited,
std::vector< bool > & is_core,
std::vector< int > & labels,
int point,
std::vector< int > & NeighborPts,
int curr_cluster,
double eps,
int minPts )
static

help function for DBSCAN

Definition at line 202 of file graphalgorithms_def.h.

References gcg::Graph< T >::getNeighborWeights(), i, and j.

Referenced by dbscan().

◆ cutoffif()

template<class T>
bool gcg::GraphAlgorithms< T >::cutoffif ( EdgeGCG & a)
static

Definition at line 379 of file graphalgorithms_def.h.

References cutoff.

Referenced by mst().

◆ weightComp()

template<class T>
int gcg::GraphAlgorithms< T >::weightComp ( const void * a,
const void * b )
static

Definition at line 388 of file graphalgorithms_def.h.

References gcg::EdgeGCG::weight.

Referenced by mst().

◆ mstfind()

template<class T>
int gcg::GraphAlgorithms< T >::mstfind ( std::vector< subset > & subsets,
int i )
static

Definition at line 399 of file graphalgorithms_def.h.

References i, and mstfind().

Referenced by mst(), mstfind(), and mstunion().

◆ mstunion()

template<class T>
void gcg::GraphAlgorithms< T >::mstunion ( std::vector< subset > & subsets,
int x,
int y )
static

Definition at line 412 of file graphalgorithms_def.h.

References mstfind().

Referenced by mst().

Field Documentation

◆ cutoff

template<class T>
double gcg::GraphAlgorithms< T >::cutoff
static

Definition at line 115 of file graphalgorithms.h.

Referenced by cutoffif(), and mst().