31 #define HEUR_NAME "mutation" 32 #define HEUR_DESC "mutation heuristic randomly fixing variables" 33 #define HEUR_DISPCHAR 'M' 34 #define HEUR_PRIORITY -1103000 36 #define HEUR_FREQOFS 8 37 #define HEUR_MAXDEPTH -1 38 #define HEUR_TIMING SCIP_HEURTIMING_AFTERNODE 39 #define HEUR_USESSUBSCIP TRUE 41 #define DEFAULT_NODESOFS 500 42 #define DEFAULT_MAXNODES 5000 43 #define DEFAULT_MINIMPROVE 0.01 44 #define DEFAULT_MINNODES 500 45 #define DEFAULT_MINFIXINGRATE 0.8 46 #define DEFAULT_NODESQUOT 0.1 47 #define DEFAULT_NWAITINGNODES 200 48 #define DEFAULT_USELPROWS FALSE 50 #define DEFAULT_COPYCUTS TRUE 52 #define DEFAULT_BESTSOLLIMIT -1 53 #define DEFAULT_USEUCT FALSE 54 #define DEFAULT_RANDSEED 19 105 assert(fixedvars !=
NULL);
106 assert(fixedvals !=
NULL);
114 *nfixedvars = (int)(minfixingrate * (nbinvars + nintvars));
117 if( *nfixedvars == 0 || *nfixedvars == nbinvars + nintvars )
122 assert(*nfixedvars < nbinvars + nintvars);
124 ndiscretevars = nbinvars + nintvars;
133 for( i = 0; i < *nfixedvars; ++i )
149 else if(
SCIPisGT(scip, solval, ub) )
160 fixedvals[i] = solval;
182 assert(scip !=
NULL);
183 assert(subscip !=
NULL);
184 assert(subvars !=
NULL);
185 assert(subsol !=
NULL);
221 assert(heur !=
NULL);
236 assert(heur !=
NULL);
241 assert(heurdata !=
NULL);
256 assert(heur !=
NULL);
261 assert(heurdata !=
NULL);
264 heurdata->usednodes = 0;
279 assert(heur !=
NULL);
284 assert(heurdata !=
NULL);
322 assert( heur !=
NULL );
324 assert( result !=
NULL );
328 assert(heurdata !=
NULL);
350 if( nbinvars + nintvars == 0 )
359 maxnnodes += heurdata->nodesofs;
362 nsubnodes = maxnnodes - heurdata->usednodes;
363 nsubnodes =
MIN(nsubnodes, heurdata->maxnodes);
366 if( nsubnodes < heurdata->minnodes )
402 heurdata->uselprows, heurdata->copycuts, &success,
NULL) );
404 for( i = 0; i < nvars; i++ )
495 cutoff =
MIN(upperbound, cutoff);
507 SCIPwarningMessage(
scip,
"Error while solving subproblem in Mutation heuristic; sub-SCIP terminated with code <%d>\n",retcode);
533 for( i = 0; i < nsubsols && !success; ++i )
572 assert(heur !=
NULL);
582 "number of nodes added to the contingent of the total nodes",
586 "maximum number of nodes to regard in the subproblem",
590 "minimum number of nodes required to start the subproblem",
594 "number of nodes without incumbent change that heuristic should wait",
598 "contingent of sub problem nodes in relation to the number of nodes of the original problem",
602 "percentage of integer variables that have to be fixed",
606 "factor by which " HEUR_NAME " should at least improve the incumbent",
610 "should subproblem be created out of the rows in the LP rows?",
614 "if uselprows == FALSE, should all active cuts from cutpool be copied to constraints in subproblem?",
618 "limit on number of improving incumbent solutions in sub-CIP",
622 "should uct node selection be used at the beginning of the search?",
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
static SCIP_DECL_HEURCOPY(heurCopyMutation)
SCIP_RETCODE SCIPrandomCreate(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
static SCIP_DECL_HEUREXIT(heurExitMutation)
SCIP_RETCODE SCIPincludeHeurMutation(SCIP *scip)
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
static SCIP_DECL_HEURFREE(heurFreeMutation)
#define DEFAULT_NWAITINGNODES
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur)
SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
int SCIPgetNOrigVars(SCIP *scip)
static SCIP_RETCODE createNewSol(SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEUR *heur, SCIP_SOL *subsol, SCIP_Bool *success)
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
SCIP_SOL ** SCIPgetSols(SCIP *scip)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_RETCODE SCIPcopyLimits(SCIP *sourcescip, SCIP *targetscip)
void SCIPrandomPermuteArray(SCIP_RANDNUMGEN *randnumgen, void **array, int begin, int end)
enum SCIP_Retcode SCIP_RETCODE
#define DEFAULT_MINFIXINGRATE
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
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 * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
#define SCIPfreeBufferArray(scip, ptr)
SCIP_RETCODE SCIPcreate(SCIP **scip)
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_RETCODE SCIPprintStatistics(SCIP *scip, FILE *file)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
static SCIP_DECL_HEUREXEC(heurExecMutation)
void SCIPrandomFree(SCIP_RANDNUMGEN **randnumgen)
SCIP_RETCODE SCIPsolve(SCIP *scip)
const char * SCIPheurGetName(SCIP_HEUR *heur)
SCIP_Bool SCIPisParamFixed(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
#define DEFAULT_NODESQUOT
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
SCIP_RETCODE SCIPmergeVariableStatistics(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR **sourcevars, SCIP_VAR **targetvars, int nvars)
LNS heuristic that tries to randomly mutate the incumbent solution.
SCIP_Real SCIPgetLowerbound(SCIP *scip)
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
#define DEFAULT_MINIMPROVE
#define SCIPallocBufferArray(scip, ptr, num)
public data structures and miscellaneous methods
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
SCIP_RETCODE SCIPtrySolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
unsigned int SCIPinitializeRandomSeed(SCIP *scip, int initialseedvalue)
int SCIPgetNSols(SCIP *scip)
#define BMScopyMemoryArray(ptr, source, num)
Constraint handler for linear constraints in their most general form, .
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
#define DEFAULT_USELPROWS
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
SCIP_NODESEL * SCIPfindNodesel(SCIP *scip, const char *name)
SCIP_RETCODE SCIPcopyLargeNeighborhoodSearch(SCIP *sourcescip, SCIP *subscip, SCIP_HASHMAP *varmap, const char *suffix, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Bool uselprows, SCIP_Bool copycuts, SCIP_Bool *success, SCIP_Bool *valid)
SCIP_Bool SCIPisStopped(SCIP *scip)
static SCIP_DECL_HEURINIT(heurInitMutation)
SCIP_RETCODE SCIPcheckCopyLimits(SCIP *sourcescip, SCIP_Bool *success)
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define DEFAULT_BESTSOLLIMIT
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
SCIP_Real SCIPsumepsilon(SCIP *scip)
SCIP_Real SCIPgetUpperbound(SCIP *scip)
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
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)
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
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)
SCIP_RETCODE SCIPfree(SCIP **scip)
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
SCIP_Longint SCIPgetSolNodenum(SCIP *scip, SCIP_SOL *sol)
static SCIP_RETCODE determineVariableFixings(SCIP *scip, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int *nfixedvars, SCIP_Real minfixingrate, SCIP_RANDNUMGEN *randnumgen, SCIP_Bool *success)