heur.c
Go to the documentation of this file.
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ 79 SCIP_CALL( SCIPsetHeurPriority(scip, (SCIP_HEUR*)paramdata, SCIPparamGetInt(param)) ); /*lint !e740*/ 165 SCIP_ALLOC( BMSreallocMemoryArray(&heur->divesets, heur->ndivesets + 1) ); /*lint !e776 I expect no overflow here */ 179 const char* name, /**< name for the diveset, or NULL if the name of the heuristic should be used */ 185 SCIP_Real maxlpiterquot, /**< maximal fraction of diving LP iterations compared to node LP iterations */ 186 SCIP_Real maxdiveubquot, /**< maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound) 188 SCIP_Real maxdiveavgquot, /**< maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound) 190 SCIP_Real maxdiveubquotnosol, /**< maximal UBQUOT when no solution was found yet (0.0: no limit) */ 191 SCIP_Real maxdiveavgquotnosol,/**< maximal AVGQUOT when no solution was found yet (0.0: no limit) */ 192 SCIP_Real lpresolvedomchgquot,/**< percentage of immediate domain changes during probing to trigger LP resolve */ 193 int lpsolvefreq, /**< LP solve frequency for (0: only if enough domain reductions are found by propagation)*/ 196 SCIP_Bool onlylpbranchcands, /**< should only LP branching candidates be considered instead of the slower but 198 SCIP_DIVETYPE divetypemask, /**< bit mask that represents the supported dive types by this dive set */ 199 SCIP_DECL_DIVESETGETSCORE((*divesetgetscore)) /**< method for candidate score and rounding direction */ 212 /* for convenience, the name gets inferred from the heuristic to which the diveset is added if no name is provided */ 235 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxlpiterquot", (*diveset)->name); 247 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxdiveubquot", (*diveset)->name); 250 "maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound) where diving is performed (0.0: no limit)", 253 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxdiveavgquot", (*diveset)->name); 256 "maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound) where diving is performed (0.0: no limit)", 259 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxdiveubquotnosol", (*diveset)->name); 265 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/maxdiveavgquotnosol", (*diveset)->name); 277 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/lpresolvedomchgquot", (*diveset)->name); 280 &(*diveset)->lpresolvedomchgquot, FALSE, lpresolvedomchgquot, 0.0, SCIP_REAL_MAX, NULL, NULL) ); 285 "LP solve frequency for diving heuristics (0: only after enough domain changes have been found)", 289 (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "heuristics/%s/onlylpbranchcands", (*diveset)->name); 441 return (diveset->nsolcalls == 0 ? 0.0 : diveset->totalsoldepth / (SCIP_Real)diveset->nsolcalls); 490 /** get the maximum upper bound quotient parameter of the diving settings if no solution is available */ 505 /** get the maximum upper bound quotient parameter of the diving settings if an incumbent solution exists */ 513 /** get the average upper bound quotient parameter of the diving settings if an incumbent solution exists */ 529 /** returns the LP solve frequency for diving LPs (0: dynamically based on number of intermediate domain reductions) */ 539 /** returns the domain reduction quotient for triggering an immediate resolve of the diving LP (0.0: always resolve)*/ 564 SCIP_DIVETYPE divetype /**< bit mask that represents the supported dive types by this dive set */ 572 /** update diveset LP statistics, should be called after every LP solved by this diving heuristic */ 616 SCIP_CALL( diveset->divesetgetscore(set->scip, diveset, divetype, divecand, divecandsol, divecandfrac, candscore, roundup) ); 655 unsigned int timingmask, /**< positions in the node solving loop where heuristic should be executed */ 657 SCIP_DECL_HEURCOPY ((*heurcopy)), /**< copy method of primal heuristic or NULL if you don't want to copy your plugin into sub-SCIPs */ 661 SCIP_DECL_HEURINITSOL ((*heurinitsol)), /**< solving process initialization method of primal heuristic */ 662 SCIP_DECL_HEUREXITSOL ((*heurexitsol)), /**< solving process deinitialization method of primal heuristic */ 712 (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "frequency for calling primal heuristic <%s> (-1: never, 0: only at depth freqofs)", name); 716 (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "frequency offset for calling primal heuristic <%s>", name); 720 (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "maximal depth level to call primal heuristic <%s> (-1: no limit)", name); 906 if( ((heur->timingmask & SCIP_HEURTIMING_BEFOREPRESOL) && heurtiming == SCIP_HEURTIMING_BEFOREPRESOL) 907 || ((heur->timingmask & SCIP_HEURTIMING_DURINGPRESOLLOOP) && heurtiming == SCIP_HEURTIMING_DURINGPRESOLLOOP) ) 909 /* heuristic may be executed before/during presolving. Do so, if it was not disabled by setting the frequency to -1 */ 915 /* heuristic was skipped on intermediate pseudo nodes: check, if a node matching the execution frequency lies 924 /* heuristic may be executed on every node: check, if the current depth matches the execution frequency and offset */ 925 execute = (heur->freq > 0 && depth >= heur->freqofs && (depth - heur->freqofs) % heur->freq == 0); 937 /* if the heuristic should be called after plunging but not during plunging, delay it if we are in plunging */ 951 /* execute heuristic only if its timing mask fits the current point in the node solving process */ 981 assert(depth >= 0 || heurtiming == SCIP_HEURTIMING_BEFOREPRESOL || heurtiming == SCIP_HEURTIMING_DURINGPRESOLLOOP); 1001 SCIPdebugMessage("executing primal heuristic <%s> in depth %d (delaypos: %d)\n", heur->name, depth, heur->delaypos); 1042 SCIPdebugMessage("delaying execution of primal heuristic <%s> in depth %d (delaypos: %d), heur was%s delayed before, had delaypos %d\n", 1083 SCIP_DECL_HEURCOPY ((*heurcopy)) /**< copy callback of primal heuristic or NULL if you don't want to copy your plugin into sub-SCIPs */ 1127 SCIP_DECL_HEURINITSOL ((*heurinitsol)) /**< solving process initialization callback of primal heuristic */ 1138 SCIP_DECL_HEUREXITSOL ((*heurexitsol)) /**< solving process deinitialization callback of primal heuristic */ 1262 /** gets maximal depth level for calling primal heuristic (returns -1, if no depth limit exists) */
void SCIPheurSetInitsol(SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol))) Definition: heur.c:1125 Definition: type_result.h:33 Definition: type_result.h:47 SCIP_Longint SCIPdivesetGetNProbingNodes(SCIP_DIVESET *diveset) Definition: heur.c:455 Definition: type_result.h:34 SCIP_Bool SCIPdivesetUseBacktrack(SCIP_DIVESET *diveset) Definition: heur.c:522 SCIP_RETCODE SCIPdivesetGetScore(SCIP_DIVESET *diveset, SCIP_SET *set, SCIP_DIVETYPE divetype, SCIP_VAR *divecand, SCIP_Real divecandsol, SCIP_Real divecandfrac, SCIP_Real *candscore, SCIP_Bool *roundup) Definition: heur.c:599 SCIP_RETCODE SCIPdivesetCreate(SCIP_DIVESET **diveset, SCIP_HEUR *heur, const char *name, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, SCIP_Real minreldepth, SCIP_Real maxreldepth, SCIP_Real maxlpiterquot, SCIP_Real maxdiveubquot, SCIP_Real maxdiveavgquot, SCIP_Real maxdiveubquotnosol, SCIP_Real maxdiveavgquotnosol, SCIP_Real lpresolvedomchgquot, int lpsolvefreq, int maxlpiterofs, SCIP_Bool backtrack, SCIP_Bool onlylpbranchcands, SCIP_DIVETYPE divetypemask, SCIP_DECL_DIVESETGETSCORE((*divesetgetscore))) Definition: heur.c:176 internal methods for clocks and timing issues void SCIPheurSetExitsol(SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol))) Definition: heur.c:1136 Definition: struct_var.h:196 SCIP_Longint SCIPdivesetGetNBacktracks(SCIP_DIVESET *diveset) Definition: heur.c:465 SCIP_Real SCIPdivesetGetAvgSolutionDepth(SCIP_DIVESET *diveset) Definition: heur.c:435 static SCIP_RETCODE heurAddDiveset(SCIP_HEUR *heur, SCIP_DIVESET *diveset) Definition: heur.c:146 SCIP_Real SCIPdivesetGetLPResolveDomChgQuot(SCIP_DIVESET *diveset) Definition: heur.c:540 Definition: struct_primal.h:36 SCIP_RETCODE SCIPheurExec(SCIP_HEUR *heur, SCIP_SET *set, SCIP_PRIMAL *primal, int depth, int lpstateforkdepth, SCIP_HEURTIMING heurtiming, SCIP_Bool nodeinfeasible, int *ndelayedheurs, SCIP_RESULT *result) Definition: heur.c:958 Definition: struct_message.h:35 void SCIPheurSetPriority(SCIP_HEUR *heur, SCIP_SET *set, int priority) Definition: heur.c:1218 int SCIPdivesetGetMaxSolutionDepth(SCIP_DIVESET *diveset) Definition: heur.c:425 internal methods for handling parameter settings SCIP_RETCODE SCIPheurCopyInclude(SCIP_HEUR *heur, SCIP_SET *set) Definition: heur.c:624 void SCIPclockEnableOrDisable(SCIP_CLOCK *clck, SCIP_Bool enable) Definition: clock.c:250 internal methods for collecting primal CIP solutions and primal informations #define SCIP_HEURTIMING_AFTERPSEUDOPLUNGE Definition: type_timing.h:80 Definition: type_retcode.h:44 Definition: struct_sol.h:50 Definition: struct_set.h:56 void SCIPdivesetUpdateLPStats(SCIP_DIVESET *diveset, SCIP_STAT *stat, SCIP_Longint niterstoadd) Definition: heur.c:573 Definition: type_clock.h:34 SCIP_Real SCIPdivesetGetMaxLPIterQuot(SCIP_DIVESET *diveset) Definition: heur.c:475 Definition: type_result.h:35 Definition: type_retcode.h:42 void SCIPheurSetCopy(SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy))) Definition: heur.c:1081 Definition: type_retcode.h:33 SCIP_RETCODE SCIPsetHeurPriority(SCIP *scip, SCIP_HEUR *heur, int priority) Definition: scip.c:7430 void SCIPheurSetTimingmask(SCIP_HEUR *heur, SCIP_HEURTIMING timingmask) Definition: heur.c:1187 internal methods for global SCIP settings #define SCIP_HEURTIMING_DURINGPRESOLLOOP Definition: type_timing.h:85 SCIP_RETCODE SCIPsetAddIntParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata) Definition: set.c:2455 Definition: struct_heur.h:75 void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata) Definition: heur.c:1068 SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype) Definition: clock.c:160 datastructures for primal heuristics public data structures and miscellaneous methods SCIP_Bool SCIPdivesetSupportsType(SCIP_DIVESET *diveset, SCIP_DIVETYPE divetype) Definition: heur.c:562 SCIP_Real SCIPdivesetGetUbQuotNoSol(SCIP_DIVESET *diveset) Definition: heur.c:491 SCIP_Real SCIPdivesetGetMaxRelDepth(SCIP_DIVESET *diveset) Definition: heur.c:349 void SCIPdivesetUpdateStats(SCIP_DIVESET *diveset, SCIP_STAT *stat, int depth, int nprobingnodes, int nbacktracks, SCIP_Longint nsolsfound, SCIP_Longint nbestsolsfound, SCIP_Bool leavesol) Definition: heur.c:108 Definition: struct_heur.h:36 SCIP_Bool SCIPheurShouldBeExecuted(SCIP_HEUR *heur, int depth, int lpstateforkdepth, SCIP_HEURTIMING heurtiming, SCIP_Bool *delayed) Definition: heur.c:896 SCIP_Real SCIPdivesetGetMinRelDepth(SCIP_DIVESET *diveset) Definition: heur.c:341 void SCIPheurSetFree(SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree))) Definition: heur.c:1092 void SCIPheurEnableOrDisableClocks(SCIP_HEUR *heur, SCIP_Bool enable) Definition: heur.c:1313 SCIP_Longint SCIPdivesetGetNLPIterations(SCIP_DIVESET *diveset) Definition: heur.c:445 int SCIPdivesetGetMinSolutionDepth(SCIP_DIVESET *diveset) Definition: heur.c:415 void SCIPdivesetSetWorkSolution(SCIP_DIVESET *diveset, SCIP_SOL *sol) Definition: heur.c:320 SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur) Definition: heur.c:1293 SCIP_RETCODE SCIPheurCreate(SCIP_HEUR **heur, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, unsigned int timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEURCOPY((*heurcopy)), SCIP_DECL_HEURFREE((*heurfree)), SCIP_DECL_HEURINIT((*heurinit)), SCIP_DECL_HEUREXIT((*heurexit)), SCIP_DECL_HEURINITSOL((*heurinitsol)), SCIP_DECL_HEUREXITSOL((*heurexitsol)), SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata) Definition: heur.c:643 void SCIPheurSetExit(SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit))) Definition: heur.c:1114 public methods for message output void SCIPheurSetInit(SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit))) Definition: heur.c:1103 SCIP_Real SCIPdivesetGetAvgQuotNoSol(SCIP_DIVESET *diveset) Definition: heur.c:499 int SCIPdivesetGetMaxLPIterOffset(SCIP_DIVESET *diveset) Definition: heur.c:483 int SCIPdivesetGetNSolutionCalls(SCIP_DIVESET *diveset) Definition: heur.c:375 Definition: struct_stat.h:44 common defines and data types used in all packages of SCIP SCIP_RETCODE SCIPsetAddRealParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata) Definition: set.c:2503 internal methods for primal heuristics Definition: objbranchrule.h:33 SCIP_RETCODE SCIPsetAddBoolParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata) Definition: set.c:2433 SCIP_SOL * SCIPdivesetGetWorkSolution(SCIP_DIVESET *diveset) Definition: heur.c:310 SCIP_Longint SCIPdivesetGetSolSuccess(SCIP_DIVESET *diveset) Definition: heur.c:357 SCIP callable library. SCIP_Bool SCIPdivesetUseOnlyLPBranchcands(SCIP_DIVESET *diveset) Definition: heur.c:552 |