Scippy

GCG

Branch-and-Price & Column Generation for Everyone

pub_colpool.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program */
4 /* GCG --- Generic Column Generation */
5 /* a Dantzig-Wolfe decomposition based extension */
6 /* of the branch-cut-and-price framework */
7 /* SCIP --- Solving Constraint Integer Programs */
8 /* */
9 /* Copyright (C) 2010-2021 Operations Research, RWTH Aachen University */
10 /* Zuse Institute Berlin (ZIB) */
11 /* */
12 /* This program is free software; you can redistribute it and/or */
13 /* modify it under the terms of the GNU Lesser General Public License */
14 /* as published by the Free Software Foundation; either version 3 */
15 /* of the License, or (at your option) any later version. */
16 /* */
17 /* This program is distributed in the hope that it will be useful, */
18 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
19 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
20 /* GNU Lesser General Public License for more details. */
21 /* */
22 /* You should have received a copy of the GNU Lesser General Public License */
23 /* along with this program; if not, write to the Free Software */
24 /* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.*/
25 /* */
26 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
27 
28 /**@file pub_colpool.h
29  * @ingroup PUBLICCOREAPI
30  * @brief public methods for storing cols in a col pool
31  * @author Tobias Achterberg
32  */
33 
34 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35 
36 #ifndef __SCIP_PUB_COLPOOL_H__
37 #define __SCIP_PUB_COLPOOL_H__
38 
39 
40 #include "scip/def.h"
41 #include "type_colpool.h"
42 #include "type_gcgcol.h"
43 #include "type_pricestore_gcg.h"
44 
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 /**
51  * @ingroup DATASTRUCTURES
52  * @{
53  */
54 
55 /** gets array of cols in the col pool */
56 SCIP_EXPORT
58  GCG_COLPOOL* colpool /**< col pool */
59  );
60 
61 /** get number of cols in the col pool */
62 SCIP_EXPORT
64  GCG_COLPOOL* colpool /**< col pool */
65  );
66 
67 /** get maximum number of cols that were stored in the col pool at the same time */
68 SCIP_EXPORT
70  GCG_COLPOOL* colpool /**< col pool */
71  );
72 
73 /** gets time in seconds used for pricing cols from the pool */
74 SCIP_EXPORT
75 SCIP_Real GCGcolpoolGetTime(
76  GCG_COLPOOL* colpool /**< col pool */
77  );
78 
79 /** get number of times, the col pool was separated */
80 SCIP_EXPORT
81 SCIP_Longint GCGcolpoolGetNCalls(
82  GCG_COLPOOL* colpool /**< col pool */
83  );
84 
85 /** get total number of cols that were priced from the col pool */
86 SCIP_EXPORT
87 SCIP_Longint GCGcolpoolGetNColsFound(
88  GCG_COLPOOL* colpool /**< col pool */
89  );
90 
91 /** creates col pool */
92 SCIP_EXPORT
93 SCIP_RETCODE GCGcolpoolCreate(
94  SCIP* scip, /**< SCIP data structure */
95  GCG_COLPOOL** colpool, /**< pointer to store col pool */
96  int agelimit /**< maximum age a col can reach before it is deleted from the pool */
97  );
98 
99 /** frees col pool */
100 SCIP_EXPORT
101 SCIP_RETCODE GCGcolpoolFree(
102  SCIP* scip, /**< SCIP data structure */
103  GCG_COLPOOL** colpool /**< pointer to store col pool */
104  );
105 
106 /** removes all cols from the col pool */
107 SCIP_EXPORT
108 SCIP_RETCODE GCGcolpoolClear(
109  GCG_COLPOOL* colpool /**< col pool */
110  );
111 
112 /** if not already existing, adds col to col pool and captures it */
113 SCIP_EXPORT
114 SCIP_RETCODE GCGcolpoolAddCol(
115  GCG_COLPOOL* colpool, /**< col pool */
116  GCG_COL* col, /**< column to add */
117  SCIP_Bool* success /**< pointer to store if col was added */
118  );
119 
120 /** adds col to col pool and captures it; doesn't check for multiple cols */
121 SCIP_EXPORT
122 SCIP_RETCODE GCGcolpoolAddNewCol(
123  GCG_COLPOOL* colpool, /**< col pool */
124  GCG_COL* col /**< column to add */
125  );
126 
127 /** removes the col from the col pool */
128 SCIP_EXPORT
129 SCIP_RETCODE GCGcolpoolDelCol(
130  GCG_COLPOOL* colpool, /**< col pool */
131  GCG_COL* col, /**< col to remove */
132  SCIP_Bool freecol /**< should the col be freed? */
133  );
134 
135 /** update node at which columns of column pool are feasible */
136 SCIP_EXPORT
137 SCIP_RETCODE GCGcolpoolUpdateNode(
138  GCG_COLPOOL* colpool /**< col pool */
139  );
140 
141 /** update reduced cost of columns in column pool */
142 SCIP_EXPORT
143 SCIP_RETCODE GCGcolpoolUpdateRedcost(
144  GCG_COLPOOL* colpool /**< col pool */
145  );
146 
147 /** gets number of cols in the col pool */
148 SCIP_EXPORT
150  GCG_COLPOOL* colpool /**< col pool */
151  );
152 
153 /** gets number of cols in the col pool */
154 SCIP_EXPORT
156  GCG_COLPOOL* colpool /**< col pool */
157  );
158 
159 /** prices cols of the col pool */
160 SCIP_EXPORT
161 SCIP_RETCODE GCGcolpoolPrice(
162  SCIP* scip, /**< SCIP data structure */
163  GCG_COLPOOL* colpool, /**< col pool */
164  GCG_PRICESTORE* pricestore, /**< GCG price storage */
165  SCIP_SOL* sol, /**< solution to be separated (or NULL for LP-solution) */
166  SCIP_Bool* foundvars /**< pointer to store the result of the separation call */
167  );
168 
169 /** @} */
170 
171 #ifdef __cplusplus
172 }
173 #endif
174 
175 #endif
SCIP_EXPORT SCIP_RETCODE GCGcolpoolCreate(SCIP *scip, GCG_COLPOOL **colpool, int agelimit)
Definition: colpool.c:159
SCIP_EXPORT SCIP_RETCODE GCGcolpoolAddCol(GCG_COLPOOL *colpool, GCG_COL *col, SCIP_Bool *success)
Definition: colpool.c:281
SCIP_EXPORT SCIP_Real GCGcolpoolGetTime(GCG_COLPOOL *colpool)
Definition: colpool.c:528
type definitions for gcg column data structure
SCIP_EXPORT GCG_COL ** GCGcolpoolGetCols(GCG_COLPOOL *colpool)
Definition: colpool.c:498
type definitions for storing priced cols
SCIP_EXPORT int GCGcolpoolGetNCols(GCG_COLPOOL *colpool)
Definition: colpool.c:508
SCIP_EXPORT SCIP_RETCODE GCGcolpoolPrice(SCIP *scip, GCG_COLPOOL *colpool, GCG_PRICESTORE *pricestore, SCIP_SOL *sol, SCIP_Bool *foundvars)
Definition: colpool.c:352
SCIP_EXPORT int GCGcolpoolGetMaxNCols(GCG_COLPOOL *colpool)
Definition: colpool.c:518
SCIP_EXPORT SCIP_RETCODE GCGcolpoolAddNewCol(GCG_COLPOOL *colpool, GCG_COL *col)
Definition: colpool.c:304
SCIP_EXPORT SCIP_RETCODE GCGcolpoolFree(SCIP *scip, GCG_COLPOOL **colpool)
Definition: colpool.c:195
SCIP_EXPORT SCIP_RETCODE GCGcolpoolClear(GCG_COLPOOL *colpool)
Definition: colpool.c:262
SCIP_EXPORT void GCGcolpoolStartFarkas(GCG_COLPOOL *colpool)
Definition: colpool.c:481
SCIP_EXPORT SCIP_RETCODE GCGcolpoolUpdateNode(GCG_COLPOOL *colpool)
Definition: colpool.c:429
SCIP_EXPORT SCIP_Longint GCGcolpoolGetNCalls(GCG_COLPOOL *colpool)
Definition: colpool.c:538
type definitions for storing cols in a col pool
SCIP_EXPORT SCIP_Longint GCGcolpoolGetNColsFound(GCG_COLPOOL *colpool)
Definition: colpool.c:548
SCIP_EXPORT SCIP_RETCODE GCGcolpoolUpdateRedcost(GCG_COLPOOL *colpool)
Definition: colpool.c:451
SCIP_EXPORT void GCGcolpoolEndFarkas(GCG_COLPOOL *colpool)
Definition: colpool.c:489
SCIP_EXPORT SCIP_RETCODE GCGcolpoolDelCol(GCG_COLPOOL *colpool, GCG_COL *col, SCIP_Bool freecol)
Definition: colpool.c:328