class_stabilization.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-2018 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 
34 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
35 
36 #ifndef CLASS_STABILIZATION_H_
37 #define CLASS_STABILIZATION_H_
38 
39 #include "objscip/objscip.h"
40 #include "class_pricingtype.h"
41 
42 namespace gcg {
43 
45 {
46 private:
47  SCIP* scip_;
48  SCIP_Real* stabcenterconsvals;
49  int stabcenterconsvalssize;
50  int nstabcenterconsvals;
51  SCIP_Real* stabcentercutvals;
52  int stabcentercutvalssize;
53  int nstabcentercutvals;
54  SCIP_Real* stabcenterlinkingconsvals;
55  int nstabcenterlinkingconsvals;
56  SCIP_Real* stabcenterconv;
57  int nstabcenterconv;
58  SCIP_Real dualdiffnorm;
59  SCIP_Real* subgradientconsvals;
60  int subgradientconsvalssize;
61  int nsubgradientconsvals;
62  SCIP_Real* subgradientcutvals;
63  int subgradientcutvalssize;
64  int nsubgradientcutvals;
65  SCIP_Real* subgradientlinkingconsvals;
66  int nsubgradientlinkingconsvals;
67  SCIP_Real subgradientnorm;
68  SCIP_Real hybridfactor;
69  PricingType* pricingtype;
70  SCIP_Real alpha;
71  SCIP_Real alphabar;
72  SCIP_Bool hybridascent;
73  SCIP_Real beta;
74  SCIP_Longint nodenr;
75  int k;
76  int t;
77  SCIP_Bool hasstabilitycenter;
78  SCIP_Real stabcenterbound;
79  SCIP_Bool inmispricingschedule;
80  SCIP_Real subgradientproduct;
81 
82 public:
85  SCIP* scip,
86  PricingType* pricingtype,
87  SCIP_Bool hybridascent
88  );
90  Stabilization();
91 
93  virtual ~Stabilization();
94 
96  SCIP_RETCODE consGetDual(
97  int i,
98  SCIP_Real* dual
99  );
100 
102  SCIP_RETCODE rowGetDual(
103  int i,
104  SCIP_Real* dual
105  );
106 
108  SCIP_Real convGetDual(
109  int i
110  );
111 
113  SCIP_RETCODE updateStabilityCenter(
114  SCIP_Real lowerbound,
115  SCIP_Real* dualsolconv,
116  GCG_COL** pricingcols
117  );
118 
120  void updateAlphaMisprice();
121 
123  void updateAlpha();
124 
126  SCIP_Bool isStabilized();
127 
130  );
131 
134  );
135 
137  SCIP_Bool isInMispricingSchedule(
138  ) const;
139 
141  SCIP_RETCODE setLinkingConss(
142  SCIP_CONS** linkingconss,
143  int* linkingconsblock,
144  int nlinkingconss
145  );
146 
148  SCIP_RETCODE setNLinkingconsvals(
149  int nlinkingconssnew
150  );
151 
153  SCIP_RETCODE setNConvconsvals(
154  int nconvconssnew
155  );
156 
158  SCIP_Real linkingconsGetDual(
159  int i
160  );
161 
163  void updateNode();
164 
166  SCIP_RETCODE updateHybrid();
167 
169  SCIP_RETCODE updateSubgradientProduct(
170  GCG_COL** pricingcols
171  );
172 
173 private:
175  void updateIterationCount();
176 
178  void updateIterationCountMispricing();
179 
181  SCIP_RETCODE updateStabcenterconsvals();
182 
184  SCIP_RETCODE updateStabcentercutvals();
185 
187  SCIP_RETCODE updateSubgradientconsvals();
188 
190  SCIP_RETCODE updateSubgradientcutvals();
191 
193  void increaseAlpha();
194 
196  void decreaseAlpha();
197 
200  SCIP_Real calculateSubgradientProduct(
201  GCG_COL** pricingcols
202  );
203 
206  void calculateSubgradient(
207  GCG_COL** pricingcols
208  );
209 
211  void calculateDualdiffnorm();
212 
214  void calculateBeta();
215 
217  void calculateHybridFactor();
218 
220  SCIP_Real computeDual(
221  SCIP_Real center,
222  SCIP_Real current,
223  SCIP_Real subgradient,
224  SCIP_Real lhs,
225  SCIP_Real rhs
226  ) const;
227 };
228 
229 } /* namespace gcg */
230 #endif /* CLASS_STABILIZATION_H_ */
abstraction for SCIP pricing types
SCIP_RETCODE rowGetDual(int i, SCIP_Real *dual)
SCIP_RETCODE updateSubgradientProduct(GCG_COL **pricingcols)
SCIP_RETCODE setNLinkingconsvals(int nlinkingconssnew)
SCIP_Bool isInMispricingSchedule() const
SCIP_RETCODE updateStabilityCenter(SCIP_Real lowerbound, SCIP_Real *dualsolconv, GCG_COL **pricingcols)
struct GCG_Col GCG_COL
Definition: type_gcgcol.h:45
SCIP_RETCODE consGetDual(int i, SCIP_Real *dual)
SCIP_RETCODE setLinkingConss(SCIP_CONS **linkingconss, int *linkingconsblock, int nlinkingconss)
SCIP_RETCODE setNConvconsvals(int nconvconssnew)
SCIP_Real convGetDual(int i)
SCIP_Real linkingconsGetDual(int i)