Detailed Description
LP diving heuristic that fixes variables with a large difference to their root solution.
Definition in file heur_gcglinesdiving.c.
#include <assert.h>#include <string.h>#include "gcg/heur_gcglinesdiving.h"#include "gcg/heur_origdiving.h"#include "gcg/gcg.h"#include "gcg/pricer_gcg.h"Go to the source code of this file.
Data Structures | |
| struct | GCG_DivingData |
Macros | |
| #define | HEUR_NAME "gcglinesdiving" |
| #define | HEUR_DESC "LP diving heuristic that chooses fixings following the line from root solution to current solution" |
| #define | HEUR_DISPCHAR 'l' |
| #define | HEUR_PRIORITY -1006000 |
| #define | HEUR_FREQ 10 |
| #define | HEUR_FREQOFS 6 |
| #define | HEUR_MAXDEPTH -1 |
Functions | |
| static SCIP_RETCODE | getRootRelaxSol (GCG *gcg, SCIP_SOL **rootsol) |
| static | assert (heur !=NULL) |
| assert (divingdata !=NULL) | |
| SCIPfreeMemory (GCGgetOrigprob(gcg), &divingdata) | |
| GCGheurSetDivingDataOrig (heur, NULL) | |
| assert (divingdata->firstrun==TRUE||divingdata->rootsol !=NULL) | |
| if (divingdata->rootsol !=NULL) | |
| assert (origprob !=NULL) | |
| assert (bestcand !=NULL) | |
| assert (bestcandmayround !=NULL) | |
| assert (bestcandroundup !=NULL) | |
| assert (divingdata->rootsol !=NULL) | |
| SCIP_CALL (SCIPgetExternBranchCands(origprob, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL)) | |
| assert (lpcands !=NULL) | |
| assert (lpcandssol !=NULL) | |
| for (c=0;c< nlpcands;++c) | |
| SCIP_RETCODE | GCGincludeHeurGcglinesdiving (GCG *gcg) |
Variables | |
| divingdata = GCGheurGetDivingDataOrig(heur) | |
| return | SCIP_OKAY |
| divingdata | firstrun = TRUE |
| divingdata | rootsol = NULL |
| static SCIP * | origprob = GCGgetOrigprob(gcg) |
| static SCIP_VAR ** | lpcands |
| SCIP_Real * | lpcandssol |
| int | nlpcands |
| SCIP_Real | bestdistquot = SCIPinfinity(origprob) |
| int | c |
| * | bestcandmayround = TRUE |
Macro Definition Documentation
◆ HEUR_NAME
| #define HEUR_NAME "gcglinesdiving" |
Definition at line 46 of file heur_gcglinesdiving.c.
◆ HEUR_DESC
| #define HEUR_DESC "LP diving heuristic that chooses fixings following the line from root solution to current solution" |
Definition at line 47 of file heur_gcglinesdiving.c.
◆ HEUR_DISPCHAR
| #define HEUR_DISPCHAR 'l' |
Definition at line 48 of file heur_gcglinesdiving.c.
◆ HEUR_PRIORITY
| #define HEUR_PRIORITY -1006000 |
Definition at line 49 of file heur_gcglinesdiving.c.
◆ HEUR_FREQ
| #define HEUR_FREQ 10 |
Definition at line 50 of file heur_gcglinesdiving.c.
◆ HEUR_FREQOFS
| #define HEUR_FREQOFS 6 |
Definition at line 51 of file heur_gcglinesdiving.c.
◆ HEUR_MAXDEPTH
| #define HEUR_MAXDEPTH -1 |
Definition at line 52 of file heur_gcglinesdiving.c.
Function Documentation
◆ getRootRelaxSol()
|
static |
get relaxation solution of root node (in original variables)
- Parameters
-
gcg GCG data structure rootsol pointer to store root relaxation solution
Definition at line 75 of file heur_gcglinesdiving.c.
References assert(), GCGgetMasterprob(), GCGtransformMastersolToOrigsol(), getRootRelaxSol(), i, masterprob, mastervars, nmastervars, rootsol, and SCIP_CALL().
◆ assert() [1/10]
| assert | ( | heur ! | = NULL | ) |
◆ assert() [2/10]
| assert | ( | divingdata ! | = NULL | ) |
References assert(), and divingdata.
◆ SCIPfreeMemory()
| SCIPfreeMemory | ( | GCGgetOrigprob(gcg) | , |
| & | divingdata ) |
References divingdata, GCGgetOrigprob(), and SCIPfreeMemory().
◆ GCGheurSetDivingDataOrig()
| GCGheurSetDivingDataOrig | ( | heur | , |
| NULL | ) |
References GCGheurSetDivingDataOrig().
◆ assert() [3/10]
| assert | ( | divingdata-> | firstrun = =TRUE||divingdata->rootsol !=NULL | ) |
References assert(), and divingdata.
◆ if()
| if | ( | divingdata->rootsol ! | = NULL | ) |
execution initialization method of diving heuristic (called when execution of diving heuristic is about to begin)
Definition at line 170 of file heur_gcglinesdiving.c.
References divingdata, origprob, and SCIP_CALL().
◆ assert() [4/10]
◆ assert() [5/10]
◆ assert() [6/10]
| assert | ( | bestcandmayround ! | = NULL | ) |
References assert(), and bestcandmayround.
◆ assert() [7/10]
| assert | ( | bestcandroundup ! | = NULL | ) |
References assert(), divingdata, and GCGheurGetDivingDataOrig().
◆ assert() [8/10]
| assert | ( | divingdata->rootsol ! | = NULL | ) |
References assert(), and divingdata.
◆ SCIP_CALL()
| SCIP_CALL | ( | SCIPgetExternBranchCands(origprob, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, NULL, NULL, NULL) | ) |
References lpcands, lpcandssol, nlpcands, origprob, and SCIP_CALL().
◆ assert() [9/10]
◆ assert() [10/10]
| assert | ( | lpcandssol ! | = NULL | ) |
References assert(), and lpcandssol.
◆ for()
| for | ( | ) |
Definition at line 240 of file heur_gcglinesdiving.c.
References bestcandmayround, bestdistquot, c, divingdata, i, lpcands, lpcandssol, nlpcands, origprob, solval, tabulist, and var.
◆ GCGincludeHeurGcglinesdiving()
| SCIP_RETCODE GCGincludeHeurGcglinesdiving | ( | GCG * | gcg | ) |
creates the gcglinesdiving heuristic and includes it in GCG
- Parameters
-
gcg GCG data structure
Definition at line 306 of file heur_gcglinesdiving.c.
References assert(), divingdata, GCGincludeDivingHeurOrig(), GCGincludeHeurGcglinesdiving(), HEUR_DESC, HEUR_DISPCHAR, HEUR_FREQ, HEUR_FREQOFS, HEUR_MAXDEPTH, HEUR_NAME, HEUR_PRIORITY, origprob, and SCIP_CALL().
Referenced by GCGincludeGcgPlugins(), and GCGincludeHeurGcglinesdiving().
Variable Documentation
◆ divingdata
| divingdata = GCGheurGetDivingDataOrig(heur) |
Definition at line 125 of file heur_gcglinesdiving.c.
◆ SCIP_OKAY
| return SCIP_OKAY |
Definition at line 130 of file heur_gcglinesdiving.c.
◆ firstrun
| divingdata firstrun = TRUE |
Definition at line 147 of file heur_gcglinesdiving.c.
◆ rootsol
| divingdata rootsol = NULL |
Definition at line 148 of file heur_gcglinesdiving.c.
Referenced by getRootRelaxSol(), getRootRelaxSol(), and getRootRelaxSol().
◆ origprob
| SCIP* origprob = GCGgetOrigprob(gcg) |
deinitialization method of diving heuristic (called before transformed problem is freed)
Definition at line 159 of file heur_gcglinesdiving.c.
◆ lpcands
| SCIP_VAR** lpcands |
variable selection method of diving heuristic; finds best candidate variable w.r.t. the root LP solution:
- in the projected space of fractional variables, extend the line segment connecting the root solution and the current LP solution up to the point, where one of the fractional variables becomes integral
- round this variable to the integral value
Definition at line 212 of file heur_gcglinesdiving.c.
◆ lpcandssol
| SCIP_Real* lpcandssol |
Definition at line 213 of file heur_gcglinesdiving.c.
◆ nlpcands
| int nlpcands |
Definition at line 214 of file heur_gcglinesdiving.c.
◆ bestdistquot
| bestdistquot = SCIPinfinity(origprob) |
Definition at line 215 of file heur_gcglinesdiving.c.
Referenced by for().
◆ c
| int c |
Definition at line 216 of file heur_gcglinesdiving.c.
◆ bestcandmayround
| * bestcandmayround = TRUE |
Definition at line 236 of file heur_gcglinesdiving.c.