Scippy

GCG

Branch-and-Price & Column Generation for Everyone

heur_gcgdins.c File Reference

Detailed Description

DINS primal heuristic (according to Ghosh)

Author
Robert Waniek
Christian Puchert

Definition in file heur_gcgdins.c.

#include <assert.h>
#include <string.h>
#include "heur_gcgdins.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   "gcgdins"
 
#define HEUR_DESC   "distance induced neighborhood search by Ghosh"
 
#define HEUR_DISPCHAR   'D'
 
#define HEUR_PRIORITY   -1105000
 
#define HEUR_FREQ   -1
 
#define HEUR_FREQOFS   0
 
#define HEUR_MAXDEPTH   -1
 
#define HEUR_TIMING   SCIP_HEURTIMING_AFTERNODE
 
#define HEUR_USESSUBSCIP   TRUE
 
#define DEFAULT_NODESOFS   5000LL
 
#define DEFAULT_MAXNODES   5000LL
 
#define DEFAULT_MINNODES   500LL
 
#define DEFAULT_MINIMPROVE   0.01
 
#define DEFAULT_NODESQUOT   0.05
 
#define DEFAULT_NWAITINGNODES   0LL
 
#define DEFAULT_NEIGHBORHOODSIZE   18
 
#define DEFAULT_SOLNUM   5
 
#define DEFAULT_USELPROWS   FALSE
 
#define DEFAULT_COPYCUTS   TRUE
 

Functions

static SCIP_RETCODE createSubproblem (SCIP *scip, SCIP *subscip, SCIP_VAR **vars, SCIP_VAR **subvars, int nbinvars, int nintvars, SCIP_Bool uselprows, int *fixingcounter, int *zerocounter)
 
static SCIP_RETCODE addLocalBranchingConstraint (SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEURDATA *heurdata, SCIP_Bool *fixed)
 
static SCIP_RETCODE getRootRelaxSol (SCIP *scip, SCIP_SOL **rootsol)
 
static SCIP_RETCODE createNewSol (SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_HEUR *heur, SCIP_SOL *subsol, SCIP_Bool *success)
 
static SCIP_DECL_HEURFREE (heurFreeGcgdins)
 
static SCIP_DECL_HEURINITSOL (heurInitsolGcgdins)
 
static SCIP_DECL_HEUREXITSOL (heurExitsolGcgdins)
 
static SCIP_DECL_HEUREXEC (heurExecGcgdins)
 
SCIP_RETCODE SCIPincludeHeurGcgdins (SCIP *scip)
 

Macro Definition Documentation

◆ HEUR_NAME

#define HEUR_NAME   "gcgdins"

Definition at line 45 of file heur_gcgdins.c.

◆ HEUR_DESC

#define HEUR_DESC   "distance induced neighborhood search by Ghosh"

Definition at line 46 of file heur_gcgdins.c.

◆ HEUR_DISPCHAR

#define HEUR_DISPCHAR   'D'

Definition at line 47 of file heur_gcgdins.c.

◆ HEUR_PRIORITY

#define HEUR_PRIORITY   -1105000

Definition at line 48 of file heur_gcgdins.c.

◆ HEUR_FREQ

#define HEUR_FREQ   -1

Definition at line 49 of file heur_gcgdins.c.

◆ HEUR_FREQOFS

#define HEUR_FREQOFS   0

Definition at line 50 of file heur_gcgdins.c.

◆ HEUR_MAXDEPTH

#define HEUR_MAXDEPTH   -1

Definition at line 51 of file heur_gcgdins.c.

◆ HEUR_TIMING

#define HEUR_TIMING   SCIP_HEURTIMING_AFTERNODE

Definition at line 52 of file heur_gcgdins.c.

◆ HEUR_USESSUBSCIP

#define HEUR_USESSUBSCIP   TRUE

does the heuristic use a secondary SCIP instance?

Definition at line 53 of file heur_gcgdins.c.

◆ DEFAULT_NODESOFS

#define DEFAULT_NODESOFS   5000LL

number of nodes added to the contingent of the total nodes

Definition at line 55 of file heur_gcgdins.c.

◆ DEFAULT_MAXNODES

#define DEFAULT_MAXNODES   5000LL

maximum number of nodes to regard in the subproblem

Definition at line 56 of file heur_gcgdins.c.

◆ DEFAULT_MINNODES

#define DEFAULT_MINNODES   500LL

minimum number of nodes to regard in the subproblem

Definition at line 57 of file heur_gcgdins.c.

◆ DEFAULT_MINIMPROVE

#define DEFAULT_MINIMPROVE   0.01

factor by which DINS should at least improve the incumbent

Definition at line 58 of file heur_gcgdins.c.

◆ DEFAULT_NODESQUOT

#define DEFAULT_NODESQUOT   0.05

subproblem nodes in relation to nodes of the original problem

Definition at line 59 of file heur_gcgdins.c.

◆ DEFAULT_NWAITINGNODES

#define DEFAULT_NWAITINGNODES   0LL

number of nodes without incumbent change that heuristic should wait

Definition at line 60 of file heur_gcgdins.c.

◆ DEFAULT_NEIGHBORHOODSIZE

#define DEFAULT_NEIGHBORHOODSIZE   18

radius of the incumbents neighborhood to be searched

Definition at line 61 of file heur_gcgdins.c.

◆ DEFAULT_SOLNUM

#define DEFAULT_SOLNUM   5

number of pool-solutions to be checked for flag array update

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

Function Documentation

◆ createSubproblem()

static SCIP_RETCODE createSubproblem ( SCIP *  scip,
SCIP *  subscip,
SCIP_VAR **  vars,
SCIP_VAR **  subvars,
int  nbinvars,
int  nintvars,
SCIP_Bool  uselprows,
int *  fixingcounter,
int *  zerocounter 
)
static

creates a subproblem for subscip by fixing a number of variables

Parameters
scipSCIP data structure of the original problem
subscipSCIP data structure of the subproblem
varsvariables of the original problem
subvarsvariables of the subproblem
nbinvarsnumber of binary variables of problem and subproblem
nintvarsnumber of general integer variables of problem and subproblem
uselprowsshould subproblem be created out of the rows in the LP rows?
fixingcounternumber of integers that get actually fixed
zerocounternumber of variables fixed to zero

Definition at line 113 of file heur_gcgdins.c.

Referenced by SCIP_DECL_HEUREXEC().

◆ addLocalBranchingConstraint()

static SCIP_RETCODE addLocalBranchingConstraint ( SCIP *  scip,
SCIP *  subscip,
SCIP_VAR **  subvars,
SCIP_HEURDATA *  heurdata,
SCIP_Bool *  fixed 
)
static

create the extra constraint of local branching and add it to subscip

Parameters
scipSCIP data structure of the original problem
subscipSCIP data structure of the subproblem
subvarsvariables of the subproblem
heurdataheuristic's data structure
fixedTRUE --> include variable in LB constraint

Definition at line 279 of file heur_gcgdins.c.

Referenced by SCIP_DECL_HEUREXEC().

◆ getRootRelaxSol()

static SCIP_RETCODE getRootRelaxSol ( SCIP *  scip,
SCIP_SOL **  rootsol 
)
static

get relaxation solution of root node (in original variables)

Parameters
scipSCIP data structure
rootsolpointer to store root relaxation solution

Definition at line 357 of file heur_gcgdins.c.

References GCGgetMasterprob(), and GCGtransformMastersolToOrigsol().

Referenced by SCIP_DECL_HEUREXEC().

◆ 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
heurDINS heuristic structure
subsolsolution of the subproblem
successused to store whether new solution was found or not

Definition at line 395 of file heur_gcgdins.c.

Referenced by SCIP_DECL_HEUREXEC().

◆ SCIP_DECL_HEURFREE()

static SCIP_DECL_HEURFREE ( heurFreeGcgdins  )
static

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

Definition at line 464 of file heur_gcgdins.c.

◆ SCIP_DECL_HEURINITSOL()

static SCIP_DECL_HEURINITSOL ( heurInitsolGcgdins  )
static

solving process initialization method of primal heuristic (called when branch and bound process is about to begin)

Definition at line 485 of file heur_gcgdins.c.

◆ SCIP_DECL_HEUREXITSOL()

static SCIP_DECL_HEUREXITSOL ( heurExitsolGcgdins  )
static

solving process deinitialization method of primal heuristic (called before branch and bound process data is freed)

Definition at line 529 of file heur_gcgdins.c.

◆ SCIP_DECL_HEUREXEC()

static SCIP_DECL_HEUREXEC ( heurExecGcgdins  )
static

execution method of primal heuristic

Definition at line 581 of file heur_gcgdins.c.

References addLocalBranchingConstraint(), createNewSol(), createSubproblem(), GCGgetMasterprob(), and getRootRelaxSol().

◆ SCIPincludeHeurGcgdins()

SCIP_RETCODE SCIPincludeHeurGcgdins ( SCIP *  scip)