GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
dec_mst.cpp File Reference

Detailed Description

minimum spanning tree clustering detector

Author
Igor Pesic
Note
requires package to be installed: GSL library, requires flag to be set: GSL=true

This detector performs minimum spanning tree clustering.

Definition in file dec_mst.cpp.

#include <time.h>
#include <algorithm>
#include "gcg/dec_mst.h"
#include "gcg/cons_decomp.h"
#include "graph/matrixgraph.h"
#include "graph/rowgraph_weighted.h"
#include "graph/graph_gcg.h"
#include "scip/clock.h"

Go to the source code of this file.

Data Structures

struct  GCG_DetectorData

Macros

#define DEC_NAME   "mst"
#define DEC_DESC   "detector based on MST clustering"
#define DEC_PRIORITY   910
#define DEC_FREQCALLROUND   1
#define DEC_MAXCALLROUND   INT_MAX
#define DEC_MINCALLROUND   0
#define DEC_FREQCALLROUNDORIGINAL   1
#define DEC_MAXCALLROUNDORIGINAL   INT_MAX
#define DEC_MINCALLROUNDORIGINAL   0
#define DEC_DECCHAR   'M'
#define DEC_ENABLED   FALSE
#define DEC_ENABLEDFINISHING   FALSE
#define DEC_ENABLEDPOSTPROCESSING   FALSE
#define DEC_SKIP   FALSE
#define DEC_USEFULRECALL   FALSE
#define DEFAULT_N_ITERATIONS   51
#define DEFAULT_JOHNSON_ENABLE   true
#define DEFAULT_INTERSECTION_ENABLE   false
#define DEFAULT_JACCARD_ENABLE   false
#define DEFAULT_COSINE_ENABLE   false
#define DEFAULT_SIMPSON_ENABLE   false
#define DEFAULT_POSTPROC_ENABLE   true
#define MAX_N_BLOCKS   100
#define finishPartialdecMST   NULL
#define detectorPostprocessPartialdecMST   NULL

Functions

static std::vector< double > getEpsList (int length, double mid, bool isintersection)
static GCG_DECL_FREEDETECTOR (freeMST)
static GCG_DECL_EXITDETECTOR (exitMST)
static GCG_DECL_INITDETECTOR (initMST)
static bool graphCompletible (gcg::DETPROBDATA *detprobdata, gcg::PARTIALDECOMP *partialdec)
static GCG_DECL_PROPAGATEPARTIALDEC (propagatePartialdecMST)
static GCG_DECL_SETPARAMAGGRESSIVE (setParamAggressiveMST)
static GCG_DECL_SETPARAMDEFAULT (setParamDefaultMST)
static GCG_DECL_SETPARAMFAST (setParamFastMST)
SCIP_RETCODE GCGincludeDetectorMST (GCG *gcg)

Macro Definition Documentation

◆ DEC_NAME

#define DEC_NAME   "mst"

name of detector

Definition at line 57 of file dec_mst.cpp.

◆ DEC_DESC

#define DEC_DESC   "detector based on MST clustering"

description of detector

Definition at line 58 of file dec_mst.cpp.

◆ DEC_PRIORITY

#define DEC_PRIORITY   910

priority of the constraint handler for separation

Definition at line 59 of file dec_mst.cpp.

◆ DEC_FREQCALLROUND

#define DEC_FREQCALLROUND   1

frequency the detector gets called in detection loop, i.e. it is called in round r if and only if minCallRound <= r <= maxCallRound AND (r - minCallRound) mod freqCallRound == 0

Definition at line 60 of file dec_mst.cpp.

◆ DEC_MAXCALLROUND

#define DEC_MAXCALLROUND   INT_MAX

last round the detector gets called

Definition at line 61 of file dec_mst.cpp.

◆ DEC_MINCALLROUND

#define DEC_MINCALLROUND   0

first round the detector gets called

Definition at line 62 of file dec_mst.cpp.

◆ DEC_FREQCALLROUNDORIGINAL

#define DEC_FREQCALLROUNDORIGINAL   1

frequency the detector gets called in detection loop while detecting the original problem

Definition at line 63 of file dec_mst.cpp.

◆ DEC_MAXCALLROUNDORIGINAL

#define DEC_MAXCALLROUNDORIGINAL   INT_MAX

last round the detector gets called while detecting the original problem

Definition at line 64 of file dec_mst.cpp.

◆ DEC_MINCALLROUNDORIGINAL

#define DEC_MINCALLROUNDORIGINAL   0

first round the detector gets called while detecting the original problem

Definition at line 65 of file dec_mst.cpp.

◆ DEC_DECCHAR

#define DEC_DECCHAR   'M'

display character of detector

Definition at line 66 of file dec_mst.cpp.

◆ DEC_ENABLED

#define DEC_ENABLED   FALSE

should the detection be enabled

Definition at line 67 of file dec_mst.cpp.

◆ DEC_ENABLEDFINISHING

#define DEC_ENABLEDFINISHING   FALSE

should the finishing be enabled

Definition at line 68 of file dec_mst.cpp.

◆ DEC_ENABLEDPOSTPROCESSING

#define DEC_ENABLEDPOSTPROCESSING   FALSE

should the postprocessing be enabled

Definition at line 69 of file dec_mst.cpp.

◆ DEC_SKIP

#define DEC_SKIP   FALSE

should detector be skipped if other detectors found decompositions

Definition at line 70 of file dec_mst.cpp.

◆ DEC_USEFULRECALL

#define DEC_USEFULRECALL   FALSE

is it useful to call this detector on a descendant of the propagated partialdec

Definition at line 71 of file dec_mst.cpp.

◆ DEFAULT_N_ITERATIONS

#define DEFAULT_N_ITERATIONS   51

Definition at line 74 of file dec_mst.cpp.

◆ DEFAULT_JOHNSON_ENABLE

#define DEFAULT_JOHNSON_ENABLE   true

Definition at line 75 of file dec_mst.cpp.

◆ DEFAULT_INTERSECTION_ENABLE

#define DEFAULT_INTERSECTION_ENABLE   false

Definition at line 76 of file dec_mst.cpp.

◆ DEFAULT_JACCARD_ENABLE

#define DEFAULT_JACCARD_ENABLE   false

Definition at line 77 of file dec_mst.cpp.

◆ DEFAULT_COSINE_ENABLE

#define DEFAULT_COSINE_ENABLE   false

Definition at line 78 of file dec_mst.cpp.

◆ DEFAULT_SIMPSON_ENABLE

#define DEFAULT_SIMPSON_ENABLE   false

Definition at line 79 of file dec_mst.cpp.

◆ DEFAULT_POSTPROC_ENABLE

#define DEFAULT_POSTPROC_ENABLE   true

Definition at line 80 of file dec_mst.cpp.

◆ MAX_N_BLOCKS

#define MAX_N_BLOCKS   100

Definition at line 81 of file dec_mst.cpp.

◆ finishPartialdecMST

#define finishPartialdecMST   NULL

Definition at line 485 of file dec_mst.cpp.

Referenced by GCGincludeDetectorMST().

◆ detectorPostprocessPartialdecMST

#define detectorPostprocessPartialdecMST   NULL

Definition at line 487 of file dec_mst.cpp.

Referenced by GCGincludeDetectorMST().

Function Documentation

◆ getEpsList()

std::vector< double > getEpsList ( int length,
double mid,
bool isintersection )
static

Definition at line 107 of file dec_mst.cpp.

References assert(), getEpsList(), i, and j.

Referenced by GCG_DECL_PROPAGATEPARTIALDEC(), and getEpsList().

◆ GCG_DECL_FREEDETECTOR()

GCG_DECL_FREEDETECTOR ( freeMST )
static

destructor of detector to free user data (called when GCG is exiting)

Definition at line 155 of file dec_mst.cpp.

References assert(), DEC_NAME, GCG_DECL_FREEDETECTOR, GCGdetectorGetData(), GCGdetectorGetName(), GCGgetOrigprob(), and SCIPfreeMemory().

◆ GCG_DECL_EXITDETECTOR()

GCG_DECL_EXITDETECTOR ( exitMST )
static

destructor of detector to free detector data (called before the solving process begins)

Definition at line 170 of file dec_mst.cpp.

References GCG_DECL_EXITDETECTOR.

◆ GCG_DECL_INITDETECTOR()

GCG_DECL_INITDETECTOR ( initMST )
static

detection initialization function of detector (called before solving is about to begin)

Definition at line 178 of file dec_mst.cpp.

References assert(), DEC_NAME, GCG_DetectorData::found, GCG_DECL_INITDETECTOR, GCGdetectorGetData(), GCGdetectorGetName(), and GCG_DetectorData::n_similarities.

◆ graphCompletible()

bool graphCompletible ( gcg::DETPROBDATA * detprobdata,
gcg::PARTIALDECOMP * partialdec )
static

◆ GCG_DECL_PROPAGATEPARTIALDEC()

◆ GCG_DECL_SETPARAMAGGRESSIVE()

GCG_DECL_SETPARAMAGGRESSIVE ( setParamAggressiveMST )
static

◆ GCG_DECL_SETPARAMDEFAULT()

GCG_DECL_SETPARAMDEFAULT ( setParamDefaultMST )
static

◆ GCG_DECL_SETPARAMFAST()

GCG_DECL_SETPARAMFAST ( setParamFastMST )
static

◆ GCGincludeDetectorMST()