dec_neighborhoodmaster.cpp
Go to the documentation of this file.
30 * @brief detector neighborhoodmaster (This detector calculates cons-cons adjacency (if not already done), sorts constraints according size of neighborhood. Searching two consecutive constraints with largest size difference (according neighborhood size) in sorted constraints. All constraints having a larger neighborhood than the second one are assigned to the master)
34 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
52 This detector calculates cons-cons adjacency (if not already done), and sorts constraints according size of neighborhood. Searching two consecutive constraints with largest size difference (according neighborhood size) in sorted constraints. All constraints having a larger neighborhood than the second one are assigned to the master
58 #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 */
61 #define DEC_FREQCALLROUNDORIGINAL 1 /** frequency the detector gets called in detection loop while detecting the original problem */
62 #define DEC_MAXCALLROUNDORIGINAL INT_MAX /** last round the detector gets called while detecting the original problem */
63 #define DEC_MINCALLROUNDORIGINAL 0 /** first round the detector gets called while detecting the original problem */
69 #define DEC_SKIP FALSE /**< should detector be skipped if other detectors found decompositions */
70 #define DEC_USEFULRECALL FALSE /**< is it useful to call this detector on a descendant of the propagated partialdec */
151 /** fix open conss that have a) type of the current subset or b) decomp info ONLY_MASTER as master conss */
156 neighborhoodsize.emplace_back(std::pair<int,int>(detprobdata->getNConssForCons(opencons), opencons));
188 partialdecdetectiondata->newpartialdecs[0]->addClockTime(SCIPgetClockTime(scip, temporaryClock));
192 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "dec_neighborhoodmaster found %d new partialdec \n", partialdecdetectiondata->nnewpartialdecs );
267 DECincludeDetector(scip, DEC_DETECTORNAME, DEC_DECCHAR, DEC_DESC, DEC_FREQCALLROUND, DEC_MAXCALLROUND,
268 DEC_MINCALLROUND, DEC_FREQCALLROUNDORIGINAL, DEC_MAXCALLROUNDORIGINAL, DEC_MINCALLROUNDORIGINAL, DEC_PRIORITY,
271 exitNeighborhoodmaster, propagatePartialdecNeighborhoodmaster, finishPartialdecNeighborhoodmaster,
void addClockTime(SCIP_Real clocktime)
adds detection time of one detector
Definition: class_partialdecomp.cpp:286
const char * DECdetectorGetName(DEC_DETECTOR *detector)
returns the name of the provided detector
Definition: cons_decomp.cpp:2618
GCG interface methods.
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
bool operator()(const std::pair< int, int > &left, const std::pair< int, int > &right)
Definition: dec_neighborhoodmaster.cpp:89
DEC_DECL_FREEDETECTOR(freeNeighborhoodmaster)
Definition: dec_neighborhoodmaster.cpp:101
various SCIP helper methods
static DEC_DECL_SETPARAMFAST(setParamFastNeighborhoodmaster)
Definition: dec_neighborhoodmaster.cpp:235
static DEC_DECL_SETPARAMDEFAULT(setParamDefaultNeighborhoodmaster)
Definition: dec_neighborhoodmaster.cpp:220
#define detectorPostprocessPartialdecNeighborhoodmaster
Definition: dec_neighborhoodmaster.cpp:201
static DEC_DECL_PROPAGATEPARTIALDEC(propagatePartialdecNeighborhoodmaster)
Definition: dec_neighborhoodmaster.cpp:127
DEC_DETECTORDATA * DECdetectorGetData(DEC_DETECTOR *detector)
returns the data of the provided detector
Definition: cons_decomp.cpp:2609
bool sort()
sorts the vars and conss data structures by their indices
Definition: class_partialdecomp.cpp:5445
#define finishPartialdecNeighborhoodmaster
Definition: dec_neighborhoodmaster.cpp:125
int getNConssForCons(int consIndex)
returns the number of constraints for a given constraint
Definition: class_detprobdata.cpp:802
void createConssAdjacency()
create the constraint adjacency datastructure that is used (if created) for some methods to faster ac...
Definition: class_detprobdata.cpp:641
Definition: class_detprobdata.h:106
Definition: cons_decomp.cpp:240
static DEC_DECL_SETPARAMAGGRESSIVE(setParamAggressiveNeighborhoodmaster)
Definition: dec_neighborhoodmaster.cpp:204
neighborhoodmaster detector
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
SCIP_Bool isConssAdjInitialized()
determines whether or not the constraint-constraint adjacency data structure is initilized
Definition: class_detprobdata.cpp:985
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
SCIP_RETCODE SCIPincludeDetectorNeighborhoodmaster(SCIP *scip)
Definition: dec_neighborhoodmaster.cpp:256
class storing partialdecs and the problem matrix