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-2018 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 */
41 extern
43  SCIP* scip, /**< SCIP data structure */
44  const char* filename /**< file name */
45  );
46 
47 /** sets the probdata graph */
48 extern
50  SCIP_PROBDATA* probdata, /**< problem data */
51  GRAPH* graph /**< graph data structure */
52  );
53 
54 /** returns the graph */
55 extern
57  SCIP_PROBDATA* probdata /**< problem data */
58  );
59 
60 /** returns the graph */
61 extern
63  SCIP* scip /**< SCIP data structure */
64  );
65 
66 /** sets the offset */
67 extern
69  SCIP_PROBDATA* probdata, /**< problem data */
70  SCIP_Real offset /**< the offset value */
71  );
72 
73 
74 /** returns the array with all variables */
75 extern
77  SCIP* scip /**< SCIP data structure */
78  );
79 
80 /** returns the array with all edge variables */
81 extern
83  SCIP* scip /**< SCIP data structure */
84  );
85 
86 /** returns the array with all terminals (without the root) */
87 extern
89  SCIP* scip /**< SCIP data structure */
90  );
91 
92 
93 /** returns the number of layers */
94 extern
96  SCIP* scip /**< SCIP data structure */
97  );
98 
99 
100 /** returns the number of vars */
101 extern
103  SCIP* scip /**< SCIP data structure */
104  );
105 
106 
107 /** returns the number of terminals */
108 extern
110  SCIP* scip /**< SCIP data structure */
111  );
112 
113 /** returns the number of terminals without the root node */
114 extern
116  SCIP* scip /**< SCIP data structure */
117  );
118 
119 /** returns root */
120 extern
122  SCIP* scip /**< SCIP data structure */
123  );
124 
125 /** returns numer of original edges */
126 extern
128  SCIP* scip /**< SCIP data structure */
129  );
130 
131 /** returns the number of edges */
132 extern
134  SCIP* scip /**< SCIP data structure */
135  );
136 
137 /** returns the offset */
138 extern
140  SCIP* scip /**< SCIP data structure */
141  );
142 
143 /** returns the edge variable for a given index */
144 extern
146  SCIP* scip, /**< SCIP data structure */
147  int idx
148  );
149 
150 /** returns the LP solution values */
151 extern
153  SCIP* scip, /**< SCIP data structure */
154  SCIP_SOL* sol
155  );
156 
157 /** returns all edge constraints */
158 extern
160  SCIP* scip /**< SCIP data structure */
161  );
162 
163 /** returns all path constraints */
164 extern
166  SCIP* scip /**< SCIP data structure */
167  );
168 
169 /** print (undirected) graph */
170 extern
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 */
179 extern
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 */
187 extern
189  SCIP* scip /**< SCIP data structure */
190  );
191 
192 /** writes the best solution to the intermediate solution file */
193 extern
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 */
206 extern
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 */
213 extern
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 */
221 extern
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 */
231 extern
233  SCIP* scip, /**< SCIP data structure */
234  SCIP_Real dual
235  );
236 
237 /** set the number of solvers */
238 extern
240  SCIP* scip, /**< SCIP data structure */
241  int nSolvers /**< the number of solvers */
242  );
243 
244 /** returns problem type */
245 extern
247  SCIP* scip /**< SCIP data structure */
248  );
249 
250 /** writes end of log file */
251 extern
253  SCIP* scip /**< SCIP data structure */
254  );
255 
256 /** branching information from UG */
257 extern
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
void SCIPprobdataSetOffset(SCIP_PROBDATA *probdata, SCIP_Real offset)
Definition: grph.h:57
SCIP_CONS ** SCIPprobdataGetEdgeConstraints(SCIP *scip)
SCIP_RETCODE SCIPprobdataWriteIntermediateSolution(SCIP *scip)
SCIP_VAR ** SCIPprobdataGetVars(SCIP *scip)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
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_RETCODE SCIPprobdataAddNewSol(SCIP *scip, SCIP_Real *nval, SCIP_SOL *sol, SCIP_HEUR *heur, SCIP_Bool *success)
void SCIPprobdataSetNSolvers(SCIP *scip, int nSolvers)
void SCIPprobdataWriteLogLine(SCIP *scip, const char *formatstr,...)
int * SCIPprobdataGetRTerms(SCIP *scip)
SCIP_RETCODE SCIPprobdataWriteSolution(SCIP *scip, FILE *file)
SCIP_RETCODE SCIPprobdataPrintGraph2(const GRAPH *graph, const char *filename, SCIP_Bool *edgemark)
SCIP_Bool SCIPprobdataIsBigt(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:62
int SCIPprobdataGetRoot(SCIP *scip)
void SCIPprobdataSetGraph(SCIP_PROBDATA *probdata, GRAPH *graph)
int SCIPprobdataGetNorgEdges(SCIP *scip)
void SCIPprobdataSetDualBound(SCIP *scip, SCIP_Real dual)
includes various files containing graph methods used for Steiner tree problems
SCIP_VAR ** SCIPprobdataGetEdgeVars(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:150
void initReceivedSubproblem(SCIP *scip, const int lLinearConsNames, const char *linearConsNames, const int lSetppcConsNames, const char *setppcConsNames)
GRAPH * SCIPprobdataGetGraph2(SCIP *scip)
void SCIPprobdataWriteStp(SCIP *scip, const GRAPH *graph, const char *filename)
SCIP callable library.
int SCIPprobdataGetNTerms(SCIP *scip)