Scippy

SCIP

Solving Constraint Integer Programs

struct_heur.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file struct_heur.h
17  * @ingroup INTERNALAPI
18  * @brief datastructures for primal heuristics
19  * @author Tobias Achterberg
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #ifndef __SCIP_STRUCT_HEUR_H__
25 #define __SCIP_STRUCT_HEUR_H__
26 
27 
28 #include "scip/def.h"
29 #include "scip/type_clock.h"
30 #include "scip/type_heur.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /** common settings for diving heuristics */
38 {
39  SCIP_HEUR* heur; /**< the heuristic to which this dive set belongs */
40  char* name; /**< name of dive controller, in case that a heuristic has several */
41  SCIP_SOL* sol; /**< working solution of this dive set */
42  SCIP_RANDNUMGEN* randnumgen; /**< random number generator */
43  SCIP_Real minreldepth; /**< minimal relative depth to start diving */
44  SCIP_Real maxreldepth; /**< maximal relative depth to start diving */
45  SCIP_Real maxlpiterquot; /**< maximal fraction of diving LP iterations compared to node LP iterations */
46  SCIP_Real maxdiveubquot; /**< maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound)
47  * where diving is performed (0.0: no limit) */
48  SCIP_Real maxdiveavgquot; /**< maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound)
49  * where diving is performed (0.0: no limit) */
50  SCIP_Real maxdiveubquotnosol; /**< maximal UBQUOT when no solution was found yet (0.0: no limit) */
51  SCIP_Real maxdiveavgquotnosol;/**< maximal AVGQUOT when no solution was found yet (0.0: no limit) */
52  SCIP_Real lpresolvedomchgquot;/**< percentage of immediate domain changes during probing to trigger LP resolve */
53  SCIP_Longint nlpiterations; /**< LP iterations used in this dive set */
54  SCIP_Longint nlps; /**< the number of LPs solved by this dive set */
55  SCIP_Longint totaldepth; /**< the total depth used in this dive set */
56  SCIP_Longint totalsoldepth; /**< the sum of depths at which this dive set found solutions */
57  SCIP_Longint totalnnodes; /**< the total number of probing nodes explored by this dive set */
58  SCIP_Longint totalnbacktracks; /**< the total number of backtracks during the execution of this dive set */
59  SCIP_Longint nsolsfound; /**< the total number of solutions found */
60  SCIP_Longint nbestsolsfound; /**< the total number of best solutions found */
61  SCIP_Longint nconflictsfound; /**< the total number of added conflicts during the execution of this dive set */
62  int maxlpiterofs; /**< additional number of allowed LP iterations */
63  int mindepth; /**< the minimum depth reached by all executions of the dive set */
64  int maxdepth; /**< the maximum depth reached by an execution of the dive set */
65  int minsoldepth; /**< the minimum depth at which this dive set found a solution */
66  int maxsoldepth; /**< the maximum depth at which this dive set found a solution */
67  int ncalls; /**< the total number of calls of this dive set */
68  int nsolcalls; /**< number of calls with a leaf solution */
69  int lpsolvefreq; /**< LP solve frequency for diving heuristics */
70  unsigned int initialseed; /**< initial seed for the random number generator */
71  SCIP_Bool backtrack; /**< use one level of backtracking if infeasibility is encountered? */
72  SCIP_Bool onlylpbranchcands; /**< should only LP branching candidates be considered instead of the slower but
73  * more general constraint handler diving variable selection? */
74  SCIP_DIVETYPE divetypemask; /**< bit mask that represents the supported dive types by this dive set */
75  SCIP_DECL_DIVESETGETSCORE((*divesetgetscore)); /**< method for candidate score and rounding direction */
76 };
77 
78 /** primal heuristics data */
79 struct SCIP_Heur
80 {
81  SCIP_Longint ncalls; /**< number of times, this heuristic was called */
82  SCIP_Longint nsolsfound; /**< number of feasible primal solutions found so far by this heuristic */
83  SCIP_Longint nbestsolsfound; /**< number of new best primal CIP solutions found so far by this heuristic */
84  char* name; /**< name of primal heuristic */
85  char* desc; /**< description of primal heuristic */
86  SCIP_DECL_HEURCOPY ((*heurcopy)); /**< copy method of primal heuristic or NULL if you don't want to copy your plugin into sub-SCIPs */
87  SCIP_DECL_HEURFREE ((*heurfree)); /**< destructor of primal heuristic */
88  SCIP_DECL_HEURINIT ((*heurinit)); /**< initialize primal heuristic */
89  SCIP_DECL_HEUREXIT ((*heurexit)); /**< deinitialize primal heuristic */
90  SCIP_DECL_HEURINITSOL ((*heurinitsol)); /**< solving process initialization method of primal heuristic */
91  SCIP_DECL_HEUREXITSOL ((*heurexitsol)); /**< solving process deinitialization method of primal heuristic */
92  SCIP_DECL_HEUREXEC ((*heurexec)); /**< execution method of primal heuristic */
93  SCIP_HEURDATA* heurdata; /**< primal heuristics local data */
94  SCIP_DIVESET** divesets; /**< array of diving controllers of this heuristic */
95  SCIP_CLOCK* setuptime; /**< time spend for setting up this heuristic for the next stages */
96  SCIP_CLOCK* heurclock; /**< heuristic execution time */
97  int priority; /**< priority of the primal heuristic */
98  int freq; /**< frequency for calling primal heuristic */
99  int freqofs; /**< frequency offset for calling primal heuristic */
100  int maxdepth; /**< maximal depth level to call heuristic at (-1: no limit) */
101  int delaypos; /**< position in the delayed heuristics queue, or -1 if not delayed */
102  int ndivesets; /**< number of diving controllers of this heuristic */
103  SCIP_HEURTIMING timingmask; /**< positions in the node solving loop where heuristic should be executed */
104  SCIP_Bool usessubscip; /**< does the heuristic use a secondary SCIP instance? */
105  SCIP_Bool initialized; /**< is primal heuristic initialized? */
106  char dispchar; /**< display character of primal heuristic */
107 };
108 
109 /** variable graph data structure to determine breadth-first distances between variables
110  *
111  * the variable graph internally stores a mapping from the variables to the constraints in which they appear.
112  *
113  * @see PublicVariableGraphMethods for available methods
114  */
116 {
117  SCIP_CONS*** varconss; /**< constraints of each variable */
118  SCIP_HASHTABLE* visitedconss; /**< hash table that keeps a record of visited constraints during breadth-first search */
119  int* nvarconss; /**< number of constraints for each variable */
120  int* varconssize; /**< size array for every varconss entry */
121 };
122 
123 #ifdef __cplusplus
124 }
125 #endif
126 
127 #endif
SCIP_Bool onlylpbranchcands
Definition: struct_heur.h:72
int * nvarconss
Definition: struct_heur.h:119
SCIP_Longint totalnnodes
Definition: struct_heur.h:57
#define SCIP_DECL_HEURINITSOL(x)
Definition: type_heur.h:97
SCIP_HEUR * heur
Definition: struct_heur.h:39
SCIP_Longint totalnbacktracks
Definition: struct_heur.h:58
SCIP_DIVESET ** divesets
Definition: struct_heur.h:94
int ndivesets
Definition: struct_heur.h:102
unsigned int SCIP_HEURTIMING
Definition: type_timing.h:97
int delaypos
Definition: struct_heur.h:101
SCIP_Real maxreldepth
Definition: struct_heur.h:44
SCIP_Bool backtrack
Definition: struct_heur.h:71
SCIP_Real maxlpiterquot
Definition: struct_heur.h:45
SCIP_Longint nsolsfound
Definition: struct_heur.h:82
SCIP_CLOCK * heurclock
Definition: struct_heur.h:96
int * varconssize
Definition: struct_heur.h:120
SCIP_Longint totaldepth
Definition: struct_heur.h:55
char * name
Definition: struct_heur.h:40
#define SCIP_DECL_HEURCOPY(x)
Definition: type_heur.h:62
#define SCIP_DECL_HEUREXEC(x)
Definition: type_heur.h:128
SCIP_CLOCK * setuptime
Definition: struct_heur.h:95
struct SCIP_HeurData SCIP_HEURDATA
Definition: type_heur.h:51
char dispchar
Definition: struct_heur.h:106
unsigned int SCIP_DIVETYPE
Definition: type_heur.h:48
SCIP_Longint nconflictsfound
Definition: struct_heur.h:61
SCIP_Bool usessubscip
Definition: struct_heur.h:104
SCIP_Real maxdiveavgquotnosol
Definition: struct_heur.h:51
SCIP_HEURTIMING timingmask
Definition: struct_heur.h:103
char * name
Definition: struct_heur.h:84
type definitions for primal heuristics
SCIP_SOL * sol
Definition: struct_heur.h:41
SCIP_Real lpresolvedomchgquot
Definition: struct_heur.h:52
SCIP_RANDNUMGEN * randnumgen
Definition: struct_heur.h:42
SCIP_Real maxdiveubquot
Definition: struct_heur.h:46
SCIP_Bool initialized
Definition: struct_heur.h:105
SCIP_Longint nlpiterations
Definition: struct_heur.h:53
SCIP_Longint totalsoldepth
Definition: struct_heur.h:56
#define SCIP_Bool
Definition: def.h:70
char * desc
Definition: struct_heur.h:85
int priority
Definition: struct_heur.h:97
SCIP_DIVETYPE divetypemask
Definition: struct_heur.h:74
SCIP_HEURDATA * heurdata
Definition: struct_heur.h:93
unsigned int initialseed
Definition: struct_heur.h:70
type definitions for clocks and timing issues
SCIP_CONS *** varconss
Definition: struct_heur.h:117
SCIP_Real maxdiveavgquot
Definition: struct_heur.h:48
SCIP_HASHTABLE * visitedconss
Definition: struct_heur.h:118
SCIP_Longint ncalls
Definition: struct_heur.h:81
SCIP_DECL_DIVESETGETSCORE((*divesetgetscore))
#define SCIP_DECL_HEUREXIT(x)
Definition: type_heur.h:86
SCIP_Longint nsolsfound
Definition: struct_heur.h:59
#define SCIP_DECL_HEURINIT(x)
Definition: type_heur.h:78
SCIP_Longint nbestsolsfound
Definition: struct_heur.h:83
#define SCIP_Real
Definition: def.h:164
SCIP_Longint nbestsolsfound
Definition: struct_heur.h:60
#define SCIP_DECL_HEURFREE(x)
Definition: type_heur.h:70
#define SCIP_Longint
Definition: def.h:149
SCIP_Real minreldepth
Definition: struct_heur.h:43
int maxlpiterofs
Definition: struct_heur.h:62
SCIP_Longint nlps
Definition: struct_heur.h:54
common defines and data types used in all packages of SCIP
#define SCIP_DECL_HEUREXITSOL(x)
Definition: type_heur.h:108
SCIP_Real maxdiveubquotnosol
Definition: struct_heur.h:50
int maxdepth
Definition: struct_heur.h:100
int freqofs
Definition: struct_heur.h:99