Scippy

SCIP

Solving Constraint Integer Programs

heur_conflictdiving.c File Reference

Detailed Description

LP diving heuristic that chooses fixings w.r.t. conflict locks.

Author
Jakob Witzig

Definition in file heur_conflictdiving.c.

#include "scip/heur_conflictdiving.h"
#include "scip/heuristics.h"
#include "scip/pub_heur.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/pub_var.h"
#include "scip/scip_heur.h"
#include "scip/scip_mem.h"
#include "scip/scip_numerics.h"
#include "scip/scip_param.h"
#include "scip/scip_sol.h"
#include "scip/scip_solvingstats.h"
#include <string.h>

Go to the source code of this file.

Macros

#define HEUR_NAME   "conflictdiving"
 
#define HEUR_DESC   "LP diving heuristic that chooses fixings w.r.t. conflict locks"
 
#define HEUR_DISPCHAR   '~'
 
#define HEUR_PRIORITY   -1000100
 
#define HEUR_FREQ   -1
 
#define HEUR_FREQOFS   0
 
#define HEUR_MAXDEPTH   -1
 
#define HEUR_TIMING   SCIP_HEURTIMING_AFTERLPPLUNGE
 
#define HEUR_USESSUBSCIP   FALSE
 
#define DIVESET_DIVETYPES   SCIP_DIVETYPE_INTEGRALITY | SCIP_DIVETYPE_SOS1VARIABLE
 
#define DEFAULT_RANDSEED   151
 
#define DEFAULT_MINRELDEPTH   0.0
 
#define DEFAULT_MAXRELDEPTH   1.0
 
#define DEFAULT_MAXLPITERQUOT   0.15
 
#define DEFAULT_MAXLPITEROFS   1000
 
#define DEFAULT_MAXDIVEUBQUOT   0.8
 
#define DEFAULT_MAXDIVEAVGQUOT   0.0
 
#define DEFAULT_MAXDIVEUBQUOTNOSOL   0.1
 
#define DEFAULT_MAXDIVEAVGQUOTNOSOL   0.0
 
#define DEFAULT_BACKTRACK   TRUE
 
#define DEFAULT_LPRESOLVEDOMCHGQUOT   0.15
 
#define DEFAULT_LPSOLVEFREQ   0
 
#define DEFAULT_ONLYLPBRANCHCANDS   FALSE
 
#define DEFAULT_LOCKWEIGHT   1.0
 
#define DEFAULT_LIKECOEF   FALSE
 
#define DEFAULT_MAXVIOL   TRUE
 
#define DEFAULT_MINCONFLICTLOCKS   5
 
#define MIN_RAND   1e-06
 
#define MAX_RAND   1e-05
 

Functions

static SCIP_DECL_HEURCOPY (heurCopyConflictdiving)
 
static SCIP_DECL_HEURFREE (heurFreeConflictdiving)
 
static SCIP_DECL_HEURINIT (heurInitConflictdiving)
 
static SCIP_DECL_HEUREXIT (heurExitConflictdiving)
 
static SCIP_DECL_HEUREXEC (heurExecConflictdiving)
 
static SCIP_RETCODE getScoreLikeCoefdiving (SCIP *scip, SCIP_HEUR *heur, SCIP_HEURDATA *heurdata, SCIP_RANDNUMGEN *rng, SCIP_DIVESET *diveset, SCIP_DIVETYPE divetype, SCIP_VAR *cand, SCIP_Real candsol, SCIP_Real candsfrac, SCIP_Real *score, SCIP_Bool *roundup)
 
static SCIP_RETCODE getScore (SCIP *scip, SCIP_HEUR *heur, SCIP_HEURDATA *heurdata, SCIP_RANDNUMGEN *rng, SCIP_DIVESET *diveset, SCIP_DIVETYPE divetype, SCIP_VAR *cand, SCIP_Real candsol, SCIP_Real candsfrac, SCIP_Real *score, SCIP_Bool *roundup)
 
static SCIP_DECL_DIVESETGETSCORE (divesetGetScoreConflictdiving)
 
SCIP_RETCODE SCIPincludeHeurConflictdiving (SCIP *scip)
 

Macro Definition Documentation

◆ HEUR_NAME

#define HEUR_NAME   "conflictdiving"

Definition at line 37 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ HEUR_DESC

#define HEUR_DESC   "LP diving heuristic that chooses fixings w.r.t. conflict locks"

Definition at line 38 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ HEUR_DISPCHAR

#define HEUR_DISPCHAR   '~'

Definition at line 39 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ HEUR_PRIORITY

#define HEUR_PRIORITY   -1000100

Definition at line 40 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ HEUR_FREQ

#define HEUR_FREQ   -1

Definition at line 41 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ HEUR_FREQOFS

#define HEUR_FREQOFS   0

Definition at line 42 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ HEUR_MAXDEPTH

#define HEUR_MAXDEPTH   -1

Definition at line 43 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ HEUR_TIMING

#define HEUR_TIMING   SCIP_HEURTIMING_AFTERLPPLUNGE

Definition at line 44 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ HEUR_USESSUBSCIP

#define HEUR_USESSUBSCIP   FALSE

does the heuristic use a secondary SCIP instance?

Definition at line 45 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DIVESET_DIVETYPES

#define DIVESET_DIVETYPES   SCIP_DIVETYPE_INTEGRALITY | SCIP_DIVETYPE_SOS1VARIABLE

bit mask that represents all supported dive types

Definition at line 46 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_RANDSEED

#define DEFAULT_RANDSEED   151

default random seed

Definition at line 47 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_MINRELDEPTH

#define DEFAULT_MINRELDEPTH   0.0

minimal relative depth to start diving

Definition at line 53 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_MAXRELDEPTH

#define DEFAULT_MAXRELDEPTH   1.0

maximal relative depth to start diving

Definition at line 54 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_MAXLPITERQUOT

#define DEFAULT_MAXLPITERQUOT   0.15

maximal fraction of diving LP iterations compared to node LP iterations

Definition at line 55 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_MAXLPITEROFS

#define DEFAULT_MAXLPITEROFS   1000

additional number of allowed LP iterations

Definition at line 56 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_MAXDIVEUBQUOT

#define DEFAULT_MAXDIVEUBQUOT   0.8

maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound) where diving is performed (0.0: no limit)

Definition at line 57 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_MAXDIVEAVGQUOT

#define DEFAULT_MAXDIVEAVGQUOT   0.0

maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound) where diving is performed (0.0: no limit)

Definition at line 60 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_MAXDIVEUBQUOTNOSOL

#define DEFAULT_MAXDIVEUBQUOTNOSOL   0.1

maximal UBQUOT when no solution was found yet (0.0: no limit)

Definition at line 63 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_MAXDIVEAVGQUOTNOSOL

#define DEFAULT_MAXDIVEAVGQUOTNOSOL   0.0

maximal AVGQUOT when no solution was found yet (0.0: no limit)

Definition at line 64 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_BACKTRACK

#define DEFAULT_BACKTRACK   TRUE

use one level of backtracking if infeasibility is encountered?

Definition at line 65 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_LPRESOLVEDOMCHGQUOT

#define DEFAULT_LPRESOLVEDOMCHGQUOT   0.15

percentage of immediate domain changes during probing to trigger LP resolve

Definition at line 66 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_LPSOLVEFREQ

#define DEFAULT_LPSOLVEFREQ   0

LP solve frequency for diving heuristics

Definition at line 67 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_ONLYLPBRANCHCANDS

#define DEFAULT_ONLYLPBRANCHCANDS   FALSE

should only LP branching candidates be considered instead of the slower but more general constraint handler diving variable selection?

Definition at line 68 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_LOCKWEIGHT

#define DEFAULT_LOCKWEIGHT   1.0

weight used in a convex combination of conflict and variable locks

Definition at line 71 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_LIKECOEF

#define DEFAULT_LIKECOEF   FALSE

perform rounding like coefficient diving

Definition at line 72 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_MAXVIOL

#define DEFAULT_MAXVIOL   TRUE

prefer rounding direction with most violation

Definition at line 73 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ DEFAULT_MINCONFLICTLOCKS

#define DEFAULT_MINCONFLICTLOCKS   5

threshold for penalizing the score

Definition at line 74 of file heur_conflictdiving.c.

Referenced by SCIPincludeHeurConflictdiving().

◆ MIN_RAND

#define MIN_RAND   1e-06

Definition at line 190 of file heur_conflictdiving.c.

Referenced by getScore(), and getScoreLikeCoefdiving().

◆ MAX_RAND

#define MAX_RAND   1e-05

Definition at line 191 of file heur_conflictdiving.c.

Referenced by getScore(), and getScoreLikeCoefdiving().

Function Documentation

◆ SCIP_DECL_HEURCOPY()

static SCIP_DECL_HEURCOPY ( heurCopyConflictdiving  )
static

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

Definition at line 92 of file heur_conflictdiving.c.

◆ SCIP_DECL_HEURFREE()

static SCIP_DECL_HEURFREE ( heurFreeConflictdiving  )
static

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

Definition at line 106 of file heur_conflictdiving.c.

◆ SCIP_DECL_HEURINIT()

static SCIP_DECL_HEURINIT ( heurInitConflictdiving  )
static

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

Definition at line 127 of file heur_conflictdiving.c.

◆ SCIP_DECL_HEUREXIT()

static SCIP_DECL_HEUREXIT ( heurExitConflictdiving  )
static

deinitialization method of primal heuristic (called before transformed problem is freed)

Definition at line 147 of file heur_conflictdiving.c.

◆ SCIP_DECL_HEUREXEC()

static SCIP_DECL_HEUREXEC ( heurExecConflictdiving  )
static

execution method of primal heuristic

Definition at line 166 of file heur_conflictdiving.c.

◆ getScoreLikeCoefdiving()

static SCIP_RETCODE getScoreLikeCoefdiving ( SCIP scip,
SCIP_HEUR heur,
SCIP_HEURDATA heurdata,
SCIP_RANDNUMGEN rng,
SCIP_DIVESET diveset,
SCIP_DIVETYPE  divetype,
SCIP_VAR cand,
SCIP_Real  candsol,
SCIP_Real  candsfrac,
SCIP_Real score,
SCIP_Bool roundup 
)
static

calculate score variant 1: use rounding strategy like coefficent diving

Parameters
scipSCIP data structure
heurheuristic data structure
heurdataheuristic data
rngrandom number generator of the diveset
divesetdiveset of the heuristic
divetypedivetype of the heuristic
canddiving candidate
candsoldiving candidate solution
candsfracfractionality of the candidate solution
scorepointer to store the score
rounduppointer to store whether the candidate should be rounded upwards

Definition at line 195 of file heur_conflictdiving.c.

References getScore(), MAX_RAND, MIN_RAND, SCIP_Bool, SCIP_DIVETYPE_INTEGRALITY, SCIP_DIVETYPE_SOS1VARIABLE, SCIP_INVALIDDATA, SCIP_LOCKTYPE_CONFLICT, SCIP_LOCKTYPE_MODEL, SCIP_OKAY, SCIP_PROBINGSCORE_PENALTYRATIO, SCIP_Real, SCIPABORT, SCIPerrorMessage, SCIPisEQ(), SCIPisFeasNegative(), SCIPisFeasPositive(), SCIPisGT(), SCIPisZero(), SCIPrandomGetInt(), SCIPrandomGetReal(), SCIPvarGetNLocksDownType(), SCIPvarGetNLocksUpType(), and SCIPvarIsBinary().

◆ getScore()

static SCIP_RETCODE getScore ( SCIP scip,
SCIP_HEUR heur,
SCIP_HEURDATA heurdata,
SCIP_RANDNUMGEN rng,
SCIP_DIVESET diveset,
SCIP_DIVETYPE  divetype,
SCIP_VAR cand,
SCIP_Real  candsol,
SCIP_Real  candsfrac,
SCIP_Real score,
SCIP_Bool roundup 
)
static

calculate score variant 2: use a rounding strategy that tends towards infeasibility

Parameters
scipSCIP data structure
heurheuristic data structure
heurdataheuristic data
rngrandom number generator of the diveset
divesetdiveset of the heuristic
divetypedivetype of the heuristic
canddiving candidate
candsoldiving candidate solution
candsfracfractionality of the candidate solution
scorepointer to store the score
rounduppointer to store whether the candidate should be rounded upwards

Definition at line 308 of file heur_conflictdiving.c.

References MAX_RAND, MIN_RAND, NULL, SCIP_Bool, SCIP_DECL_DIVESETGETSCORE(), SCIP_DIVETYPE_INTEGRALITY, SCIP_DIVETYPE_SOS1VARIABLE, SCIP_INVALIDDATA, SCIP_LOCKTYPE_CONFLICT, SCIP_LOCKTYPE_MODEL, SCIP_OKAY, SCIP_PROBINGSCORE_PENALTYRATIO, SCIP_Real, SCIPABORT, SCIPerrorMessage, SCIPisEQ(), SCIPisFeasNegative(), SCIPisFeasPositive(), SCIPisGT(), SCIPisLT(), SCIPisZero(), SCIPrandomGetInt(), SCIPrandomGetReal(), SCIPvarGetNLocksDownType(), SCIPvarGetNLocksUpType(), and SCIPvarIsBinary().

Referenced by getScoreLikeCoefdiving().

◆ SCIP_DECL_DIVESETGETSCORE()

static SCIP_DECL_DIVESETGETSCORE ( divesetGetScoreConflictdiving  )
static

returns a score for the given candidate – the best candidate maximizes the diving score

Definition at line 452 of file heur_conflictdiving.c.

Referenced by getScore().

◆ SCIPincludeHeurConflictdiving()