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-2021 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 "grph.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 
40 /** sets up the problem data */
42  SCIP* scip, /**< SCIP data structure */
43  const char* filename /**< file name */
44  );
45 
46 /** sets the probdata graph */
48  SCIP_PROBDATA* probdata, /**< problem data */
49  GRAPH* graph /**< graph data structure */
50  );
51 
52 /** returns the graph */
54  SCIP_PROBDATA* probdata /**< problem data */
55  );
56 
57 /** returns the graph */
59  SCIP* scip /**< SCIP data structure */
60  );
61 
62 /** sets the offset */
64  SCIP_PROBDATA* probdata, /**< problem data */
65  SCIP_Real offset /**< the offset value */
66  );
67 
68 
69 /** returns the array with all variables */
71  SCIP* scip /**< SCIP data structure */
72  );
73 
74 /** returns the array with all edge variables */
76  SCIP* scip /**< SCIP data structure */
77  );
78 
79 /** returns the array with all terminals (without the root) */
81  SCIP* scip /**< SCIP data structure */
82  );
83 
84 
85 /** returns the number of layers */
87  SCIP* scip /**< SCIP data structure */
88  );
89 
90 
91 /** returns the number of vars */
93  SCIP* scip /**< SCIP data structure */
94  );
95 
96 
97 /** returns the number of terminals */
99  SCIP* scip /**< SCIP data structure */
100  );
101 
102 /** returns the number of terminals without the root node */
104  SCIP* scip /**< SCIP data structure */
105  );
106 
107 /** returns root */
109  SCIP* scip /**< SCIP data structure */
110  );
111 
112 /** returns numer of original edges */
114  SCIP* scip /**< SCIP data structure */
115  );
116 
117 /** returns the number of edges */
119  SCIP* scip /**< SCIP data structure */
120  );
121 
122 /** returns the offset */
124  SCIP* scip /**< SCIP data structure */
125  );
126 
127 /** returns the edge variable for a given index */
129  SCIP* scip, /**< SCIP data structure */
130  int idx
131  );
132 
133 /** returns the LP solution values */
135  SCIP* scip, /**< SCIP data structure */
136  SCIP_SOL* sol
137  );
138 
139 /** returns all edge constraints */
141  SCIP* scip /**< SCIP data structure */
142  );
143 
144 /** returns all path constraints */
146  SCIP* scip /**< SCIP data structure */
147  );
148 
149 /** print (undirected) graph */
151  SCIP* scip, /**< SCIP data structure */
152  const char* filename, /**< Name of the output file */
153  SCIP_SOL* sol, /**< solution to be printed; or NULL for LP solution */
154  SCIP_Bool printsol /**< should solution be highlighted? */
155  );
156 
157 /** print graph (in undirected form) in GML format with given edges highlighted */
159  const GRAPH* graph, /**< Graph to be printed */
160  const char* filename, /**< Name of the output file */
161  SCIP_Bool* edgemark /**< Array of (undirected) edges to highlight */
162  );
163 
164 /** returns if 'T' model is being used */
166  SCIP* scip /**< SCIP data structure */
167  );
168 
169 /** writes the best solution to the intermediate solution file */
171  SCIP* scip /**< SCIP data structure */
172  );
173 
174 /** writes SPG (no variant!) to a file */
176  SCIP* scip, /**< SCIP data structure */
177  const GRAPH* graph, /**< graph data structure */
178  const char* filename /**< file name */
179  );
180 
181 /** writes the best solution to a file */
183  SCIP* scip, /**< SCIP data structure */
184  FILE* file /**< file to write best solution to; or NULL, to write to stdout */
185  );
186 
187 /** writes a line to the log file */
189  SCIP* scip, /**< SCIP data structure */
190  const char* formatstr, /**< format string like in printf() function */
191  ... /**< format arguments line in printf() function */
192  );
193 
194 /** add new solution */
196  SCIP* scip, /**< SCIP data structure */
197  SCIP_Real* nval, /**< array [0..nvars], nval[v] = 1 if node v is in the solution, nval[v] = 0 if not */
198  SCIP_SOL* sol, /**< the new solution */
199  SCIP_HEUR* heur, /**< heuristic data */
200  SCIP_Bool* success /**< denotes whether the new solution has been successfully added */
201  );
202 
203 /** set dual bound by ug */
205  SCIP* scip, /**< SCIP data structure */
206  SCIP_Real dual
207  );
208 
209 /** set the number of solvers */
211  SCIP* scip, /**< SCIP data structure */
212  int nSolvers /**< the number of solvers */
213  );
214 
215 /** returns problem type */
217  SCIP* scip /**< SCIP data structure */
218  );
219 
220 /** writes end of log file */
222  SCIP* scip /**< SCIP data structure */
223  );
224 
225 /** branching information from UG */
227  SCIP* scip, /**< SCIP data structure */
228  const int lLinearConsNames, /**< number of linear constraints */
229  const char* linearConsNames, /**< linear constraints string */
230  const int lSetppcConsNames, /**< number of setppc constraints */
231  const char* setppcConsNames /**< number of setppc constraints */
232  );
233 
234 #ifdef __cplusplus
235 }
236 #endif
237 
238 #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:54
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:70
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:163
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)