|
improvement heuristic that alters single variable values
- Author
- Timo Berthold
Definition in file heur_oneopt.c.
#include <assert.h>
#include <string.h>
#include "scip/heur_oneopt.h"
Go to the source code of this file.
|
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_HEUREXEC (heurExecOneopt) |
|
SCIP_RETCODE | SCIPincludeHeurOneopt (SCIP *scip) |
|
#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_USESSUBSCIP FALSE |
#define DEFAULT_WEIGHTEDOBJ TRUE |
#define DEFAULT_DURINGROOT TRUE |
#define DEFAULT_BEFOREPRESOL FALSE |
#define DEFAULT_FORCELPCONSTRUCTION FALSE |
creates a new solution for the original problem by copying the solution of the subproblem
- Parameters
-
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 68 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().
- Parameters
-
scip | SCIP data structure |
var | variable that should be shifted |
solval | current solution value |
activities | LP row activities |
Definition at line 113 of file heur_oneopt.c.
References FALSE, MIN, NULL, SCIP_Bool, SCIP_Real, SCIPcolGetNLPNonz(), SCIPcolGetRows(), SCIPcolGetVals(), SCIPdebugMessage, SCIPfeasFloor(), SCIPgetNLPRows(), SCIPisFeasGE(), SCIPisFeasLE(), SCIProwGetLhs(), SCIProwGetLPPos(), SCIProwGetName(), SCIProwGetRhs(), SCIProwIsInLP(), SCIProwIsLocal(), SCIPvarGetCol(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetObj(), SCIPvarGetUbGlobal(), and TRUE.
Referenced by SCIP_DECL_HEUREXEC().
update row activities after a variable's solution value changed
- Parameters
-
scip | SCIP data structure |
activities | LP row activities |
var | variable that has been changed |
shiftval | value that is added to variable |
Definition at line 206 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 SCIP_DECL_HEURCOPY |
( |
heurCopyOneopt |
| ) |
|
|
static |
static SCIP_DECL_HEURFREE |
( |
heurFreeOneopt |
| ) |
|
|
static |
static SCIP_DECL_HEURINITSOL |
( |
heurInitsolOneopt |
| ) |
|
|
static |
static SCIP_DECL_HEUREXITSOL |
( |
heurExitsolOneopt |
| ) |
|
|
static |
static SCIP_DECL_HEUREXEC |
( |
heurExecOneopt |
| ) |
|
|
static |
execution method of primal heuristic
Definition at line 326 of file heur_oneopt.c.
References calcShiftVal(), createNewSol(), FALSE, HEUR_TIMING, NULL, SCIP_Bool, SCIP_CALL, 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(), SCIPcalcHashtableSize(), SCIPchgVarLbDive(), SCIPchgVarUbDive(), SCIPconstructLP(), SCIPcopy(), SCIPcreate(), SCIPcreateOrigSol(), SCIPcreateSolCopy(), SCIPdebug, SCIPdebugMessage, SCIPendDive(), SCIPflushLP(), SCIPfree(), SCIPfreeBufferArray, SCIPfreeSol(), SCIPgetBestSol(), SCIPgetLPRowsData(), SCIPgetLPSolstat(), SCIPgetMemExternEstim(), SCIPgetMemUsed(), SCIPgetNLPIterations(), SCIPgetNLPRows(), SCIPgetNNodes(), SCIPgetNSols(), SCIPgetRealParam(), SCIPgetRowSolActivity(), SCIPgetSols(), SCIPgetSolVal(), SCIPgetSolVals(), SCIPgetSolvingTime(), SCIPgetVarsData(), SCIPhasCurrentNodeLP(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPhashmapGetImage(), SCIPheurGetData(), SCIPheurSetTimingmask(), SCIPisFeasGT(), SCIPisFeasLT(), SCIPisFeasZero(), SCIPisInfinity(), SCIPisParamFixed(), SCIPlinkLPSol(), SCIPprintRow(), SCIPprintSol(), SCIPprintStatistics(), SCIPreallocBufferArray, SCIProwGetLhs(), SCIProwGetLPPos(), SCIProwGetName(), SCIProwGetRhs(), SCIProwIsLocal(), SCIPsetBoolParam(), SCIPsetHeuristics(), SCIPsetIntParam(), SCIPsetLongintParam(), SCIPsetPresolving(), SCIPsetRealParam(), SCIPsetSeparating(), SCIPsetSolVal(), SCIPsetSolVals(), SCIPsolGetIndex(), SCIPsolIsOriginal(), SCIPsolSetHeur(), SCIPsolve(), SCIPsolveDiveLP(), SCIPsortRealPtr(), SCIPstartDive(), SCIPtransformProb(), SCIPtrySol(), SCIPtrySolFree(), SCIPunfixParam(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetObj(), SCIPvarGetStatus(), SCIPvarGetType(), SCIPvarGetUbGlobal(), SCIPwarningMessage(), TRUE, and updateRowActivities().
creates the oneopt primal heuristic and includes it in SCIP
- Parameters
-
Definition at line 834 of file heur_oneopt.c.
References DEFAULT_BEFOREPRESOL, DEFAULT_DURINGROOT, DEFAULT_FORCELPCONSTRUCTION, DEFAULT_WEIGHTEDOBJ, HEUR_DESC, HEUR_DISPCHAR, HEUR_FREQ, HEUR_FREQOFS, HEUR_MAXDEPTH, HEUR_NAME, HEUR_PRIORITY, HEUR_TIMING, HEUR_USESSUBSCIP, NULL, SCIP_CALL, SCIP_OKAY, SCIPaddBoolParam(), SCIPallocMemory, SCIPincludeHeurBasic(), SCIPsetHeurCopy(), SCIPsetHeurExitsol(), SCIPsetHeurFree(), SCIPsetHeurInitsol(), and TRUE.
Referenced by SCIP_DECL_HEURCOPY(), and SCIPincludeDefaultPlugins().
|