Scippy

SCIP

Solving Constraint Integer Programs

heur_ofins.c File Reference

Detailed Description

OFINS - Objective Function Induced Neighborhood Search - a primal heuristic for reoptimization.

Author
Jakob Witzig

Definition in file heur_ofins.c.

#include <assert.h>
#include <string.h>
#include <stdio.h>
#include "scip/heur_ofins.h"
#include "scip/scipdefplugins.h"
#include "scip/pub_misc.h"

Go to the source code of this file.

Macros

#define HEUR_NAME   "ofins"
 
#define HEUR_DESC   "primal heuristic for reoptimization, objective function induced neighborhood search"
 
#define HEUR_DISPCHAR   'A'
 
#define HEUR_PRIORITY   60000
 
#define HEUR_FREQ   -1
 
#define HEUR_FREQOFS   0
 
#define HEUR_MAXDEPTH   0
 
#define HEUR_TIMING   SCIP_HEURTIMING_BEFORENODE
 
#define HEUR_USESSUBSCIP   TRUE
 
#define DEFAULT_MAXNODES   5000LL
 
#define DEFAULT_MAXCHGRATE   0.50
 
#define DEFAULT_COPYCUTS   TRUE
 
#define DEFAULT_MAXCHANGE   0.04
 
#define DEFAULT_MINIMPROVE   0.01
 
#define DEFAULT_ADDALLSOLS   FALSE
 
#define DEFAULT_MINNODES   50LL
 
#define DEFAULT_NODESOFS   500LL
 
#define DEFAULT_NODESQUOT   0.1
 
#define DEFAULT_LPLIMFAC   2.0
 
#define EVENTHDLR_NAME   "Ofins"
 
#define EVENTHDLR_DESC   "LP event handler for " HEUR_NAME " heuristic"
 

Functions

static SCIP_DECL_EVENTEXEC (eventExecOfins)
 
static SCIP_RETCODE createSubproblem (SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_Bool *chgcoeffs)
 
static SCIP_RETCODE createNewSol (SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEUR *heur, SCIP_SOL *subsol, SCIP_Bool *success)
 
static SCIP_RETCODE applyOfins (SCIP *scip, SCIP_HEUR *heur, SCIP_HEURDATA *heurdata, SCIP_RESULT *result, SCIP_Longint nstallnodes, SCIP_Bool *chgcoeffs)
 
static SCIP_DECL_HEURCOPY (heurCopyOfins)
 
static SCIP_DECL_HEURFREE (heurFreeOfins)
 
static SCIP_DECL_HEUREXEC (heurExecOfins)
 
SCIP_RETCODE SCIPincludeHeurOfins (SCIP *scip)
 

Macro Definition Documentation

#define HEUR_NAME   "ofins"

Definition at line 31 of file heur_ofins.c.

Referenced by applyOfins(), SCIP_DECL_HEURCOPY(), and SCIPincludeHeurOfins().

#define HEUR_DESC   "primal heuristic for reoptimization, objective function induced neighborhood search"

Definition at line 32 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define HEUR_DISPCHAR   'A'

Definition at line 33 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define HEUR_PRIORITY   60000

Definition at line 34 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define HEUR_FREQ   -1

Definition at line 35 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define HEUR_FREQOFS   0

Definition at line 36 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define HEUR_MAXDEPTH   0

Definition at line 37 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define HEUR_TIMING   SCIP_HEURTIMING_BEFORENODE

Definition at line 38 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define HEUR_USESSUBSCIP   TRUE

does the heuristic use a secondary SCIP instance?

Definition at line 39 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define DEFAULT_MAXNODES   5000LL

maximum number of nodes to regard in the subproblem

Definition at line 42 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define DEFAULT_MAXCHGRATE   0.50

maximum percentage of changed objective coefficients

Definition at line 43 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define DEFAULT_COPYCUTS   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

Definition at line 44 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define DEFAULT_MAXCHANGE   0.04

maximal rate of change per coefficient to get fixed

Definition at line 47 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define DEFAULT_MINIMPROVE   0.01

factor by which OFINS should at least improve the incumbent

Definition at line 48 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define DEFAULT_ADDALLSOLS   FALSE

should all subproblem solutions be added to the original SCIP?

Definition at line 49 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define DEFAULT_MINNODES   50LL

minimum number of nodes to regard in the subproblem

Definition at line 50 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define DEFAULT_NODESOFS   500LL

number of nodes added to the contingent of the total nodes

Definition at line 51 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define DEFAULT_NODESQUOT   0.1

subproblem nodes in relation to nodes of the original problem

Definition at line 52 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define DEFAULT_LPLIMFAC   2.0

factor by which the limit on the number of LP depends on the node limit

Definition at line 53 of file heur_ofins.c.

Referenced by SCIPincludeHeurOfins().

#define EVENTHDLR_NAME   "Ofins"

Definition at line 56 of file heur_ofins.c.

Referenced by applyOfins(), and SCIP_DECL_EVENTEXEC().

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

Definition at line 57 of file heur_ofins.c.

Referenced by applyOfins().

Function Documentation

static SCIP_DECL_EVENTEXEC ( eventExecOfins  )
static
static SCIP_RETCODE createSubproblem ( SCIP scip,
SCIP subscip,
SCIP_VAR **  subvars,
SCIP_Bool chgcoeffs 
)
static

creates a subproblem by fixing a number of variables

Parameters
sciporiginal SCIP data structure
subscipSCIP data structure for the subproblem
subvarsthe variables of the subproblem
chgcoeffsarray indicating which coefficients have changed

Definition at line 108 of file heur_ofins.c.

References createNewSol(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPchgVarLbGlobal(), SCIPchgVarUbGlobal(), SCIPdebugMessage, SCIPgetNBinVars(), SCIPgetReoptLastOptSol(), SCIPgetSolVal(), SCIPgetUpperbound(), SCIPgetVars(), and SCIPsetObjlimit().

Referenced by applyOfins(), and SCIP_DECL_EVENTEXEC().

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
heurRENS heuristic structure
subsolsolution of the subproblem
successused to store whether new solution was found or not

Definition at line 158 of file heur_ofins.c.

References applyOfins(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPcreateSol(), SCIPfreeBufferArray, SCIPgetNOrigVars(), SCIPgetSolVals(), SCIPgetVarsData(), SCIPsetSolVals(), SCIPtrySolFree(), and TRUE.

Referenced by applyOfins(), and createSubproblem().

static SCIP_RETCODE applyOfins ( SCIP scip,
SCIP_HEUR heur,
SCIP_HEURDATA heurdata,
SCIP_RESULT result,
SCIP_Longint  nstallnodes,
SCIP_Bool chgcoeffs 
)
static

main procedure of the OFINS heuristic, creates and solves a sub-SCIP

Parameters
sciporiginal SCIP data structure
heurheuristic data structure
heurdataeuristic's private data structure
resultresult data structure
nstallnodesnumber of stalling nodes for the subproblem
chgcoeffsarray of changed coefficients

Definition at line 204 of file heur_ofins.c.

References createNewSol(), createSubproblem(), EVENTHDLR_DESC, EVENTHDLR_NAME, FALSE, HEUR_NAME, NULL, SCIP_Bool, SCIP_CALL, SCIP_DECL_HEURCOPY(), SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_EVENTTYPE_LPSOLVED, SCIP_FOUNDSOL, SCIP_OKAY, SCIP_PARAMSETTING_FAST, SCIP_PARAMSETTING_OFF, SCIP_PLUGINNOTFOUND, SCIP_Real, SCIPallocBufferArray, SCIPblkmem(), SCIPcalcHashtableSize(), SCIPcatchEvent(), SCIPcopy(), SCIPcopyCuts(), SCIPcreate(), SCIPdebug, SCIPdebugMessage, SCIPdropEvent(), SCIPerrorMessage, SCIPfindBranchrule(), SCIPfindNodesel(), SCIPfree(), SCIPfreeBufferArray, SCIPgetBestSol(), SCIPgetMemExternEstim(), SCIPgetMemUsed(), SCIPgetNConss(), SCIPgetNNodes(), SCIPgetNSols(), SCIPgetNVars(), SCIPgetPrimalbound(), SCIPgetRealParam(), SCIPgetReoptLastOptSol(), SCIPgetSols(), SCIPgetSolvingTime(), SCIPgetVars(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPhashmapGetImage(), SCIPincludeEventhdlrBasic(), SCIPinfinity(), SCIPisInfinity(), SCIPisParamFixed(), SCIPpresolve(), SCIPprintStatistics(), SCIPsetBoolParam(), SCIPsetIntParam(), SCIPsetLongintParam(), SCIPsetPresolving(), SCIPsetRealParam(), SCIPsetSeparating(), SCIPsetSubscipsOff(), SCIPsolGetNodenum(), SCIPsolve(), SCIPstatisticPrintf, SCIPtransformProb(), SCIPwarningMessage(), and TRUE.

Referenced by createNewSol(), and SCIP_DECL_HEUREXEC().

static SCIP_DECL_HEURCOPY ( heurCopyOfins  )
static

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

Definition at line 441 of file heur_ofins.c.

References HEUR_NAME, NULL, SCIP_CALL, SCIP_DECL_HEURFREE(), SCIP_OKAY, SCIPheurGetName(), and SCIPincludeHeurOfins().

Referenced by applyOfins().

static SCIP_DECL_HEURFREE ( heurFreeOfins  )
static

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

Definition at line 455 of file heur_ofins.c.

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

Referenced by SCIP_DECL_HEURCOPY().