SCIP Doxygen Documentation
Loading...
Searching...
No Matches

Detailed Description

DINS primal heuristic (according to Ghosh).

Author
Timo Berthold
Robert Waniek

Definition in file heur_dins.c.

#include "blockmemshell/memory.h"
#include "scip/cons_linear.h"
#include "scip/heur_dins.h"
#include "scip/heuristics.h"
#include "scip/pub_event.h"
#include "scip/pub_heur.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/pub_var.h"
#include "scip/scip_branch.h"
#include "scip/scip_cons.h"
#include "scip/scip_copy.h"
#include "scip/scip_event.h"
#include "scip/scip_general.h"
#include "scip/scip_heur.h"
#include "scip/scip_lp.h"
#include "scip/scip_mem.h"
#include "scip/scip_message.h"
#include "scip/scip_nodesel.h"
#include "scip/scip_numerics.h"
#include "scip/scip_param.h"
#include "scip/scip_prob.h"
#include "scip/scip_sol.h"
#include "scip/scip_solve.h"
#include "scip/scip_solvingstats.h"
#include "scip/scip_var.h"

Go to the source code of this file.

Macros

#define HEUR_NAME   "dins"
#define HEUR_DESC   "distance induced neighborhood search by Ghosh"
#define HEUR_DISPCHAR   SCIP_HEURDISPCHAR_LNS
#define HEUR_PRIORITY   -1105000
#define HEUR_FREQ   -1
#define HEUR_FREQOFS   0
#define HEUR_MAXDEPTH   -1
#define HEUR_TIMING   SCIP_HEURTIMING_AFTERLPNODE
#define HEUR_USESSUBSCIP   TRUE
#define DEFAULT_NODESOFS   5000LL
#define DEFAULT_MAXNODES   5000LL
#define DEFAULT_MINNODES   50LL
#define DEFAULT_MINIMPROVE   0.01
#define DEFAULT_NODESQUOT   0.05
#define DEFAULT_LPLIMFAC   1.5
#define DEFAULT_MINFIXINGRATE   0.3
#define DEFAULT_NWAITINGNODES   200LL
#define DEFAULT_NEIGHBORHOODSIZE   18
#define DEFAULT_SOLNUM   5
#define DEFAULT_USELPROWS   FALSE
#define DEFAULT_COPYCUTS   TRUE
#define DEFAULT_BESTSOLLIMIT   3
#define DEFAULT_USEUCT   FALSE
#define EVENTHDLR_NAME   "Dins"
#define EVENTHDLR_DESC   "LP event handler for " HEUR_NAME " heuristic"

Functions

static void computeIntegerVariableBounds (SCIP *scip, SCIP_VAR *var, SCIP_Real *lbptr, SCIP_Real *ubptr)
static SCIP_RETCODE determineVariableFixings (SCIP *scip, SCIP_HEUR *heur, SCIP_HEURDATA *heurdata, SCIP_VAR **vars, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nbinvars, int nintvars, int *binfixings, int *intfixings)
static SCIP_RETCODE reboundIntegerVariables (SCIP *scip, SCIP *subscip, SCIP_VAR **vars, SCIP_VAR **subvars, int nbinvars, int nintvars)
static SCIP_RETCODE addLocalBranchingConstraint (SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEURDATA *heurdata)
static SCIP_DECL_EVENTEXEC (eventExecDins)
static SCIP_RETCODE wrapperDins (SCIP *scip, SCIP *subscip, SCIP_HEUR *heur, SCIP_HEURDATA *heurdata, SCIP_VAR **vars, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, SCIP_RESULT *result, int nvars, int nbinvars, int nintvars, int binfixings, int intfixings, SCIP_Longint nsubnodes)
static SCIP_DECL_HEURCOPY (heurCopyDins)
static SCIP_DECL_HEURFREE (heurFreeDins)
static SCIP_DECL_HEURINITSOL (heurInitsolDins)
static SCIP_DECL_HEUREXITSOL (heurExitsolDins)
static SCIP_DECL_HEUREXEC (heurExecDins)
SCIP_RETCODE SCIPincludeHeurDins (SCIP *scip)

Macro Definition Documentation

◆ HEUR_NAME

#define HEUR_NAME   "dins"

Definition at line 62 of file heur_dins.c.

◆ HEUR_DESC

#define HEUR_DESC   "distance induced neighborhood search by Ghosh"

Definition at line 63 of file heur_dins.c.

◆ HEUR_DISPCHAR

#define HEUR_DISPCHAR   SCIP_HEURDISPCHAR_LNS

Definition at line 64 of file heur_dins.c.

◆ HEUR_PRIORITY

#define HEUR_PRIORITY   -1105000

Definition at line 65 of file heur_dins.c.

◆ HEUR_FREQ

#define HEUR_FREQ   -1

Definition at line 66 of file heur_dins.c.

◆ HEUR_FREQOFS

#define HEUR_FREQOFS   0

Definition at line 67 of file heur_dins.c.

◆ HEUR_MAXDEPTH

#define HEUR_MAXDEPTH   -1

Definition at line 68 of file heur_dins.c.

◆ HEUR_TIMING

#define HEUR_TIMING   SCIP_HEURTIMING_AFTERLPNODE

Definition at line 69 of file heur_dins.c.

◆ HEUR_USESSUBSCIP

#define HEUR_USESSUBSCIP   TRUE

does the heuristic use a secondary SCIP instance?

Definition at line 70 of file heur_dins.c.

◆ DEFAULT_NODESOFS

#define DEFAULT_NODESOFS   5000LL

Definition at line 72 of file heur_dins.c.

◆ DEFAULT_MAXNODES

#define DEFAULT_MAXNODES   5000LL

Definition at line 73 of file heur_dins.c.

◆ DEFAULT_MINNODES

#define DEFAULT_MINNODES   50LL

Definition at line 74 of file heur_dins.c.

◆ DEFAULT_MINIMPROVE

#define DEFAULT_MINIMPROVE   0.01

Definition at line 75 of file heur_dins.c.

◆ DEFAULT_NODESQUOT

#define DEFAULT_NODESQUOT   0.05

Definition at line 76 of file heur_dins.c.

◆ DEFAULT_LPLIMFAC

#define DEFAULT_LPLIMFAC   1.5

Definition at line 77 of file heur_dins.c.

◆ DEFAULT_MINFIXINGRATE

#define DEFAULT_MINFIXINGRATE   0.3

Definition at line 78 of file heur_dins.c.

◆ DEFAULT_NWAITINGNODES

#define DEFAULT_NWAITINGNODES   200LL

Definition at line 79 of file heur_dins.c.

◆ DEFAULT_NEIGHBORHOODSIZE

#define DEFAULT_NEIGHBORHOODSIZE   18

◆ DEFAULT_SOLNUM

#define DEFAULT_SOLNUM   5

Definition at line 81 of file heur_dins.c.

Referenced by SCIPincludeHeurDins().

◆ DEFAULT_USELPROWS

#define DEFAULT_USELPROWS   FALSE

Definition at line 82 of file heur_dins.c.

◆ DEFAULT_COPYCUTS

#define DEFAULT_COPYCUTS   TRUE

Definition at line 84 of file heur_dins.c.

◆ DEFAULT_BESTSOLLIMIT

#define DEFAULT_BESTSOLLIMIT   3

Definition at line 87 of file heur_dins.c.

◆ DEFAULT_USEUCT

#define DEFAULT_USEUCT   FALSE

Definition at line 88 of file heur_dins.c.

◆ EVENTHDLR_NAME

#define EVENTHDLR_NAME   "Dins"

Definition at line 92 of file heur_dins.c.

◆ EVENTHDLR_DESC

#define EVENTHDLR_DESC   "LP event handler for " HEUR_NAME " heuristic"

Definition at line 93 of file heur_dins.c.

Function Documentation

◆ computeIntegerVariableBounds()

void computeIntegerVariableBounds ( SCIP * scip,
SCIP_VAR * var,
SCIP_Real * lbptr,
SCIP_Real * ubptr )
static

compute tightened bounds for integer variables depending on how much the LP and the incumbent solution values differ

Parameters
scipSCIP data structure of the original problem
varthe variable for which bounds should be computed
lbptrpointer to store the lower bound in the DINS sub-SCIP
ubptrpointer to store the upper bound in the DINS sub-SCIP

Definition at line 132 of file heur_dins.c.

References assert(), computeIntegerVariableBounds(), MAX, MIN, REALABS, SCIP_Real, SCIP_VARTYPE_INTEGER, SCIPfeasCeil(), SCIPfeasFloor(), SCIPgetBestSol(), SCIPgetSolVal(), SCIPisFeasEQ(), SCIPvarGetLbGlobal(), SCIPvarGetLPSol(), SCIPvarGetType(), SCIPvarGetUbGlobal(), SCIPvarIsImpliedIntegral(), and var.

Referenced by computeIntegerVariableBounds(), determineVariableFixings(), and reboundIntegerVariables().

◆ determineVariableFixings()

SCIP_RETCODE determineVariableFixings ( SCIP * scip,
SCIP_HEUR * heur,
SCIP_HEURDATA * heurdata,
SCIP_VAR ** vars,
SCIP_VAR ** fixedvars,
SCIP_Real * fixedvals,
int nbinvars,
int nintvars,
int * binfixings,
int * intfixings )
static

creates a subproblem for subscip by fixing a number of variables

Parameters
scipSCIP data structure of the original problem
heurDINS heuristic structure
heurdataheuristic data structure
varsvariables of the original problem
fixedvarsarray to store variables that should be fixed in the sub-SCIP
fixedvalsarray to store fixing values for fixed variables
nbinvarsnumber of binary variables of problem and subproblem
nintvarsnumber of general integer variables of problem and subproblem
binfixingspointer to store number of binary variables that should be fixed
intfixingspointer to store number of integer variables that should be fixed

Definition at line 206 of file heur_dins.c.

References assert(), computeIntegerVariableBounds(), determineVariableFixings(), heurdata, i, MIN, nsolsfound, NULL, SCIP_Bool, SCIP_CALL, SCIP_Longint, SCIP_OKAY, SCIP_Real, SCIPcalcMemGrowSize(), SCIPgetBestSol(), SCIPgetNSols(), SCIPgetNSolsFound(), SCIPgetSolHeur(), SCIPgetSols(), SCIPgetSolVal(), SCIPisFeasEQ(), SCIPreallocBlockMemoryArray, SCIPvarGetLPSol(), SCIPvarGetRootSol(), TRUE, and vars.

◆ reboundIntegerVariables()

SCIP_RETCODE reboundIntegerVariables ( SCIP * scip,
SCIP * subscip,
SCIP_VAR ** vars,
SCIP_VAR ** subvars,
int nbinvars,
int nintvars )
static

creates a subproblem for subscip by fixing a number of variables

Parameters
scipSCIP data structure of the original problem
subscipSCIP data structure of the subproblem
varsvariables of the original problem
subvarsvariables of the DINS sub-SCIP
nbinvarsnumber of binary variables of problem and subproblem
nintvarsnumber of general integer variables of problem and subproblem

Definition at line 336 of file heur_dins.c.

References assert(), computeIntegerVariableBounds(), i, NULL, reboundIntegerVariables(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPchgVarLbGlobal(), SCIPchgVarUbGlobal(), SCIPisFeasEQ(), SCIPvarGetLbGlobal(), SCIPvarGetUbGlobal(), and vars.

Referenced by reboundIntegerVariables(), and wrapperDins().

◆ addLocalBranchingConstraint()

SCIP_RETCODE addLocalBranchingConstraint ( SCIP * scip,
SCIP * subscip,
SCIP_VAR ** subvars,
SCIP_HEURDATA * heurdata )
static

create the extra constraint of local branching and add it to subscip

Parameters
scipSCIP data structure of the original problem
subscipSCIP data structure of the subproblem
subvarsvariables of the subproblem
heurdataheuristic's data structure

Definition at line 374 of file heur_dins.c.

References addLocalBranchingConstraint(), assert(), FALSE, heurdata, i, NULL, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_BINARY, SCIPaddCons(), SCIPallocBufferArray, SCIPcreateConsLinear(), SCIPfreeBufferArray, SCIPgetBestSol(), SCIPgetProbName(), SCIPgetSolVal(), SCIPgetVarsData(), SCIPisFeasEQ(), SCIPisFeasIntegral(), SCIPreleaseCons(), SCIPsnprintf(), SCIPvarGetLbGlobal(), SCIPvarGetType(), SCIPvarGetUbGlobal(), SCIPvarIsImpliedIntegral(), TRUE, and vars.

◆ SCIP_DECL_EVENTEXEC()

◆ wrapperDins()

SCIP_RETCODE wrapperDins ( SCIP * scip,
SCIP * subscip,
SCIP_HEUR * heur,
SCIP_HEURDATA * heurdata,
SCIP_VAR ** vars,
SCIP_VAR ** fixedvars,
SCIP_Real * fixedvals,
SCIP_RESULT * result,
int nvars,
int nbinvars,
int nintvars,
int binfixings,
int intfixings,
SCIP_Longint nsubnodes )
static

wrapper for the part of heuristic that runs a subscip. Wrapper is needed to avoid possible ressource leaks

Parameters
sciporiginal SCIP data structure
subscipSCIP structure of the subproblem
heurHeuristic pointer
heurdataHeuristic's data
varsoriginal problem's variables
fixedvarsFixed variables of original SCIP
fixedvalsFixed values of original SCIP
resultResult pointer
nvarsNumber of variables
nbinvarsNumber of binary variables in original SCIP
nintvarsNumber of integer variables in original SCIP
binfixingsNumber of binary fixing in original SCIP
intfixingsNumber of integer fixings in original SCIP
nsubnodesNumber of nodes in the subscip

Definition at line 456 of file heur_dins.c.

References addLocalBranchingConstraint(), assert(), cutoff, EVENTHDLR_DESC, EVENTHDLR_NAME, FALSE, HEUR_NAME, heurdata, i, MAX, MIN, NULL, nvars, reboundIntegerVariables(), result, SCIP_Bool, SCIP_CALL, SCIP_CALL_ABORT, SCIP_EVENTTYPE_LPSOLVED, SCIP_FOUNDSOL, SCIP_Longint, SCIP_LONGINT_FORMAT, SCIP_OKAY, SCIP_PARAMSETTING_FAST, SCIP_PARAMSETTING_OFF, SCIP_PLUGINNOTFOUND, SCIP_Real, SCIPallocBufferArray, SCIPblkmem(), SCIPcatchEvent(), SCIPcopyLargeNeighborhoodSearch(), SCIPcopyLimits(), SCIPdebug, SCIPdebugMsg, SCIPdropEvent(), SCIPerrorMessage, SCIPfindBranchrule(), SCIPfindNodesel(), SCIPfreeBufferArray, SCIPgetLowerbound(), SCIPgetNBinVars(), SCIPgetNConss(), SCIPgetNIntVars(), SCIPgetNNodes(), SCIPgetNSols(), SCIPgetNVars(), SCIPgetUpperbound(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPhashmapGetImage(), SCIPincludeEventhdlrBasic(), SCIPisInfinity(), SCIPisParamFixed(), SCIPprintStatistics(), SCIPsetBoolParam(), SCIPsetCharParam(), SCIPsetIntParam(), SCIPsetLongintParam(), SCIPsetObjlimit(), SCIPsetPresolving(), SCIPsetSeparating(), SCIPsetSubscipsOff(), SCIPsolve(), SCIPsumepsilon(), SCIPtransformProb(), SCIPtranslateSubSols(), TRUE, vars, and wrapperDins().

Referenced by SCIP_DECL_HEUREXEC(), and wrapperDins().

◆ SCIP_DECL_HEURCOPY()

SCIP_DECL_HEURCOPY ( heurCopyDins )
static

copy method for primal heuristic plugins (called when SCIP copies plugins)

Definition at line 701 of file heur_dins.c.

References assert(), HEUR_NAME, NULL, SCIP_CALL, SCIP_DECL_HEURCOPY, SCIP_INVALIDCALL, SCIP_OKAY, SCIP_STRINGEQ, SCIPheurGetName(), and SCIPincludeHeurDins().

◆ SCIP_DECL_HEURFREE()

SCIP_DECL_HEURFREE ( heurFreeDins )
static

destructor of primal heuristic to free user data (called when SCIP is exiting)

Definition at line 716 of file heur_dins.c.

References assert(), heurdata, NULL, SCIP_DECL_HEURFREE, SCIP_OKAY, SCIPfreeBlockMemory, SCIPheurGetData(), and SCIPheurSetData().

◆ SCIP_DECL_HEURINITSOL()

SCIP_DECL_HEURINITSOL ( heurInitsolDins )
static

solving process initialization method of primal heuristic (called when branch and bound process is about to begin)

Definition at line 737 of file heur_dins.c.

References assert(), heurdata, i, NULL, SCIP_CALL, SCIP_DECL_HEURINITSOL, SCIP_OKAY, SCIPallocBlockMemoryArray, SCIPgetNBinVars(), SCIPheurGetData(), and TRUE.

◆ SCIP_DECL_HEUREXITSOL()

SCIP_DECL_HEUREXITSOL ( heurExitsolDins )
static

solving process deinitialization method of primal heuristic (called before branch and bound process data is freed)

Definition at line 768 of file heur_dins.c.

References assert(), heurdata, NULL, SCIP_DECL_HEUREXITSOL, SCIP_OKAY, SCIPfreeBlockMemoryArray, and SCIPheurGetData().

◆ SCIP_DECL_HEUREXEC()