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

#define HEUR_DESC   "simple and fast LP rounding heuristic"

Definition at line 33 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

#define HEUR_DISPCHAR   'r'

Definition at line 34 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

#define HEUR_PRIORITY   0

Definition at line 35 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

#define HEUR_FREQ   1

Definition at line 36 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

#define HEUR_FREQOFS   0

Definition at line 37 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

#define HEUR_MAXDEPTH   -1

Definition at line 38 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

#define HEUR_USESSUBSCIP   FALSE

does the heuristic use a secondary SCIP instance?

Definition at line 40 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

#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

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, SCIPadjustImplicitSolVals(), SCIPallColsInLP(), SCIPdebugMessage, SCIPfeasCeil(), SCIPfeasFloor(), SCIPisFeasIntegral(), SCIPprintSol(), SCIPsetSolVal(), SCIPtrySol(), SCIPvarGetName(), SCIPvarGetObj(), SCIPvarGetStatus(), SCIPvarMayRoundDown(), SCIPvarMayRoundUp(), and TRUE.

Referenced by performLPSimpleRounding(), and performRelaxSimpleRounding().

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 146 of file heur_simplerounding.c.

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

Referenced by SCIP_DECL_HEUREXEC().

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 202 of file heur_simplerounding.c.

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

Referenced by SCIP_DECL_HEUREXEC().

static SCIP_DECL_HEURCOPY ( heurCopySimplerounding  )
static

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

Definition at line 276 of file heur_simplerounding.c.

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

static SCIP_DECL_HEURFREE ( heurFreeSimplerounding  )
static

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

Definition at line 290 of file heur_simplerounding.c.

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

static SCIP_DECL_HEURINIT ( heurInitSimplerounding  )
static

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

Definition at line 310 of file heur_simplerounding.c.

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

static SCIP_DECL_HEUREXIT ( heurExitSimplerounding  )
static

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

Definition at line 329 of file heur_simplerounding.c.

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

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 346 of file heur_simplerounding.c.

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

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 366 of file heur_simplerounding.c.

References HEUR_TIMING, SCIP_OKAY, and SCIPheurSetTimingmask().