Scippy

SCIP

Solving Constraint Integer Programs

heur_simplerounding.c File Reference

Detailed Description

simple and fast LP rounding heuristic

Author
Tobias Achterberg
Marc Pfetsch

The heuristic also tries to round relaxation solutions if available.

Definition in file heur_simplerounding.c.

#include <assert.h>
#include <string.h>
#include "scip/heur_simplerounding.h"

Go to the source code of this file.

Macros

#define HEUR_NAME   "simplerounding"
 
#define HEUR_DESC   "simple and fast LP rounding heuristic"
 
#define HEUR_DISPCHAR   'r'
 
#define HEUR_PRIORITY   0
 
#define HEUR_FREQ   1
 
#define HEUR_FREQOFS   0
 
#define HEUR_MAXDEPTH   -1
 
#define HEUR_TIMING   SCIP_HEURTIMING_DURINGLPLOOP | SCIP_HEURTIMING_DURINGPRICINGLOOP
 
#define HEUR_USESSUBSCIP   FALSE
 
#define DEFAULT_ONCEPERNODE   FALSE
 

Functions

static SCIP_RETCODE performSimpleRounding (SCIP *scip, SCIP_SOL *sol, SCIP_VAR **cands, SCIP_Real *candssol, int ncands, SCIP_RESULT *result)
 
static SCIP_RETCODE performLPSimpleRounding (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_HEURTIMING heurtiming, SCIP_RESULT *result)
 
static SCIP_RETCODE performRelaxSimpleRounding (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_RESULT *result)
 
static SCIP_DECL_HEURCOPY (heurCopySimplerounding)
 
static SCIP_DECL_HEURFREE (heurFreeSimplerounding)
 
static SCIP_DECL_HEURINIT (heurInitSimplerounding)
 
static SCIP_DECL_HEUREXIT (heurExitSimplerounding)
 
static SCIP_DECL_HEURINITSOL (heurInitsolSimplerounding)
 
static SCIP_DECL_HEUREXITSOL (heurExitsolSimplerounding)
 
static SCIP_DECL_HEUREXEC (heurExecSimplerounding)
 
SCIP_RETCODE SCIPincludeHeurSimplerounding (SCIP *scip)
 

Macro Definition Documentation

◆ HEUR_NAME

◆ HEUR_DESC

#define HEUR_DESC   "simple and fast LP rounding heuristic"

Definition at line 33 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

◆ HEUR_DISPCHAR

#define HEUR_DISPCHAR   'r'

Definition at line 34 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

◆ HEUR_PRIORITY

#define HEUR_PRIORITY   0

Definition at line 35 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

◆ HEUR_FREQ

#define HEUR_FREQ   1

Definition at line 36 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

◆ HEUR_FREQOFS

#define HEUR_FREQOFS   0

Definition at line 37 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

◆ HEUR_MAXDEPTH

#define HEUR_MAXDEPTH   -1

Definition at line 38 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

◆ HEUR_TIMING

◆ HEUR_USESSUBSCIP

#define HEUR_USESSUBSCIP   FALSE

does the heuristic use a secondary SCIP instance?

Definition at line 40 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

◆ DEFAULT_ONCEPERNODE

#define DEFAULT_ONCEPERNODE   FALSE

should the heuristic only be called once per node?

Definition at line 42 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

Function Documentation

◆ performSimpleRounding()

static SCIP_RETCODE performSimpleRounding ( SCIP scip,
SCIP_SOL sol,
SCIP_VAR **  cands,
SCIP_Real candssol,
int  ncands,
SCIP_RESULT result 
)
static

perform rounding

Parameters
scipSCIP main data structure
solsolution to round
candscandidate variables
candssolsolutions of candidate variables
ncandsnumber of candidates
resultpointer to store the result of the heuristic call

Definition at line 60 of file heur_simplerounding.c.

References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_FOUNDSOL, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_COLUMN, SCIP_VARTYPE_IMPLINT, SCIPadjustImplicitSolVals(), SCIPallColsInLP(), SCIPdebugMsg, SCIPfeasCeil(), SCIPfeasFloor(), SCIPisFeasIntegral(), SCIPprintSol(), SCIPsetSolVal(), SCIPtrySol(), SCIPvarGetName(), SCIPvarGetObj(), SCIPvarGetStatus(), SCIPvarGetType(), SCIPvarMayRoundDown(), SCIPvarMayRoundUp(), and TRUE.

Referenced by performLPSimpleRounding(), and performRelaxSimpleRounding().

◆ performLPSimpleRounding()

static SCIP_RETCODE performLPSimpleRounding ( SCIP scip,
SCIP_HEURDATA heurdata,
SCIP_HEURTIMING  heurtiming,
SCIP_RESULT result 
)
static

perform LP-rounding

Parameters
scipSCIP main data structure
heurdataheuristic data
heurtimingheuristic timing mask
resultpointer to store the result of the heuristic call

Definition at line 164 of file heur_simplerounding.c.

References NULL, performSimpleRounding(), SCIP_CALL, SCIP_HEURTIMING_DURINGPRICINGLOOP, SCIP_Longint, SCIP_LPSOLSTAT_OPTIMAL, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPgetCutoffbound(), SCIPgetLPBranchCands(), SCIPgetLPObjval(), SCIPgetLPSolstat(), SCIPgetNLPs(), SCIPisGE(), and SCIPlinkLPSol().

Referenced by SCIP_DECL_HEUREXEC().

◆ performRelaxSimpleRounding()

static SCIP_RETCODE performRelaxSimpleRounding ( SCIP scip,
SCIP_HEURDATA heurdata,
SCIP_RESULT result 
)
static

perform relaxation solution rounding

Parameters
scipSCIP main data structure
heurdataheuristic data
resultpointer to store the result of the heuristic call

Definition at line 224 of file heur_simplerounding.c.

References NULL, performSimpleRounding(), SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPdebugMsg, SCIPfreeBufferArray, SCIPgetRelaxSolVal(), SCIPgetVarsData(), SCIPisFeasIntegral(), SCIPisRelaxSolValid(), and SCIPlinkRelaxSol().

Referenced by SCIP_DECL_HEUREXEC().

◆ SCIP_DECL_HEURCOPY()

static SCIP_DECL_HEURCOPY ( heurCopySimplerounding  )
static

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

Definition at line 314 of file heur_simplerounding.c.

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

◆ SCIP_DECL_HEURFREE()

static SCIP_DECL_HEURFREE ( heurFreeSimplerounding  )
static

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

Definition at line 328 of file heur_simplerounding.c.

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

◆ SCIP_DECL_HEURINIT()

static SCIP_DECL_HEURINIT ( heurInitSimplerounding  )
static

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

Definition at line 348 of file heur_simplerounding.c.

References HEUR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateSol(), SCIPheurGetData(), and SCIPheurGetName().

◆ SCIP_DECL_HEUREXIT()

static SCIP_DECL_HEUREXIT ( heurExitSimplerounding  )
static

deinitialization method of primal heuristic (called before transformed problem is freed)

Definition at line 367 of file heur_simplerounding.c.

References HEUR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPfreeSol(), SCIPheurGetData(), and SCIPheurGetName().

◆ SCIP_DECL_HEURINITSOL()

static SCIP_DECL_HEURINITSOL ( heurInitsolSimplerounding  )
static

solving process initialization method of primal heuristic (called when branch and bound process is about to begin)

Definition at line 384 of file heur_simplerounding.c.

References HEUR_NAME, NULL, SCIP_HEURTIMING_AFTERLPNODE, SCIP_OKAY, SCIPheurGetData(), SCIPheurGetName(), and SCIPheurSetTimingmask().

◆ SCIP_DECL_HEUREXITSOL()

static SCIP_DECL_HEUREXITSOL ( heurExitsolSimplerounding  )
static

solving process deinitialization method of primal heuristic (called before branch and bound process data is freed)

Definition at line 404 of file heur_simplerounding.c.

References HEUR_TIMING, SCIP_OKAY, and SCIPheurSetTimingmask().

◆ SCIP_DECL_HEUREXEC()