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 |
| static int | nbinintvars |
| * | 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, SCIPadjustImplicitSolVals(), SCIPallColsInLP(), SCIPdebugMsg, SCIPfeasCeil(), SCIPfeasFloor(), SCIPisFeasIntegral(), SCIPprintSol(), SCIPsetSolVal(), SCIPtrySol(), SCIPvarGetName(), SCIPvarGetObj(), SCIPvarGetStatus(), SCIPvarIsImpliedIntegral(), 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 185 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 245 of file heur_simplerounding.c.
References assert(), heurdata, 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 338 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)
References HEUR_NAME.
|
static |
solving process initialization method of primal heuristic (called when branch and bound process is about to begin)
Definition at line 408 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 428 of file heur_simplerounding.c.
References HEUR_TIMING, SCIP_OKAY, and SCIPheurSetTimingmask().
| assert | ( | SCIPhasCurrentNodeLP(scip) | ) |
References HEUR_NAME.
| if | ( | nbinintvars | = = 0 | ) |
Definition at line 454 of file heur_simplerounding.c.
References heurdata, i, nbinintvars, NULL, SCIP_HEURTIMING_DURINGPRICINGLOOP, SCIP_LPSOLSTAT_OPTIMAL, SCIP_OKAY, SCIPisRelaxSolValid(), and vars.
| heurdata = SCIPheurGetData(heur) |
Definition at line 361 of file heur_simplerounding.c.
| return SCIP_OKAY |
Definition at line 366 of file heur_simplerounding.c.
| heurdata lastlp = -1 |
Definition at line 382 of file heur_simplerounding.c.
| heurdata nroundablevars = -1 |
Definition at line 383 of file heur_simplerounding.c.
| nbinintvars |
execution method of primal heuristic
Definition at line 442 of file heur_simplerounding.c.
Referenced by alnsFixMoreVariables(), alnsUnfixVariables(), DECL_VARFIXINGS(), DECL_VARFIXINGS(), fillKernels(), fixMatchingSolutionValues(), fixMatchingSolutionValues(), if(), LNSFixMoreVariables(), LNSUnfixVariables(), neighborhoodFixVariables(), neighborhoodFixVariables(), SCIP_DECL_HEUREXEC(), and SCIPvariablegraphBreadthFirst().
| * result = SCIP_DIDNOTRUN |
Definition at line 448 of file heur_simplerounding.c.