improvement heuristic that alters single variable values
Definition in file heur_oneopt.c.
Go to the source code of this file.
Macros | |
#define | HEUR_NAME "oneopt" |
#define | HEUR_DESC "1-opt heuristic which tries to improve setting of single integer variables" |
#define | HEUR_DISPCHAR 'b' |
#define | HEUR_PRIORITY -20000 |
#define | HEUR_FREQ 1 |
#define | HEUR_FREQOFS 0 |
#define | HEUR_MAXDEPTH -1 |
#define | HEUR_TIMING SCIP_HEURTIMING_BEFOREPRESOL | SCIP_HEURTIMING_AFTERNODE |
#define | HEUR_USESSUBSCIP FALSE |
#define | DEFAULT_WEIGHTEDOBJ TRUE |
#define | DEFAULT_DURINGROOT TRUE |
#define | DEFAULT_BEFOREPRESOL FALSE |
#define | DEFAULT_FORCELPCONSTRUCTION FALSE |
#define | DEFAULT_USELOOP TRUE |
Functions | |
static SCIP_RETCODE | createNewSol (SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEUR *heur, SCIP_SOL *subsol, SCIP_Bool *success) |
static SCIP_Real | calcShiftVal (SCIP *scip, SCIP_VAR *var, SCIP_Real solval, SCIP_Real *activities) |
static SCIP_RETCODE | updateRowActivities (SCIP *scip, SCIP_Real *activities, SCIP_VAR *var, SCIP_Real shiftval) |
static | SCIP_DECL_HEURCOPY (heurCopyOneopt) |
static | SCIP_DECL_HEURFREE (heurFreeOneopt) |
static | SCIP_DECL_HEURINITSOL (heurInitsolOneopt) |
static | SCIP_DECL_HEUREXITSOL (heurExitsolOneopt) |
static | SCIP_DECL_HEURINIT (heurInitOneopt) |
static | SCIP_DECL_HEUREXEC (heurExecOneopt) |
SCIP_RETCODE | SCIPincludeHeurOneopt (SCIP *scip) |
#define HEUR_NAME "oneopt" |
Definition at line 32 of file heur_oneopt.c.
Referenced by SCIP_DECL_HEURCOPY(), SCIP_DECL_HEUREXITSOL(), SCIP_DECL_HEURFREE(), SCIP_DECL_HEURINITSOL(), and SCIPincludeHeurOneopt().
#define HEUR_DESC "1-opt heuristic which tries to improve setting of single integer variables" |
Definition at line 33 of file heur_oneopt.c.
Referenced by SCIPincludeHeurOneopt().
#define HEUR_DISPCHAR 'b' |
Definition at line 34 of file heur_oneopt.c.
Referenced by SCIPincludeHeurOneopt().
#define HEUR_PRIORITY -20000 |
Definition at line 35 of file heur_oneopt.c.
Referenced by SCIPincludeHeurOneopt().
#define HEUR_FREQ 1 |
Definition at line 36 of file heur_oneopt.c.
Referenced by SCIPincludeHeurOneopt().
#define HEUR_FREQOFS 0 |
Definition at line 37 of file heur_oneopt.c.
Referenced by SCIPincludeHeurOneopt().
#define HEUR_MAXDEPTH -1 |
Definition at line 38 of file heur_oneopt.c.
Referenced by SCIPincludeHeurOneopt().
#define HEUR_TIMING SCIP_HEURTIMING_BEFOREPRESOL | SCIP_HEURTIMING_AFTERNODE |
Definition at line 39 of file heur_oneopt.c.
Referenced by SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXITSOL(), and SCIPincludeHeurOneopt().
#define HEUR_USESSUBSCIP FALSE |
does the heuristic use a secondary SCIP instance?
Definition at line 40 of file heur_oneopt.c.
Referenced by SCIPincludeHeurOneopt().
#define DEFAULT_WEIGHTEDOBJ TRUE |
should the objective be weighted with the potential shifting value when sorting the shifting candidates?
Definition at line 42 of file heur_oneopt.c.
Referenced by SCIPincludeHeurOneopt().
#define DEFAULT_DURINGROOT TRUE |
should the heuristic be called before and during the root node?
Definition at line 43 of file heur_oneopt.c.
Referenced by SCIPincludeHeurOneopt().
#define DEFAULT_BEFOREPRESOL FALSE |
should the heuristic be called before presolving
Definition at line 44 of file heur_oneopt.c.
Referenced by SCIPincludeHeurOneopt().
#define DEFAULT_FORCELPCONSTRUCTION FALSE |
should the construction of the LP be forced even if LP solving is deactivated?
Definition at line 45 of file heur_oneopt.c.
Referenced by SCIPincludeHeurOneopt().
#define DEFAULT_USELOOP TRUE |
should the heuristic continue to run as long as improvements are found?
Definition at line 46 of file heur_oneopt.c.
Referenced by SCIPincludeHeurOneopt().
|
static |
creates a new solution for the original problem by copying the solution of the subproblem
scip | original SCIP data structure |
subscip | SCIP structure of the subproblem |
subvars | the variables of the subproblem |
heur | zeroobj heuristic structure |
subsol | solution of the subproblem |
success | used to store whether new solution was found or not |
Definition at line 69 of file heur_oneopt.c.
References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcreateSol(), SCIPfreeBufferArray, SCIPgetNOrigVars(), SCIPgetSolVals(), SCIPgetVarsData(), SCIPsetSolVals(), SCIPtrySolFree(), and TRUE.
Referenced by SCIP_DECL_HEUREXEC().
|
static |
compute value by which the solution of variable var
can be shifted
scip | SCIP data structure |
var | variable that should be shifted |
solval | current solution value |
activities | LP row activities |
Definition at line 115 of file heur_oneopt.c.
References FALSE, MAX, MIN, NULL, SCIP_Bool, SCIP_Real, SCIPcolGetNLPNonz(), SCIPcolGetRows(), SCIPcolGetVals(), SCIPdebugMsg, SCIPfeasFloor(), SCIPgetNLPRows(), SCIPisFeasGE(), SCIPisFeasLE(), SCIPisInfinity(), SCIProwGetLhs(), SCIProwGetLPPos(), SCIProwGetName(), SCIProwGetRhs(), SCIProwIsInLP(), SCIProwIsLocal(), SCIPvarGetCol(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetObj(), SCIPvarGetUbGlobal(), and TRUE.
Referenced by SCIP_DECL_HEUREXEC().
|
static |
update row activities after a variable's solution value changed
scip | SCIP data structure |
activities | LP row activities |
var | variable that has been changed |
shiftval | value that is added to variable |
Definition at line 213 of file heur_oneopt.c.
References NULL, SCIP_OKAY, SCIP_Real, SCIPcolGetNLPNonz(), SCIPcolGetRows(), SCIPcolGetVals(), SCIPgetNLPRows(), SCIPinfinity(), SCIPisInfinity(), SCIProwGetLPPos(), SCIProwIsLocal(), and SCIPvarGetCol().
Referenced by SCIP_DECL_HEUREXEC().
|
static |
copy method for primal heuristic plugins (called when SCIP copies plugins)
Definition at line 267 of file heur_oneopt.c.
References HEUR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPheurGetName(), and SCIPincludeHeurOneopt().
|
static |
destructor of primal heuristic to free user data (called when SCIP is exiting)
Definition at line 281 of file heur_oneopt.c.
References HEUR_NAME, NULL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPheurGetData(), SCIPheurGetName(), and SCIPheurSetData().
|
static |
solving process initialization method of primal heuristic (called when branch and bound process is about to begin)
Definition at line 301 of file heur_oneopt.c.
References HEUR_NAME, NULL, SCIP_HEURTIMING_BEFORENODE, SCIP_HEURTIMING_DURINGLPLOOP, SCIP_OKAY, SCIPheurGetData(), SCIPheurGetFreqofs(), SCIPheurGetName(), and SCIPheurSetTimingmask().
|
static |
solving process deinitialization method of primal heuristic (called before branch and bound process data is freed)
Definition at line 320 of file heur_oneopt.c.
References HEUR_NAME, HEUR_TIMING, NULL, SCIP_OKAY, SCIPheurGetName(), and SCIPheurSetTimingmask().
|
static |
initialization method of primal heuristic (called after problem was transformed)
Definition at line 333 of file heur_oneopt.c.
References NULL, SCIP_OKAY, and SCIPheurGetData().
|
static |
execution method of primal heuristic
Definition at line 353 of file heur_oneopt.c.
References calcShiftVal(), createNewSol(), FALSE, HEUR_TIMING, NULL, SCIP_Bool, SCIP_CALL, SCIP_CALL_ABORT, SCIP_DELAYED, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_FOUNDSOL, SCIP_HEURTIMING_BEFORENODE, SCIP_HEURTIMING_BEFOREPRESOL, SCIP_LPSOLSTAT_OPTIMAL, SCIP_OKAY, SCIP_PARAMSETTING_OFF, SCIP_Real, SCIP_VARSTATUS_COLUMN, SCIPallocBufferArray, SCIPblkmem(), SCIPcheckCopyLimits(), SCIPchgVarLbDive(), SCIPchgVarUbDive(), SCIPconstructLP(), SCIPcopy(), SCIPcopyLimits(), SCIPcreate(), SCIPcreateOrigSol(), SCIPcreateSolCopy(), SCIPcutoffNode(), SCIPdebug, SCIPdebugMsg, SCIPendDive(), SCIPflushLP(), SCIPfree(), SCIPfreeBufferArray, SCIPfreeSol(), SCIPgetBestSol(), SCIPgetCurrentNode(), SCIPgetLPRowsData(), SCIPgetLPSolstat(), SCIPgetNLPIterations(), SCIPgetNLPRows(), SCIPgetNNodes(), SCIPgetNSols(), SCIPgetRowSolActivity(), SCIPgetSols(), SCIPgetSolVal(), SCIPgetSolVals(), SCIPgetVarsData(), SCIPhasCurrentNodeLP(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPhashmapGetImage(), SCIPheurGetData(), SCIPheurSetTimingmask(), SCIPisFeasGE(), SCIPisFeasGT(), SCIPisFeasLE(), SCIPisFeasLT(), SCIPisFeasZero(), SCIPisParamFixed(), SCIPlinkLPSol(), SCIPprintRow(), SCIPprintSol(), SCIPprintStatistics(), SCIPreallocBufferArray, SCIProwGetLhs(), SCIProwGetLPPos(), SCIProwGetName(), SCIProwGetRhs(), SCIProwIsLocal(), SCIPsetBoolParam(), SCIPsetHeuristics(), SCIPsetIntParam(), SCIPsetLongintParam(), SCIPsetPresolving(), SCIPsetSeparating(), SCIPsetSolVal(), SCIPsetSolVals(), SCIPsolGetIndex(), SCIPsolIsOriginal(), SCIPsolSetHeur(), SCIPsolve(), SCIPsolveDiveLP(), SCIPsortRealPtr(), SCIPstartDive(), SCIPtransformProb(), SCIPtrySol(), SCIPtrySolFree(), SCIPunfixParam(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetObj(), SCIPvarGetStatus(), SCIPvarGetType(), SCIPvarGetUbGlobal(), SCIPwarningMessage(), TRUE, and updateRowActivities().