SCIP Doxygen Documentation
 
Loading...
Searching...
No Matches
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 38 of file heur_redsize.c.

◆ HEUR_DESC

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

Definition at line 39 of file heur_redsize.c.

◆ HEUR_DISPCHAR

#define HEUR_DISPCHAR   'u'

Definition at line 40 of file heur_redsize.c.

◆ HEUR_PRIORITY

#define HEUR_PRIORITY   536870911

Definition at line 41 of file heur_redsize.c.

◆ HEUR_FREQ

#define HEUR_FREQ   0

Definition at line 42 of file heur_redsize.c.

◆ HEUR_FREQOFS

#define HEUR_FREQOFS   0

Definition at line 43 of file heur_redsize.c.

◆ HEUR_MAXDEPTH

#define HEUR_MAXDEPTH   -1

Definition at line 44 of file heur_redsize.c.

◆ HEUR_TIMING

#define HEUR_TIMING   SCIP_HEURTIMING_BEFORENODE

Definition at line 45 of file heur_redsize.c.

◆ HEUR_USESSUBSCIP

#define HEUR_USESSUBSCIP   TRUE

does the heuristic use a secondary SCIP instance?

Definition at line 46 of file heur_redsize.c.

◆ DEFAULT_REDUCTIONRATE

#define DEFAULT_REDUCTIONRATE   0.75

default percentile of transition that gets deleted

Definition at line 48 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 61 of file heur_redsize.c.

References assignVars(), FALSE, i, result, 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 115 of file heur_redsize.c.

References i, 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

◆ SCIP_DECL_HEURCOPY()

static SCIP_DECL_HEURCOPY ( heurCopyRedsize )
static

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

Definition at line 322 of file heur_redsize.c.

References assert(), 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 336 of file heur_redsize.c.

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

◆ SCIP_DECL_HEUREXEC()

static SCIP_DECL_HEUREXEC ( heurExecRedsize )
static

execution method of primal heuristic

Definition at line 356 of file heur_redsize.c.

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

◆ SCIPincludeHeurRedsize()

SCIP_RETCODE SCIPincludeHeurRedsize ( SCIP * scip)