Scippy

SCIP

Solving Constraint Integer Programs

heur_clique.c File Reference

Detailed Description

LNS heuristic using a clique partition to restrict the search neighborhood.

clique primal heuristic

Author
Stefan Heinz
Michael Winkler
Gerald Gamrath

More details about the heuristic can be found in
Structure-Based Primal Heuristics for Mixed Integer Programming
Gerald Gamrath, Timo Berthold, Stefan Heinz, and Michael Winkler
Optimization in the Real World, Volume 13 of the series Mathematics for Industry, pp 37-53
Preliminary version available as ZIB-Report 15-26.

Definition in file heur_clique.c.

#include <assert.h>
#include <string.h>
#include "scip/scip.h"
#include "scip/pub_implics.h"
#include "scip/heur_clique.h"
#include "scip/heur_locks.h"
#include "scip/cons_logicor.h"
#include "scip/pub_misc.h"

Go to the source code of this file.

Macros

#define HEUR_NAME   "clique"
 
#define HEUR_DESC   "LNS heuristic using a clique partition to restrict the search neighborhood"
 
#define HEUR_DISPCHAR   'Q'
 
#define HEUR_PRIORITY   5000
 
#define HEUR_FREQ   0
 
#define HEUR_FREQOFS   0
 
#define HEUR_MAXDEPTH   -1
 
#define HEUR_TIMING   SCIP_HEURTIMING_BEFORENODE
 
#define HEUR_USESSUBSCIP   TRUE
 
#define DEFAULT_MAXNODES   5000LL
 
#define DEFAULT_MININTFIXINGRATE   0.65
 
#define DEFAULT_MINMIPFIXINGRATE   0.65
 
#define DEFAULT_MINIMPROVE   0.01
 
#define DEFAULT_MINNODES   500LL
 
#define DEFAULT_NODESOFS   500LL
 
#define DEFAULT_NODESQUOT   0.1
 
#define DEFAULT_MAXPROPROUNDS   2
 
#define DEFAULT_MAXBACKTRACKS   10
 
#define DEFAULT_COPYCUTS   TRUE
 
#define DEFAULT_USELOCKFIXINGS   FALSE
 

Functions

static SCIP_DECL_SORTINDCOMP (compCliquesSize)
 
static int getCliqueUnfixedVars (SCIP_CLIQUE *clique)
 
static SCIP_RETCODE applyCliqueFixings (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **onefixvars, SCIP_Shortbool *onefixvals, int *nonefixvars, SCIP_Bool *cutoff)
 
static SCIP_RETCODE createNewSol (SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_SOL *newsol, SCIP_SOL *subsol, SCIP_Bool *success)
 
static SCIP_DECL_HEURCOPY (heurCopyClique)
 
static SCIP_DECL_HEURFREE (heurFreeClique)
 
static SCIP_DECL_HEURINIT (heurInitClique)
 
static SCIP_DECL_HEUREXEC (heurExecClique)
 
SCIP_RETCODE SCIPincludeHeurClique (SCIP *scip)
 

Macro Definition Documentation

◆ HEUR_NAME

#define HEUR_NAME   "clique"

Definition at line 46 of file heur_clique.c.

Referenced by createNewSol().

◆ HEUR_DESC

#define HEUR_DESC   "LNS heuristic using a clique partition to restrict the search neighborhood"

Definition at line 47 of file heur_clique.c.

◆ HEUR_DISPCHAR

#define HEUR_DISPCHAR   'Q'

Definition at line 48 of file heur_clique.c.

◆ HEUR_PRIORITY

#define HEUR_PRIORITY   5000

Definition at line 49 of file heur_clique.c.

◆ HEUR_FREQ

#define HEUR_FREQ   0

Definition at line 50 of file heur_clique.c.

◆ HEUR_FREQOFS

#define HEUR_FREQOFS   0

Definition at line 51 of file heur_clique.c.

◆ HEUR_MAXDEPTH

#define HEUR_MAXDEPTH   -1

Definition at line 52 of file heur_clique.c.

◆ HEUR_TIMING

#define HEUR_TIMING   SCIP_HEURTIMING_BEFORENODE

Definition at line 53 of file heur_clique.c.

◆ HEUR_USESSUBSCIP

#define HEUR_USESSUBSCIP   TRUE

does the heuristic use a secondary SCIP instance?

Definition at line 54 of file heur_clique.c.

◆ DEFAULT_MAXNODES

#define DEFAULT_MAXNODES   5000LL

maximum number of nodes to regard in the subproblem

Definition at line 56 of file heur_clique.c.

◆ DEFAULT_MININTFIXINGRATE

#define DEFAULT_MININTFIXINGRATE   0.65

minimum percentage of integer variables that have to be fixed

Definition at line 57 of file heur_clique.c.

◆ DEFAULT_MINMIPFIXINGRATE

#define DEFAULT_MINMIPFIXINGRATE   0.65

minimum percentage of variables that have to be fixed within sub-SCIP (integer and continuous)

Definition at line 58 of file heur_clique.c.

◆ DEFAULT_MINIMPROVE

#define DEFAULT_MINIMPROVE   0.01

factor by which clique heuristic should at least improve the incumbent

Definition at line 61 of file heur_clique.c.

◆ DEFAULT_MINNODES

#define DEFAULT_MINNODES   500LL

minimum number of nodes to regard in the subproblem

Definition at line 66 of file heur_clique.c.

◆ DEFAULT_NODESOFS

#define DEFAULT_NODESOFS   500LL

number of nodes added to the contingent of the total nodes

Definition at line 67 of file heur_clique.c.

◆ DEFAULT_NODESQUOT

#define DEFAULT_NODESQUOT   0.1

subproblem nodes in relation to nodes of the original problem

Definition at line 68 of file heur_clique.c.

◆ DEFAULT_MAXPROPROUNDS

#define DEFAULT_MAXPROPROUNDS   2

maximum number of propagation rounds during probing

Definition at line 69 of file heur_clique.c.

◆ DEFAULT_MAXBACKTRACKS

#define DEFAULT_MAXBACKTRACKS   10

maximum number of backtracks during the fixing process

Definition at line 70 of file heur_clique.c.

◆ DEFAULT_COPYCUTS

#define DEFAULT_COPYCUTS   TRUE

should all active cuts from the cutpool of the original scip be copied to constraints of the subscip

Definition at line 71 of file heur_clique.c.

◆ DEFAULT_USELOCKFIXINGS

#define DEFAULT_USELOCKFIXINGS   FALSE

should more variables be fixed based on variable locks if the fixing rate was not reached?

Definition at line 76 of file heur_clique.c.

Function Documentation

◆ SCIP_DECL_SORTINDCOMP()

static SCIP_DECL_SORTINDCOMP ( compCliquesSize  )
static

comparison method for sorting cliques by their size

Definition at line 115 of file heur_clique.c.

◆ getCliqueUnfixedVars()

static int getCliqueUnfixedVars ( SCIP_CLIQUE clique)
static

Definition at line 123 of file heur_clique.c.

Referenced by applyCliqueFixings().

◆ applyCliqueFixings()

static SCIP_RETCODE applyCliqueFixings ( SCIP scip,
SCIP_HEURDATA heurdata,
SCIP_VAR **  onefixvars,
SCIP_Shortbool onefixvals,
int *  nonefixvars,
SCIP_Bool cutoff 
)
static

apply clique fixing using probing

Parameters
sciporiginal SCIP data structure
heurdatastructure containing heurdata
onefixvarsarray to store all variables which are fixed to one in the cliques
onefixvalsarray to store the values of all variables fixed to one in the cliques
nonefixvarspointer to store the number of variables fixed to one
cutoffpointer to store whether the propagation stopped with infeasibility

Definition at line 150 of file heur_clique.c.

References createNewSol(), FALSE, getCliqueUnfixedVars(), SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_MAXTREEDEPTH, SCIP_OKAY, SCIP_Real, SCIPaddConsNode(), SCIPallocBufferArray, SCIPallocClearBufferArray, SCIPbacktrackProbing(), SCIPcliqueGetNVars(), SCIPcliqueGetValues(), SCIPcliqueGetVars(), SCIPcreateConsLogicor(), SCIPdebugMessage, SCIPdebugMsg, SCIPdebugPrintCons, SCIPfixVarProbing(), SCIPfreeBufferArray, SCIPgetCliques(), SCIPgetDepth(), SCIPgetFocusNode(), SCIPgetNBinVars(), SCIPgetNCliques(), SCIPgetNegatedVar(), SCIPgetNNodes(), SCIPgetProbingDepth(), SCIPinfinity(), SCIPisStopped(), SCIPnewProbingNode(), SCIPpropagateProbing(), SCIPreleaseCons(), SCIPsnprintf(), SCIPsort(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetObj(), SCIPvarGetUbLocal(), and TRUE.

◆ createNewSol()

static SCIP_RETCODE createNewSol ( SCIP scip,
SCIP subscip,
SCIP_VAR **  subvars,
SCIP_SOL newsol,
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
newsolworking solution
subsolsolution of the subproblem
successused to store whether new solution was found or not

Definition at line 491 of file heur_clique.c.

References FALSE, HEUR_NAME, SCIP_CALL, SCIP_DECL_HEURCOPY(), SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPgetNOrigVars(), SCIPgetSolVals(), SCIPgetVarsData(), SCIPheurGetName(), SCIPsetSolVals(), SCIPtrySol(), and TRUE.

Referenced by applyCliqueFixings().

◆ SCIP_DECL_HEURCOPY()

static SCIP_DECL_HEURCOPY ( heurCopyClique  )
static

copy method for primal heuristic plugins (called when SCIP copies plugins)

Definition at line 539 of file heur_clique.c.

Referenced by createNewSol().

◆ SCIP_DECL_HEURFREE()

static SCIP_DECL_HEURFREE ( heurFreeClique  )
static

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

Definition at line 553 of file heur_clique.c.

◆ SCIP_DECL_HEURINIT()

static SCIP_DECL_HEURINIT ( heurInitClique  )
static

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

Definition at line 574 of file heur_clique.c.

◆ SCIP_DECL_HEUREXEC()

static SCIP_DECL_HEUREXEC ( heurExecClique  )
static

execution method of primal heuristic

Definition at line 593 of file heur_clique.c.