heur_rootsoldiving.c
Go to the documentation of this file.
17 * @brief LP diving heuristic that changes variable's objective values using root LP solution as guide 21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ 30 #define HEUR_DESC "LP diving heuristic that changes variable's objective values using root LP solution as guide" 46 #define DEFAULT_MAXLPITERQUOT 0.01 /**< maximal fraction of diving LP iterations compared to node LP iterations */ 48 #define DEFAULT_MAXSOLS -1 /**< total number of feasible solutions found up to which heuristic is called 50 #define DEFAULT_DEPTHFAC 0.5 /**< maximal diving depth: number of binary/integer variables times depthfac */ 51 #define DEFAULT_DEPTHFACNOSOL 2.0 /**< maximal diving depth factor if no feasible solution was found yet */ 63 SCIP_Real maxlpiterquot; /**< maximal fraction of diving LP iterations compared to node LP iterations */ 67 SCIP_Real depthfac; /**< maximal diving depth: number of binary/integer variables times depthfac */ 68 SCIP_Real depthfacnosol; /**< maximal diving depth factor if no feasible solution was found yet */ 229 /* only try to dive, if we are in the correct part of the tree, given by minreldepth and maxreldepth */ 240 maxnlpiterations = (SCIP_Longint)((1.0 + 10.0*(nsolsfound+1.0)/(ncalls+1.0)) * heurdata->maxlpiterquot * nlpiterations); 275 /* get current LP objective value, and calculate length of a single step in an objective coefficient */ 281 /* initialize array storing the preferred soft rounding directions and counting the integral value rounds */ 293 SCIPdebugMessage("(node %" SCIP_LONGINT_FORMAT ") executing rootsoldiving heuristic: depth=%d, %d fractionals, dualbound=%g, maxnlpiterations=%" SCIP_LONGINT_FORMAT ", maxdivedepth=%d, LPobj=%g, objstep=%g\n", 294 SCIPgetNNodes(scip), SCIPgetDepth(scip), nlpcands, SCIPgetDualbound(scip), maxnlpiterations, maxdivedepth, 325 SCIPdebugMessage("rootsoldiving found roundable primal solution: obj=%g\n", SCIPgetSolOrigObj(scip, heurdata->sol)); 345 SCIPdebugMessage("dive %d/%d, LP iter %" SCIP_LONGINT_FORMAT "/%" SCIP_LONGINT_FORMAT ":\n", divedepth, maxdivedepth, heurdata->nlpiterations, maxnlpiterations); 367 /* if the variable became integral after a soft rounding, count the rounds; after a while, fix it to its 389 /* if the variable was soft rounded most of the time downwards, round it downwards by changing the bounds; 409 /* if the variable was soft rounded most of the time upwards, round it upwards by changing the bounds; 442 i, SCIPvarGetName(var), SCIPvarGetLPSol(var), rootsol[i], SCIPgetVarObjDive(scip, var), objchgvals[i]); 467 retcode = SCIPsolveDiveLP(scip, MAX((int)(maxnlpiterations - heurdata->nlpiterations), MINLPITER), &lperror, NULL); 470 /* Errors in the LP solver should not kill the overall solving process, if the LP is just needed for a heuristic. 471 * Hence in optimized mode, the return code is caught and a warning is printed, only in debug mode, SCIP will stop. 481 SCIPwarningMessage(scip, "Error while solving LP in Rootsoldiving heuristic; LP solve terminated with code <%d>\n", retcode); 482 SCIPwarningMessage(scip, "This does not affect the remaining solution procedure --> continue\n"); 508 SCIPdebugMessage(" -> opposite hard rounding <%s> >= %g\n", SCIPvarGetName(var), hardroundingnewbd + 1.0); 514 SCIPdebugMessage(" -> opposite hard rounding <%s> <= %g\n", SCIPvarGetName(var), hardroundingnewbd - 1.0); 526 SCIPdebugMessage("---> diving finished: lpsolstat = %d, depth %d/%d, LP iter %" SCIP_LONGINT_FORMAT "/%" SCIP_LONGINT_FORMAT "\n", 536 SCIPdebugMessage("rootsoldiving found primal solution: obj=%g\n", SCIPgetSolOrigObj(scip, heurdata->sol));
Definition: type_result.h:33 Definition: type_result.h:47 Definition: type_result.h:34 Definition: struct_scip.h:53 SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy))) Definition: scip.c:7297 void SCIPwarningMessage(SCIP *scip, const char *formatstr,...) Definition: scip.c:1248 library methods for diving heuristics Definition: struct_var.h:196 SCIP_RETCODE SCIPincludeHeurRootsoldiving(SCIP *scip) Definition: heur_rootsoldiving.c:573 SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, unsigned int timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata) Definition: scip.c:7252 SCIP_RETCODE SCIPchgVarUbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound) Definition: scip.c:31772 SCIP_RETCODE SCIPchgVarLbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound) Definition: scip.c:31740 Definition: struct_sol.h:50 SCIP_RETCODE SCIPaddIntParam(SCIP *scip, 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: scip.c:3573 static SCIP_DECL_HEUREXEC(heurExecRootsoldiving) Definition: heur_rootsoldiving.c:160 Definition: type_result.h:35 SCIP_RETCODE SCIPchgVarObjDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj) Definition: scip.c:31699 SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur) Definition: scip.c:34002 Definition: type_retcode.h:33 Definition: struct_heur.h:75 void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata) Definition: heur.c:1068 Definition: type_lp.h:34 LP diving heuristic that changes variables' objective values using root LP solution as guide... static SCIP_DECL_HEURFREE(heurFreeRootsoldiving) Definition: heur_rootsoldiving.c:96 static SCIP_DECL_HEUREXIT(heurExitRootsoldiving) Definition: heur_rootsoldiving.c:140 SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit))) Definition: scip.c:7345 SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit))) Definition: scip.c:7329 Definition: type_lp.h:36 SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur) Definition: heur.c:1293 SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree))) Definition: scip.c:7313 Definition: type_lp.h:35 SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars) Definition: scip.c:10572 static SCIP_DECL_HEURCOPY(heurCopyRootsoldiving) Definition: heur_rootsoldiving.c:82 SCIP_RETCODE SCIPsolveDiveLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff) Definition: scip.c:31999 Definition: objbranchrule.h:33 SCIP_RETCODE SCIPaddRealParam(SCIP *scip, 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: scip.c:3629 SCIP_RETCODE SCIPtrySol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored) Definition: scip.c:36217 static SCIP_DECL_HEURINIT(heurInitRootsoldiving) Definition: heur_rootsoldiving.c:116 SCIP_RETCODE SCIProundSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *success) Definition: scip.c:35909 |