Scippy

SCIP

Solving Constraint Integer Programs

probdata_stp.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-2022 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 scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file probdata_stp.h
17  * @brief Problem data for stp problem
18  * @author Gerald Gamrath
19  * @author Thorsten Koch
20  * @author Michael Winkler
21  * @author Daniel Rehfeldt
22  *
23  * This file implements the problem data for Steiner problems. For more details see \ref STP_PROBLEMDATA page.
24  *
25  */
26 
27 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
28 
29 #ifndef __SCIP_PROBDATA_STP__
30 #define __SCIP_PROBDATA_STP__
31 
32 #include "scip/scip.h"
33 #include "graph.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 #define STP_MODE_CUT 0 /**< branch and cut */
40 #define STP_MODE_FLOW 1 /**< use flow model */
41 #define STP_MODE_PRICE 2 /**< branch and price */
42 
43 #define STP_CONS_NEVER 0 /**< never use (respective) constraints */
44 #define STP_CONS_ALWAYS 1 /**< always use (respective) constraints */
45 #define STP_CONS_AUTOMATIC 2 /**< use (respective) constraints depending on the problem instance */
46 
47 #define STP_USEDP_NEVER 0 /**< never use DP */
48 #define STP_USEDP_ALWAYS 1 /**< always use */
49 #define STP_USEDP_AUTOMATIC 2 /**< let SCIP-Jack decide */
50 
51 
52 /** sets up the problem data */
53 SCIP_EXPORT
55  SCIP* scip /**< SCIP data structure */
56  );
57 
58 /** sets up the problem data */
59 SCIP_EXPORT
61  SCIP* scip, /**< SCIP data structure */
62  const char* filename /**< file name */
63  );
64 
65 /** sets up the problem data, given graph */
66 SCIP_EXPORT
68  SCIP* scip, /**< SCIP data structure */
69  SCIP_Real offset, /**< offset */
70  const char* probname, /**< problem name */
71  SCIP_Bool isSubProb, /**< is this a subproblem? */
72  GRAPH* graph_move /**< graph; will be moved and pointer invalidated! */
73  );
74 
75 /** sets the probdata graph */
76 SCIP_EXPORT
78  SCIP_PROBDATA* probdata, /**< problem data */
79  GRAPH* graph /**< graph data structure */
80  );
81 
82 /** returns the graph */
83 SCIP_EXPORT
85  SCIP_PROBDATA* probdata /**< problem data */
86  );
87 
88 /** returns the graph */
89 SCIP_EXPORT
91  SCIP* scip /**< SCIP data structure */
92  );
93 
94 /** sets the offset */
95 SCIP_EXPORT
97  SCIP_PROBDATA* probdata, /**< problem data */
98  SCIP_Real offset /**< the offset value */
99  );
100 
101 
102 /** returns the array with all variables */
103 SCIP_EXPORT
105  SCIP* scip /**< SCIP data structure */
106  );
107 
108 /** returns the array with all edge variables */
109 SCIP_EXPORT
111  SCIP* scip /**< SCIP data structure */
112  );
113 
114 /** returns the array with all terminals (without the root) */
115 SCIP_EXPORT
117  SCIP* scip /**< SCIP data structure */
118  );
119 
120 /** returns array */
121 SCIP_EXPORT
123  SCIP* scip /**< SCIP data structure */
124  );
125 
126 /** returns the number of layers */
127 SCIP_EXPORT
129  SCIP* scip /**< SCIP data structure */
130  );
131 
132 
133 /** returns the number of vars */
134 SCIP_EXPORT
136  SCIP* scip /**< SCIP data structure */
137  );
138 
139 
140 /** returns the number of terminals */
141 SCIP_EXPORT
143  SCIP* scip /**< SCIP data structure */
144  );
145 
146 /** returns the number of terminals without the root node */
147 SCIP_EXPORT
149  SCIP* scip /**< SCIP data structure */
150  );
151 
152 /** returns root */
153 SCIP_EXPORT
155  SCIP* scip /**< SCIP data structure */
156  );
157 
158 /** returns numer of original edges */
159 SCIP_EXPORT
161  SCIP* scip /**< SCIP data structure */
162  );
163 
164 /** returns the number of edges */
165 SCIP_EXPORT
167  SCIP* scip /**< SCIP data structure */
168  );
169 
170 /** returns the number of nodes */
171 SCIP_EXPORT
173  SCIP* scip /**< SCIP data structure */
174  );
175 
176 /** returns the offset */
177 SCIP_EXPORT
179  SCIP* scip /**< SCIP data structure */
180  );
181 
182 /** returns upper bound from presolving */
183 SCIP_EXPORT
185  SCIP* scip /**< SCIP data structure */
186  );
187 
188 
189 /** returns upper bound from presolving */
190 SCIP_EXPORT
192  SCIP* scip /**< SCIP data structure */
193  );
194 
195 /** returns the edge variable for a given index */
196 SCIP_EXPORT
198  SCIP* scip, /**< SCIP data structure */
199  int idx
200  );
201 
202 /** returns the LP solution values */
203 SCIP_EXPORT
205  SCIP* scip, /**< SCIP data structure */
206  SCIP_SOL* sol
207  );
208 
209 /** returns all edge constraints */
210 SCIP_EXPORT
212  SCIP* scip /**< SCIP data structure */
213  );
214 
215 /** returns all path constraints */
216 SCIP_EXPORT
218  SCIP* scip /**< SCIP data structure */
219  );
220 
221 /** print (undirected) graph */
222 SCIP_EXPORT
224  SCIP* scip, /**< SCIP data structure */
225  const char* filename, /**< Name of the output file */
226  SCIP_SOL* sol, /**< solution to be printed; or NULL for LP solution */
227  SCIP_Bool printsol /**< should solution be highlighted? */
228  );
229 
230 /** returns if 'T' model is being used */
231 SCIP_EXPORT
233  SCIP* scip /**< SCIP data structure */
234  );
235 
236 
237 /* returns if objective is known to be integral */
238 SCIP_EXPORT
240  SCIP* scip /**< SCIP data structure */
241  );
242 
243 
244 /** returns if in subproblem */
245 SCIP_EXPORT
247  SCIP* scip /**< SCIP data structure */
248  );
249 
250 
251 /** returns whether problem seems very hard */
252 SCIP_EXPORT
254  SCIP* scip /**< SCIP data structure */
255  );
256 
257 
258 /** writes the best solution to the intermediate solution file */
259 SCIP_EXPORT
261  SCIP* scip /**< SCIP data structure */
262  );
263 
264 /** writes the best solution to a file */
265 SCIP_EXPORT
267  SCIP* scip, /**< SCIP data structure */
268  FILE* file /**< file to write best solution to; or NULL, to write to stdout */
269  );
270 
271 /** writes a line to the log file */
272 SCIP_EXPORT
274  SCIP* scip, /**< SCIP data structure */
275  const char* formatstr, /**< format string like in printf() function */
276  ... /**< format arguments line in printf() function */
277  );
278 
279 /** add new solution */
280 SCIP_EXPORT
282  SCIP* scip, /**< SCIP data structure */
283  SCIP_Real* nval, /**< array [0..nvars], nval[v] = 1 if node v is in the solution, nval[v] = 0 if not */
284  SCIP_HEUR* heur, /**< heuristic data */
285  SCIP_Bool* success /**< denotes whether the new solution has been successfully added */
286  );
287 
288 /** set dual bound by ug */
289 SCIP_EXPORT
291  SCIP* scip, /**< SCIP data structure */
292  SCIP_Real dual
293  );
294 
295 /** set the number of solvers */
296 SCIP_EXPORT
298  SCIP* scip, /**< SCIP data structure */
299  int nSolvers /**< the number of solvers */
300  );
301 
302 /** returns problem type */
303 SCIP_EXPORT
305  SCIP* scip /**< SCIP data structure */
306  );
307 
308 /** writes end of log file */
309 SCIP_EXPORT
311  SCIP* scip /**< SCIP data structure */
312  );
313 
314 /** branching information from UG */
315 SCIP_EXPORT
317  SCIP* scip, /**< SCIP data structure */
318  const int lLinearConsNames, /**< number of linear constraints */
319  const char* linearConsNames, /**< linear constraints string */
320  const int lSetppcConsNames, /**< number of setppc constraints */
321  const char* setppcConsNames /**< number of setppc constraints */
322  );
323 
324 #ifdef __cplusplus
325 }
326 #endif
327 
328 #endif
void SCIPprobdataSetOffset(SCIP_PROBDATA *probdata, SCIP_Real offset)
SCIP_Bool SCIPprobdataObjIsIntegral(SCIP *scip)
SCIP_RETCODE SCIPprobdataCreateFromGraph(SCIP *scip, SCIP_Real offset, const char *probname, SCIP_Bool isSubProb, GRAPH *graph_move)
SCIP_CONS ** SCIPprobdataGetEdgeConstraints(SCIP *scip)
SCIP_RETCODE SCIPprobdataWriteIntermediateSolution(SCIP *scip)
SCIP_VAR ** SCIPprobdataGetVars(SCIP *scip)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
includes various files containing graph methods used for Steiner tree problems
int SCIPprobdataGetNEdges(SCIP *scip)
int SCIPprobdataGetNVars(SCIP *scip)
SCIP_CONS ** SCIPprobdataGetPathConstraints(SCIP *scip)
int SCIPprobdataGetNLayers(SCIP *scip)
GRAPH * SCIPprobdataGetGraph(SCIP_PROBDATA *probdata)
int SCIPprobdataGetRNTerms(SCIP *scip)
SCIP_RETCODE SCIPprobdataWriteLogfileEnd(SCIP *scip)
SCIP_Bool SCIPprobdataProbIsAdversarial(SCIP *scip)
void SCIPprobdataSetNSolvers(SCIP *scip, int nSolvers)
SCIP_RETCODE SCIPprobdataAddNewSol(SCIP *scip, SCIP_Real *nval, SCIP_HEUR *heur, SCIP_Bool *success)
void SCIPprobdataWriteLogLine(SCIP *scip, const char *formatstr,...)
SCIP_Real SCIPprobdataGetPresolUpperBound(SCIP *scip)
int * SCIPprobdataGetRTerms(SCIP *scip)
SCIP_RETCODE SCIPprobdataWriteSolution(SCIP *scip, FILE *file)
SCIP_Bool SCIPprobdataIsBigt(SCIP *scip)
SCIP_RETCODE SCIPprobdataSetDefaultParams(SCIP *scip)
SCIP_RETCODE SCIPprobdataPrintGraph(SCIP *scip, const char *filename, SCIP_SOL *sol, SCIP_Bool printsol)
SCIP_Real SCIPprobdataGetOffset(SCIP *scip)
SCIP_RETCODE SCIPprobdataCreate(SCIP *scip, const char *filename)
int SCIPprobdataGetType(SCIP *scip)
#define SCIP_Bool
Definition: def.h:84
SCIP_Real SCIPprobdataGetPresolUpperBoundWithOffset(SCIP *scip)
int SCIPprobdataGetNNodes(SCIP *scip)
int SCIPprobdataGetRoot(SCIP *scip)
void SCIPprobdataSetGraph(SCIP_PROBDATA *probdata, GRAPH *graph)
int SCIPprobdataGetNorgEdges(SCIP *scip)
void SCIPprobdataSetDualBound(SCIP *scip, SCIP_Real dual)
SCIP_VAR ** SCIPprobdataGetEdgeVars(SCIP *scip)
SCIP_Bool SCIPprobdataIsSubproblem(SCIP *scip)
struct SCIP_ProbData SCIP_PROBDATA
Definition: type_prob.h:44
SCIP_VAR * SCIPprobdataGetedgeVarByIndex(SCIP *scip, int idx)
SCIP_Real * SCIPprobdataGetXval(SCIP *scip, SCIP_SOL *sol)
#define SCIP_Real
Definition: def.h:177
int * SCIPprobdataGetPctermsorder(SCIP *scip)
void initReceivedSubproblem(SCIP *scip, const int lLinearConsNames, const char *linearConsNames, const int lSetppcConsNames, const char *setppcConsNames)
GRAPH * SCIPprobdataGetGraph2(SCIP *scip)
SCIP callable library.
int SCIPprobdataGetNTerms(SCIP *scip)