34 #define HEUR_NAME "bound" 35 #define HEUR_DESC "heuristic which fixes all integer variables to a bound and solves the remaining LP" 36 #define HEUR_DISPCHAR 'H' 37 #define HEUR_PRIORITY -1107000 39 #define HEUR_FREQOFS 0 40 #define HEUR_MAXDEPTH -1 41 #define HEUR_TIMING SCIP_HEURTIMING_BEFORENODE 42 #define HEUR_USESSUBSCIP FALSE 44 #define DEFAULT_ONLYWITHOUTSOL TRUE 45 #define DEFAULT_MAXPROPROUNDS 0 46 #define DEFAULT_BOUND 'l' 87 maxproprounds = heurdata->maxproprounds;
88 if( maxproprounds == -2 )
93 nvars = nbinvars + nintvars;
98 for( v = 0; v < nvars; ++v )
106 for( v = 0; v < nvars; ++v )
116 for( v = 0; v < nvars; ++v )
130 SCIPdebugMsg(scip,
"fixing %d: variable <%s> to lower bound <%g> (%d pseudo cands)\n",
137 SCIPdebugMsg(scip,
"fixing %d: variable <%s> to upper bound <%g> (%d pseudo cands)\n",
142 if( heurdata->maxproprounds != 0 )
159 SCIPdebugMsg(scip,
"backtracking ended with %sfeasible problem\n", (infeasible ?
"in" :
""));
167 SCIPdebugMsg(scip,
"probing ended with %sfeasible problem\n", infeasible ?
"in" :
"");
177 SCIPdebugMsg(scip,
"starting solving bound-heur LP at time %g, LP iterations: %" SCIP_LONGINT_FORMAT
"\n",
190 SCIPwarningMessage(scip,
"Error while solving LP in bound heuristic; LP solve terminated with code <%d>\n",
202 SCIPdebugMsg(scip,
" -> error=%u, status=%d\n", lperror, lpstatus);
221 SCIPdebugMsg(scip,
"bound heuristic found roundable primal solution: obj=%g\n",
261 assert(
scip != NULL);
262 assert(heur != NULL);
292 assert(heur != NULL);
293 assert(
scip != NULL);
294 assert(result != NULL);
305 assert(heurdata != NULL);
335 if( heurdata->bound ==
'l' || heurdata->bound ==
'b' )
339 if( heurdata->bound ==
'u' || heurdata->bound ==
'b' )
367 assert(heur != NULL);
376 "Should heuristic only be executed if no primal solution was found, yet?",
380 "maximum number of propagation rounds during probing (-1 infinity, -2 parameter settings)",
384 "to which bound should integer variables be fixed? ('l'ower, 'u'pper, or 'b'oth)",
enum SCIP_Result SCIP_RESULT
SCIP_RETCODE SCIPlinkLPSol(SCIP *scip, SCIP_SOL *sol)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
static SCIP_DECL_HEURCOPY(heurCopyBound)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
SCIP_RETCODE SCIPbacktrackProbing(SCIP *scip, int probingdepth)
SCIP_Longint SCIPgetNLPIterations(SCIP *scip)
static SCIP_DECL_HEUREXEC(heurExecBound)
int SCIPgetProbingDepth(SCIP *scip)
#define DEFAULT_MAXPROPROUNDS
internal methods for clocks and timing issues
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
int SCIPgetNPseudoBranchCands(SCIP *scip)
SCIP_RETCODE SCIPincludeHeurBound(SCIP *scip)
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
SCIP_RETCODE SCIPcutoffNode(SCIP *scip, SCIP_NODE *node)
enum SCIP_Retcode SCIP_RETCODE
struct SCIP_HeurData SCIP_HEURDATA
#define SCIPfreeBlockMemory(scip, ptr)
SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, SCIP_HEURTIMING timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
SCIP_RETCODE SCIPconstructLP(SCIP *scip, SCIP_Bool *cutoff)
enum SCIP_LPSolStat SCIP_LPSOLSTAT
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
#define SCIPallocBlockMemory(scip, ptr)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
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)
SCIP_Bool SCIPisLPConstructed(SCIP *scip)
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
static SCIP_RETCODE applyBoundHeur(SCIP *scip, SCIP_HEUR *heur, SCIP_HEURDATA *heurdata, SCIP_Bool lower, SCIP_RESULT *result)
const char * SCIPheurGetName(SCIP_HEUR *heur)
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
SCIP_RETCODE SCIPpropagateProbing(SCIP *scip, int maxproprounds, SCIP_Bool *cutoff, SCIP_Longint *ndomredsfound)
SCIP_RETCODE SCIPfixVarProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval)
SCIP_RETCODE SCIPendProbing(SCIP *scip)
const char * SCIPvarGetName(SCIP_VAR *var)
static SCIP_DECL_HEURFREE(heurFreeBound)
SCIP_RETCODE SCIPsolveProbingLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
#define DEFAULT_ONLYWITHOUTSOL
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
SCIP_RETCODE SCIProundSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *success)
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
SCIP_RETCODE SCIPflushLP(SCIP *scip)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPtrySol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
SCIP_RETCODE SCIPaddCharParam(SCIP *scip, const char *name, const char *desc, char *valueptr, SCIP_Bool isadvanced, char defaultvalue, const char *allowedvalues, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPstartProbing(SCIP *scip)
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
heuristic which fixes all integer variables to a bound (lower/upper) and solves the remaining LP ...
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)