Loading...
Searching...
No Matches
cons_decomp.h
Go to the documentation of this file.
37 * This constraint handler manages the structure detection process. It will run all registered structure detectors in an
41/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
95 * @brief searches for the consclassifier with the given name and returns it or NULL if classifier is not found
105 * @brief searches for the varclassifier with the given name and returns it or NULL if classifier is not found
116 * @brief searches for the detector with the given name and returns it or NULL if detector is not found
136 * @brief searches for the score with the given name and returns it or NULL if score is not found
145 * @brief searches for the score with the given shortname and returns it or NULL if score is not found
183 GCG_CLASSIFIERDATA* classifierdata, /**< classifierdata the associated classifier data (or NULL) */
185 GCG_DECL_CONSCLASSIFY((*classify)) /**< the method that will classify constraints or variables (must not be NULL) */
198 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 */
201 int freqCallRoundOriginal, /**< frequency the detector gets called in detection loop while detecting of the original problem */
202 int maxCallRoundOriginal, /**< last round the detector gets called while detecting of the original problem */
203 int minCallRoundOriginal, /**< first round the detector gets called (offset in detection loop) while detecting of the original problem */
209 SCIP_Bool usefulRecall, /**< is it useful to call this detector on a descendant of the propagated partialdec */
214 GCG_DECL_PROPAGATEPARTIALDEC((*propagatePartialdecDetector)), /**< method to refine a partial decomposition inside detection loop (or NULL) */
215 GCG_DECL_FINISHPARTIALDEC((*finishPartialdecDetector)), /**< method to complete a partial decomposition when called in detection loop (or NULL) */
216 GCG_DECL_POSTPROCESSPARTIALDEC((*postprocessPartialdecDetector)), /**< method to postprocess a complete decomposition, called after detection loop (or NULL) */
217 GCG_DECL_SETPARAMAGGRESSIVE((*setParamAggressiveDetector)), /**< method that is called if the detection emphasis setting aggressive is chosen */
218 GCG_DECL_SETPARAMDEFAULT((*setParamDefaultDetector)), /**< method that is called if the detection emphasis setting default is chosen */
219 GCG_DECL_SETPARAMFAST((*setParamFastDetector)) /**< method that is called if the detection emphasis setting fast is chosen */
233 GCG_CLASSIFIERDATA* classifierdata,/**< classifierdata the associated classifier data (or NULL) */
235 GCG_DECL_VARCLASSIFY((*classify)) /**< method that will classify variables (must not be NULL) */
249 GCG_DECL_SCORECALC ((*scorecalc)) /**< method that will calculate the scorevalue (must not be NULL) */
295 SCIP_Bool presolved, /**< create basic partialdecomp for presolved if true, otherwise for original */
336 PARTIALDECOMP_C* partialdecomp, /**< partial decompostion for which the pricing problems are checked for identity */
343 * @brief calculates and adds block size candidates using constraint classifications and variable classifications
348 SCIP_Bool transformed /**< whether to find the candidates for the transformed problem, otherwise the original */
373 SCIP_Bool transformed /**< whether to classify the transformed problem, otherwise the original */
380 * @param partialdecomp partial decompostion for which the pricing problems are checked for identity
421 * @note Does not free Detprobdata of the original problem if GCGconshdlrDecompFreeOrigOnExit is set to false.
464 * Updates the decomp decomposition structure by converting all finished partialdecs into decompositions and replacing the
608 * Gets the number of constraints that were active while detecting the decomposition originating from the partialdec with the
609 * given id, this method is used to decide if the problem has changed since detection, if so the aggregation information
635 SCIP_Bool ignoreDetectionLimits /**< Set to true if computation should ignore detection limits. This parameter is ignored if the patched bliss version is not present. */
673/** @brief Returns a vector that maps probvar indices of a block contained in an equivalence class to the probvar indices of the representative block of the class
void GCGconshdlrDecompDeregisterPartialdecs(GCG *gcg, SCIP_Bool original)
deregisters partialdecs in the conshdlr
Definition cons_decomp.cpp:3755
SCIP_RETCODE GCGconshdlrDecompCreateVarmapForPartialdec(SCIP *scip, SCIP_HASHMAP **hashorig2pricingvar, PARTIALDECOMP_C *partialdecomp, int probnr1, int probnr2, SCIP *scip1, SCIP *scip2, SCIP_HASHMAP *varmap)
Definition cons_decomp.cpp:3639
SCIP_RETCODE GCGconshdlrDecompTranslateNBestOrigPartialdecs(GCG *gcg, int n, SCIP_Bool completeGreedily, SCIP_Bool translateSymmetry)
translates n best unpresolved partialdec to a complete presolved one
Definition cons_decomp.cpp:4629
SCIP_Bool GCGconshdlrDecompPartialdecAggregationInformationCalculated(PARTIALDECOMP_C *partialdecomp)
returns whether aggregation information has been calculated for a partialdec
Definition cons_decomp.cpp:4137
int GCGconshdlrDecompPartialdecGetReprBlockForEqClass(PARTIALDECOMP_C *partialdecomp, int eqclass)
gets the representative block of a equivalence class of partialdec
Definition cons_decomp.cpp:4168
int GCGconshdlrDecompPartialdecGetNMasterVars(PARTIALDECOMP_C *partialdecomp)
gets number of master variables of partialdec
Definition cons_decomp.cpp:4235
void GCGconshdlrDecompAddCandidatesNBlocks(GCG *gcg, SCIP_Bool origprob, int candidate)
adds a candidate for block number and counts how often a candidate is added
Definition cons_decomp.cpp:3035
SCIP_Real GCGconshdlrDecompGetCompleteDetectionTime(GCG *gcg)
returns the total detection time
Definition cons_decomp.cpp:3856
int GCGconshdlrDecompGetNBlockNumberCandidates(GCG *gcg)
returns the number of block candidates given by the user
Definition cons_decomp.cpp:4018
void GCGconshdlrDecompFreeOrigOnExit(GCG *gcg, SCIP_Bool free)
sets freeing of detection data of original problem during exit to true
Definition cons_decomp.cpp:3831
GCG_CONSCLASSIFIER * GCGfindConsClassifier(GCG *gcg, 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:2279
const char * GCGdetectorGetName(GCG_DETECTOR *detector)
returns the name of the provided detector
Definition cons_decomp.cpp:2084
GCG_VARCLASSIFIER * GCGfindVarClassifier(GCG *gcg, 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:2305
GCG_SCORE ** GCGconshdlrDecompGetScores(GCG *gcg)
Gets an array of all scores.
Definition cons_decomp.cpp:3928
SCIP_Bool GCGconshdlrDecompCheckConsistency(GCG *gcg)
check whether partialdecs are consistent
Definition cons_decomp.cpp:3443
SCIP_Real GCGconshdlrDecompAdaptScore(GCG *gcg, SCIP_Real oldscore)
method to adapt score for orig decomps
Definition cons_decomp.cpp:1528
int GCGconshdlrDecompGetNDetectors(GCG *gcg)
Gets the number of all detectors.
Definition cons_decomp.cpp:4061
int GCGconshdlrDecompGetNVarClassifiers(GCG *gcg)
Gets the number of all variable classifiers.
Definition cons_decomp.cpp:4081
const int * GCGconshdlrDecompPartialdecGetBlocksForEqClass(PARTIALDECOMP_C *partialdecomp, int eqclass)
gets the blocks of a equivalence class of partialdec
Definition cons_decomp.cpp:4179
SCIP_RETCODE GCGconshdlrDecompClassify(GCG *gcg, SCIP_Bool transformed)
run classification of vars and cons
Definition cons_decomp.cpp:3576
SCIP_RETCODE GCGwriteAllDecomps(GCG *gcg, char *directory, char *extension, SCIP_Bool original, SCIP_Bool presolved)
write out all known decompositions
Definition cons_decomp.cpp:2893
int GCGconshdlrDecompDecreaseNCallsCreateDecomp(GCG *gcg)
decreases the counter for created decompositions and returns it
Definition cons_decomp.cpp:3742
SCIP_RETCODE GCGconshdlrDecompTranslateOrigPartialdecs(GCG *gcg)
translates unpresolved partialdec to a complete presolved one
Definition cons_decomp.cpp:4680
void GCGconshdlrDecompCalcCandidatesNBlocks(GCG *gcg, SCIP_Bool transformed)
calculates and adds block size candidates using constraint classifications and variable classificatio...
Definition cons_decomp.cpp:3319
SCIP_RETCODE GCGconshdlrDecompAddPreexistingDecomp(GCG *gcg, GCG_DECOMP *decomp)
adds a decomp that exists before the detection is called
Definition cons_decomp.cpp:3112
int GCGconshdlrDecompPartialdecGetNEquivalenceClasses(PARTIALDECOMP_C *partialdecomp)
gets number of equivalence classes of partialdec
Definition cons_decomp.cpp:4158
SCIP_RETCODE GCGconshdlrDecompArePricingprobsIdenticalForPartialdec(SCIP *scip, PARTIALDECOMP_C *partialdecomp, int probnr1, int probnr2, SCIP_Bool *identical)
Definition cons_decomp.cpp:3286
SCIP_Real GCGgetRemainingTime(GCG *gcg)
returns the remaining time of scip that the decomposition may use
Definition cons_decomp.cpp:2480
const int * GCGconshdlrDecompPartialdecGetRepVarMap(PARTIALDECOMP_C *partialdecomp, int eqclass, int eqclassblock)
Returns a vector that maps probvar indices of a block contained in an equivalence class to the probva...
Definition cons_decomp.cpp:4201
SCIP_Bool GCGconshdlrDecompPresolvedDetprobdataExists(GCG *gcg)
returns whether or not a detprobdata structure for the presolved problem exists
Definition cons_decomp.cpp:4519
int GCGconshdlrDecompPartialdecGetNVarsForBlock(PARTIALDECOMP_C *partialdecomp, int block)
gets the number of variables of a block
Definition cons_decomp.cpp:4280
unsigned int GCGconshdlrDecompGetNFinishedPartialdecsOrig(GCG *gcg)
Gets the number of finished partialdecs available for the original problem.
Definition cons_decomp.cpp:4291
GCG_SCORE * GCGconshdlrDecompFindScoreByShortname(GCG *gcg, const char *shortname)
searches for the score with the given shortname and returns it or NULL if score is not found
Definition cons_decomp.cpp:2385
SCIP_Real GCGconshdlrDecompGetScoreTotalTime(GCG *gcg)
gets total score computation time
Definition cons_decomp.cpp:3254
SCIP_RETCODE GCGconshdlrDecompSetDetection(GCG *gcg, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
sets detector parameters values
Definition cons_decomp.cpp:4598
SCIP_RETCODE GCGwriteSelectedDecomps(GCG *gcg, char *directory, char *extension)
writes all selected decompositions
Definition cons_decomp.cpp:2964
int GCGconshdlrDecompPartialdecGetNMasterConss(PARTIALDECOMP_C *partialdecomp)
gets number of master constraints of partialdec
Definition cons_decomp.cpp:4224
GCG_VARCLASSIFIER ** GCGconshdlrDecompGetVarClassifiers(GCG *gcg)
gets an array of all variable classifier
Definition cons_decomp.cpp:3951
int GCGconshdlrDecompPartialdecGetNOpenConss(PARTIALDECOMP_C *partialdecomp)
gets number of open constraints of partialdec
Definition cons_decomp.cpp:4246
SCIP_VAR * GCGconshdlrDecompPartialdecGetOrigVarForBlock(PARTIALDECOMP_C *partialdecomp, int block, int blockvarindex)
returns the original variable for a block and index
Definition cons_decomp.cpp:4268
int GCGconshdlrDecompGetNextPartialdecID(GCG *gcg)
Gets the next partialdec id managed by cons_decomp.
Definition cons_decomp.cpp:4102
GCG_DETECTORDATA * GCGdetectorGetData(GCG_DETECTOR *detector)
returns the data of the provided detector
Definition cons_decomp.cpp:2075
void GCGconshdlrDecompFreeDetprobdata(GCG *gcg)
Frees Detprobdata of the original and transformed/presolved problem.
Definition cons_decomp.cpp:3810
GCG_SCORE * GCGgetCurrentScore(GCG *gcg)
Gets the currently enabled score.
Definition cons_decomp.cpp:2796
void GCGconshdlrDecompAddUserCandidatesNBlocks(GCG *gcg, int candidate)
adds a candidate for block size given by the user
Definition cons_decomp.cpp:3264
GCG_CONSCLASSIFIER ** GCGconshdlrDecompGetConsClassifiers(GCG *gcg)
gets an array of all constraint classifier
Definition cons_decomp.cpp:3940
SCIP_RETCODE GCGconshdlrDecompSelectPartialdec(PARTIALDECOMP_C *partialdecomp, SCIP_Bool select)
selects/unselects a partialdecomp
Definition cons_decomp.cpp:4584
SCIP_RETCODE GCGconshdlrDecompGetFinishedPartialdecsList(GCG *gcg, int **idlist, int *listlength)
Gets a list of ids of the current partialdecs that are finished.
Definition cons_decomp.cpp:3990
int GCGconshdlrDecompGetNConsClassifiers(GCG *gcg)
Gets the number of all constraint classifiers.
Definition cons_decomp.cpp:4071
unsigned int GCGconshdlrDecompGetNOpenPartialdecsTransformed(GCG *gcg)
Gets the number of open partialdecs available for the transformed problem.
Definition cons_decomp.cpp:4333
int GCGconshdlrDecompAddMatrixPartialdec(GCG *gcg, SCIP_Bool presolved)
creates a pure matrix partialdecomp (i.e. all cons/vars to one single block)
Definition cons_decomp.cpp:3068
SCIP_RETCODE GCGconshdlrDecompAddBasicPartialdec(GCG *gcg, SCIP_Bool presolved, PARTIALDECOMP_C **partialdecomp)
creates and adds a basic partialdecomp (all cons/vars are assigned to master)
Definition cons_decomp.cpp:3019
unsigned int GCGconshdlrDecompGetNPartialdecsTransformed(GCG *gcg)
Gets the number of partialdecs available for the transformed problem.
Definition cons_decomp.cpp:4372
SCIP_RETCODE GCGincludeVarClassifier(GCG *gcg, const char *name, const char *description, int priority, SCIP_Bool enabled, GCG_CLASSIFIERDATA *classifierdata, GCG_DECL_FREEVARCLASSIFIER((*freeClassifier)),)
includes one variable classifier
Definition cons_decomp.cpp:2730
SCIP_Bool GCGdetectionTookPlace(GCG *gcg, SCIP_Bool original)
Definition cons_decomp.cpp:4722
SCIP_Bool GCGconshdlrDecompOrigDetprobdataExists(GCG *gcg)
returns whether or not a detprobdata structure for the original problem exists
Definition cons_decomp.cpp:4491
SCIP_RETCODE GCGconshdlrDecompGetPartialdecsList(GCG *gcg, int **idlist, int *listlength)
Gets a list of ids of the current partialdecs.
Definition cons_decomp.cpp:4004
GCG_DETECTOR * GCGfindDetector(GCG *gcg, 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:2331
SCIP_RETCODE GCGincludeConshdlrDecomp(GCG *gcg)
creates the constraint handler for decomp and includes it in SCIP
Definition cons_decomp.cpp:4795
int GCGconshdlrDecompPartialdecGetNBlocks(PARTIALDECOMP_C *partialdecomp)
gets block number of partialdec
Definition cons_decomp.cpp:4029
SCIP_RETCODE GCGdetectStructure(GCG *gcg, SCIP_RESULT *result)
interface method to detect the structure including presolving
Definition cons_decomp.cpp:2093
SCIP_RETCODE GCGconshdlrDecompPrintDetectorStatistics(GCG *gcg, FILE *file)
display statistics about detectors
Definition cons_decomp.cpp:4533
int GCGconshdlrDecompGetNFormerDetectionConssForID(GCG *gcg, int id)
gets number of active constraints during the detection of the decomp with given id
Definition cons_decomp.cpp:4117
char * GCGgetCurrentScoreShortname(GCG *gcg)
Gets the shortname of the currently enabled score.
Definition cons_decomp.cpp:2783
char GCGdetectorGetChar(GCG_DETECTOR *detector)
Gets the character of the detector.
Definition cons_decomp.cpp:2064
int GCGconshdlrDecompPartialdecGetNBlocksForEqClass(PARTIALDECOMP_C *partialdecomp, int eqclass)
gets the number of blocks of a equivalence class of partialdec
Definition cons_decomp.cpp:4190
GCG_DECOMP ** GCGconshdlrDecompGetDecomps(GCG *gcg)
returns an array containing all decompositions
Definition cons_decomp.cpp:3871
unsigned int GCGconshdlrDecompGetNPartialdecsOrig(GCG *gcg)
Gets the number of partialdecs available for the original problem.
Definition cons_decomp.cpp:4358
SCIP_RETCODE SCIPconshdlrDecompRepairConsNames(GCG *gcg)
Definition cons_decomp.cpp:4734
int GCGconshdlrDecompGetNScores(GCG *gcg)
Gets the number of all scores.
Definition cons_decomp.cpp:4091
SCIP_RETCODE GCGconshdlrDecompIncludeScore(GCG *gcg, const char *name, const char *shortname, const char *description, GCG_SCOREDATA *scoredata, GCG_DECL_SCOREFREE((*scorefree)),)
includes one score
Definition cons_decomp.cpp:2822
int GCGconshdlrDecompPartialdecGetNOpenVars(PARTIALDECOMP_C *partialdecomp)
gets number of open variables of partialdec
Definition cons_decomp.cpp:4257
void GCGprintListOfDetectors(GCG *gcg)
writes out a list of all detectors
Definition cons_decomp.cpp:2864
int GCGconshdlrDecompGetNDecomps(GCG *gcg)
gets the number of decompositions (= amount of finished partialdecs)
Definition cons_decomp.cpp:4040
unsigned int GCGconshdlrDecompGetNFinishedPartialdecsTransformed(GCG *gcg)
Gets the number of finished partialdecs available for the transformed problem.
Definition cons_decomp.cpp:4305
int GCGconshdlrDecompIncreaseNCallsCreateDecomp(GCG *gcg)
counts up the counter for created decompositions and returns it
Definition cons_decomp.cpp:4456
SCIP_CLOCK * GCGconshdlrDecompGetScoreClock(GCG *gcg)
gets the clock tracking the score computation time
Definition cons_decomp.cpp:3245
int GCGconshdlrDecompPartialdecGetNLinkingVars(PARTIALDECOMP_C *partialdecomp)
gets number of linking variables of partialdec
Definition cons_decomp.cpp:4213
GCG_DECOMP * GCGgetBestDecomp(GCG *gcg, SCIP_Bool printwarnings)
Gets the best known decomposition.
Definition cons_decomp.cpp:2413
SCIP_Bool GCGconshdlrDecompOrigPartialdecExists(GCG *gcg)
returns whether or not an original decompositions exists in the data structures
Definition cons_decomp.cpp:4505
unsigned int GCGconshdlrDecompGetNOpenPartialdecsOrig(GCG *gcg)
Gets the number of open partialdecs available for the original problem.
Definition cons_decomp.cpp:4319
SCIP_RETCODE GCGincludeDetector(GCG *gcg, 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, GCG_DETECTORDATA *detectordata, GCG_DECL_FREEDETECTOR((*freeDetector)), GCG_DECL_INITDETECTOR((*initDetector)), GCG_DECL_EXITDETECTOR((*exitDetector)), GCG_DECL_PROPAGATEPARTIALDEC((*propagatePartialdecDetector)), GCG_DECL_FINISHPARTIALDEC((*finishPartialdecDetector)), GCG_DECL_POSTPROCESSPARTIALDEC((*postprocessPartialdecDetector)), GCG_DECL_SETPARAMAGGRESSIVE((*setParamAggressiveDetector)), GCG_DECL_SETPARAMDEFAULT((*setParamDefaultDetector)),)
includes one detector
Definition cons_decomp.cpp:2547
GCG_DETECTOR ** GCGconshdlrDecompGetDetectors(GCG *gcg)
Gets an array of all detectors.
Definition cons_decomp.cpp:3917
unsigned int GCGconshdlrDecompGetNPartialdecs(GCG *gcg)
Gets the number of all partialdecs.
Definition cons_decomp.cpp:4347
GCG_SCORE * GCGconshdlrDecompFindScore(GCG *gcg, const char *name)
searches for the score with the given name and returns it or NULL if score is not found
Definition cons_decomp.cpp:2357
int GCGconshdlrDecompPartialdecGetNStairlinkingVars(PARTIALDECOMP_C *partialdecomp)
gets number of stairlinking variables of partialdec
Definition cons_decomp.cpp:4386
SCIP_RETCODE GCGconshdlrDecompPrintScoreStatistics(GCG *gcg, FILE *file)
display statistics about scores
Definition cons_decomp.cpp:4555
void GCGconshdlrDecompPartialdecCalcAggregationInformation(PARTIALDECOMP_C *partialdecomp, SCIP_Bool ignoreDetectionLimits)
calculates aggregation information for a partialdec
Definition cons_decomp.cpp:4147
SCIP_RETCODE GCGconshdlrDecompGetSelectedPartialdecs(GCG *gcg, int **idlist, int *listlength)
Gets a list of ids of all currently selected partialdecs.
Definition cons_decomp.cpp:4434
SCIP_RETCODE GCGincludeConsClassifier(GCG *gcg, const char *name, const char *description, int priority, SCIP_Bool enabled, GCG_CLASSIFIERDATA *classifierdata, GCG_DECL_FREECONSCLASSIFIER((*freeClassifier)),)
includes one constraint classifier
Definition cons_decomp.cpp:2494
int GCGconshdlrDecompGetBlockNumberCandidate(GCG *gcg, int index)
returns block number user candidate with given index
Definition cons_decomp.cpp:3843
PARTIALDECOMP * GCGconshdlrDecompGetPartialdecFromID(GCG *gcg, int partialdecid)
local method to find a partialdec for a given id or NULL if no partialdec with such id is found
Definition cons_decomp.cpp:281
GCG_EXPORT SCIP_Real GCGconshdlrDecompGetPartialdecScore(PARTIALDECOMP_C *partialdecomp)
gets score of partialdec
GCG_EXPORT SCIP_Bool GCGconshdlrDecompPartialdecIsPresolved(PARTIALDECOMP_C *partialdecomp)
gets whether partialdec is presolved
GCG_EXPORT SCIP_Bool GCGconshdlrDecompPartialdecIsSelected(PARTIALDECOMP_C *partialdececomp)
gets whether partialdec is selected
#define SCIP_Bool
#define SCIP_Real
GCG interface methods.
Definition class_conspartition.cpp:44
struct SCIP_Clock SCIP_CLOCK
#define GCG_DECL_FREECONSCLASSIFIER(x)
Definition type_consclassifier.h:52
#define GCG_DECL_POSTPROCESSPARTIALDEC(x)
Definition type_detector.h:135
struct SCIP_HashMap SCIP_HASHMAP
enum SCIP_ParamSetting SCIP_PARAMSETTING
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
struct SCIP_Var SCIP_VAR