Scippy

SCIP

Solving Constraint Integer Programs

heur_redsize.c File Reference

Detailed Description

primal heuristic that solves the problem with a sparser matrix as a submip

Author
Leon Eifler

Definition in file heur_redsize.c.

#include <assert.h>
#include <string.h>
#include "heur_redsize.h"
#include "cycplugins.h"
#include "probdata_cyc.h"

Go to the source code of this file.

Macros

#define HEUR_NAME   "redsize"
 
#define HEUR_DESC   "primal heuristic that solves the problem with a sparser matrix as a submip"
 
#define HEUR_DISPCHAR   'u'
 
#define HEUR_PRIORITY   536870911
 
#define HEUR_FREQ   0
 
#define HEUR_FREQOFS   0
 
#define HEUR_MAXDEPTH   -1
 
#define HEUR_TIMING   SCIP_HEURTIMING_BEFORENODE
 
#define HEUR_USESSUBSCIP   TRUE
 
#define DEFAULT_REDUCTIONRATE   0.75
 

Functions

static SCIP_RETCODE SCIPcycAddIncompleteSol (SCIP *scip, SCIP *subscip, SCIP_HEUR *heur, SCIP_SOL *subsol, SCIP_RESULT *result)
 
static SCIP_RETCODE SCIPreduceMatrixSize (SCIP *scip, SCIP_Real **matrix, SCIP_Real percentile, SCIP_Real scale, int size)
 
static SCIP_RETCODE SCIPapplyRedSize (SCIP *scip, SCIP_HEUR *heur, SCIP_RESULT *result, SCIP_Real reductionrate, SCIP_Longint maxnodes)
 
static SCIP_DECL_HEURCOPY (heurCopyRedsize)
 
static SCIP_DECL_HEURFREE (heurFreeRedsize)
 
static SCIP_DECL_HEUREXEC (heurExecRedsize)
 
SCIP_RETCODE SCIPincludeHeurRedsize (SCIP *scip)
 

Macro Definition Documentation

◆ HEUR_NAME

#define HEUR_NAME   "redsize"

Definition at line 29 of file heur_redsize.c.

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

◆ HEUR_DESC

#define HEUR_DESC   "primal heuristic that solves the problem with a sparser matrix as a submip"

Definition at line 30 of file heur_redsize.c.

Referenced by SCIPincludeHeurRedsize().

◆ HEUR_DISPCHAR

#define HEUR_DISPCHAR   'u'

Definition at line 31 of file heur_redsize.c.

Referenced by SCIPincludeHeurRedsize().

◆ HEUR_PRIORITY

#define HEUR_PRIORITY   536870911

Definition at line 32 of file heur_redsize.c.

Referenced by SCIPincludeHeurRedsize().

◆ HEUR_FREQ

#define HEUR_FREQ   0

Definition at line 33 of file heur_redsize.c.

Referenced by SCIPincludeHeurRedsize().

◆ HEUR_FREQOFS

#define HEUR_FREQOFS   0

Definition at line 34 of file heur_redsize.c.

Referenced by SCIPincludeHeurRedsize().

◆ HEUR_MAXDEPTH

#define HEUR_MAXDEPTH   -1

Definition at line 35 of file heur_redsize.c.

Referenced by SCIPincludeHeurRedsize().

◆ HEUR_TIMING

#define HEUR_TIMING   SCIP_HEURTIMING_BEFORENODE

Definition at line 36 of file heur_redsize.c.

Referenced by SCIPincludeHeurRedsize().

◆ HEUR_USESSUBSCIP

#define HEUR_USESSUBSCIP   TRUE

does the heuristic use a secondary SCIP instance?

Definition at line 37 of file heur_redsize.c.

Referenced by SCIPincludeHeurRedsize().

◆ DEFAULT_REDUCTIONRATE

#define DEFAULT_REDUCTIONRATE   0.75

default percentile of transition that gets deleted

Definition at line 39 of file heur_redsize.c.

Referenced by SCIPincludeHeurRedsize().

Function Documentation

◆ SCIPcycAddIncompleteSol()

static SCIP_RETCODE SCIPcycAddIncompleteSol ( SCIP scip,
SCIP subscip,
SCIP_HEUR heur,
SCIP_SOL subsol,
SCIP_RESULT result 
)
static

Add incomplete solution to main scip

Parameters
scipSCIP data structure
subscipSCIP data structure of subscip
heurpointer to heuristic
subsolsolution of subscip
resultresult pointer

Definition at line 52 of file heur_redsize.c.

References assignVars(), FALSE, SCIP_Bool, SCIP_CALL, SCIP_FOUNDSOL, SCIP_OKAY, SCIP_Real, SCIPallocBlockMemoryArray, SCIPcreateSol(), SCIPcycGetBinvars(), SCIPcycGetNBins(), SCIPcycGetNCluster(), SCIPfreeBlockMemoryArray, SCIPgetSolVal(), SCIPtrySolFree(), and TRUE.

Referenced by SCIPapplyRedSize().

◆ SCIPreduceMatrixSize()

static SCIP_RETCODE SCIPreduceMatrixSize ( SCIP scip,
SCIP_Real **  matrix,
SCIP_Real  percentile,
SCIP_Real  scale,
int  size 
)
static

set all the given percentile of nonzeros to zero

Parameters
scipSCIP data structure
matrixthe matrix
percentilethe percentile of entries to be deleted
scalescaling between net flow and coherence
sizethe size of the matrix

Definition at line 106 of file heur_redsize.c.

References MAX, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBlockMemoryArray, SCIPfreeBlockMemoryArray, SCIPisZero(), SCIPreallocBlockMemoryArray, and SCIPsortRealInt().

Referenced by SCIPapplyRedSize().

◆ SCIPapplyRedSize()

static SCIP_RETCODE SCIPapplyRedSize ( SCIP scip,
SCIP_HEUR heur,
SCIP_RESULT result,
SCIP_Real  reductionrate,
SCIP_Longint  maxnodes 
)
static

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

Parameters
sciporiginal SCIP data structure
heurheuristic data structure
resultresult data structure
reductionrateminimum percentage of integer variables that have to be fixed
maxnodesmaximum number of nodes for the subproblem

Definition at line 172 of file heur_redsize.c.

References FALSE, NULL, SCIP_CALL, SCIP_CALL_ABORT, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_PARAMSETTING_FAST, SCIP_PARAMSETTING_OFF, SCIP_Real, SCIPallocBlockMemoryArray, SCIPcreate(), SCIPcreateProbCyc(), SCIPcycAddIncompleteSol(), SCIPcycGetCmatrix(), SCIPcycGetNBins(), SCIPcycGetNCluster(), SCIPcycGetScale(), SCIPdebug, SCIPfindBranchrule(), SCIPfindNodesel(), SCIPfree(), SCIPfreeBlockMemoryArray, SCIPgetNSols(), SCIPgetSols(), SCIPincludeCycPlugins(), SCIPisParamFixed(), SCIPprintStatistics(), SCIPreduceMatrixSize(), SCIPsetBoolParam(), SCIPsetCharParam(), SCIPsetIntParam(), SCIPsetLongintParam(), SCIPsetPresolving(), SCIPsetSeparating(), SCIPsetSubscipsOff(), SCIPsolve(), and TRUE.

Referenced by SCIP_DECL_HEUREXEC().

◆ SCIP_DECL_HEURCOPY()

static SCIP_DECL_HEURCOPY ( heurCopyRedsize  )
static

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

Definition at line 313 of file heur_redsize.c.

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

◆ SCIP_DECL_HEURFREE()

static SCIP_DECL_HEURFREE ( heurFreeRedsize  )
static

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

Definition at line 327 of file heur_redsize.c.

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

◆ SCIP_DECL_HEUREXEC()

static SCIP_DECL_HEUREXEC ( heurExecRedsize  )
static

execution method of primal heuristic

Definition at line 347 of file heur_redsize.c.

References HEUR_NAME, NULL, SCIP_CALL, SCIP_DIDNOTRUN, SCIP_Longint, SCIP_OKAY, SCIPapplyRedSize(), SCIPheurGetData(), and SCIPheurGetName().

◆ SCIPincludeHeurRedsize()

SCIP_RETCODE SCIPincludeHeurRedsize ( SCIP scip)