Detailed Description
zirounding primal heuristic
Definition in file heur_gcgzirounding.c.
#include <string.h>#include "gcg/heur_gcgzirounding.h"#include "gcg/gcg.h"#include "gcg/relax_gcg.h"Go to the source code of this file.
Data Structures | |
| struct | SCIP_HeurData |
Macros | |
| #define | HEUR_NAME "gcgzirounding" |
| #define | HEUR_DESC "rounding heuristic on original variables as suggested by C. Wallace taking row slacks and bounds into account" |
| #define | HEUR_DISPCHAR 'z' |
| #define | HEUR_PRIORITY -500 |
| #define | HEUR_FREQ -1 |
| #define | HEUR_FREQOFS 0 |
| #define | HEUR_MAXDEPTH -1 |
| #define | HEUR_TIMING SCIP_HEURTIMING_AFTERNODE |
| #define | HEUR_USESSUBSCIP FALSE |
| #define | DEFAULT_MAXROUNDINGLOOPS 2 |
| #define | DEFAULT_STOPZIROUND TRUE |
| #define | DEFAULT_STOPPERCENTAGE 0.02 |
| #define | DEFAULT_MINSTOPNCALLS 1000 |
| #define | MINSHIFT 1e-4 |
Functions | |
| static SCIP_Real | getZiValue (SCIP *scip, SCIP_Real val) |
| static void | calculateBounds (SCIP *scip, SCIP_VAR *var, SCIP_Real currentvalue, SCIP_Real *upperbound, SCIP_Real *lowerbound, SCIP_Real *upslacks, SCIP_Real *downslacks, int nslacks, SCIP_Bool *numericalerror) |
| static SCIP_RETCODE | updateSlacks (SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real shiftvalue, SCIP_Real *upslacks, SCIP_Real *downslacks, SCIP_Real *activities, SCIP_VAR **slackvars, SCIP_Real *slackcoeffs, int nslacks) |
| static void | rowFindSlackVar (SCIP *scip, SCIP_ROW *row, SCIP_VAR **varpointer, SCIP_Real *coeffpointer) |
| static | SCIP_DECL_HEURFREE (heurFreeGcgzirounding) |
| static | SCIP_DECL_HEURINIT (heurInitGcgzirounding) |
| static | assert (strcmp(SCIPheurGetName(heur), HEUR_NAME)==0) |
| assert (heurdata !=NULL) | |
| SCIP_CALL (SCIPfreeSol(scip, &heurdata->sol)) | |
| static | SCIP_DECL_HEURINITSOL (heurInitsolGcgzirounding) |
| static | SCIP_DECL_HEUREXEC (heurExecGcgzirounding) |
| SCIP_RETCODE | GCGincludeHeurGcgzirounding (GCG *gcg) |
Variables | |
| heurdata = SCIPheurGetData(heur) | |
| return | SCIP_OKAY |
Macro Definition Documentation
◆ HEUR_NAME
| #define HEUR_NAME "gcgzirounding" |
Definition at line 43 of file heur_gcgzirounding.c.
◆ HEUR_DESC
| #define HEUR_DESC "rounding heuristic on original variables as suggested by C. Wallace taking row slacks and bounds into account" |
Definition at line 44 of file heur_gcgzirounding.c.
◆ HEUR_DISPCHAR
| #define HEUR_DISPCHAR 'z' |
Definition at line 45 of file heur_gcgzirounding.c.
◆ HEUR_PRIORITY
| #define HEUR_PRIORITY -500 |
Definition at line 46 of file heur_gcgzirounding.c.
◆ HEUR_FREQ
| #define HEUR_FREQ -1 |
Definition at line 48 of file heur_gcgzirounding.c.
◆ HEUR_FREQOFS
| #define HEUR_FREQOFS 0 |
Definition at line 49 of file heur_gcgzirounding.c.
◆ HEUR_MAXDEPTH
| #define HEUR_MAXDEPTH -1 |
Definition at line 50 of file heur_gcgzirounding.c.
◆ HEUR_TIMING
| #define HEUR_TIMING SCIP_HEURTIMING_AFTERNODE |
Definition at line 51 of file heur_gcgzirounding.c.
◆ HEUR_USESSUBSCIP
| #define HEUR_USESSUBSCIP FALSE |
Definition at line 52 of file heur_gcgzirounding.c.
◆ DEFAULT_MAXROUNDINGLOOPS
| #define DEFAULT_MAXROUNDINGLOOPS 2 |
delimits the number of main loops, can be set to -1 for no limit
Definition at line 54 of file heur_gcgzirounding.c.
Referenced by GCGincludeHeurGcgzirounding().
◆ DEFAULT_STOPZIROUND
| #define DEFAULT_STOPZIROUND TRUE |
deactivation check is enabled by default
Definition at line 55 of file heur_gcgzirounding.c.
Referenced by GCGincludeHeurGcgzirounding().
◆ DEFAULT_STOPPERCENTAGE
| #define DEFAULT_STOPPERCENTAGE 0.02 |
the tolerance percentage after which zirounding will not be executed anymore
Definition at line 56 of file heur_gcgzirounding.c.
Referenced by GCGincludeHeurGcgzirounding().
◆ DEFAULT_MINSTOPNCALLS
| #define DEFAULT_MINSTOPNCALLS 1000 |
number of heuristic calls before deactivation check
Definition at line 57 of file heur_gcgzirounding.c.
Referenced by GCGincludeHeurGcgzirounding().
◆ MINSHIFT
| #define MINSHIFT 1e-4 |
minimum shift value for every single step
Definition at line 59 of file heur_gcgzirounding.c.
Referenced by calculateBounds(), and SCIP_DECL_HEUREXEC().
Enumeration Type Documentation
◆ Direction
| enum Direction |
| Enumerator | |
|---|---|
| DIRECTION_UP | |
| DIRECTION_DOWN | |
Definition at line 77 of file heur_gcgzirounding.c.
Function Documentation
◆ getZiValue()
returns the fractionality of a value x, which is calculated as zivalue(x) = min(x-floor(x), ceil(x)-x)
- Parameters
-
scip pointer to current SCIP data structure val the value for which the fractionality should be computed
Definition at line 90 of file heur_gcgzirounding.c.
References assert(), and getZiValue().
Referenced by getZiValue(), and SCIP_DECL_HEUREXEC().
◆ calculateBounds()
|
static |
determines shifting bounds for variable
- Parameters
-
scip pointer to current SCIP data structure var the variable for which lb and ub have to be calculated currentvalue the current value of var in the working solution upperbound pointer to store the calculated upper bound on the variable shift lowerbound pointer to store the calculated lower bound on the variable shift upslacks array that contains the slacks between row activities and the right hand sides of the rows downslacks array that contains lhs slacks nslacks current number of slacks numericalerror flag to determine whether a numerical error occurred
Definition at line 108 of file heur_gcgzirounding.c.
References assert(), calculateBounds(), i, MINSHIFT, and var.
◆ updateSlacks()
|
static |
when a variable is shifted, the activities and slacks of all rows it appears in have to be updated
- Parameters
-
scip pointer to current SCIP data structure sol working solution var pointer to variable to be modified shiftvalue the value by which the variable is shifted upslacks upslacks of all rows the variable appears in downslacks downslacks of all rows the variable appears in activities activities of the LP rows slackvars the slack variables for equality rows slackcoeffs the slack variable coefficients nslacks size of the arrays
Definition at line 232 of file heur_gcgzirounding.c.
References activities, assert(), i, SCIP_CALL(), sol, updateSlacks(), and var.
Referenced by SCIP_DECL_HEUREXEC(), and updateSlacks().
◆ rowFindSlackVar()
|
static |
finds a continuous slack variable for an equation row, NULL if none exists
- Parameters
-
scip pointer to current SCIP data structure row the row for which a slack variable is searched varpointer pointer to store the slack variable coeffpointer pointer to store the coefficient of the slack variable
Definition at line 317 of file heur_gcgzirounding.c.
References assert(), and rowFindSlackVar().
Referenced by rowFindSlackVar(), and SCIP_DECL_HEUREXEC().
◆ SCIP_DECL_HEURFREE()
|
static |
◆ SCIP_DECL_HEURINIT()
|
static |
initialization method of primal heuristic (called after problem was transformed)
Definition at line 394 of file heur_gcgzirounding.c.
References assert(), HEUR_NAME, heurdata, SCIP_CALL(), and SCIP_HeurData::sol.
◆ assert() [1/2]
| assert | ( | strcmp(SCIPheurGetName(heur), HEUR_NAME) | = =0 | ) |
◆ assert() [2/2]
◆ SCIP_CALL()
| SCIP_CALL | ( | SCIPfreeSol(scip, &heurdata->sol) | ) |
References heurdata, and SCIP_CALL().
◆ SCIP_DECL_HEURINITSOL()
|
static |
solving process initialization method of primal heuristic (called when branch and bound process is about to begin)
Definition at line 428 of file heur_gcgzirounding.c.
References assert(), HEUR_NAME, heurdata, and SCIP_HeurData::lastlp.
◆ SCIP_DECL_HEUREXEC()
|
static |
execution method of primal heuristic
Definition at line 444 of file heur_gcgzirounding.c.
References activities, assert(), c, calculateBounds(), SCIP_HeurData::gcg, GCGgetMasterprob(), getZiValue(), HEUR_NAME, heurdata, i, SCIP_HeurData::lastlp, lpcands, masterprob, SCIP_HeurData::maxroundingloops, MINSHIFT, SCIP_HeurData::minstopncalls, nlpcands, nlps, oldsolval, result, rowFindSlackVar(), SCIP_CALL(), SCIP_HeurData::sol, sol, SCIP_HeurData::stoppercentage, SCIP_HeurData::stopziround, updateSlacks(), and var.
◆ GCGincludeHeurGcgzirounding()
| SCIP_RETCODE GCGincludeHeurGcgzirounding | ( | GCG * | gcg | ) |
creates the GCG zirounding primal heuristic and includes it in SCIP
- Parameters
-
gcg GCG data structure
Definition at line 880 of file heur_gcgzirounding.c.
References assert(), DEFAULT_MAXROUNDINGLOOPS, DEFAULT_MINSTOPNCALLS, DEFAULT_STOPPERCENTAGE, DEFAULT_STOPZIROUND, SCIP_HeurData::gcg, GCGgetOrigprob(), GCGincludeHeurGcgzirounding(), HEUR_DESC, HEUR_DISPCHAR, HEUR_FREQ, HEUR_FREQOFS, HEUR_MAXDEPTH, HEUR_NAME, HEUR_PRIORITY, HEUR_TIMING, HEUR_USESSUBSCIP, heurdata, SCIP_HeurData::maxroundingloops, SCIP_HeurData::minstopncalls, origprob, SCIP_CALL(), SCIP_HeurData::stoppercentage, and SCIP_HeurData::stopziround.
Referenced by GCGincludeGcgPlugins(), and GCGincludeHeurGcgzirounding().
Variable Documentation
◆ heurdata
| heurdata = SCIPheurGetData(heur) |
Definition at line 417 of file heur_gcgzirounding.c.
◆ SCIP_OKAY
| return SCIP_OKAY |
Definition at line 423 of file heur_gcgzirounding.c.