dec_consclass.cpp
Go to the documentation of this file.
34 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
55 #define DEC_FREQCALLROUND 1 /** frequency the detector gets called in detection loop ,ie it is called in round r if and only if minCallRound <= r <= maxCallRound AND (r - minCallRound) mod freqCallRound == 0 */
58 #define DEC_FREQCALLROUNDORIGINAL 1 /** frequency the detector gets called in detection loop while detecting the original problem */
59 #define DEC_MAXCALLROUNDORIGINAL INT_MAX /** last round the detector gets called while detecting the original problem */
60 #define DEC_MINCALLROUNDORIGINAL 0 /** first round the detector gets called while detecting the original problem */
66 #define DEC_SKIP FALSE /**< should detector be skipped if other detectors found decompositions */
67 #define DEC_USEFULRECALL FALSE /**< is it useful to call this detector on a descendant of the propagated partialdec */
126 if( partialdecdetectiondata->detprobdata->getNConss() + partialdecdetectiondata->detprobdata->getNVars() >= 50000 )
127 SCIPgetIntParam(scip, "detection/classification/maxnclassesperpartitionforlargeprobs", &maximumnclasses);
131 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, " in dec_consclass: there are %d different constraint classes \n ",
135 for( int classifierIndex = 0; classifierIndex < partialdecdetectiondata->detprobdata->getNConsPartitions(); ++classifierIndex )
137 gcg::ConsPartition* classifier = partialdecdetectiondata->detprobdata->getConsPartition(classifierIndex);
143 " the current consclass distribution includes %d classes but only %d are allowed for propagatePartialdec() of cons class detector\n",
148 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, " the current constraint classifier \"%s\" consists of %d different classes \n ", classifier->getName(), classifier->getNClasses() );
158 std::vector< std::vector<int> > subsetsOfConsclasses = classifier->getAllSubsets( true, false, false );
167 /* fix open conss that have a) type of the current subset or b) decomp info ONLY_MASTER as master conss */
202 /* set decinfo to: consclass_<classfier_name>:<master_class_name#1>-...-<master_class_name#n> */
231 partialdec->setConsPartitionStatistics(partialdec->getNDetectors(), classifier, curmasterclasses);
243 SCIP_CALL( SCIPallocMemoryArray(scip, &(partialdecdetectiondata->newpartialdecs), foundpartialdecs.size()) );
246 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "dec_consclass found %d new partialdecs \n", partialdecdetectiondata->nnewpartialdecs );
251 partialdecdetectiondata->newpartialdecs[s]->addClockTime(partialdecdetectiondata->detectiontime / partialdecdetectiondata->nnewpartialdecs);
284 modifier = ((SCIP_Real)SCIPgetNConss(scip) + (SCIP_Real)SCIPgetNVars(scip) ) / SET_MULTIPLEFORSIZETRANSF;
325 modifier = ( (SCIP_Real)SCIPgetNConss(scip) + (SCIP_Real)SCIPgetNVars(scip) ) / SET_MULTIPLEFORSIZETRANSF;
364 modifier = ( (SCIP_Real)SCIPgetNConss(scip) + (SCIP_Real)SCIPgetNVars(scip) ) / SET_MULTIPLEFORSIZETRANSF;
400 DECincludeDetector(scip, DEC_DETECTORNAME, DEC_DECCHAR, DEC_DESC, DEC_FREQCALLROUND, DEC_MAXCALLROUND,
401 DEC_MINCALLROUND, DEC_FREQCALLROUNDORIGINAL, DEC_MAXCALLROUNDORIGINAL, DEC_MINCALLROUNDORIGINAL, DEC_PRIORITY, DEC_ENABLED, DEC_ENABLEDFINISHING, DEC_ENABLEDPOSTPROCESSING, DEC_SKIP, DEC_USEFULRECALL, detectordata,
402 freeConsclass, initConsclass, exitConsclass, propagatePartialdecConsclass, finishPartialdecConsclass, detectorPostprocessPartialdecConsclass, setParamAggressiveConsclass, setParamDefaultConsclass, setParamFastConsclass));
408 SCIP_CALL( SCIPaddIntParam(scip, setstr, "maximum number of classes ", NULL, FALSE, DEFAULT_MAXIMUMNCLASSES, 1, INT_MAX, NULL, NULL ) );
const char * DECdetectorGetName(DEC_DETECTOR *detector)
returns the name of the provided detector
Definition: cons_decomp.cpp:2618
static DEC_DECL_PROPAGATEPARTIALDEC(propagatePartialdecConsclass)
Definition: dec_consclass.cpp:109
GCG interface methods.
#define detectorPostprocessPartialdecConsclass
Definition: dec_consclass.cpp:262
std::vector< int >::const_iterator fixConsToMaster(std::vector< int >::const_iterator itr)
fixes a constraint to the master constraints
Definition: class_partialdecomp.cpp:4938
void addDetectorChainInfo(const char *decinfo)
add information about the detector chain
Definition: class_partialdecomp.cpp:315
std::vector< int > & getOpenconssVec()
Gets a vector containing constraint ids not assigned yet as vector.
Definition: class_partialdecomp.cpp:4253
constraint handler for structure detection
class representing a partition of a set of constraints
Definition: class_conspartition.h:53
various SCIP helper methods
CONS_DECOMPINFO getClassDecompInfo(int classindex)
Definition: class_conspartition.cpp:99
const char * getClassName(int classindex)
Definition: class_indexpartition.cpp:200
void setConsPartitionStatistics(int detectorchainindex, ConsPartition *partition, std::vector< int > &consclassesmaster)
registers statistics for a used conspartition
Definition: class_partialdecomp.cpp:4860
bool sort()
sorts the vars and conss data structures by their indices
Definition: class_partialdecomp.cpp:5445
int getClassOfCons(int consindex)
Definition: class_conspartition.cpp:132
SCIP_RETCODE SCIPincludeDetectorConsclass(SCIP *scip)
Definition: dec_consclass.cpp:390
consclass detector
int getNDetectors()
Gets the number of detectors the partialdec is propagated by.
Definition: class_partialdecomp.cpp:4136
static DEC_DECL_SETPARAMDEFAULT(setParamDefaultConsclass)
Definition: dec_consclass.cpp:305
struct gcg::subset subset
static DEC_DECL_SETPARAMAGGRESSIVE(setParamAggressiveConsclass)
Definition: dec_consclass.cpp:265
std::vector< std::vector< int > > getAllSubsets(bool both, bool only_master, bool only_pricing)
Definition: class_conspartition.cpp:86
SCIP_RETCODE DECincludeDetector(SCIP *scip, const char *name, const char decchar, const char *description, int freqCallRound, int maxCallRound, int minCallRound, int freqCallRoundOriginal, int maxCallRoundOriginal, int minCallRoundOriginal, int priority, SCIP_Bool enabled, SCIP_Bool enabledFinishing, SCIP_Bool enabledPostprocessing, SCIP_Bool skip, SCIP_Bool usefulRecall, DEC_DETECTORDATA *detectordata, DEC_DECL_FREEDETECTOR((*freeDetector)), DEC_DECL_INITDETECTOR((*initDetector)), DEC_DECL_EXITDETECTOR((*exitDetector)), DEC_DECL_PROPAGATEPARTIALDEC((*propagatePartialdecDetector)), DEC_DECL_FINISHPARTIALDEC((*finishPartialdecDetector)), DEC_DECL_POSTPROCESSPARTIALDEC((*postprocessPartialdecDetector)), DEC_DECL_SETPARAMAGGRESSIVE((*setParamAggressiveDetector)), DEC_DECL_SETPARAMDEFAULT((*setParamDefaultDetector)),)
Definition: cons_decomp.cpp:3041
int getNOpenconss()
Gets size of vector containing constraints not assigned yet.
Definition: class_partialdecomp.cpp:4192
Definition: dec_compgreedily.cpp:73
class storing (potentially incomplete) decompositions
class storing partialdecs and the problem matrix
static DEC_DECL_SETPARAMFAST(setParamFastConsclass)
Definition: dec_consclass.cpp:344