Scippy

SCIP

Solving Constraint Integer Programs

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 "blockmemshell/memory.h"
#include "scip/heur_simplerounding.h"
#include "scip/pub_heur.h"
#include "scip/pub_message.h"
#include "scip/pub_var.h"
#include "scip/scip_branch.h"
#include "scip/scip_heur.h"
#include "scip/scip_lp.h"
#include "scip/scip_mem.h"
#include "scip/scip_message.h"
#include "scip/scip_numerics.h"
#include "scip/scip_param.h"
#include "scip/scip_prob.h"
#include "scip/scip_sol.h"
#include "scip/scip_solvingstats.h"
#include "scip/scip_var.h"
#include <string.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   SCIP_HEURDISPCHAR_ROUNDING
 
#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 46 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

◆ HEUR_DISPCHAR

#define HEUR_DISPCHAR   SCIP_HEURDISPCHAR_ROUNDING

Definition at line 47 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

◆ HEUR_PRIORITY

#define HEUR_PRIORITY   0

Definition at line 48 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

◆ HEUR_FREQ

#define HEUR_FREQ   1

Definition at line 49 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

◆ HEUR_FREQOFS

#define HEUR_FREQOFS   0

Definition at line 50 of file heur_simplerounding.c.

Referenced by SCIPincludeHeurSimplerounding().

◆ HEUR_MAXDEPTH

#define HEUR_MAXDEPTH   -1

Definition at line 51 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 53 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 55 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 73 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 177 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 237 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 327 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 341 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 361 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 380 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 397 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 417 of file heur_simplerounding.c.

References HEUR_TIMING, SCIP_OKAY, and SCIPheurSetTimingmask().

◆ SCIP_DECL_HEUREXEC()