simple and fast LP rounding heuristic
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 -30 |
#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 |
Variables | |
heurdata = SCIPheurGetData(heur) | |
return | SCIP_OKAY |
heurdata | lastlp = -1 |
heurdata | nroundablevars = -1 |
* | result = SCIP_DIDNOTRUN |
#define HEUR_NAME "simplerounding" |
Definition at line 54 of file heur_simplerounding.c.
#define HEUR_DESC "simple and fast LP rounding heuristic" |
Definition at line 55 of file heur_simplerounding.c.
#define HEUR_DISPCHAR SCIP_HEURDISPCHAR_ROUNDING |
Definition at line 56 of file heur_simplerounding.c.
#define HEUR_PRIORITY -30 |
Definition at line 57 of file heur_simplerounding.c.
#define HEUR_FREQ 1 |
Definition at line 58 of file heur_simplerounding.c.
#define HEUR_FREQOFS 0 |
Definition at line 59 of file heur_simplerounding.c.
#define HEUR_MAXDEPTH -1 |
Definition at line 60 of file heur_simplerounding.c.
#define HEUR_TIMING SCIP_HEURTIMING_DURINGLPLOOP | SCIP_HEURTIMING_DURINGPRICINGLOOP |
Definition at line 61 of file heur_simplerounding.c.
#define HEUR_USESSUBSCIP FALSE |
does the heuristic use a secondary SCIP instance?
Definition at line 62 of file heur_simplerounding.c.
#define DEFAULT_ONCEPERNODE FALSE |
should the heuristic only be called once per node?
Definition at line 64 of file heur_simplerounding.c.
|
static |
perform rounding
scip | SCIP main data structure |
sol | solution to round |
cands | candidate variables |
candssol | solutions of candidate variables |
ncands | number of candidates |
result | pointer to store the result of the heuristic call |
Definition at line 82 of file heur_simplerounding.c.
References assert(), c, FALSE, mayrounddown, mayroundup, NULL, result, 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(), sol, TRUE, and var.
Referenced by performLPSimpleRounding(), and performRelaxSimpleRounding().
|
static |
perform LP-rounding
scip | SCIP main data structure |
heurdata | heuristic data |
heurtiming | heuristic timing mask |
result | pointer to store the result of the heuristic call |
Definition at line 186 of file heur_simplerounding.c.
References assert(), heurdata, lpcands, lpcandssol, nlpcands, nlps, NULL, performSimpleRounding(), result, SCIP_CALL, SCIP_HEURTIMING_DURINGPRICINGLOOP, SCIP_Longint, SCIP_LPSOLSTAT_OPTIMAL, SCIP_OKAY, SCIP_Real, SCIPdebugMsg, SCIPgetCutoffbound(), SCIPgetLPBranchCands(), SCIPgetLPObjval(), SCIPgetLPSolstat(), SCIPgetNLPs(), SCIPisGE(), SCIPlinkLPSol(), and sol.
|
static |
perform relaxation solution rounding
scip | SCIP main data structure |
heurdata | heuristic data |
result | pointer to store the result of the heuristic call |
Definition at line 246 of file heur_simplerounding.c.
References assert(), heurdata, nbinvars, nintvars, NULL, performSimpleRounding(), result, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPdebugMsg, SCIPfreeBufferArray, SCIPgetRelaxSolVal(), SCIPgetVarsData(), SCIPisFeasIntegral(), SCIPisRelaxSolValid(), SCIPlinkRelaxSol(), sol, and vars.
|
static |
copy method for primal heuristic plugins (called when SCIP copies plugins)
Definition at line 336 of file heur_simplerounding.c.
References assert(), HEUR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPheurGetName(), and SCIPincludeHeurSimplerounding().
assert | ( | heur ! | = NULL | ) |
assert | ( | strcmp(SCIPheurGetName(heur), HEUR_NAME) | = =0 | ) |
initialization method of primal heuristic (called after problem was transformed)
deinitialization method of primal heuristic (called before transformed problem is freed)
execution method of primal heuristic
References HEUR_NAME.
SCIPfreeBlockMemory | ( | scip | , |
& | heurdata ) |
References heurdata.
|
static |
solving process initialization method of primal heuristic (called when branch and bound process is about to begin)
Definition at line 406 of file heur_simplerounding.c.
References assert(), HEUR_NAME, heurdata, NULL, SCIP_HEURTIMING_AFTERLPNODE, SCIP_OKAY, SCIPheurGetData(), SCIPheurGetName(), and SCIPheurSetTimingmask().
|
static |
solving process deinitialization method of primal heuristic (called before branch and bound process data is freed)
Definition at line 426 of file heur_simplerounding.c.
References HEUR_TIMING, SCIP_OKAY, and SCIPheurSetTimingmask().
assert | ( | SCIPhasCurrentNodeLP(scip) | ) |
if | ( | SCIPgetLPSolstat(scip) ! | = SCIP_LPSOLSTAT_OPTIMAL && ! SCIPisRelaxSolValid(scip) | ) |
Definition at line 448 of file heur_simplerounding.c.
References heurdata, i, nroundablevars, NULL, SCIP_HEURTIMING_DURINGPRICINGLOOP, SCIP_LPSOLSTAT_OPTIMAL, SCIP_OKAY, SCIPisRelaxSolValid(), and vars.
if | ( | heurdata-> | nroundablevars = =0 &&heurtiming !=SCIP_HEURTIMING_DURINGPRICINGLOOP | ) |
Definition at line 521 of file heur_adaptivediving.c.
References findAndStoreDivesets(), heurdata, NULL, and SCIP_CALL.
heurdata = SCIPheurGetData(heur) |
Definition at line 359 of file heur_simplerounding.c.
return SCIP_OKAY |
Definition at line 364 of file heur_simplerounding.c.
heurdata lastlp = -1 |
Definition at line 380 of file heur_simplerounding.c.
heurdata nroundablevars = -1 |
Definition at line 381 of file heur_simplerounding.c.
Referenced by if().
* result = SCIP_DIDNOTRUN |
Definition at line 445 of file heur_simplerounding.c.