Detailed Description
detector DBSCAN
- Note
- requires package to be installed: GSL library, requires flag to be set: GSL=true
This detector performs DBSCAN clustering.
Definition in file dec_dbscan.cpp.
#include <time.h>#include <string>#include <algorithm>#include <iostream>#include "gcg/dec_dbscan.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 |
| class | RowGraphWeighted< T > |
| class | Weights |
| class | GraphGCG |
Macros | |
| #define | DEC_NAME "dbscan" |
| #define | DEC_DESC "detector based on DBSCAN clustering" |
| #define | DEC_PRIORITY 901 |
| #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 'D' |
| #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 | finishPartialdecDBSCAN NULL |
| #define | detectorPostprocessPartialdecDBSCAN NULL |
Functions | |
| static std::vector< double > | getEpsList (int length, double mid, bool isintersection) |
| static | GCG_DECL_FREEDETECTOR (freeDBSCAN) |
| static | GCG_DECL_EXITDETECTOR (exitDBSCAN) |
| static | GCG_DECL_INITDETECTOR (initDBSCAN) |
| static bool | graphCompletible (gcg::DETPROBDATA *detprobdata, gcg::PARTIALDECOMP *partialdec) |
| static | GCG_DECL_PROPAGATEPARTIALDEC (propagatePartialdecDBSCAN) |
| static | GCG_DECL_SETPARAMAGGRESSIVE (setParamAggressiveDBSCAN) |
| static | GCG_DECL_SETPARAMDEFAULT (setParamDefaultDBSCAN) |
| static | GCG_DECL_SETPARAMFAST (setParamFastDBSCAN) |
| SCIP_RETCODE | GCGincludeDetectorDBSCAN (GCG *gcg) |
Macro Definition Documentation
◆ DEC_NAME
| #define DEC_NAME "dbscan" |
name of detector
Definition at line 57 of file dec_dbscan.cpp.
◆ DEC_DESC
| #define DEC_DESC "detector based on DBSCAN clustering" |
description of detector
Definition at line 58 of file dec_dbscan.cpp.
◆ DEC_PRIORITY
| #define DEC_PRIORITY 901 |
priority of the constraint handler for separation
Definition at line 59 of file dec_dbscan.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_dbscan.cpp.
◆ DEC_MAXCALLROUND
| #define DEC_MAXCALLROUND INT_MAX |
last round the detector gets called
Definition at line 61 of file dec_dbscan.cpp.
◆ DEC_MINCALLROUND
| #define DEC_MINCALLROUND 0 |
first round the detector gets called
Definition at line 62 of file dec_dbscan.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_dbscan.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_dbscan.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_dbscan.cpp.
◆ DEC_DECCHAR
| #define DEC_DECCHAR 'D' |
display character of detector
Definition at line 66 of file dec_dbscan.cpp.
◆ DEC_ENABLED
| #define DEC_ENABLED FALSE |
should the detection be enabled
Definition at line 67 of file dec_dbscan.cpp.
◆ DEC_ENABLEDFINISHING
| #define DEC_ENABLEDFINISHING FALSE |
should the finishing be enabled
Definition at line 68 of file dec_dbscan.cpp.
◆ DEC_ENABLEDPOSTPROCESSING
| #define DEC_ENABLEDPOSTPROCESSING FALSE |
should the postprocessing be enabled
Definition at line 69 of file dec_dbscan.cpp.
◆ DEC_SKIP
| #define DEC_SKIP FALSE |
should detector be skipped if other detectors found decompositions
Definition at line 70 of file dec_dbscan.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_dbscan.cpp.
◆ DEFAULT_N_ITERATIONS
| #define DEFAULT_N_ITERATIONS 51 |
Definition at line 75 of file dec_dbscan.cpp.
Referenced by GCGincludeDetectorDBSCAN(), and GCGincludeDetectorMST().
◆ DEFAULT_JOHNSON_ENABLE
| #define DEFAULT_JOHNSON_ENABLE true |
Definition at line 76 of file dec_dbscan.cpp.
Referenced by GCGincludeDetectorDBSCAN(), and GCGincludeDetectorMST().
◆ DEFAULT_INTERSECTION_ENABLE
| #define DEFAULT_INTERSECTION_ENABLE false |
Definition at line 77 of file dec_dbscan.cpp.
Referenced by GCGincludeDetectorDBSCAN(), and GCGincludeDetectorMST().
◆ DEFAULT_JACCARD_ENABLE
| #define DEFAULT_JACCARD_ENABLE false |
Definition at line 78 of file dec_dbscan.cpp.
Referenced by GCGincludeDetectorDBSCAN(), and GCGincludeDetectorMST().
◆ DEFAULT_COSINE_ENABLE
| #define DEFAULT_COSINE_ENABLE false |
Definition at line 79 of file dec_dbscan.cpp.
Referenced by GCGincludeDetectorDBSCAN(), and GCGincludeDetectorMST().
◆ DEFAULT_SIMPSON_ENABLE
| #define DEFAULT_SIMPSON_ENABLE false |
Definition at line 80 of file dec_dbscan.cpp.
Referenced by GCGincludeDetectorDBSCAN(), and GCGincludeDetectorMST().
◆ DEFAULT_POSTPROC_ENABLE
| #define DEFAULT_POSTPROC_ENABLE true |
Definition at line 81 of file dec_dbscan.cpp.
Referenced by GCGincludeDetectorDBSCAN(), and GCGincludeDetectorMST().
◆ MAX_N_BLOCKS
| #define MAX_N_BLOCKS 100 |
Definition at line 82 of file dec_dbscan.cpp.
Referenced by GCG_DECL_PROPAGATEPARTIALDEC(), and GCG_DECL_PROPAGATEPARTIALDEC().
◆ finishPartialdecDBSCAN
| #define finishPartialdecDBSCAN NULL |
Definition at line 477 of file dec_dbscan.cpp.
Referenced by GCGincludeDetectorDBSCAN().
◆ detectorPostprocessPartialdecDBSCAN
| #define detectorPostprocessPartialdecDBSCAN NULL |
Definition at line 478 of file dec_dbscan.cpp.
Referenced by GCGincludeDetectorDBSCAN().
Function Documentation
◆ getEpsList()
|
static |
Definition at line 108 of file dec_dbscan.cpp.
References assert(), getEpsList(), i, and j.
Referenced by GCG_DECL_PROPAGATEPARTIALDEC(), and getEpsList().
◆ GCG_DECL_FREEDETECTOR()
|
static |
destructor of detector to free user data (called when GCG is exiting)
Definition at line 156 of file dec_dbscan.cpp.
References assert(), DEC_NAME, GCG_DECL_FREEDETECTOR, GCGdetectorGetData(), GCGdetectorGetName(), GCGgetOrigprob(), and SCIPfreeMemory().
◆ GCG_DECL_EXITDETECTOR()
|
static |
destructor of detector to free detector data (called before the solving process begins)
Definition at line 171 of file dec_dbscan.cpp.
References GCG_DECL_EXITDETECTOR.
◆ GCG_DECL_INITDETECTOR()
|
static |
detection initialization function of detector (called before solving is about to begin)
Definition at line 179 of file dec_dbscan.cpp.
References assert(), DEC_NAME, GCG_DetectorData::found, GCG_DECL_INITDETECTOR, GCGdetectorGetData(), GCGdetectorGetName(), and GCG_DetectorData::n_similarities.
◆ graphCompletible()
|
static |
are there conss and vars to be included by the graph and have the conss common vars included by the graph
Definition at line 195 of file dec_dbscan.cpp.
References c, gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), gcg::DETPROBDATA::getNVarsForCons(), gcg::PARTIALDECOMP::getOpenconss(), gcg::PARTIALDECOMP::getOpenvars(), gcg::DETPROBDATA::getVarsForCons(), graphCompletible(), i, gcg::PARTIALDECOMP::isVarOpenvar(), and var.
Referenced by GCG_DECL_PROPAGATEPARTIALDEC(), and graphCompletible().
◆ GCG_DECL_PROPAGATEPARTIALDEC()
|
static |
Definition at line 247 of file dec_dbscan.cpp.
References assert(), gcg::RowGraphWeighted< T >::computePartitionDBSCANForPartialGraph(), GCG_DetectorData::cosineenable, gcg::RowGraphWeighted< T >::createFromPartialMatrix(), gcg::RowGraph< T >::createPartialdecFromPartition(), GCG_DetectorData::found, GCG_DECL_PROPAGATEPARTIALDEC, GCGdetectorGetData(), GCGgetOrigprob(), getEpsList(), gcg::RowGraphWeighted< T >::getNBlocks(), graphCompletible(), i, GCG_DetectorData::intersectionenable, j, GCG_DetectorData::jaccardenable, GCG_DetectorData::johnsonenable, MAX_N_BLOCKS, GCG_DetectorData::n_iterations, GCG_DetectorData::n_similarities, gcg::RowGraphWeighted< T >::nonClustered(), origprob, GCG_DetectorData::postprocenable, gcg::PARTIALDECOMP::refineToBlocks(), result, RowGraphWeighted< T >::RowGraphWeighted(), SCIP_CALL(), and GCG_DetectorData::simpsonenable.
◆ GCG_DECL_SETPARAMAGGRESSIVE()
|
static |
Definition at line 481 of file dec_dbscan.cpp.
References assert(), GCG_DECL_SETPARAMAGGRESSIVE, GCGdetectorGetName(), GCGgetOrigprob(), origprob, and SCIP_CALL().
◆ GCG_DECL_SETPARAMDEFAULT()
|
static |
Definition at line 499 of file dec_dbscan.cpp.
References assert(), DEC_ENABLED, DEC_ENABLEDFINISHING, GCG_DECL_SETPARAMDEFAULT, GCGdetectorGetName(), GCGgetOrigprob(), origprob, and SCIP_CALL().
◆ GCG_DECL_SETPARAMFAST()
|
static |
Definition at line 516 of file dec_dbscan.cpp.
References assert(), GCG_DECL_SETPARAMFAST, GCGdetectorGetName(), GCGgetOrigprob(), origprob, and SCIP_CALL().
◆ GCGincludeDetectorDBSCAN()
| SCIP_RETCODE GCGincludeDetectorDBSCAN | ( | GCG * | gcg | ) |
creates the handler for xyz detector and includes it in SCIP
creates the DBSCAN presolver and includes it in SCIP
- Parameters
-
gcg GCG data structure
Definition at line 540 of file dec_dbscan.cpp.
References assert(), GCG_DetectorData::cosineenable, DEC_DECCHAR, DEC_DESC, DEC_ENABLED, DEC_ENABLEDFINISHING, DEC_ENABLEDPOSTPROCESSING, DEC_FREQCALLROUND, DEC_FREQCALLROUNDORIGINAL, DEC_MAXCALLROUND, DEC_MAXCALLROUNDORIGINAL, DEC_MINCALLROUND, DEC_MINCALLROUNDORIGINAL, DEC_NAME, DEC_PRIORITY, DEC_SKIP, DEC_USEFULRECALL, DEFAULT_COSINE_ENABLE, DEFAULT_INTERSECTION_ENABLE, DEFAULT_JACCARD_ENABLE, DEFAULT_JOHNSON_ENABLE, DEFAULT_N_ITERATIONS, DEFAULT_POSTPROC_ENABLE, DEFAULT_SIMPSON_ENABLE, detectorPostprocessPartialdecDBSCAN, finishPartialdecDBSCAN, GCG_DetectorData::found, GCGgetOrigprob(), GCGincludeDetector(), GCGincludeDetectorDBSCAN(), GCG_DetectorData::intersectionenable, GCG_DetectorData::jaccardenable, GCG_DetectorData::johnsonenable, GCG_DetectorData::n_iterations, origprob, GCG_DetectorData::postprocenable, SCIP_CALL(), and GCG_DetectorData::simpsonenable.
Referenced by GCGincludeDetectorDBSCAN(), and GCGincludeGcgPlugins().