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-2015 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 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 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
42 SCIP_RETCODE SCIPprobdataCreate(
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 /** sets the offset */
61 extern
63  SCIP_PROBDATA* probdata, /**< problem data */
64  SCIP_Real offset /**< the offset value */
65  );
66 
67 
68 /** returns the array with all variables */
69 extern
70 SCIP_VAR** SCIPprobdataGetVars(
71  SCIP* scip /**< SCIP data structure */
72  );
73 
74 /** returns the array with all edge variables */
75 extern
76 SCIP_VAR** SCIPprobdataGetEdgeVars(
77  SCIP* scip /**< SCIP data structure */
78  );
79 
80 /** returns the array with all terminals (without the root) */
81 extern
83  SCIP* scip /**< SCIP data structure */
84  );
85 
86 
87 /** returns the number of layers */
88 extern
90  SCIP* scip /**< SCIP data structure */
91  );
92 
93 
94 /** returns the number of vars */
95 extern
97  SCIP* scip /**< SCIP data structure */
98  );
99 
100 
101 /** returns the number of terminals */
102 extern
104  SCIP* scip /**< SCIP data structure */
105  );
106 
107 /** returns the number of terminals without the root node */
108 extern
110  SCIP* scip /**< SCIP data structure */
111  );
112 
113 /** returns root */
114 extern
116  SCIP* scip /**< SCIP data structure */
117  );
118 
119 /** returns the number of edges */
120 extern
122  SCIP* scip /**< SCIP data structure */
123  );
124 
125 /** returns the offset */
126 extern
127 SCIP_Real SCIPprobdataGetOffset(
128  SCIP* scip /**< SCIP data structure */
129  );
130 
131 /** returns the edge variable for a given index */
132 extern
134  SCIP* scip, /**< SCIP data structure */
135  int idx
136  );
137 
138 /** returns the LP solution values */
139 extern
140 SCIP_Real* SCIPprobdataGetXval(
141  SCIP* scip, /**< SCIP data structure */
142  SCIP_SOL* sol
143  );
144 
145 /** returns all edge constraints */
146 extern
148  SCIP* scip /**< SCIP data structure */
149  );
150 
151 /** returns all path constraints */
152 extern
154  SCIP* scip /**< SCIP data structure */
155  );
156 
157 /** print (undirected) graph */
158 extern
159 SCIP_RETCODE SCIPprobdataPrintGraph(
160  SCIP* scip, /**< SCIP data structure */
161  const char* filename, /**< Name of the output file */
162  SCIP_SOL* sol, /**< solution to be printed; or NULL for LP solution */
163  SCIP_Bool printsol /**< should solution be highlighted? */
164  );
165 
166 /** print graph (in undirected form) in GML format with given edges highlighted */
167 extern
168 SCIP_RETCODE SCIPprobdataPrintGraph2(
169  const GRAPH* graph, /**< Graph to be printed */
170  const char* filename, /**< Name of the output file */
171  SCIP_Bool* edgemark /**< Array of (undirected) edges to highlight */
172  );
173 
174 /** returns if 'T' model is being used */
175 extern
176 SCIP_Bool SCIPprobdataIsBigt(
177  SCIP* scip /**< SCIP data structure */
178  );
179 
180 /** writes the best solution to the intermediate solution file */
181 extern
183  SCIP* scip /**< SCIP data structure */
184  );
185 
186 /** writes the best solution to a file */
187 extern
188 SCIP_RETCODE SCIPprobdataWriteSolution(
189  SCIP* scip, /**< SCIP data structure */
190  FILE* file /**< file to write best solution to; or NULL, to write to stdout */
191  );
192 
193 /** writes a line to the log file */
194 extern
196  SCIP* scip, /**< SCIP data structure */
197  const char* formatstr, /**< format string like in printf() function */
198  ... /**< format arguments line in printf() function */
199  );
200 
201 /** add new solution */
202 extern
203 SCIP_RETCODE SCIPprobdataAddNewSol(
204  SCIP* scip, /**< SCIP data structure */
205  SCIP_Real* nval, /**< array [0..nvars], nval[v] = 1 if node v is in the solution, nval[v] = 0 if not */
206  SCIP_SOL* sol, /**< the new solution */
207  SCIP_HEUR* heur, /**< heuristic data */
208  SCIP_Bool* success /**< denotes whether the new solution has been successfully added */
209  );
210 
211 /** set dual bound by ug */
212 extern
214  SCIP* scip, /**< SCIP data structure */
215  SCIP_Real dual
216  );
217 
218 /** set the number of solvers */
219 extern
221  SCIP* scip, /**< SCIP data structure */
222  int nSolvers /**< the number of solvers */
223  );
224 
225 /** returns problem type */
226 extern
228  SCIP* scip /**< SCIP data structure */
229  );
230 
231 /** writes end of log file */
232 extern
233 SCIP_RETCODE SCIPprobdataWriteLogfileEnd(
234  SCIP* scip /**< SCIP data structure */
235  );
236 
237 #ifdef __cplusplus
238 }
239 #endif
240 
241 #endif
void SCIPprobdataSetOffset(SCIP_PROBDATA *probdata, SCIP_Real offset)
Definition: grph.h:55
SCIP_CONS ** SCIPprobdataGetEdgeConstraints(SCIP *scip)
SCIP_RETCODE SCIPprobdataWriteIntermediateSolution(SCIP *scip)
SCIP_VAR ** SCIPprobdataGetVars(SCIP *scip)
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)
int SCIPprobdataGetRoot(SCIP *scip)
void SCIPprobdataSetGraph(SCIP_PROBDATA *probdata, GRAPH *graph)
void SCIPprobdataSetDualBound(SCIP *scip, SCIP_Real dual)
includes various files containing graph methods used for Steiner problems
SCIP_VAR ** SCIPprobdataGetEdgeVars(SCIP *scip)
SCIP_VAR * SCIPprobdataGetedgeVarByIndex(SCIP *scip, int idx)
SCIP_Real * SCIPprobdataGetXval(SCIP *scip, SCIP_SOL *sol)
int SCIPprobdataGetNTerms(SCIP *scip)