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);
234 assert(scip != NULL);
235 assert(subscip != NULL);
236 assert(heur != NULL);
237 assert(fixedvars != NULL);
238 assert(fixedvals != NULL);
241 assert(heurdata != NULL);
253 heurdata->uselprows, heurdata->copycuts, &success, NULL) );
255 for( i = 0; i < nvars; i++ )
350 cutoff = MIN(upperbound, cutoff);
381 for( i = 0; i < nsubsols && !success; ++i )
404 assert(
scip != NULL);
405 assert(heur != NULL);
420 assert(heur != NULL);
421 assert(
scip != NULL);
425 assert(heurdata != NULL);
440 assert(heur != NULL);
441 assert(
scip != NULL);
445 assert(heurdata != NULL);
448 heurdata->usednodes = 0;
463 assert(heur != NULL);
464 assert(
scip != NULL);
468 assert(heurdata != NULL);
498 assert( heur != NULL );
499 assert(
scip != NULL );
500 assert( result != NULL );
504 assert(heurdata != NULL);
526 if( nbinvars + nintvars == 0 )
535 maxnnodes += heurdata->nodesofs;
538 nsubnodes = maxnnodes - heurdata->usednodes;
539 nsubnodes = MIN(nsubnodes, heurdata->maxnodes);
542 if( nsubnodes < heurdata->minnodes )
607 assert(heur != NULL);
617 "number of nodes added to the contingent of the total nodes",
621 "maximum number of nodes to regard in the subproblem",
625 "minimum number of nodes required to start the subproblem",
629 "number of nodes without incumbent change that heuristic should wait",
633 "contingent of sub problem nodes in relation to the number of nodes of the original problem",
637 "percentage of integer variables that have to be fixed",
641 "factor by which " HEUR_NAME " should at least improve the incumbent",
645 "should subproblem be created out of the rows in the LP rows?",
649 "if uselprows == FALSE, should all active cuts from cutpool be copied to constraints in subproblem?",
653 "limit on number of improving incumbent solutions in sub-CIP",
657 "should uct node selection be used at the beginning of the search?",
enum SCIP_Result SCIP_RESULT
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
void SCIPfreeRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen)
static SCIP_DECL_HEURCOPY(heurCopyMutation)
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 SCIPcreateRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen, unsigned int initialseed)
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)
static SCIP_RETCODE setupAndSolveSubscipMutation(SCIP *scip, SCIP *subscip, SCIP_HEUR *heur, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars, SCIP_Longint nsubnodes, SCIP_RESULT *result)
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)
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)
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)
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_RETCODE SCIPsetCharParam(SCIP *scip, const char *name, char value)
int SCIPgetNVars(SCIP *scip)
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_VAR ** SCIPgetVars(SCIP *scip)
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)
#define SCIP_CALL_ABORT(x)
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)