Dip-All  0.91.0
Decomp.h
Go to the documentation of this file.
1 //===========================================================================//
2 // This file is part of the DIP Solver Framework. //
3 // //
4 // DIP is distributed under the Eclipse Public License as part of the //
5 // COIN-OR repository (http://www.coin-or.org). //
6 // //
7 // Author: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) //
8 // //
9 // Conceptual Design: Matthew Galati, SAS Institute Inc. //
10 // Ted Ralphs, Lehigh University //
11 // //
12 // Copyright (C) 2002-2015, Lehigh University, Matthew Galati, Ted Ralphs //
13 // All Rights Reserved. //
14 //===========================================================================//
15 
16 //===========================================================================//
17 #ifndef Decomp_h_
18 #define Decomp_h_
19 
20 //===========================================================================//
21 // Standard Headers //
22 //===========================================================================//
23 //---
24 //--- include the necessary standard libs
25 //---
26 #include <cstdio>
27 #include <cassert>
28 #include <vector>
29 #include <list>
30 #include <iostream>
31 #include <fstream>
32 #include <iomanip>
33 #include <numeric>
34 #include <sstream>
35 #include <algorithm>
36 #include <functional>
37 #include <string>
38 #include <map>
39 #include <limits>
40 #include <cmath>
41 
42 #include "DecompConfig.h"
43 
44 //===========================================================================//
45 // DECOMP Enums, Constants and Typedefs //
46 //===========================================================================//
47 
48 //===========================================================================//
49 //---
50 //--- DECOMP typedefs
51 //---
52 class DecompVar;
53 class DecompCut;
54 typedef std::list<DecompVar*> DecompVarList;
55 typedef std::list<DecompCut*> DecompCutList;
56 
57 //===========================================================================//
58 //---
59 //--- DECOMP constants
60 //---
61 const double DecompBigNum = 1.0e21;
62 const double DecompEpsilon = 1.0e-6;
63 const double DecompZero = 1.0e-14;
64 
65 //===========================================================================//
66 //---
67 //--- DECOMP enums (for algorithms)
68 //---
69 
70 
72  bool doCut;
73  bool doPriceCut;
74  bool doDirect;
75  double timeSetupCpu ;
76  double timeSetupReal;
77  double timeSolveCpu ;
78  double timeSolveReal ;
79  double bestLB;
80  double bestUB;
81 };
82 
83 
84 
86  CUT,
91 };
92 const std::string DecompAlgoStr[5] = {
93  "CUT",
94  "PRICE_AND_CUT",
95  "RELAX_AND_CUT",
96  "VOL_AND_CUT",
97  "DECOMP"
98 };
99 
100 //---
101 //--- node stopping criteria
102 //---
111 };
112 const std::string DecompAlgoStopStr[7] = {
113  "DecompStopNo",
114  "DecompStopGap",
115  "DecompStopTailOff",
116  "DecompStopInfeasible",
117  "DecompStopBound",
118  "DecompStopTime",
119  "DecompStopIterLimit"
120 };
121 
122 
123 //===========================================================================//
124 //---
125 //--- DECOMP enums (for phases)
126 //---
133 };
134 const std::string DecompPhaseStr[6] = {
135  "PHASE_PRICE1",
136  "PHASE_PRICE2",
137  "PHASE_CUT",
138  "PHASE_DONE",
139  "PHASE_UNKNOWN"
140 };
141 
142 //===========================================================================//
143 //---
144 //--- DECOMP enums (for status)
145 //---
151 };
152 const std::string DecompStatusStr[3] = {
153  "STAT_FEASIBLE",
154  "STAT_INFEASIBLE",
155  "STAT_UNKNOWN"
156 };
157 
162 };
163 const std::string DecompPriceCutStrategyStr[3] = {
164  "Default",
165  "Favor Price",
166  "Favor Cut"
167 };
168 
169 //===========================================================================//
176 };
177 
178 //===========================================================================//
183 };
184 
189 };
190 
194 };
195 
196 //===========================================================================//
200 };
201 
207 };
208 
209 
210 
211 //===========================================================================//
213  //original row
215  //branching row
217  //convexity constraint
219  //row which is a cut
221 };
222 const std::string DecompRowTypeStr[4] = {
223  "DecompRow_Original",
224  "DecompRow_Branch",
225  "DecompRow_Convex",
226  "DecompRow_Cut"
227 };
228 
229 //===========================================================================//
230 //Corresponding to the class DecompVar
232  // points generated from bounded subproblem
234  // rays generated from unbounded subproblem
236 };
237 
238 
239 
240 //===========================================================================//
242  //structural column
244  //structural column (which should never be deleted)
246  //master-only column
248  //artifical column for original row (L for <=)
250  //artifical column for original row (G for >=)
252  //artifical column for branching row (L for <=)
254  //artifical column for branching row (G for >=)
256  //artifical column for convexity row (L for <=)
258  //artifical column for convexity row (G for >=)
260  //artifical column for cut (L for <=)
262  //artifical column for cutG(L for >=)
264  //marker used for deletion
266 };
267 const std::string DecompColTypeStr[12] = {
268  "DecompCol_Structural",
269  "DecompCol_Structural_NoDelete",
270  "DecompCol_MasterOnly",
271  "DecompCol_ArtForRowL",
272  "DecompCol_ArtForRowG",
273  "DecompCol_ArtForBranchL",
274  "DecompCol_ArtForBranchG",
275  "DecompCol_ArtForConvexL",
276  "DecompCol_ArtForConvexG",
277  "DecompCol_ArtForCutL",
278  "DecompCol_ArtForCutG",
279  "DecompCol_ToBeDeleted"
280 };
281 
285 };
286 /*
287 enum DecompNumericErrorType {
288 
289 
290 
291 };
292 */
293 
294 //===========================================================================//
295 // COIN Headers //
296 //===========================================================================//
297 //---
298 //--- include some standard COIN headers (depending on LP solver)
299 //--- depending on LP solver, set:
300 //--- OsiLp, OsiIp, and DecompInf
301 //---
302 #include "CoinError.hpp"
303 #include "CoinFinite.hpp"
304 #include "CoinPackedVector.hpp"
305 #include "CoinPackedMatrix.hpp"
306 
307 #ifdef __DECOMP_LP_CLP__
308 #include "OsiClpSolverInterface.hpp"
309 typedef OsiClpSolverInterface OsiLpSolverInterface;
310 const double DecompInf = OsiClpInfinity;
311 #endif
312 
313 #ifdef __DECOMP_LP_CPX__
314 #include "cplex.h"
315 #include "OsiCpxSolverInterface.hpp"
316 typedef OsiCpxSolverInterface OsiLpSolverInterface;
317 const double DecompInf = CPX_INFBOUND;
318 #endif
319 
320 #ifdef __DECOMP_IP_CBC__
321 #include "OsiCbcSolverInterface.hpp"
322 //confusing, since we use CbcModel/Main, we need OsiClp here
323 typedef OsiClpSolverInterface OsiIpSolverInterface;
324 //typedef OsiCbcSolverInterface OsiIpSolverInterface;
325 #endif
326 
327 #ifdef __DECOMP_IP_CPX__
328 #include "cplex.h"
329 #include "OsiCpxSolverInterface.hpp"
330 typedef OsiCpxSolverInterface OsiIpSolverInterface;
331 #endif
332 
333 #ifdef __DECOMP_IP_SYMPHONY__
334 #include "symphony.h"
335 #include "OsiSymSolverInterface.hpp"
336 typedef OsiSymSolverInterface OsiIpSolverInterface;
337 #endif
338 
339 
340 //---
341 //--- COIN vectors can do some extra checking if this is true,
342 //--- but, it is expensive, so turn off when in optimized mode
343 //---
344 #ifdef NDEBUG
345 #define DECOMP_TEST_DUPINDEX false
346 #else
347 #define DECOMP_TEST_DUPINDEX true
348 #endif
349 
350 #endif
const std::string DecompPhaseStr[6]
Definition: Decomp.h:134
DecompColType
Definition: Decomp.h:241
std::list< DecompCut * > DecompCutList
Definition: Decomp.h:55
DecompRoundRobin
Definition: Decomp.h:191
DecompPriceCutStrategy
Definition: Decomp.h:158
DecompVarType
Definition: Decomp.h:231
DecompStatus
Definition: Decomp.h:146
bool doDirect
Definition: Decomp.h:74
double timeSolveReal
Definition: Decomp.h:78
CPLEX Solver Interface.
static const double OsiClpInfinity
const std::string DecompAlgoStr[5]
Definition: Decomp.h:92
DecompAlgoStop
Definition: Decomp.h:103
DecompBranchingImplementation
Definition: Decomp.h:282
const std::string DecompStatusStr[3]
Definition: Decomp.h:152
const std::string DecompPriceCutStrategyStr[3]
Definition: Decomp.h:163
const double DecompZero
Definition: Decomp.h:63
const std::string DecompColTypeStr[12]
Definition: Decomp.h:267
const double DecompEpsilon
Definition: Decomp.h:62
Clp Solver Interface.
DecompAlgoType
Definition: Decomp.h:85
DecompFunction
Definition: Decomp.h:197
bool doCut
Definition: Decomp.h:72
DecompSubProbParallelType
Definition: Decomp.h:202
DecompGenericStatus
Definition: Decomp.h:179
Definition: Decomp.h:90
double timeSetupCpu
Definition: Decomp.h:75
double timeSetupReal
Definition: Decomp.h:76
double bestLB
Definition: Decomp.h:79
double bestUB
Definition: Decomp.h:80
const std::string DecompRowTypeStr[4]
Definition: Decomp.h:222
double timeSolveCpu
Definition: Decomp.h:77
bool doPriceCut
Definition: Decomp.h:73
DecompRowType
Definition: Decomp.h:212
const std::string DecompAlgoStopStr[7]
Definition: Decomp.h:112
DecompSolverStatus
Definition: Decomp.h:170
std::list< DecompVar * > DecompVarList
Definition: Decomp.h:53
DecompPhase
Definition: Decomp.h:127
DecompSolverType
Definition: Decomp.h:185
const double DecompBigNum
Definition: Decomp.h:61
Definition: Decomp.h:86