Scippy

SCIP

Solving Constraint Integer Programs

pub_heur.h File Reference

Detailed Description

public methods for primal heuristics

Author
Tobias Achterberg

Definition in file pub_heur.h.

#include "scip/def.h"
#include "scip/type_misc.h"
#include "scip/type_heur.h"

Go to the source code of this file.

Functions

 SCIP_DECL_SORTPTRCOMP (SCIPheurComp)
 
 SCIP_DECL_SORTPTRCOMP (SCIPheurCompName)
 
SCIP_HEURDATASCIPheurGetData (SCIP_HEUR *heur)
 
void SCIPheurSetData (SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
 
const char * SCIPheurGetName (SCIP_HEUR *heur)
 
const char * SCIPheurGetDesc (SCIP_HEUR *heur)
 
char SCIPheurGetDispchar (SCIP_HEUR *heur)
 
SCIP_HEURTIMING SCIPheurGetTimingmask (SCIP_HEUR *heur)
 
void SCIPheurSetTimingmask (SCIP_HEUR *heur, SCIP_HEURTIMING timingmask)
 
SCIP_Bool SCIPheurUsesSubscip (SCIP_HEUR *heur)
 
int SCIPheurGetPriority (SCIP_HEUR *heur)
 
int SCIPheurGetFreq (SCIP_HEUR *heur)
 
void SCIPheurSetFreq (SCIP_HEUR *heur, int freq)
 
int SCIPheurGetFreqofs (SCIP_HEUR *heur)
 
int SCIPheurGetMaxdepth (SCIP_HEUR *heur)
 
SCIP_Longint SCIPheurGetNCalls (SCIP_HEUR *heur)
 
SCIP_Longint SCIPheurGetNSolsFound (SCIP_HEUR *heur)
 
SCIP_Longint SCIPheurGetNBestSolsFound (SCIP_HEUR *heur)
 
SCIP_Bool SCIPheurIsInitialized (SCIP_HEUR *heur)
 
SCIP_Real SCIPheurGetSetupTime (SCIP_HEUR *heur)
 
SCIP_Real SCIPheurGetTime (SCIP_HEUR *heur)
 
SCIP_DIVESET ** SCIPheurGetDivesets (SCIP_HEUR *heur)
 
int SCIPheurGetNDivesets (SCIP_HEUR *heur)
 
SCIP_HEURSCIPdivesetGetHeur (SCIP_DIVESET *diveset)
 
SCIP_SOLSCIPdivesetGetWorkSolution (SCIP_DIVESET *diveset)
 
void SCIPdivesetSetWorkSolution (SCIP_DIVESET *diveset, SCIP_SOL *sol)
 
const char * SCIPdivesetGetName (SCIP_DIVESET *diveset)
 
SCIP_Real SCIPdivesetGetMinRelDepth (SCIP_DIVESET *diveset)
 
SCIP_Real SCIPdivesetGetMaxRelDepth (SCIP_DIVESET *diveset)
 
SCIP_Longint SCIPdivesetGetSolSuccess (SCIP_DIVESET *diveset)
 
int SCIPdivesetGetNCalls (SCIP_DIVESET *diveset)
 
int SCIPdivesetGetNSolutionCalls (SCIP_DIVESET *diveset)
 
int SCIPdivesetGetMinDepth (SCIP_DIVESET *diveset)
 
int SCIPdivesetGetMaxDepth (SCIP_DIVESET *diveset)
 
SCIP_Real SCIPdivesetGetAvgDepth (SCIP_DIVESET *diveset)
 
int SCIPdivesetGetMinSolutionDepth (SCIP_DIVESET *diveset)
 
int SCIPdivesetGetMaxSolutionDepth (SCIP_DIVESET *diveset)
 
SCIP_Real SCIPdivesetGetAvgSolutionDepth (SCIP_DIVESET *diveset)
 
SCIP_Longint SCIPdivesetGetNLPIterations (SCIP_DIVESET *diveset)
 
SCIP_Longint SCIPdivesetGetNProbingNodes (SCIP_DIVESET *diveset)
 
SCIP_Longint SCIPdivesetGetNBacktracks (SCIP_DIVESET *diveset)
 
SCIP_Real SCIPdivesetGetMaxLPIterQuot (SCIP_DIVESET *diveset)
 
int SCIPdivesetGetMaxLPIterOffset (SCIP_DIVESET *diveset)
 
SCIP_Real SCIPdivesetGetUbQuotNoSol (SCIP_DIVESET *diveset)
 
SCIP_Real SCIPdivesetGetAvgQuotNoSol (SCIP_DIVESET *diveset)
 
SCIP_Real SCIPdivesetGetUbQuot (SCIP_DIVESET *diveset)
 
SCIP_Real SCIPdivesetGetAvgQuot (SCIP_DIVESET *diveset)
 
SCIP_Bool SCIPdivesetUseBacktrack (SCIP_DIVESET *diveset)
 
int SCIPdivesetGetLPSolveFreq (SCIP_DIVESET *diveset)
 
SCIP_Real SCIPdivesetGetLPResolveDomChgQuot (SCIP_DIVESET *diveset)
 
SCIP_Bool SCIPdivesetUseOnlyLPBranchcands (SCIP_DIVESET *diveset)
 
SCIP_Bool SCIPdivesetSupportsType (SCIP_DIVESET *diveset, SCIP_DIVETYPE divetype)
 

Function Documentation

SCIP_DECL_SORTPTRCOMP ( SCIPheurComp  )

compares two heuristics w. r. to their priority

compares two heuristics w. r. to their delay positions and their priority

Definition at line 40 of file heur.c.

References SCIP_Heur::delaypos, SCIP_Heur::freq, SCIP_Heur::ncalls, NULL, and SCIP_Heur::priority.

SCIP_DECL_SORTPTRCOMP ( SCIPheurCompName  )

comparison method for sorting heuristics w.r.t. to their name

Definition at line 64 of file heur.c.

References SCIPheurGetName().

void SCIPheurSetData ( SCIP_HEUR heur,
SCIP_HEURDATA heurdata 
)

sets user data of primal heuristic; user has to free old data in advance!

Parameters
heurprimal heuristic
heurdatanew primal heuristic user data

Definition at line 1068 of file heur.c.

References SCIP_Heur::heurdata, and NULL.

Referenced by presolveTwoOpt(), SCIP_DECL_HEUREXIT(), SCIP_DECL_HEUREXITSOL(), SCIP_DECL_HEURFREE(), SCIP_DECL_HEURINIT(), and SCIP_DECL_HEURINITSOL().

const char* SCIPheurGetDesc ( SCIP_HEUR heur)

gets description of primal heuristic

Parameters
heurprimal heuristic

Definition at line 1157 of file heur.c.

References SCIP_Heur::desc, and NULL.

Referenced by SCIP_DECL_DIALOGEXEC(), SCIPincludeDialogDefaultFix(), and SCIPincludeDialogDefaultSet().

char SCIPheurGetDispchar ( SCIP_HEUR heur)

gets display character of primal heuristic

Parameters
heurprimal heuristic

Definition at line 1167 of file heur.c.

References SCIP_Heur::dispchar, and NULL.

Referenced by SCIP_DECL_DIALOGEXEC(), and SCIP_DECL_DISPOUTPUT().

SCIP_HEURTIMING SCIPheurGetTimingmask ( SCIP_HEUR heur)

returns the timing mask of the heuristic

Parameters
heurprimal heuristic

Definition at line 1177 of file heur.c.

References NULL, and SCIP_Heur::timingmask.

void SCIPheurSetTimingmask ( SCIP_HEUR heur,
SCIP_HEURTIMING  timingmask 
)

sets new timing mask for heuristic

Parameters
heurprimal heuristic
timingmasknew timing mask of heuristic

Definition at line 1187 of file heur.c.

References NULL, and SCIP_Heur::timingmask.

Referenced by SCIP_DECL_HEUREXEC(), SCIP_DECL_HEUREXITSOL(), SCIP_DECL_HEURINIT(), and SCIP_DECL_HEURINITSOL().

SCIP_Bool SCIPheurUsesSubscip ( SCIP_HEUR heur)

does the heuristic use a secondary SCIP instance?

Parameters
heurprimal heuristic

Definition at line 1198 of file heur.c.

References NULL, and SCIP_Heur::usessubscip.

Referenced by SCIPparamsetSetToSubscipsOff().

int SCIPheurGetPriority ( SCIP_HEUR heur)

gets priority of primal heuristic

Parameters
heurprimal heuristic

Definition at line 1208 of file heur.c.

References NULL, and SCIP_Heur::priority.

Referenced by SCIP_DECL_DIALOGEXEC(), and SCIPprimalHeuristics().

int SCIPheurGetFreq ( SCIP_HEUR heur)

gets frequency of primal heuristic

Parameters
heurprimal heuristic

Definition at line 1232 of file heur.c.

References SCIP_Heur::freq, and NULL.

Referenced by checkParameters(), SCIP_DECL_DIALOGEXEC(), SCIP_DECL_HEURINIT(), and SCIP_DECL_HEURINITSOL().

void SCIPheurSetFreq ( SCIP_HEUR heur,
int  freq 
)

sets frequency of primal heuristic

Parameters
heurprimal heuristic
freqnew frequency of heuristic

Definition at line 1242 of file heur.c.

References SCIP_Heur::freq, and NULL.

Referenced by storeSolution().

int SCIPheurGetFreqofs ( SCIP_HEUR heur)

gets frequency offset of primal heuristic

Parameters
heurprimal heuristic

Definition at line 1253 of file heur.c.

References SCIP_Heur::freqofs, and NULL.

Referenced by SCIP_DECL_DIALOGEXEC(), SCIP_DECL_HEURINIT(), and SCIP_DECL_HEURINITSOL().

int SCIPheurGetMaxdepth ( SCIP_HEUR heur)

gets maximal depth level for calling primal heuristic (returns -1, if no depth limit exists)

Parameters
heurprimal heuristic

Definition at line 1263 of file heur.c.

References SCIP_Heur::maxdepth, and NULL.

SCIP_Longint SCIPheurGetNCalls ( SCIP_HEUR heur)

gets the number of times, the heuristic was called and tried to find a solution

Parameters
heurprimal heuristic

Definition at line 1273 of file heur.c.

References SCIP_Heur::ncalls, and NULL.

Referenced by applyVbounds(), printHeuristicStatistics(), SCIP_DECL_HEUREXEC(), and SCIPapplyZeroobj().

SCIP_Longint SCIPheurGetNSolsFound ( SCIP_HEUR heur)

gets the number of primal feasible solutions found by this heuristic

Parameters
heurprimal heuristic

Definition at line 1283 of file heur.c.

References SCIP_Heur::nsolsfound, and NULL.

Referenced by printHeuristicStatistics(), and SCIP_DECL_HEUREXEC().

SCIP_Longint SCIPheurGetNBestSolsFound ( SCIP_HEUR heur)

gets the number of new best primal feasible solutions found by this heuristic

Parameters
heurprimal heuristic

Definition at line 1293 of file heur.c.

References SCIP_Heur::nbestsolsfound, and NULL.

Referenced by applyVbounds(), and SCIP_DECL_HEUREXEC().

SCIP_Bool SCIPheurIsInitialized ( SCIP_HEUR heur)

is primal heuristic initialized?

Parameters
heurprimal heuristic

Definition at line 1303 of file heur.c.

References SCIP_Heur::initialized, and NULL.

SCIP_Real SCIPheurGetSetupTime ( SCIP_HEUR heur)

gets time in seconds used in this heuristic for setting up for next stages

Parameters
heurprimal heuristic

Definition at line 1325 of file heur.c.

References NULL, SCIPclockGetTime(), and SCIP_Heur::setuptime.

Referenced by printHeuristicStatistics().

SCIP_Real SCIPheurGetTime ( SCIP_HEUR heur)

gets time in seconds used in this heuristic

Parameters
heurprimal heuristic

Definition at line 1335 of file heur.c.

References SCIP_Heur::heurclock, NULL, and SCIPclockGetTime().

Referenced by printHeuristicStatistics().

SCIP_DIVESET** SCIPheurGetDivesets ( SCIP_HEUR heur)

returns array of divesets of this primal heuristic, or NULL if it has no divesets

Parameters
heurprimal heuristic

Definition at line 1345 of file heur.c.

References SCIP_Heur::divesets, and NULL.

Referenced by printHeuristicStatistics().

int SCIPheurGetNDivesets ( SCIP_HEUR heur)

returns the number of divesets of this primal heuristic

Parameters
heurprimal heuristic

Definition at line 1355 of file heur.c.

References SCIP_Heur::ndivesets, and NULL.

Referenced by printHeuristicStatistics().

SCIP_HEUR* SCIPdivesetGetHeur ( SCIP_DIVESET diveset)

get the heuristic to which this diving setting belongs

Parameters
divesetdiving settings

Definition at line 302 of file heur.c.

References SCIP_Diveset::heur.

SCIP_SOL* SCIPdivesetGetWorkSolution ( SCIP_DIVESET diveset)

get the working solution of this dive set

Parameters
divesetdiving settings

Definition at line 310 of file heur.c.

References NULL, and SCIP_Diveset::sol.

void SCIPdivesetSetWorkSolution ( SCIP_DIVESET diveset,
SCIP_SOL sol 
)

set the working solution for this dive set

Parameters
divesetdiving settings
solnew working solution for this dive set, or NULL

Definition at line 320 of file heur.c.

References NULL, and SCIP_Diveset::sol.

Referenced by SCIPperformGenericDivingAlgorithm().

const char* SCIPdivesetGetName ( SCIP_DIVESET diveset)

get the name of the dive set

Parameters
divesetdiving settings

Definition at line 331 of file heur.c.

References SCIP_Diveset::name, and NULL.

Referenced by printHeuristicStatistics(), SCIPperformGenericDivingAlgorithm(), and solveLP().

SCIP_Real SCIPdivesetGetMinRelDepth ( SCIP_DIVESET diveset)

get the minimum relative depth of the diving settings

Parameters
divesetdiving settings

Definition at line 341 of file heur.c.

References SCIP_Diveset::minreldepth.

Referenced by SCIPperformGenericDivingAlgorithm().

SCIP_Real SCIPdivesetGetMaxRelDepth ( SCIP_DIVESET diveset)

get the maximum relative depth of the diving settings

Parameters
divesetdiving settings

Definition at line 349 of file heur.c.

References SCIP_Diveset::maxreldepth.

Referenced by SCIPperformGenericDivingAlgorithm().

SCIP_Longint SCIPdivesetGetSolSuccess ( SCIP_DIVESET diveset)

get the number of successful runs of the diving settings

Parameters
divesetdiving settings

Definition at line 357 of file heur.c.

References SCIP_Diveset::nbestsolsfound, and SCIP_Diveset::nsolsfound.

Referenced by SCIPperformGenericDivingAlgorithm().

int SCIPdivesetGetNCalls ( SCIP_DIVESET diveset)

get the number of calls to this dive set

Parameters
divesetdiving settings

Definition at line 365 of file heur.c.

References SCIP_Diveset::ncalls, and NULL.

Referenced by printHeuristicStatistics(), and SCIPperformGenericDivingAlgorithm().

int SCIPdivesetGetNSolutionCalls ( SCIP_DIVESET diveset)

get the number of calls successfully terminated at a feasible leaf node

Parameters
divesetdiving settings

Definition at line 375 of file heur.c.

References SCIP_Diveset::nsolcalls, and NULL.

Referenced by printHeuristicStatistics().

int SCIPdivesetGetMinDepth ( SCIP_DIVESET diveset)

get the minimum depth reached by this dive set

Parameters
divesetdiving settings

Definition at line 385 of file heur.c.

References SCIP_Diveset::mindepth, and NULL.

Referenced by printHeuristicStatistics().

int SCIPdivesetGetMaxDepth ( SCIP_DIVESET diveset)

get the maximum depth reached by this dive set

Parameters
divesetdiving settings

Definition at line 395 of file heur.c.

References SCIP_Diveset::maxdepth, and NULL.

Referenced by printHeuristicStatistics().

SCIP_Real SCIPdivesetGetAvgDepth ( SCIP_DIVESET diveset)

get the average depth this dive set reached during execution

Parameters
divesetdiving settings

Definition at line 405 of file heur.c.

References SCIP_Diveset::ncalls, NULL, SCIP_Real, and SCIP_Diveset::totaldepth.

Referenced by printHeuristicStatistics().

int SCIPdivesetGetMinSolutionDepth ( SCIP_DIVESET diveset)

get the minimum depth at which this dive set found a solution

Parameters
divesetdiving settings

Definition at line 415 of file heur.c.

References SCIP_Diveset::minsoldepth, and NULL.

Referenced by printHeuristicStatistics().

int SCIPdivesetGetMaxSolutionDepth ( SCIP_DIVESET diveset)

get the maximum depth at which this dive set found a solution

Parameters
divesetdiving settings

Definition at line 425 of file heur.c.

References SCIP_Diveset::maxsoldepth, and NULL.

Referenced by printHeuristicStatistics().

SCIP_Real SCIPdivesetGetAvgSolutionDepth ( SCIP_DIVESET diveset)

get the average depth at which this dive set found a solution

Parameters
divesetdiving settings

Definition at line 435 of file heur.c.

References SCIP_Diveset::nsolcalls, NULL, SCIP_Real, and SCIP_Diveset::totalsoldepth.

Referenced by printHeuristicStatistics().

SCIP_Longint SCIPdivesetGetNLPIterations ( SCIP_DIVESET diveset)

get the total number of LP iterations used by this dive set

Parameters
divesetdiving settings

Definition at line 445 of file heur.c.

References SCIP_Diveset::nlpiterations, and NULL.

Referenced by printHeuristicStatistics(), SCIPperformGenericDivingAlgorithm(), and solveLP().

SCIP_Longint SCIPdivesetGetNProbingNodes ( SCIP_DIVESET diveset)

get the total number of probing nodes used by this dive set

Parameters
divesetdiving settings

Definition at line 455 of file heur.c.

References NULL, and SCIP_Diveset::totalnnodes.

Referenced by printHeuristicStatistics().

SCIP_Longint SCIPdivesetGetNBacktracks ( SCIP_DIVESET diveset)

get the total number of backtracks performed by this dive set

Parameters
divesetdiving settings

Definition at line 465 of file heur.c.

References NULL, and SCIP_Diveset::totalnbacktracks.

Referenced by printHeuristicStatistics().

SCIP_Real SCIPdivesetGetMaxLPIterQuot ( SCIP_DIVESET diveset)

get the maximum LP iterations quotient of the diving settings

Parameters
divesetdiving settings

Definition at line 475 of file heur.c.

References SCIP_Diveset::maxlpiterquot.

Referenced by SCIPperformGenericDivingAlgorithm().

int SCIPdivesetGetMaxLPIterOffset ( SCIP_DIVESET diveset)

get the maximum LP iterations offset of the diving settings

Parameters
divesetdiving settings

Definition at line 483 of file heur.c.

References SCIP_Diveset::maxlpiterofs.

Referenced by SCIPperformGenericDivingAlgorithm().

SCIP_Real SCIPdivesetGetUbQuotNoSol ( SCIP_DIVESET diveset)

get the maximum upper bound quotient parameter of the diving settings if no solution is available

Parameters
divesetdiving settings

Definition at line 491 of file heur.c.

References SCIP_Diveset::maxdiveubquotnosol.

Referenced by SCIPperformGenericDivingAlgorithm().

SCIP_Real SCIPdivesetGetAvgQuotNoSol ( SCIP_DIVESET diveset)

get the average quotient parameter of the diving settings if no solution is available

Parameters
divesetdiving settings

Definition at line 499 of file heur.c.

References SCIP_Diveset::maxdiveavgquotnosol.

Referenced by SCIPperformGenericDivingAlgorithm().

SCIP_Real SCIPdivesetGetUbQuot ( SCIP_DIVESET diveset)

get the maximum upper bound quotient parameter of the diving settings if an incumbent solution exists

Parameters
divesetdiving settings

Definition at line 506 of file heur.c.

References SCIP_Diveset::maxdiveubquot.

Referenced by SCIPperformGenericDivingAlgorithm().

SCIP_Real SCIPdivesetGetAvgQuot ( SCIP_DIVESET diveset)

get the average upper bound quotient parameter of the diving settings if an incumbent solution exists

Parameters
divesetdiving settings

Definition at line 514 of file heur.c.

References SCIP_Diveset::maxdiveavgquot.

Referenced by SCIPperformGenericDivingAlgorithm().

SCIP_Bool SCIPdivesetUseBacktrack ( SCIP_DIVESET diveset)

should backtracking be applied?

Parameters
divesetdiving settings

Definition at line 522 of file heur.c.

References SCIP_Diveset::backtrack.

Referenced by SCIPperformGenericDivingAlgorithm().

int SCIPdivesetGetLPSolveFreq ( SCIP_DIVESET diveset)

returns the LP solve frequency for diving LPs (0: dynamically based on number of intermediate domain reductions)

Parameters
divesetdiving settings

Definition at line 530 of file heur.c.

References SCIP_Diveset::lpsolvefreq, and NULL.

Referenced by SCIPperformGenericDivingAlgorithm().

SCIP_Real SCIPdivesetGetLPResolveDomChgQuot ( SCIP_DIVESET diveset)

returns the domain reduction quotient for triggering an immediate resolve of the diving LP (0.0: always resolve)

Parameters
divesetdiving settings

Definition at line 540 of file heur.c.

References SCIP_Diveset::lpresolvedomchgquot, and NULL.

Referenced by SCIPperformGenericDivingAlgorithm().

SCIP_Bool SCIPdivesetUseOnlyLPBranchcands ( SCIP_DIVESET diveset)

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

Parameters
divesetdiving settings

Definition at line 552 of file heur.c.

References NULL, and SCIP_Diveset::onlylpbranchcands.

Referenced by SCIPperformGenericDivingAlgorithm().

SCIP_Bool SCIPdivesetSupportsType ( SCIP_DIVESET diveset,
SCIP_DIVETYPE  divetype 
)

returns TRUE if dive set supports diving of the specified type

Parameters
divesetdiving settings
divetypebit mask that represents the supported dive types by this dive set

Definition at line 562 of file heur.c.

References SCIP_Diveset::divetypemask, and NULL.

Referenced by getDiveBdChgsSOS1conflictgraph(), and getDiveBdChgsSOS1constraints().