Scippy

SCIP

Solving Constraint Integer Programs

heur_rins.c File Reference

Detailed Description

LNS heuristic that combines the incumbent with the LP optimum.

Author
Timo Berthold

Definition in file heur_rins.c.

#include <assert.h>
#include <string.h>
#include "scip/scip.h"
#include "scip/scipdefplugins.h"
#include "scip/cons_linear.h"
#include "scip/heur_rins.h"
#include "scip/pub_misc.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   'N'
 
#define HEUR_PRIORITY   -1101000
 
#define HEUR_FREQ   25
 
#define HEUR_FREQOFS   0
 
#define HEUR_MAXDEPTH   -1
 
#define HEUR_TIMING   SCIP_HEURTIMING_AFTERLPNODE
 
#define HEUR_USESSUBSCIP   TRUE
 
#define DEFAULT_NODESOFS   500 /* number of nodes added to the contingent of the total nodes */
 
#define DEFAULT_MAXNODES   5000 /* maximum number of nodes to regard in the subproblem */
 
#define DEFAULT_MINNODES   50 /* minimum number of nodes to regard in the subproblem */
 
#define DEFAULT_MINIMPROVE   0.01 /* factor by which RINS should at least improve the incumbent */
 
#define DEFAULT_MINFIXINGRATE   0.3 /* minimum percentage of integer variables that have to be fixed */
 
#define DEFAULT_NODESQUOT   0.1 /* subproblem nodes in relation to nodes of the original problem */
 
#define DEFAULT_LPLIMFAC   2.0 /* factor by which the limit on the number of LP depends on the node limit */
 
#define DEFAULT_NWAITINGNODES   200 /* number of nodes without incumbent change that heuristic should wait */
 
#define DEFAULT_USELPROWS
 
#define DEFAULT_COPYCUTS
 
#define EVENTHDLR_NAME   "Rins"
 
#define EVENTHDLR_DESC   "LP event handler for " HEUR_NAME " heuristic"
 

Functions

static SCIP_RETCODE createSubproblem (SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_Real minfixingrate, SCIP_Bool uselprows, SCIP_Bool *success)
 
static SCIP_RETCODE createNewSol (SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEUR *heur, SCIP_SOL *subsol, SCIP_Bool *success)
 
static SCIP_DECL_EVENTEXEC (eventExecRins)
 
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

#define HEUR_NAME   "rins"

Definition at line 31 of file heur_rins.c.

Referenced by SCIP_DECL_HEURCOPY(), SCIP_DECL_HEUREXEC(), and SCIPincludeHeurRins().

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

Definition at line 32 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define HEUR_DISPCHAR   'N'

Definition at line 33 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define HEUR_PRIORITY   -1101000

Definition at line 34 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define HEUR_FREQ   25

Definition at line 35 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define HEUR_FREQOFS   0

Definition at line 36 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define HEUR_MAXDEPTH   -1

Definition at line 37 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define HEUR_TIMING   SCIP_HEURTIMING_AFTERLPNODE

Definition at line 38 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define HEUR_USESSUBSCIP   TRUE

does the heuristic use a secondary SCIP instance?

Definition at line 39 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define DEFAULT_NODESOFS   500 /* number of nodes added to the contingent of the total nodes */

Definition at line 41 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define DEFAULT_MAXNODES   5000 /* maximum number of nodes to regard in the subproblem */

Definition at line 42 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define DEFAULT_MINNODES   50 /* minimum number of nodes to regard in the subproblem */

Definition at line 43 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define DEFAULT_MINIMPROVE   0.01 /* factor by which RINS should at least improve the incumbent */

Definition at line 44 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define DEFAULT_MINFIXINGRATE   0.3 /* minimum percentage of integer variables that have to be fixed */

Definition at line 45 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define DEFAULT_NODESQUOT   0.1 /* subproblem nodes in relation to nodes of the original problem */

Definition at line 46 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define DEFAULT_LPLIMFAC   2.0 /* factor by which the limit on the number of LP depends on the node limit */

Definition at line 47 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define DEFAULT_NWAITINGNODES   200 /* number of nodes without incumbent change that heuristic should wait */

Definition at line 48 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define DEFAULT_USELPROWS
Value:
FALSE /* should subproblem be created out of the rows in the LP rows,
* otherwise, the copy constructors of the constraints handlers are used */
#define FALSE
Definition: def.h:56

Definition at line 49 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define DEFAULT_COPYCUTS
Value:
TRUE /* if DEFAULT_USELPROWS is FALSE, then should all active cuts from the cutpool
* of the original scip be copied to constraints of the subscip
*/
#define TRUE
Definition: def.h:55

Definition at line 51 of file heur_rins.c.

Referenced by SCIPincludeHeurRins().

#define EVENTHDLR_NAME   "Rins"

Definition at line 56 of file heur_rins.c.

Referenced by SCIP_DECL_EVENTEXEC(), and SCIP_DECL_HEUREXEC().

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

Definition at line 57 of file heur_rins.c.

Referenced by SCIP_DECL_HEUREXEC().

Function Documentation

static SCIP_RETCODE createSubproblem ( SCIP scip,
SCIP subscip,
SCIP_VAR **  subvars,
SCIP_Real  minfixingrate,
SCIP_Bool  uselprows,
SCIP_Bool success 
)
static

creates a subproblem for subscip by fixing a number of variables

Parameters
sciporiginal SCIP data structure
subscipSCIP data structure for the subproblem
subvarsthe variables of the subproblem
minfixingratepercentage of integer variables that have to be fixed
uselprowsshould subproblem be created out of the rows in the LP rows?
successpointer to store whether the problem was created successfully

Definition at line 89 of file heur_rins.c.

References FALSE, MAX, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPaddCons(), SCIPallocBufferArray, SCIPchgVarLbGlobal(), SCIPchgVarUbGlobal(), SCIPcolGetVar(), SCIPcreateConsLinear(), SCIPfreeBufferArray, SCIPgetBestSol(), SCIPgetLPRowsData(), SCIPgetSolVal(), SCIPgetVarsData(), SCIPisFeasEQ(), SCIPreleaseCons(), SCIProwGetCols(), SCIProwGetConstant(), SCIProwGetLhs(), SCIProwGetName(), SCIProwGetNNonz(), SCIProwGetRhs(), SCIProwGetVals(), SCIProwIsLocal(), SCIPvarGetLPSol(), SCIPvarGetProbindex(), and TRUE.

Referenced by SCIP_DECL_HEUREXEC().

static SCIP_RETCODE createNewSol ( SCIP scip,
SCIP subscip,
SCIP_VAR **  subvars,
SCIP_HEUR heur,
SCIP_SOL subsol,
SCIP_Bool success 
)
static

creates a new solution for the original problem by copying the solution of the subproblem

Parameters
sciporiginal SCIP data structure
subscipSCIP structure of the subproblem
subvarsthe variables of the subproblem
heurRINS heuristic structure
subsolsolution of the subproblem
successused to store whether new solution was found or not

Definition at line 210 of file heur_rins.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 SCIP_DECL_EVENTEXEC ( eventExecRins  )
static
static SCIP_DECL_HEURCOPY ( heurCopyRins  )
static

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

Definition at line 290 of file heur_rins.c.

References HEUR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPheurGetName(), and SCIPincludeHeurRins().

static SCIP_DECL_HEURFREE ( heurFreeRins  )
static

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

Definition at line 304 of file heur_rins.c.

References NULL, SCIP_OKAY, SCIPfreeMemory, SCIPheurGetData(), and SCIPheurSetData().

static SCIP_DECL_HEURINIT ( heurInitRins  )
static

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

Definition at line 325 of file heur_rins.c.

References NULL, SCIP_OKAY, and SCIPheurGetData().

static SCIP_DECL_HEUREXEC ( heurExecRins  )
static

execution method of primal heuristic

Definition at line 346 of file heur_rins.c.

References createNewSol(), createSubproblem(), EVENTHDLR_DESC, EVENTHDLR_NAME, FALSE, HEUR_NAME, MAX, MIN, NULL, SCIP_Bool, SCIP_CALL, SCIP_DELAYED, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_EVENTTYPE_LPSOLVED, SCIP_FOUNDSOL, SCIP_Longint, SCIP_LPSOLSTAT_OPTIMAL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_PARAMSETTING_FAST, SCIP_PARAMSETTING_OFF, SCIP_PLUGINNOTFOUND, SCIP_Real, SCIPallocBufferArray, SCIPblkmem(), SCIPcalcHashtableSize(), SCIPcatchEvent(), SCIPcopy(), SCIPcopyCuts(), SCIPcopyVars(), SCIPcreate(), SCIPcreateProb(), SCIPdebug, SCIPdebugMessage, SCIPdropEvent(), SCIPerrorMessage, SCIPfindBranchrule(), SCIPfindConshdlr(), SCIPfindNodesel(), SCIPfree(), SCIPfreeBufferArray, SCIPgetBestSol(), SCIPgetCutoffbound(), SCIPgetLowerbound(), SCIPgetLPObjval(), SCIPgetLPSolstat(), SCIPgetMemExternEstim(), SCIPgetMemUsed(), SCIPgetNNodes(), SCIPgetNSols(), SCIPgetProbName(), SCIPgetRealParam(), SCIPgetSolNodenum(), SCIPgetSols(), SCIPgetSolvingTime(), SCIPgetUpperbound(), SCIPgetVarsData(), SCIPhasCurrentNodeLP(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPhashmapGetImage(), SCIPheurGetData(), SCIPheurGetNBestSolsFound(), SCIPheurGetNCalls(), SCIPincludeDefaultPlugins(), SCIPincludeEventhdlrBasic(), SCIPinfinity(), SCIPisGE(), SCIPisInfinity(), SCIPisParamFixed(), SCIPisStopped(), SCIPmergeVariableStatistics(), SCIPprintStatistics(), SCIPsetBoolParam(), SCIPsetIntParam(), SCIPsetLongintParam(), SCIPsetObjlimit(), SCIPsetPresolving(), SCIPsetRealParam(), SCIPsetSeparating(), SCIPsetSubscipsOff(), SCIPsnprintf(), SCIPsolIsOriginal(), SCIPsolve(), SCIPsumepsilon(), SCIPtransformProb(), SCIPwarningMessage(), and TRUE.