cons_decomp.cpp
Go to the documentation of this file.
37 * This constraint handler will run all registered structure detectors in a loop. They will find partial decompositions in a loop iteration until the decompositions are full
42 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
79 #define CONSHDLR_DESC "constraint handler for structure detection" /**< description of constraint handler */
80 #define CONSHDLR_ENFOPRIORITY 0 /**< priority of the constraint handler for constraint enforcing */
81 #define CONSHDLR_CHECKPRIORITY 0 /**< priority of the constraint handler for checking feasibility */
82 #define CONSHDLR_EAGERFREQ -1 /**< frequency for using all instead of only the useful constraints in separation,
84 #define CONSHDLR_NEEDSCONS FALSE /**< should the constraint handler be skipped, if no constraints are available? */
88 #define DEFAULT_DUALVALRANDOMMETHOD 1 /**< default value for method to dual initialization of dual values for strong decomposition: 1) naive, 2) expected equal, 3) expected overestimation */
89 #define DEFAULT_COEFFACTORORIGVSRANDOM 0.5 /**< default value for convex coefficient for orig dual val (1-this coef is factor for random dual value) */
91 #define DEFAULT_BLOCKNUMBERCANDSMEDIANVARSPERCONS FALSE /**< should for block number candidates calculation the medianvarspercons calculation be considered */
96 #define DEFAULT_MAXNCLASSESLARGEPROBS 5 /**< maximum number of classes allowed for large (nvars+nconss > 50000) MIPs for detectors, partitions with more classes are reduced to the maximum number of classes */
97 #define DEFAULT_MAXNCLASSES 9 /**< maximum number of classes allowed for detectors, partitions with more classes are reduced to the maximum number of classes */
98 #define DEFAULT_MAXNCLASSESFORNBLOCKCANDIDATES 18 /**< maximum number of classes a partition can have to be used for voting nblockcandidates */
99 #define DEFAULT_ENABLEORIGDETECTION TRUE /**< indicates whether to start detection for the original problem */
103 #define DEFAULT_ALLOWPARTITIONDUPLICATES FALSE /**< if false each new (conss- and vars-) partitions is checked for being a duplicate of an existing one, if so it is not added and NBOT statistically recognized*/
105 #define DEFAULT_ENABLEORIGCLASSIFICATION TRUE /**< indicates whether to start detection for the original problem */
107 #define DEFAULT_AGGREGATIONLIMITNCONSSPERBLOCK 300 /**< if this limit on the number of constraints of a block is exceeded the aggregation information for this block is not calculated */
108 #define DEFAULT_AGGREGATIONLIMITNVARSPERBLOCK 300 /**< if this limit on the number of variables of a block is exceeded the aggregation information for this block is not calculated */
110 #define DEFAULT_BENDERSONLYCONTSUBPR FALSE /**< indicates whether only decomposition with only continuous variables in the subproblems should be searched*/
111 #define DEFAULT_BENDERSONLYBINMASTER FALSE /**< indicates whether only decomposition with only binary variables in the master should be searched */
113 #define DEFAULT_LEVENSHTEIN_MAXMATRIXHALFPERIMETER 10000 /**< deactivate levenshtein constraint classifier if nrows + ncols exceeds this value for emphasis default */
114 #define AGGRESSIVE_LEVENSHTEIN_MAXMATRIXHALFPERIMETER 80000 /**< deactivate levenshtein constraint classifier if nrows + ncols exceeds this value for emphasis aggressive */
115 #define FAST_LEVENSHTEIN_MAXMATRIXHALFPERIMETER 2000 /**< deactivate levenshtein constraint classifier if nrows + ncols exceeds this value for emphasis fast */
122 #define DEFAULT_STRONGTIMELIMIT 30. /**< timelimit for strong decompotition score calculation per partialdec */
124 #define DEFAULT_SCORECOEF_FASTBENEFICIAL 1. /**< coefficient for fast & beneficial in strong decomposition score computation */
125 #define DEFAULT_SCORECOEF_MEDIUMBENEFICIAL 0.75 /**< coefficient for not fast but beneficial in strong decomposition score computation */
126 #define DEFAULT_SCORECOEF_FASTNOTBENEFICIAL 0.3 /**< coefficient for fast & not beneficial in strong decomposition score computation */
127 #define DEFAULT_SCORECOEF_MEDIUMNOTBENEFICIAL 0.1 /**< coefficient for not & not beneficial in strong decomposition score computation */
139 std::unordered_map<int, PARTIALDECOMP*>* partialdecsbyid; /**< list of all existing partialdecs */
140 int partialdeccounter; /**< counts the number of created partialdecs, used to determine next partialdec id
155 DEC_DETECTOR** propagatingdetectors; /**< array of detectors able to propagate partial decompositions */
156 int npropagatingdetectors; /**< number of detectors able to propagate partial decompositions (size of propagatingdetectors) */
157 DEC_DETECTOR** finishingdetectors; /**< array of detectors able to finish partial decompositions */
158 int nfinishingdetectors; /**< number of detectors able to finish partial decompositions (size of finishingdetectors) */
159 DEC_DETECTOR** postprocessingdetectors; /**< array of detectors able to postprocess decompositions */
160 int npostprocessingdetectors; /**< number of detectors able to postprocess decompositions (size of postprocessingdetectors) */
164 SCIP_Bool hasrunoriginal; /**< flag to indicate whether we have already detected (original problem) */
169 int strongdetectiondualvalrandommethod; /**< method to dual initialization of dual values for strong decomposition: 1) naive, 2) expected equal, 3) expected overestimation */
170 SCIP_Real coeffactororigvsrandom; /**< convex coefficient for orig dual val (1-this coef is factor for random dual value) */
171 SCIP_Bool blocknumbercandsmedianvarspercons; /**< should for block number candidates calculation the medianvarspercons calculation be considered */
172 int maxnclassesfornblockcandidates; /**< maximum number of classes a partition can have to be used for voting nblockcandidates */
173 int maxnclassesperpartition; /**< maximum number of classes allowed for detectors, partition with more classes are reduced to the maximum number of classes */
174 int maxnclassesperpartitionforlargeprobs; /**< maximum number of classes allowed for large (nvars+nconss > 50000) MIPs for detectors, partition with more classes are reduced to the maximum number of classes */
175 int weightinggpresolvedoriginaldecomps; /**< weighing method for comparing presolved and original decompositions (see corresponding enum) */
176 int aggregationlimitnconssperblock; /**< if this limit on the number of constraints of a block is exceeded the aggregation information for this block is not calculated */
177 int aggregationlimitnvarsperblock; /**< if this limit on the number of variables of a block is exceeded the aggregation information for this block is not calculated */
180 SCIP_Bool allowpartitionduplicates; /**< indicates whether partition duplicates are allowed (for statistical reasons) */
181 SCIP_Bool enableorigdetection; /**< indicates whether to start detection for the original problem */
182 SCIP_Bool enableorigclassification; /**< indicates whether to start constraint classification for the original problem */
184 SCIP_Bool bendersonlycontsubpr; /**< indicates whether only decomposition with only continuous variables in the subproblems should be searched*/
185 SCIP_Bool bendersonlybinmaster; /**< indicates whether only decomposition with only binary variables in the master should be searched */
188 int ncallscreatedecomp; /**< debugging method for counting the number of calls of created decompositions */
190 gcg::DETPROBDATA* detprobdatapres; /**< detprobdata containing data for the presolved transformed problem */
194 int currscoretype; /**< indicates which score should be used for comparing (partial) decompositions
205 std::vector<SCIP_Real>* dualvalsrandom; /**< vector of random dual values, used for strong detection scores */
206 std::vector<SCIP_Real>* dualvalsoptimaloriglp; /**< vector of dual values of the optimal solved original lp, used for strong detection scores */
207 SCIP_Bool dualvalsoptimaloriglpcalculated; /**< are the optimal dual values from original lp calulated? used for strong detection scores */
208 SCIP_Bool dualvalsrandomset; /**< are the random dual values set, used for strong detection scores */
209 SCIP_Real strongtimelimit; /**< timelimit for calculating strong decomposition score for one partialdec */
211 PARTIALDECOMP* partialdectowrite; /**< pointer enabling the use of SCIPs writeProb/writeTransProb function for writing partial decompositions*/
214 std::vector<int>* userblocknrcandidates; /**< vector to store block number candidates that were given by user */
215 SCIP_Bool freeorig; /**< help bool to notify a nonfinal free transform (needed if presolving is revoked, e.g. if orig decomposition is used, and transformation is not successful) */
219 // TODO ref add comments! this is used in strong decomposition score calculation in @see shuffleDualvalsRandom()
229 /** parameter how to modify scores when comparing decompositions for original and presolved problem
233 FRACTION_OF_NNONZEROS, /**< scores are weighted according to ratio of number nonzeros, the more the worse */
234 FRACTION_OF_NROWS, /**< scores are weighted according to ratio of number rows, the more the worse */
235 FAVOUR_PRESOLVED /**< decompositions for presolved problems are always favoured over decompositions of original problem */
241 bool operator()(const std::pair<PARTIALDECOMP*, SCIP_Real> &left, const std::pair<PARTIALDECOMP*, SCIP_Real> &right) {
311 SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "Decomposition to add is already known to gcg!\n");
397 * method to unselect all decompositions, called in consexit, and when the partialdeclist is updated
455 // for the orig detprobdata, reset only the current partialdecs as the rest will stay the same in any case
505 gcg::DETPROBDATA *detprobdata /**< detprobdata for problem the detection should be performed on */
551 PARTIALDEC_DETECTION_DATA* partialdecdetdata = createPartialdecDetectionData(detprobdata, partialdec);
604 PARTIALDEC_DETECTION_DATA *finishingdata = createPartialdecDetectionData(detprobdata, partialdecomp);
605 SCIP_CALL( finishingdetector->finishPartialdec(scip, finishingdetector, finishingdata, &result) );
646 PARTIALDEC_DETECTION_DATA* partialdecdetdata = createPartialdecDetectionData(detprobdata, postpartialdec);
648 SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "call finisher for detector %s \n", DECdetectorGetName( postdetector ) );
651 SCIP_CALL( postdetector->postprocessPartialdec( scip, postdetector, partialdecdetdata, &result ) );
676 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "POSTPROCESSING of decompositions. Added %d new decomps. \n", numpostprocessed);
736 /** @brief initialization method of constraint handler (called after problem was transformed) */
769 /** @brief deinitialization method of constraint handler (called before transformed problem is freed) */
822 /** @brief destructor of constraint handler to free constraint handler data (called when SCIP is exiting) */
952 * @brief finds a non duplicate constraint name of the form c_{a} with minimal natural number {a}
967 /* terminates since there are only finitely many constraints and i (for c_i) increases every iteration */
1004 DETPROBDATA* detprobdata = decomp->presolved ? GCGconshdlrDecompGetDetprobdataPresolved(scip) : GCGconshdlrDecompGetDetprobdataOrig(scip);
1024 nblock = (int) (size_t) SCIPhashmapGetImage(constoblock, (void*) (size_t) detprobdata->getCons(c));
1144 std::vector<SCIP_Bool> isblockdeleted = std::vector<SCIP_Bool>(partialdec->getNBlocks(), FALSE);
1197 SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "All blocks have been deleted since only deleted constraints are contained, no reformulation is done.\n");
1206 SCIP_CALL_ABORT( SCIPallocBufferArray( scip, &nsubscipconss, partialdec->getNBlocks() - ndeletedblocks ) );
1207 SCIP_CALL_ABORT( SCIPallocBufferArray( scip, &subscipconss, partialdec->getNBlocks() - ndeletedblocks ) );
1209 SCIP_CALL_ABORT( SCIPhashmapCreate( &constoblock, SCIPblkmem( scip ), partialdec->getNConss() ) );
1210 SCIP_CALL_ABORT( SCIPhashmapCreate( &consindex, SCIPblkmem( scip ), partialdec->getNConss() ) );
1230 SCIP_CALL_ABORT( SCIPhashmapInsert( constoblock, scipcons, (void*) ( size_t )( partialdec->getNBlocks() + 1 - ndeletedblocks ) ) );
1247 SCIP_CALL_ABORT( SCIPallocBufferArray( scip, & subscipconss[b-ndeletedblocksbefore[b]], partialdec->getNConssForBlock( b ) ) );
1265 SCIPdebugMessage("Set cons %s to block %d + 1 - %d in cons to block\n", SCIPconsGetName(scipcons), b, ndeletedblocksbefore[b] );
1266 SCIP_CALL_ABORT( SCIPhashmapInsert( constoblock, scipcons, (void*) ( size_t )( b + 1 - ndeletedblocksbefore[b] ) ) );
1281 SCIP_CALL_ABORT( SCIPhashmapInsert( constoblock, scipcons, (void*) ( size_t )( partialdec->getNBlocks() + 1 - ndeletedblocks ) ) );
1294 SCIP_CALL_ABORT( SCIPallocBufferArray( scip, & nsubscipvars, partialdec->getNBlocks() - ndeletedblocks ) );
1295 SCIP_CALL_ABORT( SCIPallocBufferArray( scip, & subscipvars, partialdec->getNBlocks() - ndeletedblocks ) );
1296 SCIP_CALL_ABORT( SCIPallocBufferArray( scip, & nstairlinkingvars, partialdec->getNBlocks() - ndeletedblocks ) );
1297 SCIP_CALL_ABORT( SCIPallocBufferArray( scip, & stairlinkingvars, partialdec->getNBlocks() -ndeletedblocks ) );
1299 SCIP_CALL_ABORT( SCIPhashmapCreate( & vartoblock, SCIPblkmem( scip ), partialdec->getNVars() + (int) origfixedtozerovars.size() ) );
1300 SCIP_CALL_ABORT( SCIPhashmapCreate( & varindex, SCIPblkmem( scip ), partialdec->getNVars() + (int) origfixedtozerovars.size()) );
1303 nlinkingvars = partialdec->getNLinkingvars() + partialdec->getNMastervars() + partialdec->getNTotalStairlinkingvars() + nmastervarsfromdeleted + (int) origfixedtozerovars.size();
1317 SCIPdebugMessage( "Set var %s to block %d + 2 - %d in var to block\n", SCIPvarGetName(scipvar), partialdec->getNBlocks(), ndeletedblocks );
1318 SCIP_CALL_ABORT( SCIPhashmapInsert( vartoblock, scipvar, (void*) ( size_t )( partialdec->getNBlocks() + 2 - ndeletedblocks ) ) );
1328 SCIP_CALL_ABORT( SCIPhashmapInsert( vartoblock, scipvar, (void*) ( size_t )( partialdec->getNBlocks() + 1 - ndeletedblocks) ) );
1339 SCIP_CALL_ABORT( SCIPhashmapInsert( vartoblock, var, (void*) ( size_t )( partialdec->getNBlocks() + 1 - ndeletedblocks) ) );
1349 linkingvars[partialdec->getNMastervars() + partialdec->getNLinkingvars() + nmastervarsfromdeleted + v] = var;
1350 SCIP_CALL_ABORT( SCIPhashmapInsert( vartoblock, var, (void*) ( size_t )( partialdec->getNBlocks() + 1 - ndeletedblocks) ) );
1362 SCIP_CALL_ABORT( SCIPallocBufferArray( scip, & subscipvars[b -ndeletedblocksbefore[b]], partialdec->getNVarsForBlock( b ) ) );
1367 SCIP_CALL_ABORT( SCIPallocBufferArray( scip, & stairlinkingvars[b-ndeletedblocksbefore[b]], partialdec->getNStairlinkingvars( b ) ) );
1381 SCIPdebugMessage("Set var %s to block %d + 1 - %d in var to block\n", SCIPvarGetName(scipvar), b, ndeletedblocksbefore[b] );
1382 assert( !SCIPhashmapExists(vartoblock, scipvar) || SCIPhashmapGetImage(vartoblock, scipvar) == (void*) ( size_t )( b + 1 - ndeletedblocksbefore[b] ) );
1383 SCIP_CALL_ABORT( SCIPhashmapInsert( vartoblock, scipvar, (void*) ( size_t )( b + 1 - ndeletedblocksbefore[b] ) ) );
1395 linkingvars[partialdec->getNLinkingvars() + partialdec->getNMastervars() + nmastervarsfromdeleted + counterstairlinkingvars] = scipvar;
1396 SCIP_CALL_ABORT( SCIPhashmapInsert( vartoblock, scipvar, (void*) ( size_t )( partialdec->getNBlocks() + 2 - ndeletedblocks) ) );
1409 SCIP_CALL_ABORT( SCIPhashmapInsert( vartoblock, scipvar, (void*) ( size_t )( partialdec->getNBlocks() + 1 - ndeletedblocks) ) );
1417 DECdecompSetLinkingvars( scip, *newdecomp, linkingvars, nlinkingvars, (int) origfixedtozerovars.size(), partialdec->getNMastervars() + nmastervarsfromdeleted );
1458 DECdecompSetDetectorChain(scip, (*newdecomp), partialdec->getDetectorchain().data(), (int) partialdec->getDetectorchain().size());
1469 DECdecompSetDetectorPctVarsToBorder(scip, *newdecomp, partialdec->getPctVarsToBorderVector().data());
1470 DECdecompSetDetectorPctVarsToBlock(scip, *newdecomp, partialdec->getPctVarsToBlockVector().data());
1471 DECdecompSetDetectorPctVarsFromOpen(scip, *newdecomp, partialdec->getPctVarsFromFreeVector().data());
1472 DECdecompSetDetectorPctConssToBorder(scip, *newdecomp, partialdec->getPctConssToBorderVector().data());
1473 DECdecompSetDetectorPctConssToBlock(scip, *newdecomp, partialdec->getPctConssToBlockVector().data());
1474 DECdecompSetDetectorPctConssFromOpen(scip, *newdecomp, partialdec->getPctConssFromFreeVector().data());
1482 if( newnlinkingvars == partialdec->getNTotalStairlinkingvars() && newnlinkingconss == 0 && newnlinkingvars > 0 )
1532 std::sort(conshdlrdata->partialdecs->begin(), conshdlrdata->partialdecs->end(), [&](PARTIALDECOMP* a, PARTIALDECOMP* b) {return (a->getScore(sctype) > b->getScore(sctype)); });
1552 SCIP_CALL(SCIPgetIntParam(scip, "detection/origprob/weightinggpresolvedoriginaldecomps", &method) );
1559 score *= (SCIP_Real) conshdlrdata->detprobdataorig->getNNonzeros() / conshdlrdata->detprobdatapres->getNNonzeros();
1567 score *= (SCIP_Real) conshdlrdata->detprobdataorig->getNConss() / conshdlrdata->detprobdatapres->getNConss();
1583 gcg::DETPROBDATA* detprobdata /**< classification is for problem to which these data correspond */
1597 ConsPartition* newpartition = detprobdata->getConsPartition(partitionid)->reduceClasses(maxnclasses);
1601 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, " Added reduced version of conspartition %s with %d different constraint classes \n",
1613 gcg::DETPROBDATA *detprobdata /**< classification is for problem to which these data correspond */
1627 VarPartition* newpartition = detprobdata->getVarPartition(partitionid)->reduceClasses(maxnclasses);
1631 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, " Added reduced version of varpartition %s with %d different variable classes\n",
1673 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/nnonzeros/enabled", TRUE) );
1674 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/scipconstype/enabled", TRUE) );
1675 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/miplibconstype/enabled", TRUE) );
1676 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/consnamenonumbers/enabled", TRUE) );
1678 if( SCIPgetStage(scip) >= SCIP_STAGE_PROBLEM && SCIPgetNVars(scip) + SCIPgetNConss(scip) < DEFAULT_LEVENSHTEIN_MAXMATRIXHALFPERIMETER )
1679 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/consnamelevenshtein/enabled", TRUE) );
1681 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/consnamelevenshtein/enabled", FALSE) );
1702 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "%s = %s\n", paramname, paramval == TRUE ? "TRUE" : "FALSE");
1707 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "%s = %s\n", paramname, paramval == TRUE ? "TRUE" : "FALSE");
1737 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/nnonzeros/enabled", TRUE) );
1738 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/scipconstype/enabled", TRUE) );
1739 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/miplibconstype/enabled", TRUE) );
1740 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/consnamenonumbers/enabled", TRUE) );
1742 if( SCIPgetStage(scip) >= SCIP_STAGE_PROBLEM && SCIPgetNVars(scip) + SCIPgetNConss(scip) < AGGRESSIVE_LEVENSHTEIN_MAXMATRIXHALFPERIMETER)
1743 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/consnamelevenshtein/enabled", TRUE) );
1745 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/consnamelevenshtein/enabled", FALSE) );
1763 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "%s = %s\n", paramname, paramval == TRUE ? "TRUE" : "FALSE");
1768 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "%s = %s\n", paramname, paramval == TRUE ? "TRUE" : "FALSE");
1795 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "detection/detectors/%s/enabled", conshdlrdata->detectors[i]->name);
1807 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "detection/detectors/%s/finishingenabled", conshdlrdata->detectors[i]->name);
1819 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "detection/detectors/%s/postprocessingenabled", conshdlrdata->detectors[i]->name);
1854 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/nnonzeros/enabled", TRUE) );
1855 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/scipconstype/enabled", TRUE) );
1856 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/miplibconstype/enabled", TRUE) );
1857 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/consnamenonumbers/enabled", TRUE) );
1859 if( SCIPgetStage(scip) >= SCIP_STAGE_PROBLEM && SCIPgetNVars(scip) + SCIPgetNConss(scip) < FAST_LEVENSHTEIN_MAXMATRIXHALFPERIMETER )
1860 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/consnamelevenshtein/enabled", TRUE) );
1862 SCIP_CALL(SCIPsetBoolParam(scip, "detection/classification/consclassifier/consnamelevenshtein/enabled", FALSE) );
1882 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "%s = %s\n", paramname, paramval == TRUE ? "TRUE" : "FALSE");
1887 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "%s = %s\n", paramname, paramval == TRUE ? "TRUE" : "FALSE");
1917 SCIP_Real infinity, /**< values larger than this are considered infinity in the pricing problem */
1918 SCIP_Real epsilon, /**< absolute values smaller than this are considered zero in the pricing problem */
1919 SCIP_Real sumepsilon, /**< absolute values of sums smaller than this are considered zero in the pricing problem */
1922 SCIP_Real dualfeastol, /**< feasibility tolerance for reduced costs in LP solution in the pricing problem */
1950 /* disable dual fixing presolver for the moment, because we want to avoid variables fixed to infinity */
2010 * @brief method to calculate and set the optimal dual values from original lp, used for strong detection score
2027 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "started calculating optimal dual values for original lp\n");
2078 DETPROBDATA* detprobdata = (transformed) ? conshdlrdata->detprobdatapres : conshdlrdata->detprobdataorig;
2094 SCIPwarningMessage(scip, "Could not find constraint for random dual variable initialization when calculating strong decomposition score; skipping cons: %s \n", SCIPconsGetName(cons));
2110 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "optimal dual sol of constraint %s is %f \n", SCIPconsGetName(cons), (*conshdlrdata->dualvalsoptimaloriglp)[c]);
2113 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "finished calculating optimal dual values for original lp, start freeing\n");
2125 * @brief method that shuffles randomly and set dual variable values, used for strong detection score
2151 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "set dual val random method to %d. \n", method );
2160 DETPROBDATA* detprobdata = (transformed) ? conshdlrdata->detprobdatapres : conshdlrdata->detprobdataorig;
2206 else if( usedmethod == GCG_RANDOM_DUAL_EXPECTED_EQUAL || usedmethod == GCG_RANDOM_DUAL_EXPECTED_OVERESTIMATE)
2288 * @brief returns the value of the optimal lp relaxation dual value of the given constrainr rid correspondoning problem of the detprobdata; if it is not calculated yet it will be calculated
2289 * @returns the value of the optimal lp relaxation dual value of the given constraint rid correspondoning problem of the detprobdata
2309 * @brief return the a random value of the dual variable of the corresponding ; if it is not calculated yet it will be calculated
2338 SCIP_HASHMAP* hashorig2pricingvar /**< hashmap mapping original to corresponding pricing variables */
2351 SCIP_CALL( SCIPhashmapCreate(&hashorig2pricingconstmp, SCIPblkmem(scip), detprobdata->getNConss() ) ); /*lint !e613*/
2426 matrixarea = (unsigned long) partialdec->getNVars() * (unsigned long) partialdec->getNConss() ;
2431 blockarea += (unsigned long) partialdec->getNConssForBlock(i) * ( (unsigned long) partialdec->getNVarsForBlock(i) );
2434 SCIP_Real blockareascore = 1. - (matrixarea == 0 ? 0 : ( (SCIP_Real) blockarea / (SCIP_Real) matrixarea ));
2456 detprobdata = (conshdlrdata->detprobdatapres == NULL ? conshdlrdata->detprobdataorig : conshdlrdata->detprobdatapres );
2459 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), NULL, "No block number candidates are calculated yet, consider detecting first.. \n" );
2474 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(givenscip), file, "%f \n", (SCIP_Real) GCGconshdlrDecompGetCompleteDetectionTime(givenscip) );
2490 detprobdata = (conshdlrdata->detprobdatapres == NULL ? conshdlrdata->detprobdataorig : conshdlrdata->detprobdatapres );
2525 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), file, "%d\n", (*partialdeciter)->getNBlocks());
2529 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), file, "%d\n", partialdec->getNConssForBlock(block));
2530 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), file, "%d\n", partialdec->getNVarsForBlock(block));
2535 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), file, "%d\n", partialdec->getNTotalStairlinkingvars());
2537 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), file, "%f\n", partialdec->getScore(scoretype::CLASSIC));
2538 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), file, "%f\n", partialdec->getScore(scoretype::MAX_FORESSEEING_WHITE));
2539 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), file, "%d\n", partialdec->hasSetppccardMaster());
2540 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), file, "%d\n", (int) partialdec->getDetectorchain( ).size());
2681 SCIPdebugMessage("is stage < transformed ? %s -> do %s transformProb() ", (SCIPgetStage(scip) < SCIP_STAGE_TRANSFORMED ? "yes" : "no"), (SCIPgetStage(scip) < SCIP_STAGE_TRANSFORMED ? "" : "not") );
2703 SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "start finding decompositions for original problem!\n");
2708 SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "finished finding decompositions for original problem!\n");
2715 std::vector<gcg::PARTIALDECOMP*> partialdecsorig(0); /* partialdecs that were found for the orig problem */
2729 if( SCIPgetStage(scip) == SCIP_STAGE_INIT || SCIPgetNVars(scip) == 0 || SCIPgetNConss(scip) == 0 )
2731 SCIPverbMessage(scip, SCIP_VERBLEVEL_DIALOG, NULL, "No problem exists, cannot detect structure!\n");
2753 conshdlrdata->detprobdatapres->addCandidatesNBlocksNVotes(candidatesNBlock.first, candidatesNBlock.second);
2779 if( conshdlrdata->detprobdatapres != NULL && conshdlrdata->detprobdatapres->getNFinishedPartialdecs() > 0 )
2782 if( conshdlrdata->detprobdataorig != NULL && conshdlrdata->detprobdataorig->getNFinishedPartialdecs() > 0 )
2785 SCIPdebugMessage("Detection took %fs\n", SCIPgetClockTime( scip, conshdlrdata->detectorclock));
2791 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "Detection Time: %.2f\n", GCGconshdlrDecompGetCompleteDetectionTime(scip));
3027 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/classification/consclassifier/%s/enabled", name);
3028 (void) SCIPsnprintf(descstr, SCIP_MAXSTRLEN, "flag to indicate whether constraint classifier for <%s> is enabled", description);
3029 SCIP_CALL( SCIPaddBoolParam(scip, setstr, descstr, &(classifier->enabled), FALSE, enabled, NULL, NULL) );
3031 SCIP_CALL( SCIPreallocMemoryArray(scip, &conshdlrdata->consclassifiers, (size_t)conshdlrdata->nconsclassifiers+1) );
3032 SCIP_CALL( SCIPreallocMemoryArray(scip, &conshdlrdata->consclassifierpriorities,(size_t) conshdlrdata->nconsclassifiers+1) );
3097 SCIP_ALLOC( BMSduplicateMemoryArray(&detector->description, description, strlen(description)+1) );
3133 (void) SCIPsnprintf(descstr, SCIP_MAXSTRLEN, "flag to indicate whether detector <%s> is enabled", name);
3134 SCIP_CALL( SCIPaddBoolParam(scip, setstr, descstr, &(detector->enabled), FALSE, enabled, NULL, NULL) );
3137 (void) SCIPsnprintf(descstr, SCIP_MAXSTRLEN, "flag to indicate whether detector <%s> is enabled for finishing of incomplete decompositions", name);
3138 SCIP_CALL( SCIPaddBoolParam(scip, setstr, descstr, &(detector->enabledFinishing), FALSE, enabledFinishing, NULL, NULL) );
3140 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/detectors/%s/postprocessingenabled", name);
3141 (void) SCIPsnprintf(descstr, SCIP_MAXSTRLEN, "flag to indicate whether detector <%s> is enabled for postprocessing of finished decompositions", name);
3142 SCIP_CALL( SCIPaddBoolParam(scip, setstr, descstr, &(detector->enabledPostprocessing), FALSE, enabledPostprocessing, NULL, NULL) );
3145 (void) SCIPsnprintf(descstr, SCIP_MAXSTRLEN, "flag to indicate whether detector <%s> should be skipped if others found decompositions", name);
3146 SCIP_CALL( SCIPaddBoolParam(scip, setstr, descstr, &(detector->skip), FALSE, skip, NULL, NULL) );
3149 (void) SCIPsnprintf(descstr, SCIP_MAXSTRLEN, "flag to indicate whether detector <%s> should be called on descendants of the current partialdec", name);
3150 SCIP_CALL( SCIPaddBoolParam(scip, setstr, descstr, &(detector->usefulRecall), FALSE, usefulRecall, NULL, NULL) );
3153 (void) SCIPsnprintf(descstr, SCIP_MAXSTRLEN, "flag to indicate whether emphasis settings for detector <%s> should be overruled by normal settings", name);
3154 SCIP_CALL( SCIPaddBoolParam(scip, setstr, descstr, &(detector->overruleemphasis), FALSE, FALSE, NULL, NULL) );
3157 (void) SCIPsnprintf(descstr, SCIP_MAXSTRLEN, "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 <%s>", name);
3158 SCIP_CALL( SCIPaddIntParam(scip, setstr, descstr, &(detector->freqCallRound), FALSE, freqCallRound, 0, INT_MAX, NULL, NULL) );
3161 (void) SCIPsnprintf(descstr, SCIP_MAXSTRLEN, "maximum round the detector gets called in detection loop <%s>", name);
3162 SCIP_CALL( SCIPaddIntParam(scip, setstr, descstr, &(detector->maxCallRound), FALSE, maxCallRound, 0, INT_MAX, NULL, NULL) );
3165 (void) SCIPsnprintf(descstr, SCIP_MAXSTRLEN, "minimum round the detector gets called in detection loop <%s>", name);
3166 SCIP_CALL( SCIPaddIntParam(scip, setstr, descstr, &(detector->minCallRound), FALSE, minCallRound, 0, INT_MAX, NULL, NULL) );
3169 (void) SCIPsnprintf(descstr, SCIP_MAXSTRLEN, "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 <%s>", name);
3170 SCIP_CALL( SCIPaddIntParam(scip, setstr, descstr, &(detector->freqCallRoundOriginal), FALSE, freqCallRoundOriginal, 0, INT_MAX, NULL, NULL) );
3173 (void) SCIPsnprintf(descstr, SCIP_MAXSTRLEN, "maximum round the detector gets called in detection loop <%s>", name);
3174 SCIP_CALL( SCIPaddIntParam(scip, setstr, descstr, &(detector->maxCallRoundOriginal), FALSE, maxCallRoundOriginal, 0, INT_MAX, NULL, NULL) );
3177 (void) SCIPsnprintf(descstr, SCIP_MAXSTRLEN, "minimum round the detector gets called in detection loop <%s>", name);
3178 SCIP_CALL( SCIPaddIntParam(scip, setstr, descstr, &(detector->minCallRoundOriginal), FALSE, minCallRoundOriginal, 0, INT_MAX, NULL, NULL) );
3182 SCIP_CALL( SCIPaddIntParam(scip, setstr, descstr, &(detector->priority), FALSE, priority, INT_MIN, INT_MAX, NULL, NULL) );
3184 SCIP_CALL( SCIPreallocMemoryArray(scip, &conshdlrdata->detectors, (size_t)conshdlrdata->ndetectors+1) );
3185 SCIP_CALL( SCIPreallocMemoryArray(scip, &conshdlrdata->priorities,(size_t) conshdlrdata->ndetectors+1) );
3191 // TODO ref replace propagatePartialdec by more appropriate name once partialdecs are introduced
3195 SCIP_CALL( SCIPreallocMemoryArray(scip, &conshdlrdata->propagatingdetectors, (size_t)conshdlrdata->npropagatingdetectors+1) );
3204 SCIP_CALL( SCIPreallocMemoryArray(scip, &conshdlrdata->finishingdetectors, (size_t)conshdlrdata->nfinishingdetectors+1) );
3209 // TODO ref replace postprocessPartialdec by more appropriate name once partialdecs are introduced
3213 SCIP_CALL( SCIPreallocMemoryArray(scip, &conshdlrdata->postprocessingdetectors, (size_t)conshdlrdata->npostprocessingdetectors+1) );
3257 (void) SCIPsnprintf(setstr, SCIP_MAXSTRLEN, "detection/classification/varclassifier/%s/enabled", name);
3258 (void) SCIPsnprintf(descstr, SCIP_MAXSTRLEN, "flag to indicate whether variable classifier for <%s> is enabled", description);
3259 SCIP_CALL( SCIPaddBoolParam(scip, setstr, descstr, &(classifier->enabled), FALSE, enabled, NULL, NULL) );
3261 SCIP_CALL( SCIPreallocMemoryArray(scip, &conshdlrdata->varclassifiers, (size_t)conshdlrdata->nvarclassifiers+1) );
3262 SCIP_CALL( SCIPreallocMemoryArray(scip, &conshdlrdata->varclassifierpriorities,(size_t) conshdlrdata->nvarclassifiers+1) );
3320 if( presolved && conshdlrdata->detprobdatapres != NULL && conshdlrdata->detprobdatapres->getNFinishedPartialdecs() == 0 )
3461 SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "added block number candidate: %d \n", candidate );
3577 if( partialdec->getUsergiven() == USERGIVEN::COMPLETE || partialdec->getUsergiven() == USERGIVEN::COMPLETED_CONSTOMASTER )
3592 std::vector<PARTIALDECOMP*> newpartialdecs = conshdlrdata->detprobdatapres->translatePartialdecs(conshdlrdata->detprobdataorig, partialdectotranslate);
3631 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, " added %s decomp for %s problem with %d blocks and %d masterconss, %d linkingvars, "
3634 partialdec->getNLinkingvars(), partialdec->getNMastervars(), (partialdec->isComplete() ? " " : " at best "),
3669 SCIPverbMessage(scip, SCIP_VERBLEVEL_DIALOG, NULL, "added user block number candidate: %d \n", candidate );
3699 SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, " block %d and block %d are represented by %d and %d hence they are identical=%d.\n", probnr1, probnr2, partialdec->getRepForBlock(probnr1), partialdec->getRepForBlock(probnr2), *identical );
3735 /* calc bender area score (1 - fraction of white area in master constraints to complete area) */
3743 if ( partialdec->isVarOpenvar(var) || partialdec->isVarMastervar(var) || partialdec->isVarLinkingvar(var) )
3817 benderborderarea = ( nrelevantconss * nrelevantvars ) + ( nrelevantconss2 * nrelevantvars2 ) - badblockvararea;
3818 totalarea = ( (unsigned long) partialdec->getNConss() * (unsigned long) partialdec->getNVars() );
3867 borderarea += (unsigned long) ( partialdec->getNLinkingvars() + partialdec->getNTotalStairlinkingvars() ) * (unsigned long) partialdec->getNConss();
3868 borderarea += (unsigned long) partialdec->getNMasterconss() * ( (unsigned long) partialdec->getNVars() - ( partialdec->getNLinkingvars() + partialdec->getNTotalStairlinkingvars() ) ) ;
3888 gcg::DETPROBDATA* detprobdata = (transformed ? conshdlrdata->detprobdatapres : conshdlrdata->detprobdataorig );
3889 /* strategy: for every subset of constraint classes and variable classes calculate gcd (greatest common divisors)
3914 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, " the current consclass distribution includes %d classes but only %d are allowed for GCGconshdlrDecompCalcCandidatesNBlocks()\n", partition->getNClasses(), maximumnclasses );
3919 std::vector<std::vector<int>> subsetsOfConstypes = partition->getAllSubsets(true, true, true );
3925 GCGconshdlrDecompAddCandidatesNBlocks( scip, detprobdata->isAssignedToOrigProb(), nConssOfClasses[i] );
3936 greatestCD = gcd( nConssOfClasses[subsetsOfConstypes[subset][0]], nConssOfClasses[subsetsOfConstypes[subset][1]] );
3943 GCGconshdlrDecompAddCandidatesNBlocks( scip, detprobdata->isAssignedToOrigProb(), greatestCD );
3953 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, " the current varclass distribution includes %d classes but only %d are allowed for GCGconshdlrDecompCalcCandidatesNBlocks()\n", partition->getNClasses(), maximumnclasses );
3958 std::vector<std::vector<int>> subsetsOfVartypes = partition->getAllSubsets(true, true, true, true );
3964 GCGconshdlrDecompAddCandidatesNBlocks( scip, detprobdata->isAssignedToOrigProb(), nVarsOfClasse );
3982 GCGconshdlrDecompAddCandidatesNBlocks( scip, detprobdata->isAssignedToOrigProb(), greatestCD );
4126 borderarea = ((unsigned long) partialdec->getNMasterconss() * partialdec->getNVars() ) + ( ((unsigned long) partialdec->getNLinkingvars() + partialdec->getNMastervars() + partialdec->getNTotalStairlinkingvars() ) ) * ( partialdec->getNConss() - partialdec->getNMasterconss() );
4128 matrixarea = ((unsigned long) partialdec->getNVars() ) * ((unsigned long) partialdec->getNConss() );
4140 if( ( partialdec->getNLinkingvars() + partialdec->getNMastervars() + partialdec->getNTotalStairlinkingvars() ) > 0 )
4142 varratio *= 1.0 * nlinkvarsblocks[i] / ( partialdec->getNLinkingvars() + partialdec->getNMastervars() + partialdec->getNTotalStairlinkingvars() );
4155 totalscore = 1. - (alphaborderarea * ( borderscore ) + alphalinking * ( linkingscore ) + alphadensity * ( densityscore ) );
4200 std::vector<int> nblocksforlinkingvar(partialdec->getNLinkingvars() + partialdec->getNTotalStairlinkingvars(), 0);
4256 newmasterarea = ( partialdec->getNMasterconss() + sumblockshittinglinkingvar) * ( partialdec->getNVars() + sumlinkingvarshittingblock );
4261 newblockareaagg += partialdec->getNConssForBlock( partialdec->getBlocksForRep(br)[0] ) * ( partialdec->getNVarsForBlock( partialdec->getBlocksForRep(br)[0] ) + nlinkingvarsforblock[partialdec->getBlocksForRep(br)[0]] );
4264 SCIP_Real maxforeseeingwhitescoreagg = ((SCIP_Real ) newblockareaagg + (SCIP_Real) newmasterarea) / (SCIP_Real) newwidth;
4303 std::vector<int> nblocksforlinkingvar(partialdec->getNLinkingvars() + partialdec->getNTotalStairlinkingvars(), 0);
4333 /* count for each block and each linking var how many linking vars or blocks, respectively, they hit */
4375 newmasterarea = ( (SCIP_Real) partialdec->getNMasterconss() + sumblockshittinglinkingvar) * ( (SCIP_Real) partialdec->getNVars() + sumlinkingvarshittingblock );
4380 newblockarea += ((SCIP_Real) partialdec->getNConssForBlock(b) ) * ( (SCIP_Real) partialdec->getNVarsForBlock(b) + nlinkingvarsforblock[b] );
4383 SCIP_Real maxforeseeingwhitescore = ((SCIP_Real ) newblockarea + (SCIP_Real) newmasterarea) / (SCIP_Real) newwidth;
4461 if( partialdec->hasSetppccardMaster() && !partialdec->isTrivial() && partialdec->getNBlocks() > 1 )
4499 GCGconshdlrDecompCalcMaxForeseeingWhiteAggScore(scip, partialdecid, &maxforeseeingwhitescoreagg);
4504 if( partialdec->hasSetppccardMaster() && !partialdec->isTrivial() && partialdec->getNBlocks() > 1 )
4529 /** @todo use and introduce scip parameter limit (for a pricing problem to be considered fractional solvable) of difference optimal value of LP-Relaxation and optimal value of artificial pricing problem */
4532 /** @todo use and introduce scip parameter weighted limit (for a pricing problem to be considered fractional solvable) difference optimal value of LP-Relaxation and optimal value of artificial pricing problem */
4564 SCIPverbMessage(scip, SCIP_VERBLEVEL_MINIMAL, NULL, " \n Attention! Strong decomposition score is not implemented for decomps belonging to the original problem \n\n");
4571 SCIPgetRealParam(scip, "detection/score/strong_detection/coeffactororigvsrandom", &dualvalmethodcoef);
4573 /* get numerical tolerances of the original SCIP instance in order to use the same numerical tolerances in master and pricing problems */
4581 /* get clocktype of the original SCIP instance in order to use the same clocktype in master and pricing problems */
4595 /* for every pricing problem calculate a corresponding score coeff and break if a pricing problem cannot be solved in the timelimit */
4612 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "started calculate strong decomposition subproblem for block %d \n", block );
4616 SCIP_CALL( SCIPhashmapCreate(&hashpricingvartoindex, SCIPblkmem(scip), SCIPgetNVars(scip)) ); /*lint !e613*/
4617 SCIP_CALL( SCIPhashmapCreate(&hashorig2pricingvar, SCIPblkmem(scip), SCIPgetNVars(scip)) ); /*lint !e613*/
4629 SCIP_CALL( setTestpricingProblemParameters(subscip, clocktype, infinity, epsilon, sumepsilon, feastol, lpfeastol, dualfeastol, enableppcuts, conshdlrdata->strongtimelimit) );
4634 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "started calculate strong decomposition, timelimit: %f timelimitfast: %f \n", conshdlrdata->strongtimelimit, timelimitfast );
4669 dualval = dualvalmethodcoef * getDualvalOptimalLP(scip, consid, partialdec->isAssignedToOrigProb()) + (1. - dualvalmethodcoef) * getDualvalRandom(scip, consid, partialdec->isAssignedToOrigProb());
4686 SCIP_CALL( createTestPricingprobConss(scip, subscip, partialdec, block, hashorig2pricingvar) );
4692 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "started solving subproblem for block %d \n", block );
4694 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "finished solving subproblem in %f seconds \n", SCIPgetSolvingTime(subscip) );
4707 SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "Hit timelimit in pricing problem %d \n.", block);
4722 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "first dual bound: %f ; dual bound end: %f \n",SCIPgetFirstLPLowerboundRoot(subscip), SCIPgetDualbound(subscip) );
4739 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "scorecoef for subproblem %d is %f with weighting factor %f\n", block, score_coef, weight_subproblem );
4775 /* check whether the predecessors of all finished partialdecs in both detprobdatas can be found */
4787 SCIPwarningMessage(scip, "Warning: presolved partialdec %d has an ancestor (id: %d) that is not found! \n", partialdec->getID(), id );
4805 SCIPwarningMessage(scip, "Warning: orig partialdec %d has an ancestor (id: %d) that is not found! \n", partialdec->getID(), id );
4829 SCIPerrorMessage("Decomp constraint handler is not included, cannot manage decompositions!\n");
4833 if( (!original && conshdlrdata->detprobdatapres == NULL) || (original && conshdlrdata->detprobdataorig == NULL) )
4847 SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "currently no decomposition is selected, hence every known decomposition is considered: \n");
4856 SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "number of considered decompositions: %ld \n", selectedpartialdecs.size() );
4868 partialdec = GCGconshdlrDecompGetPartialdecFromID(scip, partialdec->getTranslatedpartialdecid());
4874 SCIPwarningMessage(scip, "A selected decomposition (id=%d) of the orig. problem is ignored since its translation is incomplete.\n", partialdec->getID());
4883 candidates.emplace_back(partialdec, partialdec->getScore(GCGconshdlrDecompGetScoretype(scip)));
4887 SCIPwarningMessage(scip, "A selected decomposition (id=%d) is ignored since it is incomplete.\n", partialdec->getID());
4924 (void) SCIPsnprintf(setting, SCIP_MAXSTRLEN, "detection/classification/consclassifier/%s/enabled", classifier->name);
4939 (void) SCIPsnprintf(setting, SCIP_MAXSTRLEN, "detection/classification/varclassifier/%s/enabled", classifier->name);
5022 SCIPwarningMessage(scip, "blockid1 should be the representative (hence has id=0 in reptoblocksarray but in fact has %d) \n", repid1);
5208 SCIP_CALL_ABORT( SCIPallocBlockMemoryArray(scip, &conshdlrdata->decomps, GCGconshdlrDecompGetNDecomps(scip) ) );
5389 /* partialdec is not found hence we should not trust the isomorph information from detection */
5721 SCIPmessageFPrintInfo(SCIPgetMessagehdlr(scip), file, "Detector statistics: time #decompositions #complete decompositions\n");
5741 if( conshdlrdata->partialdecsbyid->find(partialdec->getID()) == conshdlrdata->partialdecsbyid->end())
5828 if( conshdlrdata->detprobdataorig->getNOpenPartialdecs() == 0 && conshdlrdata->detprobdataorig->getNFinishedPartialdecs() == 0 )
5842 std::vector<PARTIALDECOMP *> partialdecstranslated = conshdlrdata->detprobdatapres->translatePartialdecs(
5878 if( conshdlrdata->detprobdataorig->getNOpenPartialdecs() == 0 && conshdlrdata->detprobdataorig->getNFinishedPartialdecs() == 0 )
5883 std::vector<PARTIALDECOMP*> partialdecstranslated = conshdlrdata->detprobdatapres->translatePartialdecs(conshdlrdata->detprobdataorig);
5935 if( SCIPconsGetName(cons) == NULL || strcmp(SCIPconsGetName(cons), "") == 0 || consnamemap[SCIPconsGetName(cons)] )
6037 SCIP_CALL( SCIPaddBoolParam(scip, "detection/enabled", "Enables detection", &conshdlrdata->enabled, FALSE, DEFAULT_ENABLED, NULL, NULL) );
6039 SCIP_CALL( SCIPaddBoolParam(scip, "detection/postprocess", "Enables postprocessing of complete decompositions",
6050 SCIP_CALL( SCIPaddBoolParam(scip, "detection/origprob/enabled", "Enables detection for the original problem",
6054 "Weighting method when comparing decompositions for presolved and orig problem", &conshdlrdata->weightinggpresolvedoriginaldecomps, TRUE,
6058 "Limits the number of constraints of a block (aggregation information for block is not calculated when exceeded)",
6063 "Limits the number of variables of a block (aggregation information for block is not calculated when exceeded)",
6067 SCIP_CALL( SCIPaddBoolParam(scip, "detection/benders/onlycontsubpr", "If enabled only decomposition with only continiuous variables in the subproblems are searched",
6070 SCIP_CALL( SCIPaddBoolParam(scip, "detection/benders/onlybinmaster", "If enabled only decomposition with only binary variables in the master are searched",
6077 SCIP_CALL( SCIPaddBoolParam(scip, "detection/classification/enabled", "Enables classification", &conshdlrdata->classify, FALSE, DEFAULT_CLASSIFY, NULL, NULL) );
6079 SCIP_CALL( SCIPaddBoolParam(scip, "detection/classification/allowduplicates", "If enabled partition duplicates are allowed (for statistical reasons)",
6080 &conshdlrdata->allowpartitionduplicates, FALSE, DEFAULT_ALLOWPARTITIONDUPLICATES, NULL, NULL) );
6082 SCIP_CALL( SCIPaddBoolParam(scip, "detection/origprob/classificationenabled", "Enables classification for the original problem",
6083 &conshdlrdata->enableorigclassification, FALSE, DEFAULT_ENABLEORIGCLASSIFICATION, NULL, NULL) );
6089 SCIP_CALL( SCIPaddIntParam(scip, "detection/classification/maxnclassesperpartitionforlargeprobs",
6090 "Maximum number of classes per partition for large problems (nconss + nvars >= 50000)", &conshdlrdata->maxnclassesperpartitionforlargeprobs, FALSE,
6095 "Maximum number of classes a partition can use for voting nblockcandidates", &conshdlrdata->maxnclassesfornblockcandidates, FALSE,
6105 "Score calculation for comparing (partial) decompositions (0: max white, 1: border area, 2: classic, 3: max foreseeing white, 4: ppc-max-white, 5: max foreseeing white with aggregation info, 6: ppc-max-white with aggregation info, 7: experimental benders score, 8: strong decomposition score)",
6110 "Timelimit for strong decompositions score calculation per partialdec in seconds", &conshdlrdata->strongtimelimit, FALSE,
6114 "Method for random dual values use for strong decomposition: 1: naive, 2: expected equality exponential distributed, 3: expected overestimation exponential distributed ",
gcg::PARTIALDECOMP * partialdec
Definition: wrapper_partialdecomp.h:49
void DECdecompSetNBlocks(DEC_DECOMP *decomp, int nblocks)
Definition: decomp.c:733
void addClockTime(SCIP_Real clocktime)
adds detection time of one detector
Definition: class_partialdecomp.cpp:286
void setFinishedByFinisher(bool finished)
sets whether this partialdec was finished by a finishing detector
Definition: class_partialdecomp.cpp:5009
int getNConss()
returns the number of variables considered in the detprobdata
Definition: class_detprobdata.cpp:796
bool aggInfoCalculated()
Checks if the aggregation information was already calculated.
Definition: class_partialdecomp.cpp:5634
const char * DECdetectorGetName(DEC_DETECTOR *detector)
returns the name of the provided detector
Definition: cons_decomp.cpp:2618
SCIP_Bool GCGconshdlrDecompOrigPartialdecExists(SCIP *scip)
returns whether or not an original decompositions exists in the data structures
Definition: cons_decomp.cpp:5683
std::vector< SCIP_Real > * dualvalsoptimaloriglp
Definition: cons_decomp.cpp:206
#define DEFAULT_SCORECOEF_MEDIUMNOTBENEFICIAL
Definition: cons_decomp.cpp:127
static SCIP_DECL_CONSEXIT(consExitDecomp)
deinitialization method of constraint handler (called before transformed problem is freed)
Definition: cons_decomp.cpp:771
int getNFinishedPartialdecs()
Definition: class_detprobdata.cpp:824
structure information for decomposition information in GCG projects
SCIP_Bool blocknumbercandsmedianvarspercons
Definition: cons_decomp.cpp:171
SCIP_Bool allowpartitionduplicates
Definition: cons_decomp.cpp:180
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
int * varclassifierpriorities
Definition: cons_decomp.cpp:150
static void getFinishedPartialdecs(SCIP *scip, std::vector< PARTIALDECOMP * > &finishedpartialdecs)
gets vector of all finished partialdecs
Definition: cons_decomp.cpp:381
std::vector< int > & getMastervars()
Gets array containing all master vars indices.
Definition: class_partialdecomp.cpp:3998
DEC_DETECTOR ** propagatingdetectors
Definition: cons_decomp.cpp:155
std::vector< SCIP_Real > * dualvalsrandom
Definition: cons_decomp.cpp:205
void GCGconshdlrDecompAddUserCandidatesNBlocks(SCIP *scip, int candidate)
adds a candidate for block size given by the user
Definition: cons_decomp.cpp:3652
bool isVarStairlinkingvar(int var)
Checks whether the var is a stairlinking var.
Definition: class_partialdecomp.cpp:4730
#define DEFAULT_ALLOWPARTITIONDUPLICATES
Definition: cons_decomp.cpp:103
SCIP_RETCODE DECdecompSetSubscipconss(SCIP *scip, DEC_DECOMP *decomp, SCIP_CONS ***subscipconss, int *nsubscipconss)
Definition: decomp.c:843
std::vector< int > & getVarsForBlock(int block)
Gets array containing vars of a block.
Definition: class_partialdecomp.cpp:4470
void fixVarToMaster(int var)
adds a variable to the master variables
Definition: class_partialdecomp.cpp:5210
SCIP_Real coeffactororigvsrandom
Definition: cons_decomp.cpp:170
SCIP_RETCODE GCGconshdlrDecompCalcStrongDecompositionScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the strong decomposition score of a partialdec
Definition: cons_decomp.cpp:4523
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
std::string GCGconshdlrDecompGetDetectorHistoryByPartialdecId(SCIP *scip, int id)
gets detector history of partialdec with given id
Definition: cons_decomp.cpp:5224
SCIP_RETCODE GCGprintDecompInformation(SCIP *scip, FILE *file)
Definition: cons_decomp.cpp:2499
int getNOpenvars()
Gets size of vector containing variables not assigned yet.
Definition: class_partialdecomp.cpp:4198
void DECdecompSetDetectorPctVarsFromOpen(SCIP *scip, DEC_DECOMP *decomp, SCIP_Real *pctVarsFromOpen)
Definition: decomp.c:1871
enum GCG_Random_dual_methods GCG_RANDOM_DUAL_METHOD
Definition: cons_decomp.cpp:226
SCIP_RETCODE GCGconshdlrDecompCalcClassicScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the classic score of a partialdec
Definition: cons_decomp.cpp:4005
static int gcd(int a, int b)
method to calculate the greatest common divisor
Definition: cons_decomp.cpp:1901
int maxnclassesfornblockcandidates
Definition: cons_decomp.cpp:172
unsigned int GCGconshdlrDecompGetNOpenPartialdecsTransformed(SCIP *scip)
Gets the number of open partialdecs available for the transformed problem.
Definition: cons_decomp.cpp:5491
SCIP_Real * DECdecompGetDetectorPctVarsFromOpen(DEC_DECOMP *decomp)
Definition: decomp.c:1899
static SCIP_DECL_CONSFREE(consFreeDecomp)
destructor of constraint handler to free constraint handler data (called when SCIP is exiting)
Definition: cons_decomp.cpp:824
static SCIP_RETCODE addPartialdec(SCIP *scip, PARTIALDECOMP *partialdec)
local method to handle store a partialdec in the correct detprobdata
Definition: cons_decomp.cpp:287
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 setMaxForWhiteAggScore(SCIP_Real score)
set the maximum foreseeing white area score with respect to aggregatable blocks
Definition: class_partialdecomp.cpp:5575
void printPartitionInformation(FILE *file)
output method for json file writer to write partition candidate information
Definition: class_detprobdata.cpp:1157
Definition: struct_decomp.h:51
SCIP_RETCODE GCGconshdlrDecompPrintDetectorStatistics(SCIP *scip, FILE *file)
display statistics about detectors
Definition: cons_decomp.cpp:5711
float GCGconshdlrDecompGetScoreByPartialdecId(SCIP *scip, int id)
gets score of partialdec with given id
Definition: cons_decomp.cpp:5581
SCIP_RETCODE DECdecompSetDetectorChain(SCIP *scip, DEC_DECOMP *decomp, DEC_DETECTOR **detectors, int ndetectors)
Definition: decomp.c:1610
SCIP_Bool isAssignedToOrigProb()
returns true if the matrix structure corresponds to the presolved problem
Definition: class_detprobdata.cpp:1098
DEC_DETECTOR ** DECdecompGetDetectorChain(DEC_DECOMP *decomp)
Definition: decomp.c:1600
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
data structures for variable classifiers
unsigned int GCGconshdlrDecompGetNPartialdecsTransformed(SCIP *scip)
Gets the number of partialdecs available for the transformed problem.
Definition: cons_decomp.cpp:5530
void setNBlocks(int nblocks)
sets number of blocks, only increasing number allowed
Definition: class_partialdecomp.cpp:5025
void DECdecompSetVartoblock(DEC_DECOMP *decomp, SCIP_HASHMAP *vartoblock)
Definition: decomp.c:1187
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
SCIP_RETCODE GCGprintPartitionInformation(SCIP *scip, FILE *file)
Definition: cons_decomp.cpp:2481
std::vector< int > & getOpenconssVec()
Gets a vector containing constraint ids not assigned yet as vector.
Definition: class_partialdecomp.cpp:4253
unsigned int GCGconshdlrDecompGetNFinishedPartialdecsTransformed(SCIP *scip)
Gets the number of finished partialdecs available for the transformed problem.
Definition: cons_decomp.cpp:5463
SCIP_Real getMaxForWhiteAggScore()
gets the maximum foreseeing white area score with respect to aggregatable blocks
Definition: class_partialdecomp.cpp:5570
#define FAST_LEVENSHTEIN_MAXMATRIXHALFPERIMETER
Definition: cons_decomp.cpp:115
SCIP_RETCODE GCGconshdlrDecompSelectPartialdec(SCIP *scip, int partialdecid, SCIP_Bool select)
selects/unselects a partialdecomp
Definition: cons_decomp.cpp:5749
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
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 DECdecompSetSubscipvars(SCIP *scip, DEC_DECOMP *decomp, SCIP_VAR ***subscipvars, int *nsubscipvars)
Definition: decomp.c:755
bool isVarOpenvar(int var)
Checks whether the var is an open var.
Definition: class_partialdecomp.cpp:4721
static SCIP_RETCODE setDetectionEnabled(SCIP *scip, SCIP_Bool quiet, SCIP_Bool enabled)
sets detection/enabled setting
Definition: cons_decomp.cpp:1642
Definition: class_indexpartition.cpp:46
SCIP_RETCODE GCGconshdlrDecompAddScoreTime(SCIP *scip, SCIP_Real time)
adds given time to total score calculation time
Definition: cons_decomp.cpp:3641
std::vector< SCIP_Real > & getPctConssToBlockVector()
Gets fraction of constraints assigned to a block for detectors in detectorchain.
Definition: class_partialdecomp.cpp:4378
SCIP_RETCODE GCGconshdlrDecompAddPreexistingDecomp(SCIP *scip, DEC_DECOMP *decomp)
adds a decomp that exists before the detection is called
Definition: cons_decomp.cpp:3534
static void reduceConsclasses(SCIP *scip, gcg::DETPROBDATA *detprobdata)
adds constraint partitions with a reduced number of classes
Definition: cons_decomp.cpp:1581
int getVarProbindexForBlock(int varid, int block)
Gets index in variables array of a block for a variable.
Definition: class_partialdecomp.cpp:4479
bool isVarBlockvarOfBlock(int var, int block)
Checks whether the var is assigned to the block.
Definition: class_partialdecomp.cpp:4683
void DECdecompSetConstoblock(DEC_DECOMP *decomp, SCIP_HASHMAP *constoblock)
Definition: decomp.c:1209
#define DEFAULT_AGGREGATIONLIMITNVARSPERBLOCK
Definition: cons_decomp.cpp:108
void findVarsLinkingToStairlinking()
reassigns variables classified as linking to stairlinking if appropriate
Definition: class_partialdecomp.cpp:3457
void DECsetMaxWhiteScore(SCIP *scip, DEC_DECOMP *decdecomp, SCIP_Real maxwhitescore)
Definition: decomp.c:3253
void addPctConssToBorder(SCIP_Real pct)
adds percentage of constraints assigned to border
Definition: class_partialdecomp.cpp:358
std::vector< int > & getMasterconss()
Gets array containing all master conss indices.
Definition: class_partialdecomp.cpp:3992
SCIP_Real nblockscandidatescalctime
Definition: class_detprobdata.h:148
bool isComplete()
Gets whether this partialdec is complete, i.e. it has no more open constraints and variables.
Definition: class_partialdecomp.cpp:4494
SCIP_Real GCGconsGetDualsol(SCIP *scip, SCIP_CONS *cons)
Definition: scip_misc.c:368
int GCGconshdlrDecompGetNBlockNumberCandidates(SCIP *scip)
returns the number of block candidates given by the user
Definition: cons_decomp.cpp:5305
Definition: class_conspartition.h:53
int npostprocessingdetectors
Definition: cons_decomp.cpp:160
SCIP_RETCODE GCGconsGetVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int nvars)
Definition: scip_misc.c:490
void GCGconshdlrDecompSetScoretype(SCIP *scip, SCORETYPE sctype)
Sets the currently used scoretype.
Definition: cons_decomp.cpp:5796
void fixVarToLinking(int var)
adds a variable to the linking variables
Definition: class_partialdecomp.cpp:5154
DEC_DECL_FREEDETECTOR(freeNeighborhoodmaster)
Definition: dec_neighborhoodmaster.cpp:101
#define DEC_DECL_FREECONSCLASSIFIER(x)
Definition: type_consclassifier.h:52
unsigned int GCGconshdlrDecompGetNPartialdecs(SCIP *scip)
Gets the number of all partialdecs.
Definition: cons_decomp.cpp:5505
void DECdecompSetDetectorPctConssToBlock(SCIP *scip, DEC_DECOMP *decomp, SCIP_Real *pctConssToBlock)
Definition: decomp.c:1834
static SCIP_RETCODE createTestPricingprobConss(SCIP *scip, SCIP *subscip, PARTIALDECOMP *partialdec, int block, SCIP_HASHMAP *hashorig2pricingvar)
creates the pricing problem constraints
Definition: cons_decomp.cpp:2333
std::vector< SCIP_Real > & getPctVarsToBlockVector()
returns fraction of variables assigned to a block for detectors in detectorchain
Definition: class_partialdecomp.cpp:4305
private methods for working with decomp structures
unsigned int GCGconshdlrDecompGetNFinishedPartialdecsOrig(SCIP *scip)
Gets the number of finished partialdecs available for the original problem.
Definition: cons_decomp.cpp:5449
SCIP_RETCODE GCGconshdlrDecompAddDecomp(SCIP *scip, DEC_DECOMP *decomp, SCIP_Bool select)
adds the given decomposition structure
Definition: cons_decomp.cpp:3468
#define DEFAULT_SCORECOEF_FASTBENEFICIAL
Definition: cons_decomp.cpp:124
USERGIVEN getUsergiven()
Gets the USERGIVEN status of this partialdecs.
Definition: class_partialdecomp.cpp:4097
void GCGconshdlrDecompFreeOrigOnExit(SCIP *scip, SCIP_Bool free)
sets freeing of detection data of original problem during exit to true
Definition: cons_decomp.cpp:5152
DETPROBDATA * GCGconshdlrDecompGetDetprobdataOrig(SCIP *scip)
help method to access detprobdata for unpresolved problem
Definition: cons_decomp.cpp:5249
int getNVarsForBlock(int block)
Gets size of the vector containing vars assigned to a block.
Definition: class_partialdecomp.cpp:4226
SCIP_Real * DECdecompGetDetectorPctConssToBorder(DEC_DECOMP *decomp)
Definition: decomp.c:1791
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
#define DEFAULT_SCORECOEF_FASTNOTBENEFICIAL
Definition: cons_decomp.cpp:126
SCIP_Bool bendersonlybinmaster
Definition: cons_decomp.cpp:185
DEC_CLASSIFIERDATA * DECconsClassifierGetData(DEC_CONSCLASSIFIER *classifier)
returns the data of the provided consclassifier
Definition: cons_decomp.cpp:2562
static SCIP_RETCODE setDetectionAggressive(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_Bool quiet)
sets the parameters to aggressive values
Definition: cons_decomp.cpp:1721
#define AGGRESSIVE_LEVENSHTEIN_MAXMATRIXHALFPERIMETER
Definition: cons_decomp.cpp:114
SCIP_CONS ** DECdecompGetLinkingconss(DEC_DECOMP *decomp)
Definition: decomp.c:967
std::vector< int > getNNewBlocksVector()
gets number of blocks the detectors in the detectorchain added
Definition: class_partialdecomp.cpp:4164
SCIP_RETCODE DECincludeVarClassifier(SCIP *scip, const char *name, const char *description, int priority, SCIP_Bool enabled, DEC_CLASSIFIERDATA *classifierdata, DEC_DECL_FREEVARCLASSIFIER((*freeClassifier)),)
Definition: cons_decomp.cpp:3222
PARTIALDECOMP * partialdectowrite
Definition: cons_decomp.cpp:211
Definition: graphalgorithms.h:45
void addPctVarsFromFree(SCIP_Real pct)
adds percentage of closed variables
Definition: class_partialdecomp.cpp:366
SCIP_CLOCK * completedetectionclock
Definition: cons_decomp.cpp:163
int getNTotalStairlinkingvars()
Gets total number of stairlinking vars.
Definition: class_partialdecomp.cpp:4182
void fixVarToStairlinking(int var, int firstblock)
adds a variable to the stairlinking variables
Definition: class_partialdecomp.cpp:5255
DEC_DECL_PROPAGATEPARTIALDEC(detectorPropagatePartialdecIsomorph)
Definition: dec_isomorph.cpp:1485
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
Definition: class_varpartition.h:54
std::vector< int > & getConssForVar(int varIndex)
returns the constraint indices of the coefficient matrix for a variable
Definition: class_detprobdata.cpp:714
void DECprintListOfDetectors(SCIP *scip)
writes out a list of all detectors
Definition: cons_decomp.cpp:3271
void buildDecChainString(char *buffer)
creates a detector chain short string for this partialdec, is built from detector chain
Definition: class_partialdecomp.cpp:5480
DEC_CLASSIFIERDATA * DECvarClassifierGetData(DEC_VARCLASSIFIER *classifier)
returns the data of the provided varclassifier
Definition: cons_decomp.cpp:2580
int GCGconshdlrDecompGetNextPartialdecID(SCIP *scip)
Gets the next partialdec id managed by cons_decomp.
Definition: cons_decomp.cpp:5359
SCIP_RETCODE GCGconshdlrDecompTranslateOrigPartialdecs(SCIP *scip)
translates unpresolved partialdec to a complete presolved one
Definition: cons_decomp.cpp:5858
#define DEFAULT_SCORECOEF_MEDIUMBENEFICIAL
Definition: cons_decomp.cpp:125
PARTIALDECOMP * DECgetPartialdecToWrite(SCIP *scip, SCIP_Bool transformed)
Definition: cons_decomp.cpp:2928
static SCIP_RETCODE partialdecVecToIdArray(std::vector< PARTIALDECOMP * > &partialdecs, int **idlist, int *listlength)
translates a vector of PARTIALDECOMP pointers into an array of their ids
Definition: cons_decomp.cpp:338
various SCIP helper methods
std::vector< PARTIALDECOMP * > * partialdecs
Definition: cons_decomp.cpp:138
void setSetPartForWhiteScore(SCIP_Real score)
set the setpartitioning maximum foreseeing white area score
Definition: class_partialdecomp.cpp:5562
void setMaxWhiteScore(SCIP_Real score)
set the maximum white area score
Definition: class_partialdecomp.cpp:5536
SCIP_Real getMaxWhiteScore()
gets the maximum white area score
Definition: class_partialdecomp.cpp:5531
VarPartition * reduceClasses(int maxNumberOfClasses)
Definition: class_varpartition.cpp:174
void GCGconshdlrDecompFreeDetprobdata(SCIP *scip)
Frees Detprobdata of the original and transformed/presolved problem.
Definition: cons_decomp.cpp:5131
DEC_DETECTOR ** finishingdetectors
Definition: cons_decomp.cpp:157
void setUsergiven(USERGIVEN usergiven)
sets whether this partialdec is user given
Definition: class_partialdecomp.cpp:5063
bool isConsMastercons(int cons)
Gets whether the cons is a master cons.
Definition: class_partialdecomp.cpp:4515
void DECdecompSetConsindex(DEC_DECOMP *decomp, SCIP_HASHMAP *consindex)
Definition: decomp.c:1251
static SCIP_Real calcBlockAreaScore(SCIP *scip, PARTIALDECOMP *partialdec)
gets an intermediate score value for the blocks of a partialdec
Definition: cons_decomp.cpp:2414
SCIP_Real DECgetRemainingTime(SCIP *scip)
returns the remaining time of scip that the decomposition may use
Definition: cons_decomp.cpp:2979
std::unordered_map< int, PARTIALDECOMP * > * partialdecsbyid
Definition: cons_decomp.cpp:139
SCIP_Bool hasSetppccardMaster()
checks if all master constraints set partitioning, set packing, set cover, or cardinality constraints
Definition: class_partialdecomp.cpp:3197
void addPartialdecToAncestor(PARTIALDECOMP *partialdec)
adds a partialdec to ancestor partialdecs
Definition: class_detprobdata.cpp:538
std::vector< SCIP_VAR * > getOrigVarsFixedZero()
returns pointers to all orig vars that are fixed to zero
Definition: class_detprobdata.cpp:862
int GCGconshdlrDecompGetNStairlinkingVarsByPartialdecId(SCIP *scip, int id)
gets number of stairlinking variables of partialdec with given id
Definition: cons_decomp.cpp:5544
SCIP_Real GCGconshdlrDecompGetScoreTotalTime(SCIP *scip)
gets total score computation time
Definition: cons_decomp.cpp:5592
std::vector< int > & getRepVarmap(int repid, int blockrepid)
Gets the represenation varmap.
Definition: class_partialdecomp.cpp:4415
int aggregationlimitnconssperblock
Definition: cons_decomp.cpp:176
SCIP_Real GCGconshdlrDecompGetCompleteDetectionTime(SCIP *scip)
returns the total detection time
Definition: cons_decomp.cpp:5177
static SCIP_CONSHDLRDATA * getConshdlrdata(SCIP *scip)
local function to get the conshdlr data of the current conshdlr
Definition: cons_decomp.cpp:263
int maxnclassesperpartitionforlargeprobs
Definition: cons_decomp.cpp:174
Definition: struct_consclassifier.h:43
void setDetectorFinished(DEC_DETECTOR *detector)
sets detector that finished the partialdec
Definition: class_partialdecomp.cpp:4991
DEC_CONSCLASSIFIER ** consclassifiers
Definition: cons_decomp.cpp:145
SCIP_RETCODE DECdecompSetStairlinkingvars(SCIP *scip, DEC_DECOMP *decomp, SCIP_VAR ***stairlinkingvars, int *nstairlinkingvars)
Definition: decomp.c:1081
void calcStairlinkingVars()
reassigns linking vars to stairlinkingvars if possible
Definition: class_partialdecomp.cpp:1322
int * consclassifierpriorities
Definition: cons_decomp.cpp:147
int getNStairlinkingvars(int block)
Gets size of the vector containing stairlinking vars.
Definition: class_partialdecomp.cpp:4210
int getNConssForBlock(int block)
Gets size of the vector containing conss assigned to a block.
Definition: class_partialdecomp.cpp:4121
std::vector< PARTIALDECOMP * > * GCGconshdlrDecompGetPartialdecs(SCIP *scip)
gets vector of all partialdecs
Definition: cons_decomp.cpp:5555
unsigned int GCGconshdlrDecompGetNPartialdecsOrig(SCIP *scip)
Gets the number of partialdecs available for the original problem.
Definition: cons_decomp.cpp:5516
SCIP_RETCODE GCGconshdlrDecompCalcMaxForeseeingWhiteAggScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the maxforeseeingwhiteagg score of a partialdec
Definition: cons_decomp.cpp:4180
SCIP_VAR * GCGpricingVarGetOriginalVar(SCIP_VAR *var)
Definition: gcgvar.c:511
static SCIP_RETCODE partition(SCIP *scip, SCIP_VAR **J, int *Jsize, SCIP_Longint *priority, SCIP_VAR **F, int Fsize, SCIP_VAR **origvar, SCIP_Real *median)
Definition: branch_generic.c:832
SCIP_CONS * getCons(int consIndex)
returns the SCIP constraint related to a constraint index
Definition: class_detprobdata.cpp:698
SCIP_RETCODE GCGconshdlrDecompCalcBendersScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the benders score of a partialdec
Definition: cons_decomp.cpp:3705
void setStrongDecompScore(SCIP_Real score)
set the strong decomposition score
Definition: class_partialdecomp.cpp:5613
SCIP_RETCODE DECdecompSetLinkingconss(SCIP *scip, DEC_DECOMP *decomp, SCIP_CONS **linkingconss, int nlinkingconss)
Definition: decomp.c:926
SCIP_Bool shouldCompletedByConsToMaster()
Checks whether this partialdec is a userpartialdec that should be completed.
Definition: class_partialdecomp.cpp:5439
SCIP_HASHMAP * DECdecompGetVartoblock(DEC_DECOMP *decomp)
Definition: decomp.c:1199
bool addPartialdecToFinished(PARTIALDECOMP *partialdec)
adds a partialdec to finished partialdecs
Definition: class_detprobdata.cpp:563
int DECdecompGetDetectorChainSize(DEC_DECOMP *decomp)
Definition: decomp.c:1637
void addDecChangesFromAncestor(PARTIALDECOMP *ancestor)
adds the statistical differences to an ancestor
Definition: class_partialdecomp.cpp:294
void GCGconshdlrDecompDeregisterPartialdec(SCIP *scip, PARTIALDECOMP *partialdec)
deregisters a partialdec in the conshdlr
Definition: cons_decomp.cpp:5095
DEC_DETECTOR ** GCGconshdlrDecompGetDetectors(SCIP *scip)
Gets an array of all detectors.
Definition: cons_decomp.cpp:5238
static SCIP_DECL_CONSENFORELAX(consEnforeDecomp)
Definition: cons_decomp.cpp:908
std::vector< std::pair< int, int > > candidatesNBlocks
Definition: class_detprobdata.h:142
static SCIP_Real GCGconshdlrDecompAdaptScore(SCIP *scip, SCIP_Real oldscore)
method to adapt score for orig decomps
Definition: cons_decomp.cpp:1541
int GCGconshdlrDecompGetNMasterConssByPartialdecId(SCIP *scip, int id)
gets number of master constraints of partialdec with given id
Definition: cons_decomp.cpp:5405
Definition: struct_detector.h:46
Definition: struct_varclassifier.h:43
static SCIP_RETCODE unselectAllPartialdecs(SCIP *scip)
Definition: cons_decomp.cpp:403
static PARTIALDEC_DETECTION_DATA * createPartialdecDetectionData(gcg::DETPROBDATA *detprobdata, PARTIALDECOMP *partialdec)
initializes a new detection data structure
Definition: cons_decomp.cpp:425
void addPctVarsToBorder(SCIP_Real pct)
adds percentage of variables assigned to border
Definition: class_partialdecomp.cpp:382
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
void addPctConssToBlock(SCIP_Real pct)
adds percentage of constraints assigned to blocks
Definition: class_partialdecomp.cpp:350
static SCIP_Real getDualvalRandom(SCIP *scip, int consindex, SCIP_Bool transformed)
return the a random value of the dual variable of the corresponding ; if it is not calculated yet it ...
Definition: cons_decomp.cpp:2313
#define DEFAULT_MAXNCLASSESFORNBLOCKCANDIDATES
Definition: cons_decomp.cpp:98
static void reduceVarclasses(SCIP *scip, gcg::DETPROBDATA *detprobdata)
adds variable partitions with a reduced number of classes
Definition: cons_decomp.cpp:1611
SCIP_RETCODE DECdecompSetLinkingvars(SCIP *scip, DEC_DECOMP *decomp, SCIP_VAR **linkingvars, int nlinkingvars, int nfixedlinkingvars, int nmastervars)
Definition: decomp.c:989
void DECdecompSetDetectorClockTimes(SCIP *scip, DEC_DECOMP *decomp, SCIP_Real *detectorClockTimes)
Definition: decomp.c:1671
bool operator()(const std::pair< PARTIALDECOMP *, SCIP_Real > &left, const std::pair< PARTIALDECOMP *, SCIP_Real > &right)
Definition: cons_decomp.cpp:241
char DECdetectorGetChar(DEC_DETECTOR *detector)
Gets the character of the detector.
Definition: cons_decomp.cpp:2598
SCIP_RETCODE SCIPconshdlrDecompRepairConsNames(SCIP *scip)
Definition: cons_decomp.cpp:5909
miscellaneous methods for visualizations
void completeGreedily()
assigns all open constraints and open variables
Definition: class_partialdecomp.cpp:2382
int getNVars()
return the number of variables considered in the detprobdata
Definition: class_detprobdata.cpp:848
DEC_DETECTORDATA * DECdetectorGetData(DEC_DETECTOR *detector)
returns the data of the provided detector
Definition: cons_decomp.cpp:2609
int GCGconshdlrDecompGetNOpenVarsByPartialdecId(SCIP *scip, int id)
gets number of open variables of partialdec with given id
Definition: cons_decomp.cpp:5438
static int findGenericConsname(SCIP *scip, int startcount, char *consname, int namelength)
finds a non duplicate constraint name of the form c_{a} with minimal natural number {a}
Definition: cons_decomp.cpp:956
int GCGconshdlrDecompGetBlockNumberCandidate(SCIP *scip, int index)
returns block number user candidate with given index
Definition: cons_decomp.cpp:5164
static SCIP_RETCODE deletePartialdecDetectionData(SCIP *scip, PARTIALDEC_DETECTION_DATA *data)
delets the detection data structure
Definition: cons_decomp.cpp:481
SCIP_RETCODE GCGconshdlrDecompGetPartialdecsList(SCIP *scip, int **idlist, int *listlength)
Gets a list of ids of the current partialdecs.
Definition: cons_decomp.cpp:5291
interface data structure for the detector calling methods
Definition: class_detprobdata.h:672
void GCGconshdlrDecompCalcCandidatesNBlocks(SCIP *scip, SCIP_Bool transformed)
calculates and adds block size candidates using constraint classifications and variable classificatio...
Definition: cons_decomp.cpp:3882
static SCIP_RETCODE createDecompFromPartialdec(SCIP *scip, PARTIALDECOMP *partialdec, DEC_DECOMP **newdecomp)
creates a decomposition DEC_DECOMP structure for a given partialdec
Definition: cons_decomp.cpp:1108
int getRepForBlock(int blockid)
Gets index of the representative block for a block, this might be blockid itself.
Definition: class_partialdecomp.cpp:4408
SCIP_Bool enableorigclassification
Definition: cons_decomp.cpp:182
int getIndexForCons(SCIP_CONS *cons)
returns the constraint index related to a SCIP constraint
Definition: class_detprobdata.cpp:744
DEC_DETECTOR ** postprocessingdetectors
Definition: cons_decomp.cpp:159
int getNLinkingvars()
Gets size of the vector containing linking vars.
Definition: class_partialdecomp.cpp:4148
SCIP_Real * DECdecompGetDetectorPctVarsToBorder(DEC_DECOMP *decomp)
Definition: decomp.c:1756
bool sort()
sorts the vars and conss data structures by their indices
Definition: class_partialdecomp.cpp:5445
static SCIP_Retcode detect(SCIP *scip, gcg::DETPROBDATA *detprobdata)
constructs partialdecs using the registered detectors
Definition: cons_decomp.cpp:503
SCIP_VAR *** DECdecompGetStairlinkingvars(DEC_DECOMP *decomp)
Definition: decomp.c:1151
static SCIP_RETCODE calculateDualvalsOptimalOrigLP(SCIP *scip, SCIP_Bool transformed)
method to calculate and set the optimal dual values from original lp, used for strong detection score
Definition: cons_decomp.cpp:2014
std::vector< int > * userblocknrcandidates
Definition: cons_decomp.cpp:214
int getIndexForVar(SCIP_VAR *var)
returns the variable index related to a SCIP variable
Definition: class_detprobdata.cpp:776
SCIP_RETCODE DECdetectStructure(SCIP *scip, SCIP_RESULT *result)
interface method to detect the structure including presolving
Definition: cons_decomp.cpp:2627
struct Partialdec_Detection_Data PARTIALDEC_DETECTION_DATA
Definition: type_detector.h:51
void DECdecompSetPresolved(DEC_DECOMP *decomp, SCIP_Bool presolved)
Definition: decomp.c:712
C++ interface of cons_decomp.
int getNConsPartitions()
returns number of different constraint partitions
Definition: class_detprobdata.cpp:790
std::vector< SCIP_Real > & getPctConssFromFreeVector()
Gets fraction of constraints that are not longer open for detectors in detectorchain.
Definition: class_partialdecomp.cpp:4402
void printPartitionInformation(SCIP *givenscip, FILE *file)
prints partition information as described in
Definition: class_partialdecomp.cpp:4767
static SCIP_DECL_CONSINIT(consInitDecomp)
initialization method of constraint handler (called after problem was transformed)
Definition: cons_decomp.cpp:738
Provides wrapping to have Partialdecomps as parameters in C-conform function headers with C++ impleme...
#define DEC_DECL_POSTPROCESSPARTIALDEC(x)
Definition: type_detector.h:133
const char * DECvarClassifierGetName(DEC_VARCLASSIFIER *classifier)
returns the name of the provided classifier
Definition: cons_decomp.cpp:2589
const int * getStairlinkingvars(int block)
Gets array containing stairlinking vars,.
Definition: class_partialdecomp.cpp:4446
void findVarsLinkingToMaster()
reassigns linking variables to master if appropriate
Definition: class_partialdecomp.cpp:3413
gcg::DETPROBDATA * detprobdata
Definition: class_detprobdata.h:674
static SCIP_RETCODE setDetectionFast(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_Bool quiet)
sets the parameters to fast values
Definition: cons_decomp.cpp:1838
void DECdecompSetNNewBlocks(SCIP *scip, DEC_DECOMP *decomp, int *nNewBlocks)
Definition: decomp.c:1944
ConsPartition * getConsPartition(int partitionIndex)
returns pointer to a constraint partition
Definition: class_detprobdata.cpp:688
Definition: class_detprobdata.h:106
int GCGconshdlrDecompIncreaseNCallsCreateDecomp(SCIP *scip)
counts up the counter for created decompositions and returns it
Definition: cons_decomp.cpp:5634
SCIP_Bool GCGconshdlrDecompOrigDetprobdataExists(SCIP *scip)
returns whether or not a detprobdata structure for the original problem exists
Definition: cons_decomp.cpp:5669
const std::vector< int > & getBlocksForRep(int repid)
get a vector of block ids that are identical to block with id repid
Definition: class_partialdecomp.cpp:3602
data structures for constraint classifiers
SCIP_Real * DECdecompGetDetectorPctVarsToBlock(DEC_DECOMP *decomp)
Definition: decomp.c:1826
int getTranslatedpartialdecid() const
Definition: class_partialdecomp.cpp:5639
SCIP_RETCODE GCGconsGetVals(SCIP *scip, SCIP_CONS *cons, SCIP_Real *vals, int nvals)
Definition: scip_misc.c:621
void DECdecompSetDetectorPctConssFromOpen(SCIP *scip, DEC_DECOMP *decomp, SCIP_Real *pctConssFromOpen)
Definition: decomp.c:1907
Definition: wrapper_partialdecomp.h:47
std::vector< SCIP_Real > & getPctConssToBorderVector()
Gets fraction of constraints assigned to the border for detectors in detectorchain.
Definition: class_partialdecomp.cpp:4354
void setSelected(bool selected)
set the selection status of this partialdecs
Definition: class_partialdecomp.cpp:5047
SCIP_Bool GCGconshdlrDecompIsPresolvedByPartialdecId(SCIP *scip, int id)
gets whether partialdec with given id is presolved
Definition: cons_decomp.cpp:5647
DEC_DECOMP ** GCGconshdlrDecompGetDecomps(SCIP *scip)
returns an array containing all decompositions
Definition: cons_decomp.cpp:5192
void addVarPartition(VarPartition *partition)
adds a variable partition if it is no duplicate of an existing variable partition
Definition: class_detprobdata.cpp:589
void addNNewBlocks(int nnewblocks)
adds how many new blocks were introduced
Definition: class_partialdecomp.cpp:334
#define DEFAULT_BLOCKNUMBERCANDSMEDIANVARSPERCONS
Definition: cons_decomp.cpp:91
int getAncestorID(int ancestorindex)
gets partialdec id of given ancestor id
Definition: class_partialdecomp.cpp:3587
SCIP_Bool bendersonlycontsubpr
Definition: cons_decomp.cpp:184
int GCGconshdlrDecompGetNDecomps(SCIP *scip)
gets the number of decompositions (= amount of finished partialdecs)
Definition: cons_decomp.cpp:5327
bool checkConsistency()
Checks whether the assignments in the partialdec are consistent.
Definition: class_partialdecomp.cpp:1546
Definition: cons_decomp.cpp:134
int getNDetectors()
Gets the number of detectors the partialdec is propagated by.
Definition: class_partialdecomp.cpp:4136
void DECdecompSetDetectorPctVarsToBorder(SCIP *scip, DEC_DECOMP *decomp, SCIP_Real *pctVarsToBorder)
Definition: decomp.c:1728
std::vector< PARTIALDECOMP * > & getFinishedPartialdecs()
gets all finished partialdecs
Definition: class_detprobdata.cpp:738
void setBorderAreaScore(SCIP_Real score)
set the border area score
Definition: class_partialdecomp.cpp:5523
void addPartialdecToFinishedUnchecked(PARTIALDECOMP *partialdec)
adds a partialdec to finished partialdecs without checking for duplicates, dev has to check this on h...
Definition: class_detprobdata.cpp:580
void DECdecompSetPartialdecID(DEC_DECOMP *decomp, int id)
Definition: decomp.c:1648
static SCIP_RETCODE resetDetprobdata(SCIP *scip, SCIP_Bool original)
resets/creates the detprobdata for the given problem
Definition: cons_decomp.cpp:444
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
void GCGconshdlrDecompDeregisterPartialdecs(SCIP *scip, SCIP_Bool original)
deregisters partialdecs in the conshdlr
Definition: cons_decomp.cpp:5076
ConsPartition * reduceClasses(int maxNumberOfClasses)
Definition: class_conspartition.cpp:167
SCIP_RETCODE GCGconshdlrDecompCalcMaxWhiteScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the maximum white area score of a partialdec
Definition: cons_decomp.cpp:4397
std::vector< SCIP_Real > & getDetectorClockTimes()
returns a vector of the clock times that each detector needed that was involved in this partialdec
Definition: class_partialdecomp.cpp:3656
std::vector< SCIP_VAR * > getRelevantVars()
returns pointers to all problem vars that are not fixed to 0
Definition: class_detprobdata.cpp:874
std::vector< int > & getConssForBlock(int block)
returns array containing constraints assigned to a block
Definition: class_partialdecomp.cpp:3693
int GCGconshdlrDecompGetNBlocksByPartialdecId(SCIP *scip, int id)
gets block number of partialdec with given id
Definition: cons_decomp.cpp:5316
GCG relaxator.
VarPartition * getVarPartition(int partitionIndex)
returns pointer to a variable partition with given index
Definition: class_detprobdata.cpp:939
SCIP_Bool dualvalsoptimaloriglpcalculated
Definition: cons_decomp.cpp:207
SCIP_RETCODE DECdecompAddRemainingConss(SCIP *scip, DEC_DECOMP *decdecomp)
Definition: decomp.c:2179
int aggregationlimitnvarsperblock
Definition: cons_decomp.cpp:177
bool isVarMastervar(int var)
Checks whether the var is a master var.
Definition: class_partialdecomp.cpp:4699
void DECdecompSetDetectorPctConssToBorder(SCIP *scip, DEC_DECOMP *decomp, SCIP_Real *pctConssToBorder)
Definition: decomp.c:1764
static SCIP_RETCODE setTestpricingProblemParameters(SCIP *scip, int clocktype, SCIP_Real infinity, SCIP_Real epsilon, SCIP_Real sumepsilon, SCIP_Real feastol, SCIP_Real lpfeastol, SCIP_Real dualfeastol, SCIP_Bool enableppcuts, SCIP_Real timelimit)
sets the pricing problem parameters
Definition: cons_decomp.cpp:1914
static SCIP_RETCODE setDetectionDefault(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_Bool quiet)
resets the parameters to their default value
Definition: cons_decomp.cpp:1660
struct gcg::subset subset
static void sortPartialdecs(SCIP *scip)
sorts all registered partialdecs according to score, descending
Definition: cons_decomp.cpp:1524
gcg::PARTIALDECOMP ** newpartialdecs
Definition: class_detprobdata.h:676
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
SCIP_RETCODE GCGconshdlrDecompAddPreexisitingPartialDec(SCIP *scip, PARTIALDECOMP *partialdec)
adds a preexisting partial dec to be considered at the beginning of the detection
Definition: cons_decomp.cpp:3554
void fixVarToBlock(int var, int block)
adds a variable to the linking variables
Definition: class_partialdecomp.cpp:5109
SCIP_Real getScore(SCORETYPE type)
returns the score of the partialdec (depending on used scoretype)
Definition: class_partialdecomp.cpp:4025
DETPROBDATA * getDetprobdata()
Gets the corresponding detprobdata.
Definition: class_partialdecomp.cpp:4424
static SCIP_RETCODE createPartialdecFromDecomp(SCIP *scip, DEC_DECOMP *decomp, PARTIALDECOMP **newpartialdec)
creates a partialdec for a given decomposition
Definition: cons_decomp.cpp:994
PARTIALDECOMP * GCGconshdlrDecompGetPartialdecFromID(SCIP *scip, 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:317
#define DEFAULT_LEVENSHTEIN_MAXMATRIXHALFPERIMETER
Definition: cons_decomp.cpp:113
bool isVarLinkingvar(int var)
Checks whether the var is a linking var.
Definition: class_partialdecomp.cpp:4708
static SCIP_RETCODE shuffleDualvalsRandom(SCIP *scip, SCIP_Bool transformed)
method that shuffles randomly and set dual variable values, used for strong detection score
Definition: cons_decomp.cpp:2129
SCIP_RETCODE GCGprintCompleteDetectionTime(SCIP *givenscip, FILE *file)
Definition: cons_decomp.cpp:2468
void setSetPartForWhiteAggScore(SCIP_Real score)
set the setpartitioning maximum foreseeing white area score with respect to aggregateable
Definition: class_partialdecomp.cpp:5588
void DECdecompSetDetector(DEC_DECOMP *decomp, DEC_DETECTOR *detector)
Definition: decomp.c:1579
std::vector< int > & getLinkingvars()
returns array containing all linking vars indices
Definition: class_partialdecomp.cpp:3986
void addPctConssFromFree(SCIP_Real pct)
adds percentage of closed constraints
Definition: class_partialdecomp.cpp:342
int getNVarsForCons(int consIndex)
returns the number of variables for a given constraint
Definition: class_detprobdata.cpp:854
SCIP_RETCODE GCGprintBlockcandidateInformation(SCIP *scip, FILE *file)
Definition: cons_decomp.cpp:2447
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
int GCGconshdlrDecompGetNLinkingVarsByPartialdecId(SCIP *scip, int id)
gets number of linking variables of partialdec with given id
Definition: cons_decomp.cpp:5394
unsigned int GCGconshdlrDecompGetNOpenPartialdecsOrig(SCIP *scip)
Gets the number of open partialdecs available for the original problem.
Definition: cons_decomp.cpp:5477
bool isConsOpencons(int cons)
Gets whether the cons is an open cons.
Definition: class_partialdecomp.cpp:4524
std::vector< ConsPartition * > conspartitioncollection
Definition: class_detprobdata.h:144
DETPROBDATA * GCGconshdlrDecompGetDetprobdataPresolved(SCIP *scip)
help method to access detprobdata for transformed problem
Definition: cons_decomp.cpp:5263
SCIP_RETCODE GCGconshdlrDecompCalcBorderAreaScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the border area score of a partialdec
Definition: cons_decomp.cpp:3849
bool isPropagatedBy(DEC_DETECTOR *detector)
Gets whether this partialdec was propagated by specified detector.
Definition: class_partialdecomp.cpp:4649
int GCGconshdlrDecompGetNDetectors(SCIP *scip)
Gets the number of all detectors.
Definition: cons_decomp.cpp:5348
void addPctVarsToBlock(SCIP_Real pct)
adds percentage of variables assigned to blocks
Definition: class_partialdecomp.cpp:374
void DECdecompSetDetectorPctVarsToBlock(SCIP *scip, DEC_DECOMP *decomp, SCIP_Real *pctVarsToBlock)
Definition: decomp.c:1799
SCIP_RETCODE DECdecompSetDetectorChainString(SCIP *scip, DEC_DECOMP *decomp, const char *detectorchainstring)
Definition: decomp.c:1705
SCIP_RETCODE DECdecompCreate(SCIP *scip, DEC_DECOMP **decdecomp)
Definition: decomp.c:471
void calcAggregationInformation(bool ignoreDetectionLimits)
computes if aggregation of sub problems is possible
Definition: class_partialdecomp.cpp:1105
SCIP_Bool GCGconshdlrDecompIsSelectedByPartialdecId(SCIP *scip, int id)
gets whether partialdec with given id is selected
Definition: cons_decomp.cpp:5658
SCIP_Real * DECdecompGetDetectorClockTimes(DEC_DECOMP *decomp)
Definition: decomp.c:1696
void setDetectorPropagated(DEC_DETECTOR *detector)
sets partialdec to be propagated by a detector
Definition: class_partialdecomp.cpp:4982
Definition: dec_compgreedily.cpp:73
void GCGconshdlrDecompRegisterPartialdec(SCIP *scip, PARTIALDECOMP *partialdec)
registers a partialdec in the conshdlr
Definition: cons_decomp.cpp:5733
int GCGconshdlrDecompDecreaseNCallsCreateDecomp(SCIP *scip)
decreases the counter for created decompositions and returns it
Definition: cons_decomp.cpp:5063
class storing (potentially incomplete) decompositions
int * DECdecompGetNStairlinkingvars(DEC_DECOMP *decomp)
Definition: decomp.c:1160
SCIP_RETCODE GCGconshdlrDecompClassify(SCIP *scip, SCIP_Bool transformed)
run classification of vars and cons
Definition: cons_decomp.cpp:4898
SCORETYPE GCGconshdlrDecompGetScoretype(SCIP *scip)
Gets the currently selected scoretype.
Definition: cons_decomp.cpp:5601
int GCGconshdlrDecompGetNMasterVarsByPartialdecId(SCIP *scip, int id)
gets number of master variables of partialdec with given id
Definition: cons_decomp.cpp:5416
static SCIP_Real getDualvalOptimalLP(SCIP *scip, int consindex, SCIP_Bool transformed)
returns the value of the optimal lp relaxation dual value of the given constrainr rid correspondoning...
Definition: cons_decomp.cpp:2292
SCIP_RETCODE DECwriteSelectedDecomps(SCIP *scip, char *directory, char *extension)
writes all selected decompositions
Definition: cons_decomp.cpp:3367
int maxnclassesperpartition
Definition: cons_decomp.cpp:173
std::vector< VarPartition * > varpartitioncollection
Definition: class_detprobdata.h:145
SCIP_Real getVal(int row, int col)
returns a coefficient from the coefficient matrix
Definition: class_detprobdata.cpp:916
int getNConssForVar(int varIndex)
returns the number of constraints for a given variable where the var has a nonzero entry in
Definition: class_detprobdata.cpp:810
std::vector< int > & getVarsForCons(int consIndex)
returns the variable indices of the coefficient matrix for a constraint
Definition: class_detprobdata.cpp:963
SCIP_RETCODE DECdecompCheckConsistency(SCIP *scip, DEC_DECOMP *decdecomp)
Definition: decomp.c:2267
std::vector< DEC_DETECTOR * > & getDetectorchain()
returns detector chain as vector of detector pointers
Definition: class_partialdecomp.cpp:3702
bool isTrivial()
Gets whether this partialdec is considered to be trivial.
Definition: class_partialdecomp.cpp:4659
bool addPartialdecToOpen(PARTIALDECOMP *partialdec)
adds a partialdec to current partialdecs (data structure for partialdecs that are goin to processed i...
Definition: class_detprobdata.cpp:546
SCIP_RETCODE GCGconshdlrDecompGetSelectedPartialdecs(SCIP *scip, int **idlist, int *listlength)
Gets a list of ids of all currently selected partialdecs.
Definition: cons_decomp.cpp:5612
SCIP_Bool consnamesalreadyrepaired
Definition: cons_decomp.cpp:213
int GCGconshdlrDecompGetNOpenConssByPartialdecId(SCIP *scip, int id)
gets number of open constraints of partialdec with given id
Definition: cons_decomp.cpp:5427
int getNMasterconss()
Gets size of the vector containing master conss.
Definition: class_partialdecomp.cpp:4170
bool isAssignedToOrigProb()
Gets whether the partialdec is from the presolved problem.
Definition: class_partialdecomp.cpp:4533
std::vector< SCIP_Real > & getPctVarsToBorderVector()
Gets fraction of variables assigned to the border for detectors in detectorchain.
Definition: class_partialdecomp.cpp:4281
void DECdecompSetVarindex(DEC_DECOMP *decomp, SCIP_HASHMAP *varindex)
Definition: decomp.c:1231
SCIP_Real * DECdecompGetDetectorPctConssToBlock(DEC_DECOMP *decomp)
Definition: decomp.c:1862
static SCIP_RETCODE setDetectionOff(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_Bool quiet)
disables detectors
Definition: cons_decomp.cpp:1782
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
const char * DECconsClassifierGetName(DEC_CONSCLASSIFIER *classifier)
returns the name of the provided classifier
Definition: cons_decomp.cpp:2571
SCIP_VAR * getVar(int varIndex)
returns SCIP variable related to a variable index
Definition: class_detprobdata.cpp:955
void addConsPartition(ConsPartition *partition)
adds a constraint partition if it is no duplicate of an existing constraint partition
Definition: class_detprobdata.cpp:505
void deleteEmptyBlocks(bool variables)
deletes empty blocks and sets nblocks accordingly
Definition: class_partialdecomp.cpp:2794
int getNMastervars()
Gets size of the vector containing master vars.
Definition: class_partialdecomp.cpp:4176
SCIP_RETCODE DECdecompSetType(DEC_DECOMP *decomp, DEC_DECTYPE type)
Definition: decomp.c:647
int weightinggpresolvedoriginaldecomps
Definition: cons_decomp.cpp:175
SCIP_RETCODE DECincludeConsClassifier(SCIP *scip, const char *name, const char *description, int priority, SCIP_Bool enabled, DEC_CLASSIFIERDATA *classifierdata, DEC_DECL_FREECONSCLASSIFIER((*freeClassifier)),)
Definition: cons_decomp.cpp:2992
static std::vector< PARTIALDECOMP * > getSelectedPartialdecs(SCIP *scip, std::vector< PARTIALDECOMP * > &selectedpartialdecs)
gets all selected partialdecs
Definition: cons_decomp.cpp:358
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
class storing partialdecs and the problem matrix
SCIP_Real * DECdecompGetDetectorPctConssFromOpen(DEC_DECOMP *decomp)
Definition: decomp.c:1936
std::vector< SCIP_Real > & getPctVarsFromFreeVector()
Gets fraction of variables that are not longer open for detectors in detectorchain.
Definition: class_partialdecomp.cpp:4330
void GCGgetVisualizationFilename(SCIP *scip, PARTIALDECOMP *partialdec, const char *extension, char *filename)
Definition: miscvisualization.cpp:54
SCIP_RETCODE GCGconshdlrDecompChooseCandidatesFromSelected(SCIP *scip, std::vector< std::pair< gcg::PARTIALDECOMP *, SCIP_Real > > &candidates, SCIP_Bool original, SCIP_Bool printwarnings)
Definition: cons_decomp.cpp:4816
SCIP_Bool GCGdetectionTookPlace(SCIP *scip, SCIP_Bool original)
Definition: cons_decomp.cpp:5897
void fixConsToBlock(int cons, int block)
adds a constraint to a block
Definition: class_partialdecomp.cpp:4894
int strongdetectiondualvalrandommethod
Definition: cons_decomp.cpp:169
#define DEFAULT_ENABLEORIGCLASSIFICATION
Definition: cons_decomp.cpp:105
gcg::PARTIALDECOMP * workonpartialdec
Definition: class_detprobdata.h:675
std::vector< PARTIALDECOMP * > & getOpenPartialdecs()
determines all partialdecs from current (open) partialdec data structure
Definition: class_detprobdata.cpp:722
SCIP_RETCODE GCGconshdlrDecompCalcSetPartForWhiteAggScore(SCIP *scip, int partialdecid, SCIP_Real *score)
calculates the setpartfwhiteagg score of a partialdec
Definition: cons_decomp.cpp:4480
SCIP_HASHMAP * DECdecompGetConstoblock(DEC_DECOMP *decomp)
Definition: decomp.c:1221
#define DEFAULT_AGGREGATIONLIMITNCONSSPERBLOCK
Definition: cons_decomp.cpp:107
SCIP_Real getMaxForWhiteScore()
gets the maximum foreseeing white area score
Definition: class_partialdecomp.cpp:5544
SCIP_RETCODE GCGconshdlrDecompSetDetection(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
sets detector parameters values
Definition: cons_decomp.cpp:5764
SCIP_Bool GCGconshdlrDecompCheckConsistency(SCIP *scip)
check whether partialdecs are consistent
Definition: cons_decomp.cpp:4766
std::vector< SCIP_CONS * > getRelevantConss()
returns pointers to all constraints that are not marked as deleted or obsolete
Definition: class_detprobdata.cpp:868
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
int getNVarPartitions()
returns number of different variable partitions
Definition: class_detprobdata.cpp:842
DEC_DECOMP * DECgetBestDecomp(SCIP *scip, SCIP_Bool printwarnings)
Gets the best known decomposition.
Definition: cons_decomp.cpp:2898
void printBlockcandidateInformation(SCIP *scip, FILE *file)
output method for json file writer to write block candidate information
Definition: class_detprobdata.cpp:1138
SCIP_Bool GCGconshdlrDecompPresolvedDetprobdataExists(SCIP *scip)
returns whether or not a detprobdata structure for the presolved problem exists
Definition: cons_decomp.cpp:5697
@ GCG_RANDOM_DUAL_EXPECTED_OVERESTIMATE
Definition: cons_decomp.cpp:224
SCIP_RETCODE SCIPincludeConshdlrDecomp(SCIP *scip)
creates the constraint handler for decomp and includes it in SCIP
Definition: cons_decomp.cpp:5969