Scippy

SCIP

Solving Constraint Integer Programs

type_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-2017 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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file type_heur.h
17  * @ingroup TYPEDEFINITIONS
18  * @brief type definitions for primal heuristics
19  * @author Tobias Achterberg
20  * @author Timo Berthold
21  *
22  * This file defines the interface for primal heuristics implemented in C.
23  *
24  * - \ref HEUR "Instructions for implementing a primal heuristic"
25  * - \ref PRIMALHEURISTICS "List of available primal heuristics"
26  * - \ref scip::ObjHeur "C++ wrapper class"
27  */
28 
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
30 
31 #ifndef __SCIP_TYPE_HEUR_H__
32 #define __SCIP_TYPE_HEUR_H__
33 
34 #include "scip/def.h"
35 #include "scip/type_scip.h"
36 #include "scip/type_result.h"
37 #include "scip/type_timing.h"
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /** represents different methods for a dive set to explore the next children */
44 #define SCIP_DIVETYPE_NONE 0x000u /**< no method specified */
45 #define SCIP_DIVETYPE_INTEGRALITY 0x001u /**< use branching on a variable by shrinking the domain in the child nodes */
46 #define SCIP_DIVETYPE_SOS1VARIABLE 0x002u /**< branch on a variable solution value by exploiting special-ordered set conflict structure */
47 
48 typedef unsigned int SCIP_DIVETYPE;
49 
50 typedef struct SCIP_Heur SCIP_HEUR; /**< primal heuristic */
51 typedef struct SCIP_HeurData SCIP_HEURDATA; /**< locally defined primal heuristic data */
52 typedef struct SCIP_Diveset SCIP_DIVESET; /**< common parameters for all diving heuristics */
53 typedef struct SCIP_VGraph SCIP_VGRAPH; /**< variable graph data structure to determine breadth-first
54  * distances between variables */
55 
56 /** copy method for heuristic plugins (called when SCIP copies plugins)
57  *
58  * input:
59  * - scip : SCIP main data structure
60  * - heur : the primal heuristic itself
61  */
62 #define SCIP_DECL_HEURCOPY(x) SCIP_RETCODE x (SCIP* scip, SCIP_HEUR* heur)
63 
64 /** destructor of primal heuristic to free user data (called when SCIP is exiting)
65  *
66  * input:
67  * - scip : SCIP main data structure
68  * - heur : the primal heuristic itself
69  */
70 #define SCIP_DECL_HEURFREE(x) SCIP_RETCODE x (SCIP* scip, SCIP_HEUR* heur)
71 
72 /** initialization method of primal heuristic (called after problem was transformed)
73  *
74  * input:
75  * - scip : SCIP main data structure
76  * - heur : the primal heuristic itself
77  */
78 #define SCIP_DECL_HEURINIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_HEUR* heur)
79 
80 /** deinitialization method of primal heuristic (called before transformed problem is freed)
81  *
82  * input:
83  * - scip : SCIP main data structure
84  * - heur : the primal heuristic itself
85  */
86 #define SCIP_DECL_HEUREXIT(x) SCIP_RETCODE x (SCIP* scip, SCIP_HEUR* heur)
87 
88 /** solving process initialization method of primal heuristic (called when branch and bound process is about to begin)
89  *
90  * This method is called when the presolving was finished and the branch and bound process is about to begin.
91  * The primal heuristic may use this call to initialize its branch and bound specific data.
92  *
93  * input:
94  * - scip : SCIP main data structure
95  * - heur : the primal heuristic itself
96  */
97 #define SCIP_DECL_HEURINITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_HEUR* heur)
98 
99 /** solving process deinitialization method of primal heuristic (called before branch and bound process data is freed)
100  *
101  * This method is called before the branch and bound process is freed.
102  * The primal heuristic should use this call to clean up its branch and bound data.
103  *
104  * input:
105  * - scip : SCIP main data structure
106  * - heur : the primal heuristic itself
107  */
108 #define SCIP_DECL_HEUREXITSOL(x) SCIP_RETCODE x (SCIP* scip, SCIP_HEUR* heur)
109 
110 /** execution method of primal heuristic
111  *
112  * Searches for feasible primal solutions. The method is called in the node processing loop.
113  *
114  * input:
115  * - scip : SCIP main data structure
116  * - heur : the primal heuristic itself
117  * - heurtiming : current point in the node solving loop
118  * - nodeinfeasible : was the current node already detected to be infeasible?
119  * - result : pointer to store the result of the heuristic call
120  *
121  * possible return values for *result:
122  * - SCIP_FOUNDSOL : at least one feasible primal solution was found
123  * - SCIP_DIDNOTFIND : the heuristic searched, but did not find a feasible solution
124  * - SCIP_DIDNOTRUN : the heuristic was skipped
125  * - SCIP_DELAYED : the heuristic was skipped, but should be called again as soon as possible, disregarding
126  * its frequency
127  */
128 #define SCIP_DECL_HEUREXEC(x) SCIP_RETCODE x (SCIP* scip, SCIP_HEUR* heur, SCIP_HEURTIMING heurtiming, \
129  SCIP_Bool nodeinfeasible, SCIP_RESULT* result)
130 
131 
132 /* callbacks for diving heuristic specific settings */
133 
134 /** calculate score and preferred rounding direction for the candidate variable; the best candidate maximizes the
135  * score
136  *
137  * input:
138  * - scip : SCIP main data structure
139  * - diveset : diving settings for scoring
140  * - divetype : represents different methods for a dive set to explore the next children
141  * - cand : Candidate variable for which the score should be determined
142  * - candsol : solution value of variable in LP relaxation solution
143  * - candsfrac : fractional part of solution value of variable
144  * - score : pointer for diving score value - small scores are preferred
145  * - roundup : pointer to store whether the preferred rounding direction is upwards
146  *
147  * returns SCIP_OKAY if everything worked, otherwise, a suitable error code
148  */
149 #define SCIP_DECL_DIVESETGETSCORE(x) SCIP_RETCODE x (SCIP* scip, SCIP_DIVESET* diveset, \
150  SCIP_DIVETYPE divetype, SCIP_VAR* cand, SCIP_Real candsol, SCIP_Real candsfrac, SCIP_Real* score, SCIP_Bool* roundup)
151 
152 #ifdef __cplusplus
153 }
154 #endif
155 
156 #endif
timing definitions for SCIP
struct SCIP_HeurData SCIP_HEURDATA
Definition: type_heur.h:51
unsigned int SCIP_DIVETYPE
Definition: type_heur.h:48
type definitions for SCIP&#39;s main datastructure
result codes for SCIP callback methods
common defines and data types used in all packages of SCIP