cons_decomp.h
Go to the documentation of this file.
35 * This constraint handler manages the structure detection process. It will run all registered structure detectors in an
39 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
132 * @brief searches for the consclassifier with the given name and returns it or NULL if classifier is not found
142 * @brief searches for the varclassifier with the given name and returns it or NULL if classifier is not found
153 * @brief searches for the detector with the given name and returns it or NULL if detector is not found
177 * @returns partialdec to write if one can be found, or partialdecwrapper->partialdec = NULL otherwise */
205 DEC_CLASSIFIERDATA* classifierdata, /**< classifierdata the associated classifier data (or NULL) */
207 DEC_DECL_CONSCLASSIFY((*classify)) /**< the method that will classify constraints or variables (must not be NULL) */
220 int freqCallRound, /**< 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 */
223 int freqCallRoundOriginal, /**< frequency the detector gets called in detection loop while detecting of the original problem */
224 int maxCallRoundOriginal, /**< last round the detector gets called while detecting of the original problem */
225 int minCallRoundOriginal, /**< first round the detector gets called (offset in detection loop) while detecting of the original problem */
231 SCIP_Bool usefulRecall, /**< is it useful to call this detector on a descendant of the propagated partialdec */
236 DEC_DECL_PROPAGATEPARTIALDEC((*propagatePartialdecDetector)), /**< method to refine a partial decomposition inside detection loop (or NULL) */
237 DEC_DECL_FINISHPARTIALDEC((*finishPartialdecDetector)), /**< method to complete a partial decomposition when called in detection loop (or NULL) */
238 DEC_DECL_POSTPROCESSPARTIALDEC((*postprocessPartialdecDetector)), /**< method to postprocess a complete decomposition, called after detection loop (or NULL) */
239 DEC_DECL_SETPARAMAGGRESSIVE((*setParamAggressiveDetector)), /**< method that is called if the detection emphasis setting aggressive is chosen */
240 DEC_DECL_SETPARAMDEFAULT((*setParamDefaultDetector)), /**< method that is called if the detection emphasis setting default is chosen */
241 DEC_DECL_SETPARAMFAST((*setParamFastDetector)) /**< method that is called if the detection emphasis setting fast is chosen */
255 DEC_CLASSIFIERDATA* classifierdata,/**< classifierdata the associated classifier data (or NULL) */
257 DEC_DECL_VARCLASSIFY((*classify)) /**< method that will classify variables (must not be NULL) */
314 SCIP_Bool presolved /**< create basic partialdecomp for presolved if true, otherwise for original */
364 int partialdecid, /**< partialdecid id of the partial decompostion for which the pricing problems are checked for identity */
374 * bendersscore = max ( 0., 1 - ( 1 - blockareascore + (1 - borderareascore - bendersareascore ) ) ) with
381 * PENALTY = \f$\sum_{b=1}^(\text{nblocks}) \sum_{\text{blockvars }bv\text{ of block }b\text{ hitting a master constraint}} \sum_{\text{all blocks }b2 != b} \text{nblockcons}(b2)\f$
407 * @brief calculates and adds block size candidates using constraint classifications and variable classifications
412 SCIP_Bool transformed /**< whether to find the candidates for the transformed problem, otherwise the original */
447 * (i.e. maximize fraction of white area score considering problem with copied linking variables and
448 * corresponding master constraints; white area is nonblock and nonborder area, stairlinking variables count as linking)
534 SCIP_Bool transformed /**< whether to classify the transformed problem, otherwise the original */
541 * @param partialdecid id of the partial decompostion for which the pricing problems are checked for identity
582 * @note Does not free Detprobdata of the original problem if GCGconshdlrDecompFreeOrigOnExit is set to false.
625 * Updates the decomp decomposition structure by converting all finished partialdecs into decompositions and replacing the
709 * Gets the number of constraints that were active while detecting the decomposition originating from the partialdec with the
710 * given id, this method is used to decide if the problem has changed since detection, if so the aggregation information
SCIP_RETCODE GCGconshdlrDecompCreateVarmapForPartialdecId(SCIP *scip, SCIP_HASHMAP **hashorig2pricingvar, int partialdecid, int probnr1, int probnr2, SCIP *scip1, SCIP *scip2, SCIP_HASHMAP *varmap)
for two identical pricing problems a corresponding varmap is created
Definition: cons_decomp.cpp:4960
SCIP_RETCODE GCGconshdlrDecompSelectPartialdec(SCIP *scip, int partialdecid, SCIP_Bool select)
selects/unselects a partialdecomp
Definition: cons_decomp.cpp:5749
DEC_CLASSIFIERDATA * DECconsClassifierGetData(DEC_CONSCLASSIFIER *classifier)
returns the data of the provided consclassifier
Definition: cons_decomp.cpp:2562
SCIP_RETCODE GCGconshdlrDecompAddPreexistingDecomp(SCIP *scip, DEC_DECOMP *decomp)
adds a decomp that exists before the detection is called
Definition: cons_decomp.cpp:3534
type definitions for detectors in GCG projects
unsigned int GCGconshdlrDecompGetNOpenPartialdecsOrig(SCIP *scip)
Gets the number of open partialdecs available for the original problem.
Definition: cons_decomp.cpp:5477
SCIP_RETCODE GCGconshdlrDecompGetPartialdecsList(SCIP *scip, int **idlist, int *listlength)
Gets a list of ids of the current partialdecs.
Definition: cons_decomp.cpp:5291
int GCGconshdlrDecompGetNMasterConssByPartialdecId(SCIP *scip, int id)
gets number of master constraints of partialdec with given id
Definition: cons_decomp.cpp:5405
Definition: struct_decomp.h:51
void GCGconshdlrDecompFreeOrigOnExit(SCIP *scip, SCIP_Bool free)
sets freeing of detection data of original problem during exit to true
Definition: cons_decomp.cpp:5152
const char * DECconsClassifierGetName(DEC_CONSCLASSIFIER *classifier)
returns the name of the provided classifier
Definition: cons_decomp.cpp:2571
SCIP_RETCODE GCGconshdlrDecompCalcSetPartForseeingWhiteScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the setpartitioning maximum foreseeing white area score of a partialdec
Definition: cons_decomp.cpp:4437
unsigned int GCGconshdlrDecompGetNOpenPartialdecsTransformed(SCIP *scip)
Gets the number of open partialdecs available for the transformed problem.
Definition: cons_decomp.cpp:5491
int GCGconshdlrDecompGetNStairlinkingVarsByPartialdecId(SCIP *scip, int id)
gets number of stairlinking variables of partialdec with given id
Definition: cons_decomp.cpp:5544
DEC_DETECTORDATA * DECdetectorGetData(DEC_DETECTOR *detector)
returns the data of the provided detector
Definition: cons_decomp.cpp:2609
SCIP_Real GCGconshdlrDecompGetCompleteDetectionTime(SCIP *scip)
returns the total detection time
Definition: cons_decomp.cpp:5177
char DECdetectorGetChar(DEC_DETECTOR *detector)
Gets the character of the detector.
Definition: cons_decomp.cpp:2598
SCIP_RETCODE GCGconshdlrDecompTranslateOrigPartialdecs(SCIP *scip)
translates unpresolved partialdec to a complete presolved one
Definition: cons_decomp.cpp:5858
SCIP_RETCODE SCIPconshdlrDecompRepairConsNames(SCIP *scip)
Definition: cons_decomp.cpp:5909
DEC_DECL_FREEDETECTOR(freeNeighborhoodmaster)
Definition: dec_neighborhoodmaster.cpp:101
#define DEC_DECL_FREECONSCLASSIFIER(x)
Definition: type_consclassifier.h:52
type definition for score type
SCIP_RETCODE SCIPincludeConshdlrDecomp(SCIP *scip)
creates the constraint handler for decomp and includes it in SCIP
Definition: cons_decomp.cpp:5969
DEC_CLASSIFIERDATA * DECvarClassifierGetData(DEC_VARCLASSIFIER *classifier)
returns the data of the provided varclassifier
Definition: cons_decomp.cpp:2580
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)), DEC_DECL_SETPARAMFAST((*setParamFastDetector)))
includes one detector
unsigned int GCGconshdlrDecompGetNPartialdecsTransformed(SCIP *scip)
Gets the number of partialdecs available for the transformed problem.
Definition: cons_decomp.cpp:5530
int GCGconshdlrDecompGetNDecomps(SCIP *scip)
gets the number of decompositions (= amount of finished partialdecs)
Definition: cons_decomp.cpp:5327
SCIP_RETCODE GCGconshdlrDecompAddDecomp(SCIP *scip, DEC_DECOMP *decomp, SCIP_Bool select)
adds the given decomposition structure
Definition: cons_decomp.cpp:3468
unsigned int GCGconshdlrDecompGetNPartialdecs(SCIP *scip)
Gets the number of all partialdecs.
Definition: cons_decomp.cpp:5505
SCIP_Bool GCGconshdlrDecompIsPresolvedByPartialdecId(SCIP *scip, int id)
gets whether partialdec with given id is presolved
Definition: cons_decomp.cpp:5647
DEC_DECL_PROPAGATEPARTIALDEC(detectorPropagatePartialdecIsomorph)
Definition: dec_isomorph.cpp:1485
SCIP_RETCODE GCGconshdlrDecompCalcStrongDecompositionScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the strong decomposition score of a partialdec
Definition: cons_decomp.cpp:4523
SCIP_Bool GCGconshdlrDecompIsSelectedByPartialdecId(SCIP *scip, int id)
gets whether partialdec with given id is selected
Definition: cons_decomp.cpp:5658
DEC_VARCLASSIFIER * DECfindVarClassifier(SCIP *scip, const char *name)
searches for the varclassifier with the given name and returns it or NULL if classifier is not found
Definition: cons_decomp.cpp:2837
SCIP_RETCODE DECdetectStructure(SCIP *scip, SCIP_RESULT *result)
interface method to detect the structure including presolving
Definition: cons_decomp.cpp:2627
Definition: struct_consclassifier.h:43
int GCGconshdlrDecompGetNOpenConssByPartialdecId(SCIP *scip, int id)
gets number of open constraints of partialdec with given id
Definition: cons_decomp.cpp:5427
DEC_DETECTOR ** GCGconshdlrDecompGetDetectors(SCIP *scip)
Gets an array of all detectors.
Definition: cons_decomp.cpp:5238
SCIP_Bool GCGconshdlrDecompOrigPartialdecExists(SCIP *scip)
returns whether or not an original decompositions exists in the data structures
Definition: cons_decomp.cpp:5683
DEC_CONSCLASSIFIER * DECfindConsClassifier(SCIP *scip, const char *name)
searches for the consclassifier with the given name and returns it or NULL if classifier is not found
Definition: cons_decomp.cpp:2806
Definition: struct_detector.h:46
Definition: struct_varclassifier.h:43
int GCGconshdlrDecompGetNBlockNumberCandidates(SCIP *scip)
returns the number of block candidates given by the user
Definition: cons_decomp.cpp:5305
SCIP_RETCODE GCGconshdlrDecompClassify(SCIP *scip, SCIP_Bool transformed)
run classification of vars and cons
Definition: cons_decomp.cpp:4898
SCIP_RETCODE GCGconshdlrDecompCalcClassicScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the classic score of a partialdec
Definition: cons_decomp.cpp:4005
int GCGconshdlrDecompGetNOpenVarsByPartialdecId(SCIP *scip, int id)
gets number of open variables of partialdec with given id
Definition: cons_decomp.cpp:5438
int GCGconshdlrDecompAddMatrixPartialdec(SCIP *scip, SCIP_Bool presolved)
creates a pure matrix partialdecomp (i.e. all cons/vars to one single block)
Definition: cons_decomp.cpp:3490
SCIP_RETCODE DECincludeConsClassifier(SCIP *scip, const char *name, const char *description, int priority, SCIP_Bool enabled, DEC_CLASSIFIERDATA *classifierdata, DEC_DECL_FREECONSCLASSIFIER((*freeClassifier)), DEC_DECL_CONSCLASSIFY((*classify)))
includes one constraint classifier
SCIP_RETCODE DECgetPartialdecToWrite(SCIP *scip, SCIP_Bool transformed, PARTIALDECOMP_WRAPPER *partialdecwrapper)
Gets the currently considered best partialdec.
Definition: cons_decomp.cpp:2967
int GCGconshdlrDecompGetBlockNumberCandidate(SCIP *scip, int index)
returns block number user candidate with given index
Definition: cons_decomp.cpp:5164
int GCGconshdlrDecompGetNLinkingVarsByPartialdecId(SCIP *scip, int id)
gets number of linking variables of partialdec with given id
Definition: cons_decomp.cpp:5394
SCIP_Bool GCGdetectionTookPlace(SCIP *scip, SCIP_Bool original)
Definition: cons_decomp.cpp:5897
SCIP_RETCODE DECwriteAllDecomps(SCIP *scip, char *directory, char *extension, SCIP_Bool original, SCIP_Bool presolved)
write out all known decompositions
Definition: cons_decomp.cpp:3297
type definitions for constraints classifier in GCG projects
int GCGconshdlrDecompGetNDetectors(SCIP *scip)
Gets the number of all detectors.
Definition: cons_decomp.cpp:5348
void GCGconshdlrDecompFreeDetprobdata(SCIP *scip)
Frees Detprobdata of the original and transformed/presolved problem.
Definition: cons_decomp.cpp:5131
SCIP_Real DECgetRemainingTime(SCIP *scip)
returns the remaining time of scip that the decomposition may use
Definition: cons_decomp.cpp:2979
void GCGconshdlrDecompAddCandidatesNBlocks(SCIP *scip, SCIP_Bool origprob, int candidate)
adds a candidate for block number and counts how often a candidate is added
Definition: cons_decomp.cpp:3435
SCIP_RETCODE GCGconshdlrDecompCalcMaxWhiteScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the maximum white area score of a partialdec
Definition: cons_decomp.cpp:4397
#define DEC_DECL_POSTPROCESSPARTIALDEC(x)
Definition: type_detector.h:133
DEC_DECOMP * DECgetBestDecomp(SCIP *scip, SCIP_Bool printwarnings)
Gets the best known decomposition.
Definition: cons_decomp.cpp:2898
SCIP_RETCODE DECwriteSelectedDecomps(SCIP *scip, char *directory, char *extension)
writes all selected decompositions
Definition: cons_decomp.cpp:3367
Definition: wrapper_partialdecomp.h:47
void GCGconshdlrDecompSetScoretype(SCIP *scip, SCORETYPE sctype)
Sets the currently used scoretype.
Definition: cons_decomp.cpp:5796
void GCGconshdlrDecompAddUserCandidatesNBlocks(SCIP *scip, int candidate)
adds a candidate for block size given by the user
Definition: cons_decomp.cpp:3652
SCIP_RETCODE GCGconshdlrDecompCalcMaxForeseeingWhiteAggScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the maxforeseeingwhiteagg score of a partialdec
Definition: cons_decomp.cpp:4180
SCIP_RETCODE GCGconshdlrDecompPrintDetectorStatistics(SCIP *scip, FILE *file)
display statistics about detectors
Definition: cons_decomp.cpp:5711
int GCGconshdlrDecompIncreaseNCallsCreateDecomp(SCIP *scip)
counts up the counter for created decompositions and returns it
Definition: cons_decomp.cpp:5634
SCIP_RETCODE GCGconshdlrDecompCalcSetPartForWhiteAggScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the setpartfwhiteagg score of a partialdec
Definition: cons_decomp.cpp:4480
void DECprintListOfDetectors(SCIP *scip)
writes out a list of all detectors
Definition: cons_decomp.cpp:3271
unsigned int GCGconshdlrDecompGetNPartialdecsOrig(SCIP *scip)
Gets the number of partialdecs available for the original problem.
Definition: cons_decomp.cpp:5516
void GCGconshdlrDecompDeregisterPartialdecs(SCIP *scip, SCIP_Bool original)
deregisters partialdecs in the conshdlr
Definition: cons_decomp.cpp:5076
unsigned int GCGconshdlrDecompGetNFinishedPartialdecsOrig(SCIP *scip)
Gets the number of finished partialdecs available for the original problem.
Definition: cons_decomp.cpp:5449
int GCGconshdlrDecompAddBasicPartialdec(SCIP *scip, SCIP_Bool presolved)
creates and adds a basic partialdecomp (all cons/vars are assigned to master)
Definition: cons_decomp.cpp:3421
int GCGconshdlrDecompGetNBlocksByPartialdecId(SCIP *scip, int id)
gets block number of partialdec with given id
Definition: cons_decomp.cpp:5316
unsigned int GCGconshdlrDecompGetNFinishedPartialdecsTransformed(SCIP *scip)
Gets the number of finished partialdecs available for the transformed problem.
Definition: cons_decomp.cpp:5463
SCIP_RETCODE GCGconshdlrDecompGetPartialdecFromID(SCIP *scip, int partialdecid, PARTIALDECOMP_WRAPPER *pwr)
Gets wrapped PARTIALDECOMP with given id.
Definition: cons_decomp.cpp:5566
SCIP_RETCODE GCGconshdlrDecompTranslateNBestOrigPartialdecs(SCIP *scip, int n, SCIP_Bool completeGreedily)
translates n best unpresolved partialdec to a complete presolved one
Definition: cons_decomp.cpp:5808
SCIP_RETCODE DECincludeVarClassifier(SCIP *scip, const char *name, const char *description, int priority, SCIP_Bool enabled, DEC_CLASSIFIERDATA *classifierdata, DEC_DECL_FREEVARCLASSIFIER((*freeClassifier)), DEC_DECL_VARCLASSIFY((*classify)))
includes one variable classifier
SCIP_Bool GCGconshdlrDecompPresolvedDetprobdataExists(SCIP *scip)
returns whether or not a detprobdata structure for the presolved problem exists
Definition: cons_decomp.cpp:5697
type definitions for variable classifier in GCG projects
DEC_DECOMP ** GCGconshdlrDecompGetDecomps(SCIP *scip)
returns an array containing all decompositions
Definition: cons_decomp.cpp:5192
SCIP_Bool GCGconshdlrDecompOrigDetprobdataExists(SCIP *scip)
returns whether or not a detprobdata structure for the original problem exists
Definition: cons_decomp.cpp:5669
SCIP_RETCODE GCGconshdlrDecompCalcBorderAreaScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the border area score of a partialdec
Definition: cons_decomp.cpp:3849
SCIP_RETCODE GCGconshdlrDecompAddScoreTime(SCIP *scip, SCIP_Real time)
adds given time to total score calculation time
Definition: cons_decomp.cpp:3641
SCIP_RETCODE GCGconshdlrDecompSetDetection(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
sets detector parameters values
Definition: cons_decomp.cpp:5764
SCIP_RETCODE GCGconshdlrDecompGetSelectedPartialdecs(SCIP *scip, int **idlist, int *listlength)
Gets a list of ids of all currently selected partialdecs.
Definition: cons_decomp.cpp:5612
Definition: dec_compgreedily.cpp:73
int GCGconshdlrDecompGetNFormerDetectionConssForID(SCIP *scip, int id)
gets number of active constraints during the detection of the decomp with given id
Definition: cons_decomp.cpp:5374
SCORETYPE GCGconshdlrDecompGetScoretype(SCIP *scip)
Gets the currently selected scoretype.
Definition: cons_decomp.cpp:5601
SCIP_RETCODE GCGconshdlrDecompGetFinishedPartialdecsList(SCIP *scip, int **idlist, int *listlength)
Gets a list of ids of the current partialdecs that are finished.
Definition: cons_decomp.cpp:5277
float GCGconshdlrDecompGetScoreByPartialdecId(SCIP *scip, int id)
gets score of partialdec with given id
Definition: cons_decomp.cpp:5581
SCIP_Bool GCGconshdlrDecompCheckConsistency(SCIP *scip)
check whether partialdecs are consistent
Definition: cons_decomp.cpp:4766
SCIP_RETCODE GCGconshdlrDecompArePricingprobsIdenticalForPartialdecid(SCIP *scip, int partialdecid, int probnr1, int probnr2, SCIP_Bool *identical)
checks if two pricing problems are identical based on information from detection
Definition: cons_decomp.cpp:3673
const char * DECvarClassifierGetName(DEC_VARCLASSIFIER *classifier)
returns the name of the provided classifier
Definition: cons_decomp.cpp:2589
DEC_DETECTOR * DECfindDetector(SCIP *scip, const char *name)
searches for the detector with the given name and returns it or NULL if detector is not found
Definition: cons_decomp.cpp:2868
SCIP_Real GCGconshdlrDecompGetScoreTotalTime(SCIP *scip)
gets total score computation time
Definition: cons_decomp.cpp:5592
int GCGconshdlrDecompGetNextPartialdecID(SCIP *scip)
Gets the next partialdec id managed by cons_decomp.
Definition: cons_decomp.cpp:5359
void GCGconshdlrDecompCalcCandidatesNBlocks(SCIP *scip, SCIP_Bool transformed)
calculates and adds block size candidates using constraint classifications and variable classificatio...
Definition: cons_decomp.cpp:3882
const char * DECdetectorGetName(DEC_DETECTOR *detector)
returns the name of the provided detector
Definition: cons_decomp.cpp:2618
int GCGconshdlrDecompGetNMasterVarsByPartialdecId(SCIP *scip, int id)
gets number of master variables of partialdec with given id
Definition: cons_decomp.cpp:5416
SCIP_RETCODE GCGconshdlrDecompCalcBendersScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the benders score of a partialdec
Definition: cons_decomp.cpp:3705
int GCGconshdlrDecompDecreaseNCallsCreateDecomp(SCIP *scip)
decreases the counter for created decompositions and returns it
Definition: cons_decomp.cpp:5063
SCIP_RETCODE GCGconshdlrDecompCalcMaxForseeingWhiteScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the maximum foreseeing white area score of a partialdec
Definition: cons_decomp.cpp:4280