Scippy

GCG

Branch-and-Price & Column Generation for Everyone

pricestore_gcg.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 pricestore_gcg.h
29  * @brief methods for storing priced cols (based on SCIP's separation storage)
30  * @author Jonas Witt
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #ifndef __GCG_PRICESTORE_H__
36 #define __GCG_PRICESTORE_H__
37 
38 
39 #include "scip/def.h"
40 #include "blockmemshell/memory.h"
41 #include "scip/type_implics.h"
42 #include "scip/type_retcode.h"
43 #include "scip/type_set.h"
44 #include "scip/type_stat.h"
45 #include "scip/type_event.h"
46 #include "scip/type_lp.h"
47 #include "scip/type_prob.h"
48 #include "scip/type_tree.h"
49 #include "scip/type_reopt.h"
50 #include "scip/type_branch.h"
51 
52 #include "pub_colpool.h"
53 #include "pub_gcgcol.h"
54 #include "type_pricestore_gcg.h"
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 /** creates price storage */
61 extern
62 SCIP_RETCODE GCGpricestoreCreate(
63  SCIP* scip, /**< SCIP data structure */
64  GCG_PRICESTORE** pricestore, /**< pointer to store price storage */
65  SCIP_Real redcostfac, /**< factor of -redcost/norm in score function */
66  SCIP_Real objparalfac, /**< factor of objective parallelism in score function */
67  SCIP_Real orthofac, /**< factor of orthogonalities in score function */
68  SCIP_Real mincolorth, /**< minimal orthogonality of columns to add
69  (with respect to columns added in the current round) */
70  GCG_EFFICIACYCHOICE efficiacychoice /**< choice to base efficiacy on */
71  );
72 
73 /** frees price storage */
74 extern
75 SCIP_RETCODE GCGpricestoreFree(
76  SCIP* scip, /**< SCIP data structure */
77  GCG_PRICESTORE** pricestore /**< pointer to store price storage */
78  );
79 
80 /** informs price storage, that Farkas pricing starts now */
81 extern
83  GCG_PRICESTORE* pricestore /**< price storage */
84  );
85 
86 /** informs price storage, that Farkas pricing is now finished */
87 extern
89  GCG_PRICESTORE* pricestore /**< price storage */
90  );
91 
92 /** informs price storage, that the following cols should be used in any case */
93 extern
95  GCG_PRICESTORE* pricestore /**< price storage */
96  );
97 
98 /** informs price storage, that the following cols should no longer be used in any case */
99 extern
101  GCG_PRICESTORE* pricestore /**< price storage */
102  );
103 
104 /** adds col to price storage;
105  * if the col should be forced to enter the LP, an infinite score has to be used
106  */
107 extern
108 SCIP_RETCODE GCGpricestoreAddCol(
109  SCIP* scip, /**< SCIP data structure */
110  GCG_PRICESTORE* pricestore, /**< price storage */
111  GCG_COL* col, /**< priced col */
112  SCIP_Bool forcecol /**< should the col be forced to enter the LP? */
113  );
114 
115 /** adds cols to priced vars and clears price storage */
116 extern
117 SCIP_RETCODE GCGpricestoreApplyCols(
118  GCG_PRICESTORE* pricestore, /**< price storage */
119  GCG_COLPOOL* colpool, /**< GCG column pool */
120  SCIP_Bool usecolpool, /**< use column pool? */
121  int* nfoundvars /**< pointer to store number of variables that were added to the problem */
122  );
123 
124 /** clears the price storage without adding the cols to priced vars */
125 extern
127  GCG_PRICESTORE* pricestore /**< price storage */
128  );
129 
130 /** removes cols that are inefficacious w.r.t. the current LP solution from price storage without adding the cols to the LP */
131 extern
133  GCG_PRICESTORE* pricestore /**< price storage */
134  );
135 
136 /** get cols in the price storage */
137 extern
139  GCG_PRICESTORE* pricestore /**< price storage */
140  );
141 
142 /** get number of cols in the price storage */
143 extern
145  GCG_PRICESTORE* pricestore /**< price storage */
146  );
147 
148 /** get number of efficacious cols in the price storage */
149 extern
151  GCG_PRICESTORE* pricestore /**< price storage */
152  );
153 
154 /** get total number of cols found so far */
155 extern
157  GCG_PRICESTORE* pricestore /**< price storage */
158  );
159 
160 /** get number of cols found so far in current price round */
161 extern
163  GCG_PRICESTORE* pricestore /**< price storage */
164  );
165 
166 /** get total number of cols applied to the LPs */
167 extern
169  GCG_PRICESTORE* pricestore /**< price storage */
170  );
171 
172 /** gets time in seconds used for pricing cols from the pricestore */
173 extern
174 SCIP_Real GCGpricestoreGetTime(
175  GCG_PRICESTORE* pricestore /**< price storage */
176  );
177 
178 #ifdef __cplusplus
179 }
180 #endif
181 
182 #endif
enum GCG_Efficiacychoice GCG_EFFICIACYCHOICE
int GCGpricestoreGetNCols(GCG_PRICESTORE *pricestore)
int GCGpricestoreGetNColsApplied(GCG_PRICESTORE *pricestore)
void GCGpricestoreStartFarkas(GCG_PRICESTORE *pricestore)
type definitions for storing priced cols
void GCGpricestoreEndForceCols(GCG_PRICESTORE *pricestore)
public methods for working with gcg columns
int GCGpricestoreGetNColsFound(GCG_PRICESTORE *pricestore)
int GCGpricestoreGetNColsFoundRound(GCG_PRICESTORE *pricestore)
SCIP_RETCODE GCGpricestoreApplyCols(GCG_PRICESTORE *pricestore, GCG_COLPOOL *colpool, SCIP_Bool usecolpool, int *nfoundvars)
int GCGpricestoreGetNEfficaciousCols(GCG_PRICESTORE *pricestore)
public methods for storing cols in a col pool
SCIP_RETCODE GCGpricestoreFree(SCIP *scip, GCG_PRICESTORE **pricestore)
void GCGpricestoreRemoveInefficaciousCols(GCG_PRICESTORE *pricestore)
void GCGpricestoreEndFarkas(GCG_PRICESTORE *pricestore)
SCIP_Real GCGpricestoreGetTime(GCG_PRICESTORE *pricestore)
void GCGpricestoreClearCols(GCG_PRICESTORE *pricestore)
SCIP_RETCODE GCGpricestoreCreate(SCIP *scip, GCG_PRICESTORE **pricestore, SCIP_Real redcostfac, SCIP_Real objparalfac, SCIP_Real orthofac, SCIP_Real mincolorth, GCG_EFFICIACYCHOICE efficiacychoice)
GCG_COL ** GCGpricestoreGetCols(GCG_PRICESTORE *pricestore)
SCIP_RETCODE GCGpricestoreAddCol(SCIP *scip, GCG_PRICESTORE *pricestore, GCG_COL *col, SCIP_Bool forcecol)
void GCGpricestoreStartForceCols(GCG_PRICESTORE *pricestore)