Scippy

GCG

Branch-and-Price & Column Generation for Everyone

heur_gcgrens.c File Reference

Detailed Description

LNS heuristic that finds the optimal rounding to a given point.

Author
Timo Berthold
Christian Puchert

Definition in file heur_gcgrens.c.

#include <assert.h>
#include <string.h>
#include <stdio.h>
#include "heur_gcgrens.h"
#include "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 /* should all subproblem solutions be added to the original SCIP? */
 

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)
 
SCIP_RETCODE GCGapplyGcgrens (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 SCIPincludeHeurGcgrens (SCIP *scip)
 

Macro Definition Documentation

◆ HEUR_NAME

#define HEUR_NAME   "gcgrens"

Definition at line 47 of file heur_gcgrens.c.

◆ HEUR_DESC

#define HEUR_DESC   "LNS exploring fractional neighborhood of relaxation's optimum"

Definition at line 48 of file heur_gcgrens.c.

◆ HEUR_DISPCHAR

#define HEUR_DISPCHAR   'E'

Definition at line 49 of file heur_gcgrens.c.

◆ HEUR_PRIORITY

#define HEUR_PRIORITY   -1100000

Definition at line 50 of file heur_gcgrens.c.

◆ HEUR_FREQ

#define HEUR_FREQ   0

Definition at line 51 of file heur_gcgrens.c.

◆ HEUR_FREQOFS

#define HEUR_FREQOFS   0

Definition at line 52 of file heur_gcgrens.c.

◆ HEUR_MAXDEPTH

#define HEUR_MAXDEPTH   -1

Definition at line 53 of file heur_gcgrens.c.

◆ HEUR_TIMING

#define HEUR_TIMING   SCIP_HEURTIMING_AFTERNODE

Definition at line 54 of file heur_gcgrens.c.

◆ HEUR_USESSUBSCIP

#define HEUR_USESSUBSCIP   TRUE

does the heuristic use a secondary SCIP instance?

Definition at line 55 of file heur_gcgrens.c.

◆ DEFAULT_BINARYBOUNDS

#define DEFAULT_BINARYBOUNDS   TRUE

should general integers get binary bounds [floor(.),ceil(.)] ?

Definition at line 58 of file heur_gcgrens.c.

◆ DEFAULT_MAXNODES

#define DEFAULT_MAXNODES   5000LL

maximum number of nodes to regard in the subproblem

Definition at line 59 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 60 of file heur_gcgrens.c.

◆ DEFAULT_MINIMPROVE

#define DEFAULT_MINIMPROVE   0.01

factor by which RENS should at least improve the incumbent

Definition at line 61 of file heur_gcgrens.c.

◆ DEFAULT_MINNODES

#define DEFAULT_MINNODES   500LL

minimum number of nodes to regard in the subproblem

Definition at line 62 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 63 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 64 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 65 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 67 of file heur_gcgrens.c.

◆ DEFAULT_ADDALLSOLS

#define DEFAULT_ADDALLSOLS   FALSE /* should all subproblem solutions be added to the original SCIP? */

Definition at line 70 of file heur_gcgrens.c.

Function Documentation

◆ createSubproblem()

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

creates a subproblem by fixing a number of variables

Parameters
sciporiginal SCIP data structure
subscipSCIP data structure for the subproblem
subvarsthe variables of the subproblem
minfixingratepercentage of integer variables that have to be fixed
binaryboundsshould general integers get binary bounds [floor(.),ceil(.)] ?
uselprowsshould subproblem be created out of the rows in the LP rows?
intfixingratepercentage of integers that get actually fixed
zerofixingratepercentage of variables fixed to zero
successpointer to store whether the problem was created successfully

Definition at line 113 of file heur_gcgrens.c.

Referenced by GCGapplyGcgrens().

◆ createNewSol()

static SCIP_RETCODE createNewSol ( SCIP *  scip,
SCIP *  subscip,
SCIP_VAR **  subvars,
SCIP_HEUR *  heur,
SCIP_SOL *  subsol,
SCIP_Bool *  success 
)
static

creates a new solution for the original problem by copying the solution of the subproblem

Parameters
sciporiginal SCIP data structure
subscipSCIP structure of the subproblem
subvarsthe variables of the subproblem
heurRENS heuristic structure
subsolsolution of the subproblem
successused to store whether new solution was found or not

Definition at line 265 of file heur_gcgrens.c.

Referenced by GCGapplyGcgrens().

◆ GCGapplyGcgrens()

SCIP_RETCODE GCGapplyGcgrens ( 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 
)

main procedure of the GCG RENS heuristic, creates and solves a sub-SCIP

Parameters
sciporiginal SCIP data structure
heurheuristic data structure
resultresult data structure
minfixingrateminimum percentage of integer variables that have to be fixed
minimprovefactor by which RENS should at least improve the incumbent
maxnodesmaximum number of nodes for the subproblem
nstallnodesnumber of stalling nodes for the subproblem
binaryboundsshould general integers get binary bounds [floor(.),ceil(.)]?
uselprowsshould subproblem be created out of the rows in the LP rows?

Definition at line 332 of file heur_gcgrens.c.

References createNewSol(), and createSubproblem().

Referenced by SCIP_DECL_HEUREXEC().

◆ SCIP_DECL_HEURFREE()

static SCIP_DECL_HEURFREE ( heurFreeGcgrens  )
static

destructor of primal heuristic to free user data (called when SCIP is exiting)

Definition at line 633 of file heur_gcgrens.c.

◆ SCIP_DECL_HEURINIT()

static SCIP_DECL_HEURINIT ( heurInitGcgrens  )
static

initialization method of primal heuristic (called after problem was transformed)

Definition at line 654 of file heur_gcgrens.c.

◆ SCIP_DECL_HEUREXEC()

static SCIP_DECL_HEUREXEC ( heurExecGcgrens  )
static

execution method of primal heuristic

Definition at line 737 of file heur_gcgrens.c.

References GCGapplyGcgrens(), and GCGgetMasterprob().

◆ SCIPincludeHeurGcgrens()

SCIP_RETCODE SCIPincludeHeurGcgrens ( SCIP *  scip)