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-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 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 "grph.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 
40 /** sets up the problem data */
43  SCIP* scip, /**< SCIP data structure */
44  const char* filename /**< file name */
45  );
46 
47 /** sets the probdata graph */
50  SCIP_PROBDATA* probdata, /**< problem data */
51  GRAPH* graph /**< graph data structure */
52  );
53 
54 /** returns the graph */
57  SCIP_PROBDATA* probdata /**< problem data */
58  );
59 
60 /** returns the graph */
63  SCIP* scip /**< SCIP data structure */
64  );
65 
66 /** sets the offset */
69  SCIP_PROBDATA* probdata, /**< problem data */
70  SCIP_Real offset /**< the offset value */
71  );
72 
73 
74 /** returns the array with all variables */
77  SCIP* scip /**< SCIP data structure */
78  );
79 
80 /** returns the array with all edge variables */
83  SCIP* scip /**< SCIP data structure */
84  );
85 
86 /** returns the array with all terminals (without the root) */
89  SCIP* scip /**< SCIP data structure */
90  );
91 
92 
93 /** returns the number of layers */
96  SCIP* scip /**< SCIP data structure */
97  );
98 
99 
100 /** returns the number of vars */
103  SCIP* scip /**< SCIP data structure */
104  );
105 
106 
107 /** returns the number of terminals */
110  SCIP* scip /**< SCIP data structure */
111  );
112 
113 /** returns the number of terminals without the root node */
116  SCIP* scip /**< SCIP data structure */
117  );
118 
119 /** returns root */
122  SCIP* scip /**< SCIP data structure */
123  );
124 
125 /** returns numer of original edges */
128  SCIP* scip /**< SCIP data structure */
129  );
130 
131 /** returns the number of edges */
134  SCIP* scip /**< SCIP data structure */
135  );
136 
137 /** returns the offset */
140  SCIP* scip /**< SCIP data structure */
141  );
142 
143 /** returns the edge variable for a given index */
146  SCIP* scip, /**< SCIP data structure */
147  int idx
148  );
149 
150 /** returns the LP solution values */
153  SCIP* scip, /**< SCIP data structure */
154  SCIP_SOL* sol
155  );
156 
157 /** returns all edge constraints */
160  SCIP* scip /**< SCIP data structure */
161  );
162 
163 /** returns all path constraints */
166  SCIP* scip /**< SCIP data structure */
167  );
168 
169 /** print (undirected) graph */
172  SCIP* scip, /**< SCIP data structure */
173  const char* filename, /**< Name of the output file */
174  SCIP_SOL* sol, /**< solution to be printed; or NULL for LP solution */
175  SCIP_Bool printsol /**< should solution be highlighted? */
176  );
177 
178 /** print graph (in undirected form) in GML format with given edges highlighted */
181  const GRAPH* graph, /**< Graph to be printed */
182  const char* filename, /**< Name of the output file */
183  SCIP_Bool* edgemark /**< Array of (undirected) edges to highlight */
184  );
185 
186 /** returns if 'T' model is being used */
189  SCIP* scip /**< SCIP data structure */
190  );
191 
192 /** writes the best solution to the intermediate solution file */
195  SCIP* scip /**< SCIP data structure */
196  );
197 
198 /** writes SPG (no variant!) to a file */
200  SCIP* scip, /**< SCIP data structure */
201  const GRAPH* graph, /**< graph data structure */
202  const char* filename /**< file name */
203  );
204 
205 /** writes the best solution to a file */
208  SCIP* scip, /**< SCIP data structure */
209  FILE* file /**< file to write best solution to; or NULL, to write to stdout */
210  );
211 
212 /** writes a line to the log file */
215  SCIP* scip, /**< SCIP data structure */
216  const char* formatstr, /**< format string like in printf() function */
217  ... /**< format arguments line in printf() function */
218  );
219 
220 /** add new solution */
223  SCIP* scip, /**< SCIP data structure */
224  SCIP_Real* nval, /**< array [0..nvars], nval[v] = 1 if node v is in the solution, nval[v] = 0 if not */
225  SCIP_SOL* sol, /**< the new solution */
226  SCIP_HEUR* heur, /**< heuristic data */
227  SCIP_Bool* success /**< denotes whether the new solution has been successfully added */
228  );
229 
230 /** set dual bound by ug */
233  SCIP* scip, /**< SCIP data structure */
234  SCIP_Real dual
235  );
236 
237 /** set the number of solvers */
240  SCIP* scip, /**< SCIP data structure */
241  int nSolvers /**< the number of solvers */
242  );
243 
244 /** returns problem type */
247  SCIP* scip /**< SCIP data structure */
248  );
249 
250 /** writes end of log file */
253  SCIP* scip /**< SCIP data structure */
254  );
255 
256 /** branching information from UG */
259  SCIP* scip, /**< SCIP data structure */
260  const int lLinearConsNames, /**< number of linear constraints */
261  const char* linearConsNames, /**< linear constraints string */
262  const int lSetppcConsNames, /**< number of setppc constraints */
263  const char* setppcConsNames /**< number of setppc constraints */
264  );
265 
266 #ifdef __cplusplus
267 }
268 #endif
269 
270 #endif
SCIP_EXPORT void SCIPprobdataWriteLogLine(SCIP *scip, const char *formatstr,...)
SCIP_EXPORT void SCIPprobdataSetGraph(SCIP_PROBDATA *probdata, GRAPH *graph)
SCIP_EXPORT int SCIPprobdataGetNEdges(SCIP *scip)
Definition: grph.h:57
SCIP_EXPORT int SCIPprobdataGetNorgEdges(SCIP *scip)
SCIP_EXPORT SCIP_Real SCIPprobdataGetOffset(SCIP *scip)
#define SCIP_EXPORT
Definition: def.h:98
SCIP_EXPORT SCIP_VAR ** SCIPprobdataGetVars(SCIP *scip)
SCIP_EXPORT SCIP_VAR ** SCIPprobdataGetEdgeVars(SCIP *scip)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_EXPORT void SCIPprobdataSetOffset(SCIP_PROBDATA *probdata, SCIP_Real offset)
SCIP_EXPORT SCIP_RETCODE SCIPprobdataCreate(SCIP *scip, const char *filename)
SCIP_EXPORT int SCIPprobdataGetNVars(SCIP *scip)
SCIP_EXPORT SCIP_Real * SCIPprobdataGetXval(SCIP *scip, SCIP_SOL *sol)
SCIP_EXPORT int SCIPprobdataGetNTerms(SCIP *scip)
SCIP_EXPORT SCIP_RETCODE SCIPprobdataWriteSolution(SCIP *scip, FILE *file)
SCIP_EXPORT SCIP_RETCODE SCIPprobdataWriteLogfileEnd(SCIP *scip)
SCIP_EXPORT void SCIPprobdataSetNSolvers(SCIP *scip, int nSolvers)
SCIP_EXPORT SCIP_RETCODE SCIPprobdataWriteIntermediateSolution(SCIP *scip)
SCIP_EXPORT int SCIPprobdataGetRNTerms(SCIP *scip)
SCIP_EXPORT int SCIPprobdataGetType(SCIP *scip)
SCIP_EXPORT int SCIPprobdataGetRoot(SCIP *scip)
SCIP_EXPORT SCIP_CONS ** SCIPprobdataGetPathConstraints(SCIP *scip)
SCIP_EXPORT void SCIPprobdataSetDualBound(SCIP *scip, SCIP_Real dual)
SCIP_EXPORT SCIP_RETCODE SCIPprobdataPrintGraph(SCIP *scip, const char *filename, SCIP_SOL *sol, SCIP_Bool printsol)
SCIP_EXPORT SCIP_CONS ** SCIPprobdataGetEdgeConstraints(SCIP *scip)
SCIP_EXPORT int * SCIPprobdataGetRTerms(SCIP *scip)
SCIP_EXPORT void initReceivedSubproblem(SCIP *scip, const int lLinearConsNames, const char *linearConsNames, const int lSetppcConsNames, const char *setppcConsNames)
#define SCIP_Bool
Definition: def.h:70
SCIP_EXPORT SCIP_VAR * SCIPprobdataGetedgeVarByIndex(SCIP *scip, int idx)
includes various files containing graph methods used for Steiner tree problems
SCIP_EXPORT int SCIPprobdataGetNLayers(SCIP *scip)
SCIP_EXPORT SCIP_Bool SCIPprobdataIsBigt(SCIP *scip)
SCIP_EXPORT SCIP_RETCODE SCIPprobdataPrintGraph2(const GRAPH *graph, const char *filename, SCIP_Bool *edgemark)
struct SCIP_ProbData SCIP_PROBDATA
Definition: type_prob.h:44
SCIP_EXPORT GRAPH * SCIPprobdataGetGraph2(SCIP *scip)
#define SCIP_Real
Definition: def.h:164
SCIP_EXPORT GRAPH * SCIPprobdataGetGraph(SCIP_PROBDATA *probdata)
void SCIPprobdataWriteStp(SCIP *scip, const GRAPH *graph, const char *filename)
SCIP_EXPORT SCIP_RETCODE SCIPprobdataAddNewSol(SCIP *scip, SCIP_Real *nval, SCIP_SOL *sol, SCIP_HEUR *heur, SCIP_Bool *success)
SCIP callable library.