Detailed Description
LNS heuristic that finds the optimal rounding to a given point.
Definition in file heur_gcgrens.c.
#include <assert.h>#include <string.h>#include <stdio.h>#include "gcg/heur_gcgrens.h"#include "gcg/gcg.h"#include "scip/scipdefplugins.h"#include "scip/cons_linear.h"Go to the source code of this file.
Data Structures | |
| struct | SCIP_HeurData |
Macros | |
| #define | HEUR_NAME "gcgrens" |
| #define | HEUR_DESC "LNS exploring fractional neighborhood of relaxation's optimum" |
| #define | HEUR_DISPCHAR 'E' |
| #define | HEUR_PRIORITY -1100000 |
| #define | HEUR_FREQ 0 |
| #define | HEUR_FREQOFS 0 |
| #define | HEUR_MAXDEPTH -1 |
| #define | HEUR_TIMING SCIP_HEURTIMING_AFTERNODE |
| #define | HEUR_USESSUBSCIP TRUE |
| #define | DEFAULT_BINARYBOUNDS TRUE |
| #define | DEFAULT_MAXNODES 5000LL |
| #define | DEFAULT_MINFIXINGRATE 0.5 |
| #define | DEFAULT_MINIMPROVE 0.01 |
| #define | DEFAULT_MINNODES 500LL |
| #define | DEFAULT_NODESOFS 500LL |
| #define | DEFAULT_NODESQUOT 0.1 |
| #define | DEFAULT_USELPROWS FALSE |
| #define | DEFAULT_COPYCUTS TRUE |
| #define | DEFAULT_ADDALLSOLS FALSE |
Functions | |
| static SCIP_RETCODE | createSubproblem (SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_Real minfixingrate, SCIP_Bool binarybounds, SCIP_Bool uselprows, SCIP_Real *intfixingrate, SCIP_Real *zerofixingrate, SCIP_Bool *success) |
| static SCIP_RETCODE | createNewSol (SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEUR *heur, SCIP_SOL *subsol, SCIP_Bool *success) |
| static SCIP_RETCODE | applyGcgrens (SCIP *scip, SCIP_HEUR *heur, SCIP_RESULT *result, SCIP_Real minfixingrate, SCIP_Real minimprove, SCIP_Longint maxnodes, SCIP_Longint nstallnodes, SCIP_Bool binarybounds, SCIP_Bool uselprows) |
| static | SCIP_DECL_HEURFREE (heurFreeGcgrens) |
| static | SCIP_DECL_HEURINIT (heurInitGcgrens) |
| static | SCIP_DECL_HEUREXEC (heurExecGcgrens) |
| SCIP_RETCODE | GCGincludeHeurGcgrens (GCG *gcg) |
Macro Definition Documentation
◆ HEUR_NAME
| #define HEUR_NAME "gcgrens" |
Definition at line 48 of file heur_gcgrens.c.
◆ HEUR_DESC
| #define HEUR_DESC "LNS exploring fractional neighborhood of relaxation's optimum" |
Definition at line 49 of file heur_gcgrens.c.
◆ HEUR_DISPCHAR
| #define HEUR_DISPCHAR 'E' |
Definition at line 50 of file heur_gcgrens.c.
◆ HEUR_PRIORITY
| #define HEUR_PRIORITY -1100000 |
Definition at line 51 of file heur_gcgrens.c.
◆ HEUR_FREQ
| #define HEUR_FREQ 0 |
Definition at line 52 of file heur_gcgrens.c.
◆ HEUR_FREQOFS
| #define HEUR_FREQOFS 0 |
Definition at line 53 of file heur_gcgrens.c.
◆ HEUR_MAXDEPTH
| #define HEUR_MAXDEPTH -1 |
Definition at line 54 of file heur_gcgrens.c.
◆ HEUR_TIMING
| #define HEUR_TIMING SCIP_HEURTIMING_AFTERNODE |
Definition at line 55 of file heur_gcgrens.c.
◆ HEUR_USESSUBSCIP
| #define HEUR_USESSUBSCIP TRUE |
does the heuristic use a secondary SCIP instance?
Definition at line 56 of file heur_gcgrens.c.
◆ DEFAULT_BINARYBOUNDS
| #define DEFAULT_BINARYBOUNDS TRUE |
should general integers get binary bounds [floor(.),ceil(.)] ?
Definition at line 59 of file heur_gcgrens.c.
Referenced by GCGincludeHeurGcgrens().
◆ DEFAULT_MAXNODES
| #define DEFAULT_MAXNODES 5000LL |
maximum number of nodes to regard in the subproblem
Definition at line 60 of file heur_gcgrens.c.
◆ DEFAULT_MINFIXINGRATE
| #define DEFAULT_MINFIXINGRATE 0.5 |
minimum percentage of integer variables that have to be fixed
Definition at line 61 of file heur_gcgrens.c.
Referenced by GCGincludeHeurGcgrens(), GCGincludeHeurGcgrins(), GCGincludeHeurRestmaster(), GCGincludeHeurXpcrossover(), GCGincludeHeurXprins(), and SCIPincludeHeurIPcolgen().
◆ DEFAULT_MINIMPROVE
| #define DEFAULT_MINIMPROVE 0.01 |
factor by which RENS should at least improve the incumbent
Definition at line 62 of file heur_gcgrens.c.
◆ DEFAULT_MINNODES
| #define DEFAULT_MINNODES 500LL |
minimum number of nodes to regard in the subproblem
Definition at line 63 of file heur_gcgrens.c.
◆ DEFAULT_NODESOFS
| #define DEFAULT_NODESOFS 500LL |
number of nodes added to the contingent of the total nodes
Definition at line 64 of file heur_gcgrens.c.
◆ DEFAULT_NODESQUOT
| #define DEFAULT_NODESQUOT 0.1 |
subproblem nodes in relation to nodes of the original problem
Definition at line 65 of file heur_gcgrens.c.
◆ DEFAULT_USELPROWS
| #define DEFAULT_USELPROWS FALSE |
should subproblem be created out of the rows in the LP rows, otherwise, the copy constructors of the constraints handlers are used
Definition at line 66 of file heur_gcgrens.c.
◆ DEFAULT_COPYCUTS
| #define DEFAULT_COPYCUTS TRUE |
if DEFAULT_USELPROWS is FALSE, then should all active cuts from the cutpool of the original scip be copied to constraints of the subscip
Definition at line 68 of file heur_gcgrens.c.
◆ DEFAULT_ADDALLSOLS
| #define DEFAULT_ADDALLSOLS FALSE |
Definition at line 71 of file heur_gcgrens.c.
Referenced by GCGincludeHeurGcgrens().
Function Documentation
◆ createSubproblem()
|
static |
creates a subproblem by fixing a number of variables
- Parameters
-
scip original SCIP data structure subscip SCIP data structure for the subproblem subvars the variables of the subproblem minfixingrate percentage of integer variables that have to be fixed binarybounds should general integers get binary bounds [floor(.),ceil(.)] ? uselprows should subproblem be created out of the rows in the LP rows? intfixingrate percentage of integers that get actually fixed zerofixingrate percentage of variables fixed to zero success pointer to store whether the problem was created successfully
Definition at line 115 of file heur_gcgrens.c.
References assert(), createSubproblem(), i, j, nbinvars, nintvars, SCIP_CALL(), SCIPfreeBufferArray(), success, and vars.
◆ createNewSol()
|
static |
creates a new solution for the original problem by copying the solution of the subproblem
- Parameters
-
scip original SCIP data structure subscip SCIP structure of the subproblem subvars the variables of the subproblem heur RENS heuristic structure subsol solution of the subproblem success used to store whether new solution was found or not
Definition at line 267 of file heur_gcgrens.c.
References SCIP_HeurData::addallsols, assert(), createNewSol(), heurdata, nvars, SCIP_CALL(), SCIPfreeBufferArray(), success, and vars.
◆ applyGcgrens()
|
static |
main procedure of the GCG RENS heuristic, creates and solves a sub-SCIP
- Parameters
-
scip original SCIP data structure heur heuristic data structure result result data structure minfixingrate minimum percentage of integer variables that have to be fixed minimprove factor by which RENS should at least improve the incumbent maxnodes maximum number of nodes for the subproblem nstallnodes number of stalling nodes for the subproblem binarybounds should general integers get binary bounds [floor(.),ceil(.)]? uselprows should subproblem be created out of the rows in the LP rows?
Definition at line 335 of file heur_gcgrens.c.
References SCIP_HeurData::addallsols, applyGcgrens(), assert(), SCIP_HeurData::copycuts, createNewSol(), createSubproblem(), cutoff, heurdata, i, nvars, result, retcode, SCIP_CALL(), SCIPdebugMessage(), SCIPfreeBufferArray(), success, SCIP_HeurData::usednodes, varmapfw, and vars.
Referenced by applyGcgrens(), and SCIP_DECL_HEUREXEC().
◆ SCIP_DECL_HEURFREE()
|
static |
destructor of primal heuristic to free user data (called when SCIP is exiting)
Definition at line 636 of file heur_gcgrens.c.
References assert(), heurdata, and SCIPfreeMemory().
◆ SCIP_DECL_HEURINIT()
|
static |
initialization method of primal heuristic (called after problem was transformed)
Definition at line 657 of file heur_gcgrens.c.
References assert(), heurdata, and SCIP_HeurData::usednodes.
◆ SCIP_DECL_HEUREXEC()
|
static |
execution method of primal heuristic
Definition at line 740 of file heur_gcgrens.c.
References applyGcgrens(), assert(), SCIP_HeurData::binarybounds, SCIP_HeurData::gcg, GCGgetMasterprob(), heurdata, masterprob, SCIP_HeurData::maxnodes, SCIP_HeurData::minfixingrate, SCIP_HeurData::minimprove, SCIP_HeurData::minnodes, SCIP_HeurData::nodesofs, SCIP_HeurData::nodesquot, result, SCIP_CALL(), SCIPdebugMessage(), SCIP_HeurData::usednodes, and SCIP_HeurData::uselprows.
◆ GCGincludeHeurGcgrens()
| SCIP_RETCODE GCGincludeHeurGcgrens | ( | GCG * | gcg | ) |
creates GCG RENS primal heuristic and includes it in SCIP
creates RENS primal heuristic and includes it in SCIP
- Parameters
-
gcg GCG data structure
Definition at line 817 of file heur_gcgrens.c.
References SCIP_HeurData::addallsols, assert(), SCIP_HeurData::binarybounds, SCIP_HeurData::copycuts, DEFAULT_ADDALLSOLS, DEFAULT_BINARYBOUNDS, DEFAULT_COPYCUTS, DEFAULT_MAXNODES, DEFAULT_MINFIXINGRATE, DEFAULT_MINIMPROVE, DEFAULT_MINNODES, DEFAULT_NODESOFS, DEFAULT_NODESQUOT, DEFAULT_USELPROWS, SCIP_HeurData::gcg, GCGgetOrigprob(), GCGincludeHeurGcgrens(), HEUR_DESC, HEUR_DISPCHAR, HEUR_FREQ, HEUR_FREQOFS, HEUR_MAXDEPTH, HEUR_NAME, HEUR_PRIORITY, HEUR_TIMING, HEUR_USESSUBSCIP, heurdata, SCIP_HeurData::maxnodes, SCIP_HeurData::minfixingrate, SCIP_HeurData::minimprove, SCIP_HeurData::minnodes, SCIP_HeurData::nodesofs, SCIP_HeurData::nodesquot, origprob, SCIP_CALL(), and SCIP_HeurData::uselprows.
Referenced by GCGincludeGcgPlugins(), and GCGincludeHeurGcgrens().