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

Detailed Description

LNS heuristic that combines the incumbent with the LP optimum.

Author
Timo Berthold

Definition in file heur_rins.c.

#include "blockmemshell/memory.h"
#include "scip/heuristics.h"
#include "scip/heur_rins.h"
#include "scip/pub_event.h"
#include "scip/pub_heur.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/pub_sol.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"

Go to the source code of this file.

Macros

#define HEUR_NAME   "rins"
#define HEUR_DESC   "relaxation induced neighborhood search by Danna, Rothberg, and Le Pape"
#define HEUR_DISPCHAR   SCIP_HEURDISPCHAR_LNS
#define HEUR_PRIORITY   -1101000
#define HEUR_FREQ   15
#define HEUR_FREQOFS   0
#define HEUR_MAXDEPTH   -1
#define HEUR_TIMING   SCIP_HEURTIMING_AFTERLPNODE
#define HEUR_USESSUBSCIP   TRUE
#define DEFAULT_NODESOFS   500
#define DEFAULT_MAXNODES   5000
#define DEFAULT_MINNODES   50
#define DEFAULT_MINIMPROVE   0.01
#define DEFAULT_MINFIXINGRATE   0.3
#define DEFAULT_NODESQUOT   0.3
#define DEFAULT_LPLIMFAC   2.0
#define DEFAULT_NWAITINGNODES   200
#define DEFAULT_USELPROWS   FALSE
#define DEFAULT_COPYCUTS   TRUE
#define DEFAULT_USEUCT   FALSE
#define EVENTHDLR_NAME   "Rins"
#define EVENTHDLR_DESC   "LP event handler for " HEUR_NAME " heuristic"

Functions

static SCIP_RETCODE determineFixings (SCIP *scip, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int *nfixedvars, int fixedvarssize, SCIP_Real minfixingrate, SCIP_Bool *success)
static SCIP_DECL_EVENTEXEC (eventExecRins)
static SCIP_RETCODE wrapperRins (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 nfixedvars, SCIP_Longint nnodes)
static SCIP_DECL_HEURCOPY (heurCopyRins)
static SCIP_DECL_HEURFREE (heurFreeRins)
static SCIP_DECL_HEURINIT (heurInitRins)
static SCIP_DECL_HEUREXEC (heurExecRins)
SCIP_RETCODE SCIPincludeHeurRins (SCIP *scip)

Macro Definition Documentation

◆ HEUR_NAME

#define HEUR_NAME   "rins"

Definition at line 60 of file heur_rins.c.

◆ HEUR_DESC

#define HEUR_DESC   "relaxation induced neighborhood search by Danna, Rothberg, and Le Pape"

Definition at line 61 of file heur_rins.c.

◆ HEUR_DISPCHAR

#define HEUR_DISPCHAR   SCIP_HEURDISPCHAR_LNS

Definition at line 62 of file heur_rins.c.

◆ HEUR_PRIORITY

#define HEUR_PRIORITY   -1101000

Definition at line 63 of file heur_rins.c.

◆ HEUR_FREQ

#define HEUR_FREQ   15

Definition at line 64 of file heur_rins.c.

◆ HEUR_FREQOFS

#define HEUR_FREQOFS   0

Definition at line 65 of file heur_rins.c.

◆ HEUR_MAXDEPTH

#define HEUR_MAXDEPTH   -1

Definition at line 66 of file heur_rins.c.

◆ HEUR_TIMING

#define HEUR_TIMING   SCIP_HEURTIMING_AFTERLPNODE

Definition at line 67 of file heur_rins.c.

◆ HEUR_USESSUBSCIP

#define HEUR_USESSUBSCIP   TRUE

does the heuristic use a secondary SCIP instance?

Definition at line 68 of file heur_rins.c.

◆ DEFAULT_NODESOFS

#define DEFAULT_NODESOFS   500

Definition at line 70 of file heur_rins.c.

◆ DEFAULT_MAXNODES

#define DEFAULT_MAXNODES   5000

Definition at line 71 of file heur_rins.c.

◆ DEFAULT_MINNODES

#define DEFAULT_MINNODES   50

Definition at line 72 of file heur_rins.c.

◆ DEFAULT_MINIMPROVE

#define DEFAULT_MINIMPROVE   0.01

Definition at line 73 of file heur_rins.c.

◆ DEFAULT_MINFIXINGRATE

#define DEFAULT_MINFIXINGRATE   0.3

Definition at line 74 of file heur_rins.c.

◆ DEFAULT_NODESQUOT

#define DEFAULT_NODESQUOT   0.3

Definition at line 75 of file heur_rins.c.

◆ DEFAULT_LPLIMFAC

#define DEFAULT_LPLIMFAC   2.0

Definition at line 76 of file heur_rins.c.

◆ DEFAULT_NWAITINGNODES

#define DEFAULT_NWAITINGNODES   200

Definition at line 77 of file heur_rins.c.

◆ DEFAULT_USELPROWS

#define DEFAULT_USELPROWS   FALSE

Definition at line 78 of file heur_rins.c.

◆ DEFAULT_COPYCUTS

#define DEFAULT_COPYCUTS   TRUE

Definition at line 80 of file heur_rins.c.

◆ DEFAULT_USEUCT

#define DEFAULT_USEUCT   FALSE

Definition at line 83 of file heur_rins.c.

◆ EVENTHDLR_NAME

#define EVENTHDLR_NAME   "Rins"

Definition at line 86 of file heur_rins.c.

◆ EVENTHDLR_DESC

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

Definition at line 87 of file heur_rins.c.

Function Documentation

◆ determineFixings()

SCIP_RETCODE determineFixings ( SCIP * scip,
SCIP_VAR ** fixedvars,
SCIP_Real * fixedvals,
int * nfixedvars,
int fixedvarssize,
SCIP_Real minfixingrate,
SCIP_Bool * success )
static

determines variable fixings for RINS

RINS fixes variables with matching solution values in the current LP and the incumbent solution

Parameters
sciporiginal SCIP data structure
fixedvarsarray to store source SCIP variables that should be fixed in the copy
fixedvalsarray to store fixing values for variables that should be fixed in the copy
nfixedvarspointer to store the number of variables that RINS can fix
fixedvarssizesize of the buffer arrays to store potential fixings
minfixingratepercentage of integer variables that have to be fixed
successpointer to store whether sufficiently many variable fixings were found

Definition at line 126 of file heur_rins.c.

References assert(), determineFixings(), FALSE, i, MAX, NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPgetBestSol(), SCIPgetSolVal(), SCIPgetVarsData(), SCIPisFeasEQ(), SCIPvarGetLPSol(), TRUE, and vars.

Referenced by determineFixings(), and SCIP_DECL_HEUREXEC().

◆ SCIP_DECL_EVENTEXEC()

◆ wrapperRins()

SCIP_RETCODE wrapperRins ( 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 nfixedvars,
SCIP_Longint nnodes )
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
nfixedvarsNumber of fixed variables
nnodesNumber of nodes in the b&b tree

Definition at line 206 of file heur_rins.c.

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

Referenced by SCIP_DECL_HEUREXEC(), and wrapperRins().

◆ SCIP_DECL_HEURCOPY()

SCIP_DECL_HEURCOPY ( heurCopyRins )
static

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

Definition at line 405 of file heur_rins.c.

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

◆ SCIP_DECL_HEURFREE()

SCIP_DECL_HEURFREE ( heurFreeRins )
static

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

Definition at line 420 of file heur_rins.c.

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

◆ SCIP_DECL_HEURINIT()

SCIP_DECL_HEURINIT ( heurInitRins )
static

initialization method of primal heuristic (called after problem was transformed)

Definition at line 441 of file heur_rins.c.

References assert(), heurdata, NULL, SCIP_DECL_HEURINIT, SCIP_OKAY, and SCIPheurGetData().

◆ SCIP_DECL_HEUREXEC()