29 #define HEUR_NAME "fixandinfer" 30 #define HEUR_DESC "iteratively fixes variables and propagates inferences" 31 #define HEUR_DISPCHAR 'I' 32 #define HEUR_PRIORITY -500000 34 #define HEUR_FREQOFS 0 35 #define HEUR_MAXDEPTH -1 36 #define HEUR_TIMING SCIP_HEURTIMING_AFTERNODE 37 #define HEUR_USESSUBSCIP FALSE 39 #define MAXDIVEDEPTH 100 46 #define DEFAULT_PROPROUNDS 0 47 #define DEFAULT_MINFIXINGS 100 83 assert(pseudocands !=
NULL);
84 assert(npseudocands > 0);
91 ncands = npseudocands;
96 for( c = 0; c < ncands; ++c )
99 if( score > bestscore )
105 assert(bestcand != -1);
108 var = pseudocands[bestcand];
138 SCIPdebugMsg(scip,
" -> fixed variable <%s>[%g,%g] = %g (%d candidates left)\n",
155 assert(heur !=
NULL);
172 assert(heurdata !=
NULL);
209 assert(heurdata !=
NULL);
216 startncands = ncands;
227 SCIPdebugMsg(
scip,
"starting fix-and-infer heuristic with %d unfixed integral variables\n", ncands);
239 while( !cutoff && ncands > 0
240 && (divedepth < heurdata->minfixings || (startncands - ncands) * 2 *
MAXDIVEDEPTH >= startncands * divedepth)
263 else if( ncands == 0 )
284 SCIPdebugMsg(
scip,
"probing was aborted (probing depth: %d, fixed: %d/%d)", divedepth, startncands - ncands, startncands);
314 assert(heur !=
NULL);
322 "heuristics/fixandinfer/proprounds",
323 "maximal number of propagation rounds in probing subproblems (-1: no limit, 0: auto)",
326 "heuristics/fixandinfer/minfixings",
327 "minimal number of fixings to apply before dive may be aborted",
int SCIPgetNPrioPseudoBranchBins(SCIP *scip)
SCIP_Real SCIPfeastol(SCIP *scip)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
static SCIP_RETCODE fixVariable(SCIP *scip, SCIP_VAR **pseudocands, int npseudocands, SCIP_Real large)
static SCIP_DECL_HEUREXEC(heurExecFixandinfer)
static SCIP_DECL_HEURFREE(heurFreeFixandinfer)
SCIP_Real SCIPinfinity(SCIP *scip)
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)
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
#define SCIPallocBlockMemory(scip, ptr)
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)
int SCIPgetNContVars(SCIP *scip)
static SCIP_DECL_HEURCOPY(heurCopyFixandinfer)
#define DEFAULT_PROPROUNDS
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 SCIPtryCurrentSol(SCIP *scip, SCIP_HEUR *heur, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
SCIP_RETCODE SCIPfixVarProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval)
SCIP_RETCODE SCIPendProbing(SCIP *scip)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPgetPseudoBranchCands(SCIP *scip, SCIP_VAR ***pseudocands, int *npseudocands, int *npriopseudocands)
#define DEFAULT_MINFIXINGS
int SCIPgetDepth(SCIP *scip)
fix-and-infer primal heuristic
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
#define SCIP_MAXTREEDEPTH
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_Real SCIPgetVarSol(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPnewProbingNode(SCIP *scip)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPstartProbing(SCIP *scip)
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
SCIP_RETCODE SCIPincludeHeurFixandinfer(SCIP *scip)
SCIP_Real SCIPgetVarAvgInferenceScore(SCIP *scip, SCIP_VAR *var)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)