Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

master.h
Go to the documentation of this file.
1 
30 #pragma once
31 
32 #include <ogdf/lib/abacus/global.h>
34 
35 #include <ogdf/lib/abacus/hash.h>
36 #include <ogdf/basic/Stopwatch.h>
37 
38 
39 class OsiSolverInterface;
40 
41 namespace abacus {
42 
43 
44 class Sub;
45 class BranchRule;
46 class Variable;
47 class Constraint;
48 
49 class History;
50 class OpenSub;
51 class FixCand;
52 class LpMasterOsi;
53 
54 template<class BaseType, class CoType> class StandardPool;
55 
56 
58 
70 
71  friend class Sub;
72  friend class FixCand;
73 
74 public:
75 
77  enum STATUS {
78  Optimal,
85  Guaranteed,
91  ExceptionFathom
93  };
94 
96 
99  static const char* STATUS_[];
100 
101 
103  enum ENUMSTRAT {
104  BestFirst,
109  DiveAndBest
111  };
112 
114 
117  static const char *ENUMSTRAT_[];
118 
122  CloseHalfExpensive
124  };
125 
127 
130  static const char *BRANCHINGSTRAT_[];
131 
133 
139  NoPrimalBound,
142  OptimumOne
144  };
145 
147 
150  static const char* PRIMALBOUNDMODE_[];
151 
154  SkipByNode,
156  SkipByLevel
157  };
158 
160 
163  static const char* SKIPPINGMODE_[];
164 
166  enum CONELIMMODE {
169  Basic
170  };
171 
172 
174 
177  static const char* CONELIMMODE_[];
178 
180  enum VARELIMMODE {
182  ReducedCost
183  };
184 
186 
189  static const char* VARELIMMODE_[];
190 
192  enum VBCMODE {
195  Pipe
196  };
197 
199 
202  static const char* VBCMODE_[];
203 
204 
206 
209  enum OSISOLVER { Cbc, Clp, CPLEX, DyLP, FortMP, GLPK, MOSEK, OSL, SoPlex, SYMPHONY, XPRESS_MP, Gurobi, Csdp };
210 
212  static const char* OSISOLVER_[];
213 
215 
239  Master(const char *problemName, bool cutting, bool pricing,
241  double eps = 1.0e-4, double machineEps = 1.0e-7,
242  double infinity = 1.0e30,
243  bool readParamFromFile = false);
244 
246  virtual ~Master();
247 
249 
252  STATUS optimize();
253 
266 
268  double lowerBound() const;
269 
271  double upperBound() const;
272 
274 
278  double primalBound() const { return primalBound_; }
279 
281 
286  void primalBound(double x);
287 
289 
293  double dualBound() const { return dualBound_; }
294 
296 
301  void dualBound(double x);
302 
304 
307  bool betterDual(double x) const;
308 
310 
318  bool primalViolated(double x) const;
319 
321 
326  bool betterPrimal(double x) const;
327 
329  double rootDualBound() const { return rootDualBound_; }
330 
332  /***
333  * This function is only correct if any primal bound better than plus/minus infinity corresponds
334  * to a feasible solution.
335  *
336  * \return true If a feasible solution of the optimization problem has been found, false otherwise.
337  */
338  bool feasibleFound() const;
340 
342  ENUMSTRAT enumerationStrategy() const { return enumerationStrategy_; }
343 
345 
348  void enumerationStrategy(ENUMSTRAT strat) { enumerationStrategy_ = strat; }
349 
363  virtual int enumerationStrategy(const Sub *s1, const Sub *s2);
364 
366 
379  bool guaranteed() const;
380 
382 
388  double guarantee() const;
389 
391 
395  void printGuarantee() const;
396 
398 
406  bool check() const;
407 
420  bool knownOptimum(double &optVal) const;
421 
423  virtual void output() const { }
424 
431  bool cutting() const { return cutting_; }
432 
439  bool pricing() const { return pricing_; }
440 
442  const OptSense *optSense() const { return &optSense_; }
443 
445  History *history() const { return history_; }
446 
448  OpenSub *openSub() const { return openSub_; }
449 
451  StandardPool<Constraint, Variable> *conPool() const { return conPool_; }
452 
454  StandardPool<Constraint, Variable> *cutPool() const { return cutPool_; }
455 
457  StandardPool<Variable, Constraint> *varPool() const { return varPool_; }
458 
460 
463  Sub *root() const { return root_; }
464 
470  Sub *rRoot() const { return rRoot_; }
471 
473  STATUS status() const { return status_; }
474 
476  const string &problemName() const { return problemName_; }
477 
479  const ogdf::StopwatchWallClock *totalCowTime() const { return &totalCowTime_; }
480 
482  inline bool solveApprox() const { return solveApprox_; }
483 
485  const ogdf::StopwatchCPU *totalTime() const { return &totalTime_; }
486 
488  const ogdf::StopwatchCPU *lpTime() const { return &lpTime_; }
489 
491  const ogdf::StopwatchCPU *lpSolverTime() const { return &lpSolverTime_; }
492 
494  const ogdf::StopwatchCPU *separationTime() const { return &separationTime_; }
495 
497  const ogdf::StopwatchCPU *improveTime() const { return &improveTime_; }
498 
500  const ogdf::StopwatchCPU *pricingTime() const { return &pricingTime_; }
501 
503  const ogdf::StopwatchCPU *branchingTime() const { return &branchingTime_; }
504 
506  int nSub() const { return nSub_; }
507 
509  int nLp() const { return nLp_; }
510 
512  int highestLevel() const { return highestLevel_; }
513 
515  int nNewRoot() const { return nNewRoot_; }
516 
518  int nSubSelected() const { return nSubSelected_; }
519 
521  void printParameters() const;
522 
524  BRANCHINGSTRAT branchingStrategy() const { return branchingStrategy_; }
525 
527 
530  void branchingStrategy(BRANCHINGSTRAT strat) { branchingStrategy_ = strat; }
531 
533  OSISOLVER defaultLpSolver() const { return defaultLpSolver_; }
534 
536 
539  void defaultLpSolver(OSISOLVER osiSolver) { defaultLpSolver_ = osiSolver; }
540 
541  LpMasterOsi *lpMasterOsi() const { return lpMasterOsi_; }
542 
544  int nBranchingVariableCandidates() const { return nBranchingVariableCandidates_; }
545 
547 
551  void nBranchingVariableCandidates(int n);
552 
554  int nStrongBranchingIterations() const { return nStrongBranchingIterations_; }
555 
557 
560  void nStrongBranchingIterations(int n);
561 
563  double requiredGuarantee() const { return requiredGuarantee_; }
564 
566 
573  void requiredGuarantee(double g);
574 
576 
579  int maxLevel() const { return maxLevel_; }
580 
582 
587  void maxLevel(int ml);
588 
590 
593  int maxNSub() const { return maxNSub_; }
594 
596 
601  void maxNSub(int ml);
602 
604  int64_t maxCpuTime() const { return maxCpuTime_; }
605 
607  string maxCpuTimeAsString() const;
608 
610 
613  void maxCpuTime(const string &t);
614 
616  void maxCpuTime(int64_t seconds) { maxCpuTime_ = seconds; }
617 
619  void maxCpuTime(int hour, int min, int sec);
620 
622  int64_t maxCowTime() const { return maxCowTime_; }
623 
625  string maxCowTimeAsString() const;
626 
628  void maxCowTime(int64_t seconds) { maxCowTime_ = seconds; }
629 
631 
634  void maxCowTime(const string &t);
635 
637  bool objInteger() const { return objInteger_; }
638 
640 
643  void objInteger(bool b) { objInteger_ = b; }
644 
646  int tailOffNLp() const { return tailOffNLp_; }
647 
649 
655  void tailOffNLp(int n) { tailOffNLp_ = n; }
656 
658  double tailOffPercent() const { return tailOffPercent_; }
659 
661 
667  void tailOffPercent(double p);
668 
670 
673  bool delayedBranching(int nOpt) const;
674 
676 
687  void dbThreshold(int threshold) { dbThreshold_ = threshold; }
688 
690 
693  int dbThreshold() const { return dbThreshold_; }
694 
696 
700  int minDormantRounds() const { return minDormantRounds_; }
701 
703 
706  void minDormantRounds(int nRounds) { minDormantRounds_ = nRounds; }
707 
709  PRIMALBOUNDMODE pbMode() const { return pbMode_; }
710 
712 
715  void pbMode(PRIMALBOUNDMODE mode) { pbMode_ = mode; }
716 
718 
725  int pricingFreq() const { return pricingFreq_; }
726 
728 
731  void pricingFreq(int f);
732 
734  int skipFactor() const { return skipFactor_; }
735 
737 
740  void skipFactor(int f);
741 
743 
746  void skippingMode(SKIPPINGMODE mode) { skippingMode_ = mode; }
747 
749  SKIPPINGMODE skippingMode() const { return skippingMode_; }
750 
752  CONELIMMODE conElimMode() const { return conElimMode_; }
753 
755 
758  void conElimMode(CONELIMMODE mode) { conElimMode_ = mode; }
759 
761  VARELIMMODE varElimMode() const { return varElimMode_; }
762 
764 
767  void varElimMode(VARELIMMODE mode) { varElimMode_ = mode; }
768 
770  double conElimEps() const { return conElimEps_; }
771 
773 
776  void conElimEps(double eps) { conElimEps_ = eps; }
777 
779  double varElimEps() const { return varElimEps_; }
780 
782 
785  void varElimEps(double eps) { varElimEps_ = eps; }
786 
788  int varElimAge() const { return varElimAge_; }
789 
791 
794  void varElimAge(int age) { varElimAge_ = age; }
795 
797  int conElimAge() const { return conElimAge_; }
798 
800 
803  void conElimAge(int age) { conElimAge_ = age; }
804 
809  bool fixSetByRedCost() const { return fixSetByRedCost_; }
810 
812 
816  void fixSetByRedCost(bool on) { fixSetByRedCost_ = on; }
817 
822  bool printLP() const { return printLP_; }
823 
825 
829  void printLP(bool on) { printLP_ = on; }
830 
832  int maxConAdd() const { return maxConAdd_; }
833 
835  /***
836  * \param max The maximal number of constraints.
837  */
838  void maxConAdd(int max) { maxConAdd_ = max; }
839 
841  int maxConBuffered() const { return maxConBuffered_; }
842 
844 
850  void maxConBuffered(int max) { maxConBuffered_ = max; }
851 
853  int maxVarAdd() const { return maxVarAdd_; }
854 
856 
859  void maxVarAdd(int max) { maxVarAdd_ = max; }
860 
862  int maxVarBuffered() const { return maxVarBuffered_; }
863 
865 
871  void maxVarBuffered(int max) { maxVarBuffered_ = max; }
872 
874  int maxIterations() const { return maxIterations_; }
875 
877 
886  void maxIterations(int max) { maxIterations_ = max; }
887 
892  bool eliminateFixedSet() const { return eliminateFixedSet_; }
893 
895 
899  void eliminateFixedSet(bool turnOn) { eliminateFixedSet_ = turnOn; }
900 
906  bool newRootReOptimize() const { return newRootReOptimize_; }
907 
909 
912  void newRootReOptimize(bool on) { newRootReOptimize_ = on; }
913 
915  const string &optimumFileName() const { return optimumFileName_; }
916 
918 
921  void optimumFileName(const char *name) { optimumFileName_ = name; }
922 
929  bool showAverageCutDistance() const { return showAverageCutDistance_; }
930 
932 
935  void showAverageCutDistance(bool on) { showAverageCutDistance_ = on; }
936 
938  VBCMODE vbcLog() const { return VbcLog_; }
939 
941 
947  void vbcLog(VBCMODE mode) { VbcLog_ = mode; }
948 
950 
955  virtual bool setSolverParameters(OsiSolverInterface* interface, bool solverIsApprox);
956 
957 protected:
958 
960 
978  virtual void initializePools(
979  ArrayBuffer<Constraint*> &constraints,
980  ArrayBuffer<Variable*> &variables,
981  int varPoolSize,
982  int cutPoolSize,
983  bool dynamicCutPool = false);
984 
986 
1008  virtual void initializePools(
1009  ArrayBuffer<Constraint*> &constraints,
1011  ArrayBuffer<Variable*> &variables,
1012  int varPoolSize,
1013  int cutPoolSize,
1014  bool dynamicCutPool = false);
1015 
1023  void initializeOptSense(OptSense::SENSE sense) { optSense_.sense(sense); }
1024 
1026 
1039  int bestFirstSearch(const Sub* s1, const Sub* s2) const;
1040 
1066  virtual int equalSubCompare(const Sub *s1, const Sub *s2) const;
1067 
1069 
1080  int depthFirstSearch(const Sub* s1, const Sub* s2) const;
1081 
1083 
1095  int breadthFirstSearch(const Sub* s1, const Sub* s2) const;
1096 
1097 
1099 
1107  int diveAndBestFirstSearch(const Sub *s1, const Sub* s2) const;
1108 
1114  virtual void initializeParameters() { }
1115 
1117 
1122  virtual Sub *firstSub() = 0;
1123 
1130  virtual void initializeOptimization() { }
1131 
1138  virtual void terminateOptimization() { }
1139 
1141  virtual void assignParameters();
1142 
1143 private:
1144 
1146 
1163  void _initializeParameters();
1164 
1165  void _createLpMasters();
1166  void _deleteLpMasters();
1167  void _initializeLpParameters();
1168 
1170 
1173  void _setDefaultLpParameters();
1174 
1176 
1179  void _printLpParameters() const;
1180 
1182 
1185  void _outputLpStatistics() const;
1186 
1188 
1194  Sub *select();
1195 
1196  int initLP();
1197 
1199 
1205  void writeTreeInterface(const string &info, bool time = true) const;
1206 
1212  void treeInterfaceNewNode(Sub *sub) const;
1213 
1215  void treeInterfacePaintNode(int id, int color) const;
1216 
1218  void treeInterfaceLowerBound(double lb) const;
1219 
1221  void treeInterfaceUpperBound(double ub) const;
1222 
1224  void treeInterfaceNodeBounds(int id, double lb, double ub);
1225 
1227 
1230  void newSub(int level);
1231 
1233  void countLp() { ++nLp_; }
1234 
1236  void newFixed(int n) { nFixed_ += n; }
1237 
1239  void addCons(int n) { nAddCons_ += n; }
1240 
1242  void removeCons(int n) { nRemCons_ += n; }
1243 
1245  void addVars(int n) { nAddVars_ += n; }
1246 
1248  void removeVars(int n) { nRemVars_ += n; }
1249 
1251  FixCand *fixCand() const { return fixCand_; }
1252 
1254 
1261  void rRoot(Sub *newRoot, bool reoptimize);
1262 
1264  void status(STATUS stat) { status_ = stat; }
1265 
1267 
1270  void rootDualBound(double x);
1271 
1272  void theFuture();
1273 
1276 
1278 
1281 
1284 
1287 
1290 
1293 
1296 
1299 
1302 
1305 
1308 
1310 
1313 
1314 
1317 
1320 
1323 
1325  double dualBound_;
1326 
1329 
1332 
1334  bool cutting_;
1335 
1337  bool pricing_;
1338 
1341 
1344 
1347 
1349  std::ostream *treeStream_;
1350 
1352 
1356 
1358 
1362 
1364 
1368 
1370  int64_t maxCpuTime_;
1371 
1373  int64_t maxCowTime_;
1374 
1377 
1380 
1383 
1386 
1393 
1396 
1399 
1402 
1408 
1411 
1413  bool printLP_;
1414 
1417 
1420 
1423 
1426 
1429 
1432 
1438 
1441 
1447 
1450 
1453 
1455  double conElimEps_;
1456 
1458  double varElimEps_;
1459 
1462 
1465 
1468 
1471 
1474 
1477 
1479 
1482 
1485 
1488 
1491 
1493  int nSub_;
1494 
1496  int nLp_;
1497 
1500 
1502  int nFixed_;
1503 
1506 
1509 
1512 
1515 
1518 
1519  Master(const Master &rhs);
1520  const Master &operator=(const Master& rhs);
1521 };
1522 
1523 
1524 inline double Master::lowerBound() const
1525 {
1526  if (optSense_.max()) return primalBound_;
1527  else return dualBound_;
1528 }
1529 
1530 inline double Master::upperBound() const
1531 {
1532  if (optSense_.max()) return dualBound_;
1533  else return primalBound_;
1534 }
1535 
1536 }
void removeCons(int n)
Increments the counter for the total number of removed constraints by n.
Definition: master.h:1242
const ogdf::StopwatchCPU * lpSolverTime() const
Return a pointer to the timer measuring the cpu time required by the LP solver.
Definition: master.h:491
LpMasterOsi * lpMasterOsi() const
Definition: master.h:541
const ogdf::StopwatchWallClock * totalCowTime() const
Returns a pointer to the timer measuring the total wall clock time.
Definition: master.h:479
double primalBound() const
Returns the value of the primal bound.
Definition: master.h:278
void maxIterations(int max)
Changes the default value for the maximal number of iterations of the optimization of a subproblem...
Definition: master.h:886
void varElimAge(int age)
Changes the age for the elimination of variables by the reduced cost criterion to age...
Definition: master.h:794
int dbThreshold_
The number of optimizations of an Sub until branching is performed.
Definition: master.h:1385
virtual void terminateOptimization()
The default implementation of terminateOptimization() does nothing.
Definition: master.h:1138
int nNewRoot() const
Returns the number of root changes of the remaining branch-and-cut tree.
Definition: master.h:515
void varElimMode(VARELIMMODE mode)
Changes the variable elimination mode to mode.
Definition: master.h:767
int minDormantRounds() const
Returns the maximal number of rounds, i.e., number of subproblem optimizations, a subproblem is dorma...
Definition: master.h:700
Solution histories.
Definition: history.h:43
int nAddVars_
The total number of added variables.
Definition: master.h:1511
double primalBound_
The best known primal bound.
Definition: master.h:1322
std::ostream * treeStream_
A pointer to the log stream for the VBC-Tool.
Definition: master.h:1349
Global data and functions.
Definition: global.h:57
int pricingFreq() const
Returns the number of linear programs being solved between two additional pricing steps...
Definition: master.h:725
PRIMALBOUNDMODE pbMode() const
Returns the mode of the primal bound initialization.
Definition: master.h:709
OptSense optSense_
The sense of the objective function.
Definition: master.h:1280
const string & problemName() const
Returns the name of the instance being optimized (as specified in the constructor of this class)...
Definition: master.h:476
void minDormantRounds(int nRounds)
Sets the number of rounds a subproblem should stay dormant to nRounds.
Definition: master.h:706
bool newRootReOptimize_
If true, then an already earlier processed node is reoptimized if it becomes the new root of the rema...
Definition: master.h:1437
The master of the optimization.
Definition: master.h:69
int64_t maxCpuTime_
The maximal available cpu time.
Definition: master.h:1370
void varElimEps(double eps)
Changes the tolerance for the elimination of variables by the reduced cost criterion to eps...
Definition: master.h:785
int maxVarAdd() const
Returns the maximal number of variables which should be added in the column generation algorithm...
Definition: master.h:853
void printLP(bool on)
Turns the output of the linear program in every iteration on or off.
Definition: master.h:829
ogdf::StopwatchCPU branchingTime_
The timer for the cpu time spent in determining the branching rules.
Definition: master.h:1490
void conElimEps(double eps)
Changes the tolerance for the elimination of constraints by the slack criterion to eps...
Definition: master.h:776
void initializeOptSense(OptSense::SENSE sense)
Can be used to initialize the sense of the optimization in derived classes, if this has not been alre...
Definition: master.h:1023
int maxVarBuffered_
The size of the buffer for generated variables.
Definition: master.h:1425
int nBranchingVariableCandidates_
The number of candidates that are evaluated for branching on variables.
Definition: master.h:1301
Selects the variable with fractional part closest to 0.5.
Definition: master.h:121
FixCand * fixCand() const
Returns a pointer to the object storing the variables which are candidates for being fixed...
Definition: master.h:1251
bool cutting() const
Definition: master.h:431
StandardPool< Constraint, Variable > * cutPool() const
Returns a pointer to the default pool for the generated cutting planes.
Definition: master.h:454
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
void countLp()
Increments the counter for linear programs and should be called in each optimization call of the LP-r...
Definition: master.h:1233
bool showAverageCutDistance_
If true then the average distance of the added cutting planes is output every iteration of the cuttin...
Definition: master.h:1446
VBCMODE
This enumeration defines what kind of output can be generated for the VBCTOOL.
Definition: master.h:192
Declaration of stopwatch classes.
int nSub() const
returns the number of generated subproblems.
Definition: master.h:506
ogdf::StopwatchCPU lpSolverTime_
Definition: master.h:1478
void eliminateFixedSet(bool turnOn)
Turns the elimination of fixed and set variables on or off.
Definition: master.h:899
void maxCowTime(int64_t seconds)
Sets the maximally allowed wall-clock time to seconds.
Definition: master.h:628
Breadth-first search, i.e., select the subproblem with minimal level in the enumeration tree...
Definition: master.h:107
int highestLevel() const
Returns the highest level in the tree which has been reached during the implicit enumeration.
Definition: master.h:512
int maxVarBuffered() const
Returns the size of the buffer for the variables generated in the column generation algorithm...
Definition: master.h:862
double requiredGuarantee() const
The guarantee specification for the optimization.
Definition: master.h:563
BRANCHINGSTRAT branchingStrategy() const
Returns the branching strategy.
Definition: master.h:524
StandardPool< Constraint, Variable > * conPool() const
Returns a pointer to the default pool storing the constraints of the problem formulation.
Definition: master.h:451
bool newRootReOptimize() const
Definition: master.h:906
int nBranchingVariableCandidates() const
Returns the number of variables that should be tested for the selection of the branching variable...
Definition: master.h:544
bool pricing() const
Definition: master.h:439
StandardPool< Variable, Constraint > * varPool_
The default pool with the variables of the problem formulation.
Definition: master.h:1319
SKIPPINGMODE skippingMode() const
Returns the skipping strategy.
Definition: master.h:749
virtual void initializeParameters()
Is only a dummy.
Definition: master.h:1114
int nRemCons_
The total number of removed constraints.
Definition: master.h:1508
BRANCHINGSTRAT branchingStrategy_
The branching strategy.
Definition: master.h:1298
PRIMALBOUNDMODE pbMode_
The mode of the primal bound initialization.
Definition: master.h:1395
The primal bound is initialized with the value of the optimum solution.
Definition: master.h:141
double rootDualBound_
The best known dual bound at the end of the optimization of the root node.
Definition: master.h:1328
StandardPool< Variable, Constraint > * varPool() const
Returns a pointer to the default pool storing the variables.
Definition: master.h:457
const ogdf::StopwatchCPU * improveTime() const
Returns a pointer to the timer measuring the cpu time spent in the heuristics for the computation of ...
Definition: master.h:497
double varElimEps_
The tolerance for the elimination of variables by the mode ReducedCost.
Definition: master.h:1458
OSISOLVER defaultLpSolver() const
returns the Lp Solver.
Definition: master.h:533
The subproblem.
Definition: sub.h:68
void maxConAdd(int max)
Sets the maximal number of constraints that are added in an iteration of the cutting plane algorithm...
Definition: master.h:838
const string & optimumFileName() const
Returns the name of the file that stores the optimum solutions.
Definition: master.h:915
int conElimAge() const
Returns the age for the elimination of constraints.
Definition: master.h:797
hash table.
SKIPPINGMODE
The way nodes are skipped for the generation of cuts.
Definition: master.h:153
An array that keeps track of the number of inserted elements; also usable as an efficient stack...
Definition: Array.h:45
void conElimMode(CONELIMMODE mode)
Changes the constraint elimination mode to mode.
Definition: master.h:758
Output for the tree interface is written to a file.
Definition: master.h:194
CONELIMMODE conElimMode_
The way constraints are automatically eliminated in the cutting plane algorithm.
Definition: master.h:1449
int tailOffNLp() const
Returns the number of linear programs considered in the tailing off analysis.
Definition: master.h:646
double rootDualBound() const
Returns the dual bound at the root node.
Definition: master.h:329
Nonbinding constraints are eliminated.
Definition: master.h:168
global.
void pbMode(PRIMALBOUNDMODE mode)
Sets the mode of the primal bound initialization to mode.
Definition: master.h:715
int maxLevel_
The maximal level in enumeration tree.
Definition: master.h:1361
void maxConBuffered(int max)
Changes the maximal number of constraints that are buffered in an iteration of the cutting plane algo...
Definition: master.h:850
int conElimAge_
The number of iterations an elimination criterion must be satisfied until a constraint can be removed...
Definition: master.h:1461
void tailOffNLp(int n)
Sets the number of linear programs considered in the tailing off analysis to n.
Definition: master.h:655
No constraints are eliminated.
Definition: master.h:167
ogdf::StopwatchCPU pricingTime_
The timer for the cpu time spent in pricing.
Definition: master.h:1487
int nSub_
The number of generated subproblems.
Definition: master.h:1493
bool readParamFromFile_
Definition: master.h:1277
An error occurred during the optimization process.
Definition: master.h:81
bool objInteger() const
If true then we assume that all feasible solutions have integral objective function values...
Definition: master.h:637
double dualBound_
The best known dual bound.
Definition: master.h:1325
History * history_
The solution history.
Definition: master.h:1292
void vbcLog(VBCMODE mode)
Changes the mode of output for the Vbc-Tool to mode.
Definition: master.h:947
int nLp_
The number of solved LPs.
Definition: master.h:1496
OpenSub * openSub() const
Returns a pointer to the set of open subproblems.
Definition: master.h:448
const OptSense * optSense() const
Returns a pointer to the object holding the optimization sense of the problem.
Definition: master.h:442
bool printLP() const
Definition: master.h:822
Depth-first search, i.e., select the subproblem with maximal level in the enumeration tree...
Definition: master.h:108
sense of optimization.
int maxLevel() const
Returns the maximal depth up to which the enumeration should be performed.
Definition: master.h:579
CONELIMMODE
This enumeration defines the ways for automatic constraint elimination during the cutting plane phase...
Definition: master.h:166
bool showAverageCutDistance() const
Definition: master.h:929
bool cutting_
If true, then constraints are generated in the optimization.
Definition: master.h:1334
OpenSub * openSub_
The set of open subproblems.
Definition: master.h:1289
double lowerBound() const
Returns the value of the global lower bound.
Definition: master.h:1524
void removeVars(int n)
Increments the counter for the total number of removed variables by n.
Definition: master.h:1248
Maintains open subproblems.
Definition: opensub.h:49
double dualBound() const
Returns the value of the dual bound.
Definition: master.h:293
StandardPool< Constraint, Variable > * conPool_
The default pool with the constraints of the problem formulation.
Definition: master.h:1312
bool solveApprox() const
True, if an approximative solver should be used.
Definition: master.h:482
void skippingMode(SKIPPINGMODE mode)
Sets the skipping strategy to mode.
Definition: master.h:746
void addVars(int n)
Increments the counter for the total number of added variables by n.
Definition: master.h:1245
int maxConBuffered_
The size of the buffer for generated cutting planes.
Definition: master.h:1419
int varElimAge_
The number of iterations an elimination criterion must be satisfied until a variable can be removed...
Definition: master.h:1464
int nStrongBranchingIterations() const
The number of simplex iterations that are performed when testing candidates for branching variables w...
Definition: master.h:554
void maxCpuTime(int64_t seconds)
Sets the maximally allowed cpu time to seconds.
Definition: master.h:616
int tailOffNLp_
The number of LP-iterations for the tailing off analysis.
Definition: master.h:1379
int varElimAge() const
Returns the age for the elimination of variables by the reduced cost criterion.
Definition: master.h:788
int maxIterations() const
Returns the maximal number of iterations per subproblem optimization (-1 means no iteration limit)...
Definition: master.h:874
int nFixed_
The total number of fixed variables.
Definition: master.h:1502
ogdf::StopwatchCPU lpTime_
The timer for the cpu time spent in the LP-interface.
Definition: master.h:1476
bool printLP_
If true, then the linear program is output every iteration.
Definition: master.h:1413
CONELIMMODE conElimMode() const
Returns the mode for the elimination of constraints.
Definition: master.h:752
const ogdf::StopwatchCPU * branchingTime() const
Returns a pointer to the timer measuring the cpu time spent in finding and selecting the branching ru...
Definition: master.h:503
void optimumFileName(const char *name)
Changes the name of the file in which the value of the optimum solution is searched.
Definition: master.h:921
int maxConAdd_
The maximal number of added constraints per iteration of the cutting plane algorithm.
Definition: master.h:1416
void newRootReOptimize(bool on)
Turns the reoptimization of new root nodes of the remaining branch and bound tree on or off...
Definition: master.h:912
History * history() const
Returns a pointer to the object storing the solution history of this branch and cut problem...
Definition: master.h:445
bool objInteger_
true, if all objective function values of feasible solutions are assumed to be integer.
Definition: master.h:1376
int maxIterations_
The maximal number of iterations of the cutting plane/column generation algorithm in the subproblem...
Definition: master.h:1428
double requiredGuarantee_
The guarantee in percent which should be reached when the optimization stops.
Definition: master.h:1355
int64_t maxCpuTime() const
Returns the maximal cpu time (in seconds) which can be used by the optimization.
Definition: master.h:604
bool eliminateFixedSet_
If true, then nonbasic fixed and set variables are eliminated.
Definition: master.h:1431
void maxVarAdd(int max)
Changes the maximal number of variables that are added in an iteration of the subproblem optimization...
Definition: master.h:859
void fixSetByRedCost(bool on)
Turns fixing and setting variables by reduced cost on or off.
Definition: master.h:816
void conElimAge(int age)
Changes the age for the elimination of constraints to age.
Definition: master.h:803
Implements a stopwatch measuring wall-clock time.
Definition: Stopwatch.h:195
The status, if the optimization terminates since the maximum cpu time is exceeded.
Definition: master.h:88
const ogdf::StopwatchCPU * totalTime() const
returns a pointer to the timer measuring the total cpu time for the optimization. ...
Definition: master.h:485
No variables are eliminated.
Definition: master.h:181
const ogdf::StopwatchCPU * lpTime() const
Returns a pointer to the timer measuring the cpu time spent in members of the LP-interface.
Definition: master.h:488
VARELIMMODE varElimMode() const
Returns the mode for the elimination of variables.
Definition: master.h:761
bool fixSetByRedCost_
If true, then variables are fixed and set by reduced cost criteria.
Definition: master.h:1410
int nRemVars_
The total number of removed variables.
Definition: master.h:1514
int nSubSelected() const
Returns the number of subproblems which have already been selected from the set of open subproblems...
Definition: master.h:518
void enumerationStrategy(ENUMSTRAT strat)
Changes the enumeration strategy to strat.
Definition: master.h:348
No output for the tree interface.
Definition: master.h:193
double upperBound() const
Returns the value of the global upper bound.
Definition: master.h:1530
BRANCHINGSTRAT
This enumeration defines the two currently implemented branching variable selection strategies...
Definition: master.h:120
PRIMALBOUNDMODE
This enumeration provides various methods for the initialization of the primal bound.
Definition: master.h:138
bool fixSetByRedCost() const
Definition: master.h:809
The status while the optimization is performed.
Definition: master.h:84
int minDormantRounds_
The minimal number of rounds, i.e., number of subproblem optimizations, a subproblem is dormant...
Definition: master.h:1392
Sense of optimization.
Definition: optsense.h:44
OSISOLVER
This enumeration defines which solvers can be used to solve the LP-relaxations.
Definition: master.h:209
bool solveApprox_
If true, then an approximative solver is used to solve linear programs.
Definition: master.h:1340
STATUS status() const
Returns the status of the Master.
Definition: master.h:473
int nStrongBranchingIterations_
The number of simplex iterations that are performed when testing a branching variable candidate withi...
Definition: master.h:1304
int maxVarAdd_
The maximal number of added variables per iteration of the column generation algorithm.
Definition: master.h:1422
int nNewRoot_
The number of changes of the root of the remaining branch-and-bound tree.
Definition: master.h:1517
Sub * root_
The root node of the enumeration tree.
Definition: master.h:1283
void addCons(int n)
Increments the counter for the total number of added constraints by n.
Definition: master.h:1239
int maxNSub_
The maximal number of subproblems to be processed.
Definition: master.h:1367
ogdf::StopwatchCPU improveTime_
The timer for the cpu time spent in the heuristics for the computation of feasible solutions...
Definition: master.h:1484
SKIPPINGMODE skippingMode_
Either constraints are generated only every skipFactor_ subproblem (SkipByNode) only every skipFactor...
Definition: master.h:1407
The OSI LP master.
Definition: lpmasterosi.h:43
The status, if subproblems are ignored since the maximum enumeration level is exceeded.
Definition: master.h:87
Candidates for fixing.
Definition: fixcand.h:63
SENSE
The enumeration defining the sense of optimization.
Definition: optsense.h:48
int nAddCons_
The total number of added constraints.
Definition: master.h:1505
int nLp() const
Returns the number of optimized linear programs (only LP-relaxations).
Definition: master.h:509
void status(STATUS stat)
Sets the status of the Master.
Definition: master.h:1264
OSISOLVER defaultLpSolver_
The default LP-Solver.
Definition: master.h:1307
void branchingStrategy(BRANCHINGSTRAT strat)
Changes the branching strategy to strat.
Definition: master.h:530
ENUMSTRAT
The enumeration defining the different enumeration strategies for the branch and bound algorithm...
Definition: master.h:103
void objInteger(bool b)
Sets the assumption that the objective function values of all feasible solutions are integer...
Definition: master.h:643
void maxVarBuffered(int max)
Changes the maximal number of variables that are buffered in an iteration of the subproblem optimizat...
Definition: master.h:871
VARELIMMODE
This enumeration defines the ways for automatic variable elimination during the column generation alg...
Definition: master.h:180
Unknown optimization sense, required to recognize uninitialized object.
Definition: optsense.h:51
int highestLevel_
The highest level which has been reached in the enumeration tree.
Definition: master.h:1499
VBCMODE VbcLog_
Ouput for the Tree Interface is generated depending on the value of this variable.
Definition: master.h:1346
ENUMSTRAT enumerationStrategy_
The enumeration strategy.
Definition: master.h:1295
void defaultLpSolver(OSISOLVER osiSolver)
Changes the default Lp solver to osiSolver.
Definition: master.h:539
STATUS status_
The current status of the optimization.
Definition: master.h:1467
string optimumFileName_
The name of a file storing a list of optimum solutions of problem instances.
Definition: master.h:1440
void newFixed(int n)
Increments the counter of the number of fixed variables by n.
Definition: master.h:1236
The status, if the optimization terminates since the maximum number of subproblems is reached...
Definition: master.h:89
int maxConBuffered() const
Returns the size of the buffer for generated constraints in the cutting plane algorithm.
Definition: master.h:841
VBCMODE vbcLog() const
Returns the mode of output for the Vbc-Tool.
Definition: master.h:938
int64_t maxCowTime_
The maximal available wall-clock time.
Definition: master.h:1373
double conElimEps_
The tolerance for the elimination of constraints by the mode NonBinding/.
Definition: master.h:1455
string problemName_
The name of the optimized problem.
Definition: master.h:1275
int skipFactor_
The frequency constraints or variables are generated depending on the skipping mode.
Definition: master.h:1401
virtual void output() const
Does nothing but can be redefined in derived classes for output before the timing statistics...
Definition: master.h:423
double varElimEps() const
Returns the zero tolerance for the elimination of variables by the reduced cost criterion.
Definition: master.h:779
const ogdf::StopwatchCPU * pricingTime() const
Returns a pointer to the timer measuring the cpu time spent in pricing.
Definition: master.h:500
Standard pools.
Definition: convar.h:44
STATUS
The various statuses of the optimization process.
Definition: master.h:77
FixCand * fixCand_
The variables which are candidates for being fixed.
Definition: master.h:1331
Sub * rRoot() const
Definition: master.h:470
ENUMSTRAT enumerationStrategy() const
Returns the enumeration strategy.
Definition: master.h:342
ogdf::StopwatchCPU totalTime_
The timer for the total cpu time for the optimization.
Definition: master.h:1473
bool eliminateFixedSet() const
Definition: master.h:892
int pricingFreq_
The number of solved LPs between two additional pricing steps.
Definition: master.h:1398
The status, if the optimization terminates since the maximum wall-clock time is exceeded.
Definition: master.h:90
bool pricing_
If true, then variables are generated in the optimization.
Definition: master.h:1337
ogdf::StopwatchCPU separationTime_
The timer for the cpu time spent in the separation.
Definition: master.h:1481
double conElimEps() const
Returns the zero tolerance for the elimination of constraints by the slack criterion.
Definition: master.h:770
void showAverageCutDistance(bool on)
Turns the output of the average distance of the added cuts from the fractional solution on or off...
Definition: master.h:935
int maxNSub() const
Returns the maximal number of subproblems to be processed.
Definition: master.h:593
const ogdf::StopwatchCPU * separationTime() const
Returns a pointer to the timer measuring the cpu time spent in the separation of cutting planes...
Definition: master.h:494
Sub * root() const
Can be used to access the root node of the branch-and-bound tree.
Definition: master.h:463
int skipFactor() const
Returns the frequency of subproblems in which constraints or variables should be generated.
Definition: master.h:734
Sub * rRoot_
The root node of the remaining enumeration tree.
Definition: master.h:1286
void dbThreshold(int threshold)
Sets the number of optimizations of a subproblem until sons are created in Sub::branching().
Definition: master.h:687
ogdf::StopwatchWallClock totalCowTime_
The timer for the total elapsed time.
Definition: master.h:1470
int64_t maxCowTime() const
Returns the maximal wall-clock time (in seconds) which can be used by the optimization.
Definition: master.h:622
int nSubSelected_
The number of subproblems already selected from the list of open subproblems.
Definition: master.h:1343
VARELIMMODE varElimMode_
The way variables are automatically eliminated in the column generation algorithm.
Definition: master.h:1452
int maxConAdd() const
Returns the maximal number of constraints which should be added in every iteration of the cutting pla...
Definition: master.h:832
The initial status, before the optimization starts.
Definition: master.h:83
double tailOffPercent() const
Returns the minimal change of the dual bound for the tailing off analysis in percent.
Definition: master.h:658
StandardPool< Constraint, Variable > * cutPool_
The default pool of dynamically generated constraints.
Definition: master.h:1316
int dbThreshold() const
Returns the number of optimizations of a subproblem until sons are created.
Definition: master.h:693
double tailOffPercent_
The minimal change of the LP-value on the tailing off analysis.
Definition: master.h:1382
LpMasterOsi * lpMasterOsi_
Definition: master.h:1309
virtual void initializeOptimization()
The default implementation of initializeOptimization() does nothing.
Definition: master.h:1130
Implements a stopwatch measuring CPU time.
Definition: Stopwatch.h:168