Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

sub.h
Go to the documentation of this file.
1 
30 #pragma once
31 
32 #include <ogdf/lib/abacus/lp.h>
35 
36 #include <ogdf/basic/Stopwatch.h>
37 
38 
39 namespace abacus {
40 
41 class LpSub;
42 class TailOff;
43 class BranchRule;
44 class LPVARSTAT;
45 class Variable;
46 class Master;
47 class InfeasCon;
48 class Constraint;
49 
50 template<class BaseType, class CoType> class CutBuffer;
51 template<class BaseType, class CoType> class Active;
52 template<class BaseType, class CoType> class Pool;
53 template<class BaseType, class CoType> class PoolSlot;
54 template<class BaseType, class CoType> class LpSolution;
55 
56 
58 
68 class OGDF_EXPORT Sub : public AbacusRoot {
69 
70  friend class Master;
71  friend class BoundBranchRule;
72  friend class OpenSub;
73  friend class LpSolution<Constraint, Variable>;
74  friend class LpSolution<Variable, Constraint>;
75 
76 public:
77 
79  enum STATUS {
82  Dormant,
85  Fathomed
86  };
87 
89  enum PHASE {
90  Done,
91  Cutting,
94  Fathoming
95  };
96 
98 
115  Sub(
116  Master *master,
117  double conRes,
118  double varRes,
119  double nnzRes,
120  bool relativeRes = true,
121  ArrayBuffer<PoolSlot<Constraint, Variable> *> *constraints = nullptr,
122  ArrayBuffer<PoolSlot<Variable, Constraint> *> *variables = nullptr);
123 
125 
131  Sub(Master *master, Sub *father, BranchRule *branchRule);
132 
134 
144  virtual ~Sub();
145 
147  bool forceExactSolver() const { return forceExactSolver_; }
148 
150  int level() const { return level_; }
151 
153  int id() const { return id_; }
154 
156  STATUS status() const { return status_; }
157 
159  int nVar() const;
160 
162  int maxVar() const;
163 
165  int nCon() const;
166 
168  int maxCon() const;
169 
171  double lowerBound() const;
172 
174  double upperBound() const;
175 
177 
181  double dualBound() const { return dualBound_; }
182 
184 
195  void dualBound(double x);
196 
198  const Sub *father() const { return father_; }
199 
201  LpSub *lp() const { return lp_; }
202 
204 
210  void maxIterations(int max);
211 
213  Active<Constraint, Variable> *actCon() const { return actCon_; }
214 
216  Active<Variable, Constraint> *actVar() const { return actVar_; }
217 
219 
222  Constraint *constraint(int i) const;
223 
225 
228  SlackStat *slackStat(int i) const { return (*slackStat_)[i]; }
229 
231 
234  Variable *variable(int i) const;
235 
237 
245  double lBound(int i) const { return (*lBound_)[i]; }
246 
248 
255  void lBound(int i, double l);
256 
258 
266  double uBound(int i) const { return (*uBound_)[i]; }
267 
269 
276  void uBound(int i, double u);
277 
279 
291  FSVarStat *fsVarStat(int i) const { return (*fsVarStat_)[i]; }
292 
294 
297  LPVARSTAT *lpVarStat(int i) const { return (*lpVarStat_)[i]; }
298 
300 
303  double xVal(int i) const { return xVal_[i]; }
304 
306 
309  double yVal(int i) const { return yVal_[i]; }
310 
312 
317  bool ancestor(const Sub *sub) const;
318 
320  Master *master() { return master_; }
321 
323  const Master *master() const { return master_; }
324 
326 
333  void removeVars(ArrayBuffer<int> &remove);
334 
336 
343  void removeVar(int i) { removeVarBuffer_->push(i); }
344 
346  double nnzReserve() const { return nnzReserve_; }
347 
352  bool relativeReserve() const { return relativeReserve_; }
353 
355  BranchRule *branchRule() const { return branchRule_; }
356 
358 
371  bool objAllInteger() const;
372 
374 
379  virtual void removeCons(ArrayBuffer<int> &remove);
380 
382 
385  virtual void removeCon(int i);
386 
388 
395  int addConBufferSpace() const;
396 
398 
405  int addVarBufferSpace() const;
406 
408  int nDormantRounds() const { return nDormantRounds_; }
409 
411 
423  void ignoreInTailingOff();
424 
426 
435  virtual int addBranchingConstraint(PoolSlot<Constraint, Variable> *slot);
436 
437 protected:
438 
440 
457  virtual int addCons(ArrayBuffer<Constraint*> &constraints,
458  Pool<Constraint, Variable> *pool = nullptr,
459  ArrayBuffer<bool> *keepInPool = nullptr,
460  ArrayBuffer<double> *rank = nullptr);
461 
463 
468  virtual int addCons(
470 
472 
489  virtual int addVars(ArrayBuffer<Variable*> &variables,
490  Pool<Variable, Constraint> *pool = nullptr,
491  ArrayBuffer<bool> *keepInPool = nullptr,
492  ArrayBuffer<double> *rank = nullptr);
493 
495 
506  virtual int addVars(
508 
510 
524  virtual int variablePoolSeparation(
525  int ranking = 0,
526  Pool<Variable, Constraint> *pool = nullptr,
527  double minViolation = 0.001);
528 
530 
546  virtual int constraintPoolSeparation(
547  int ranking = 0,
548  Pool<Constraint, Variable> *pool = nullptr,
549  double minViolation = 0.001);
550 
552 
555  virtual void activate() { }
556 
558 
563  virtual void deactivate () { }
564 
566 
576  return branchingOnVariable(rules);
577  }
578 
580 
590  virtual int branchingOnVariable(ArrayBuffer<BranchRule*> &rules);
591 
593 
606  virtual int selectBranchingVariable(int &variable);
607 
609 
639  virtual int selectBranchingVariableCandidates(ArrayBuffer<int> &candidates);
640 
642 
654  virtual int selectBestBranchingSample(int nSamples,
655  ArrayBuffer<BranchRule*> **samples);
656 
658 
663  virtual void rankBranchingSample(ArrayBuffer<BranchRule*> &sample,
664  Array<double> &rank);
665 
667 
676  virtual double rankBranchingRule(BranchRule *branchRule);
677 
679 
693  double lpRankBranchingRule(BranchRule *branchRule, int iterLimit = -1);
694 
696 
707  virtual int compareBranchingSampleRanks(Array<double> &rank1,
708  Array<double> &rank2);
709 
711 
720  int closeHalfExpensive(int &branchVar, VarType::TYPE branchVarType);
721 
723  /***
724  * Those variables with fractional part close to \f$0.5\f$ and high absolute objective function
725  * coefficient are selected..
726  *
727  * \param variables Holds the numbers of possible branching variables if
728  * at least one is found. We try to find as many
729  * candidates as fit into this buffer. We abort
730  * the function with a fatal error if the size
731  * of the buffer is 0.
732  * \param branchVarType The type of the branching variable can be restricted either
733  * to VarType::Binary or VarType::Integer.
734  *
735  * \return 0 If at least one branching variable is found, 1 otherwise.
736  */
737  int closeHalfExpensive(ArrayBuffer<int> &variables,
738  VarType::TYPE branchVarType);
739 
741 
748  int closeHalf(int &branchVar, VarType::TYPE branchVarType);
749 
751 
758  int closeHalf(ArrayBuffer<int> &branchVar, VarType::TYPE branchVarType);
759 
761 
768  int findNonFixedSet(ArrayBuffer<int> &branchVar,
769  VarType::TYPE branchVarType);
770 
772 
779  int findNonFixedSet(int &branchVar, VarType::TYPE branchVarType);
780 
782 
797  virtual int initMakeFeas(
798  ArrayBuffer<InfeasCon*> &infeasCon,
799  ArrayBuffer<Variable*> &newVars,
801  {
802  return 1;
803  }
804 
806 
822  virtual int makeFeasible() { return 1; }
823 
835  virtual bool goodCol(Column &col, Array<double> &row,
836  double x, double lb, double ub);
837 
839 
845  virtual void setByLogImp(ArrayBuffer<int> &variable,
846  ArrayBuffer<FSVarStat*> &status) { }
847 
849 
856  virtual bool feasible() = 0;
857 
859 
866  bool integerFeasible();
867 
869 
879  virtual bool primalSeparation();
880 
882 
887  virtual int separate();
888 
890 
899  virtual void conEliminate(ArrayBuffer<int> &remove);
900 
902 
905  virtual void nonBindingConEliminate(ArrayBuffer<int> &remove);
906 
908 
911  virtual void basicConEliminate(ArrayBuffer<int> &remove);
912 
914 
920  virtual void varEliminate(ArrayBuffer<int> &remove);
921 
923 
926  void redCostVarEliminate(ArrayBuffer<int> &remove);
927 
929 
934  virtual int pricing() { return 0; }
935 
937 
945  virtual int improve(double &primalValue);
946 
948 
951  virtual Sub *generateSon(BranchRule *rule) = 0;
952 
954  bool boundCrash() const;
955 
968  virtual bool pausing() { return false; }
969 
971  bool infeasible();
972 
974 
977  virtual void varRealloc(int newSize);
978 
980 
983  virtual void conRealloc(int newSize);
984 
986 
999  virtual LP::METHOD chooseLpMethod(int nVarRemoved, int nConRemoved,
1000  int nVarAdded, int nConAdded);
1001 
1003 
1014  virtual bool tailingOff() { return true; }
1015 
1017  bool betterDual(double x) const;
1018 
1020 
1024  virtual void selectVars() { }
1025 
1027 
1031  virtual void selectCons() { }
1032 
1034 
1045  virtual int fixByRedCost(bool &newValues, bool saveCand);
1046 
1048  /***
1049  * The default implementation of \a fixByLogImp() does nothing. This
1050  * function has to be redefined if variables should be fixed by logical
1051  * implications in derived classes.
1052  *
1053  * \param variables The variables which should be fixed.
1054  * \param status The statuses these variables should be fixed to.
1055  */
1056  virtual void fixByLogImp(ArrayBuffer<int> &variables,
1057  ArrayBuffer<FSVarStat*> &status) { }
1058 
1060 
1073  virtual int fixAndSet(bool &newValues);
1074 
1076 
1086  virtual int fixing(bool &newValues, bool saveCand = false);
1087 
1089 
1098  virtual int setting(bool &newValues);
1099 
1101 
1104  virtual int setByRedCost();
1105 
1107 
1130  virtual void fathom(bool reoptimize);
1131 
1133 
1138  virtual bool fixAndSetTime() { return true; }
1139 
1141 
1156  virtual int fix(int i, FSVarStat *newStat, bool &newValue);
1157 
1159 
1169  virtual int set(int i, FSVarStat *newStat, bool &newValue);
1170 
1172 
1181  virtual int set(int i, FSVarStat::STATUS newStat, bool &newValue);
1182 
1184 
1194  virtual int set(int i, FSVarStat::STATUS newStat, double value,
1195  bool &newValue);
1196 
1206  virtual double dualRound(double x);
1207 
1209 
1212  virtual double guarantee() const;
1213 
1218  virtual bool guaranteed() const;
1219 
1227  virtual bool removeNonLiftableCons();
1228 
1230 
1236  virtual int prepareBranching(bool &lastIteration);
1237 
1239 
1250  virtual void fathomTheSubTree();
1251 
1253 
1271  virtual int optimize();
1272 
1274 
1290  virtual void reoptimize();
1291 
1293 
1296  virtual void initializeVars(int maxVar);
1297 
1299 
1302  virtual void initializeCons(int maxCon);
1303 
1305 
1325  virtual PHASE branching();
1326 
1328 
1352  virtual PHASE fathoming();
1353 
1355 
1365  virtual PHASE cutting();
1366 
1368 
1376  virtual LpSub *generateLp();
1377 
1379 
1390  virtual int initializeLp();
1391 
1393 
1407  virtual int solveLp();
1408 
1410 
1415  virtual bool exceptionFathom() { return false; }
1416 
1418 
1424  virtual bool exceptionBranch() { return false; }
1425 
1432  virtual bool solveApproxNow() { return false; }
1433 
1434 
1437 
1440 
1443 
1446 
1449 
1451 
1459 
1462 
1465 
1468 
1471 
1474 
1476  double dualBound_;
1477 
1479  int nIter_;
1480 
1483 
1486 
1489 
1495 
1498 
1501 
1504 
1507 
1510 
1512  double *xVal_;
1513 
1515  double *yVal_;
1516 
1518  double *bInvRow_;
1519 
1522 
1525 
1528 
1529 private:
1530 
1532  virtual int _separate();
1533 
1535 
1540  virtual int _conEliminate();
1541 
1543 
1546  virtual int _varEliminate();
1547 
1572  virtual int _pricing(bool &newValues, bool doFixSet = true);
1573 
1575 
1587  virtual int _improve(double &primalValue);
1588 
1590 
1594  virtual int _fixByLogImp(bool &newValues);
1595 
1597 
1601  virtual void updateBoundInLp(int i);
1602 
1604  virtual double fixSetNewBound(int i);
1605 
1607 
1611  virtual void newDormantRound() { ++nDormantRounds_; }
1612 
1614 
1647  virtual PHASE _activate();
1648 
1650 
1659  virtual void _deactivate();
1660 
1662 
1674  virtual int _initMakeFeas();
1675 
1684  virtual int _makeFeasible();
1685 
1687 
1696  virtual int _setByLogImp(bool &newValues);
1697 
1699 
1702  virtual void infeasibleSub();
1703 
1705  virtual void getBase();
1706 
1708 
1712  virtual void activateVars(ArrayBuffer<PoolSlot<Variable, Constraint>*> &newVars);
1713 
1715 
1720  virtual void addVarsToLp(ArrayBuffer<PoolSlot<Variable, Constraint>*> &newVars,
1721  ArrayBuffer<FSVarStat*> *localStatus = nullptr);
1722 
1724 
1727  virtual void _selectVars(ArrayBuffer<PoolSlot<Variable, Constraint>*> &newVars);
1728 
1730  virtual void _selectCons(ArrayBuffer<PoolSlot<Constraint, Variable>*> &newCons);
1731 
1733  virtual int _removeVars(ArrayBuffer<int> &remove);
1734 
1736  virtual int _removeCons(ArrayBuffer<int> &remove);
1737 
1739  bool _atUpperBound(int i);
1740 
1742  bool _atLowerBound(int i);
1743 
1744 
1746  int level_;
1747 
1749  int id_;
1750 
1753 
1756 
1759 
1761  int nOpt_;
1762 
1772 
1774  double varReserve_;
1775 
1777  double conReserve_;
1778 
1780  double nnzReserve_;
1781 
1784 
1786 
1791 
1793 
1798 
1801 
1803 
1806 
1807  Sub(const Sub &rhs);
1808  const Sub &operator=(const Sub &rhs);
1809 };
1810 
1811 }
1812 
1813 // NOW declaration of sub is complete. its definitions below need full declarations of the below types...
1814 
1815 #include <ogdf/lib/abacus/variable.h>
1817 #include <ogdf/lib/abacus/active.h>
1818 #include <ogdf/lib/abacus/cutbuffer.h>
1819 #include <ogdf/lib/abacus/lpsub.h>
1820 
1821 namespace abacus {
1822 
1824 {
1825  return addConBuffer_->insert(slot, true);
1826 }
1827 
1828 inline int Sub::addConBufferSpace() const
1829 {
1830  return addConBuffer_->space();
1831 }
1832 
1833 inline int Sub::addVarBufferSpace() const
1834 {
1835  return addVarBuffer_->space();
1836 }
1837 
1838 inline int Sub::nVar() const
1839 {
1840  return actVar_->number();
1841 }
1842 
1843 inline int Sub::nCon() const
1844 {
1845  return actCon_->number();
1846 }
1847 
1848 inline int Sub::maxVar() const
1849 {
1850  return actVar_->max();
1851 }
1852 
1853 inline int Sub::maxCon() const
1854 {
1855  return actCon_->max();
1856 }
1857 
1858 inline Constraint *Sub::constraint(int i) const
1859 {
1860  return (*actCon_)[i];
1861 }
1862 
1863 inline Variable *Sub::variable(int i) const
1864 {
1865  return (*actVar_)[i];
1866 }
1867 
1868 inline double Sub::rankBranchingRule(BranchRule *branchRule)
1869 {
1871 }
1872 
1873 inline double Sub::lowerBound() const
1874 {
1875  if (master_->optSense()->max())
1876  return master_->primalBound();
1877  else
1878  return dualBound_;
1879 }
1880 
1881 inline double Sub::upperBound() const
1882 {
1883  if (master_->optSense()->min())
1884  return master_->primalBound();
1885  else
1886  return dualBound_;
1887 }
1888 
1889 inline bool Sub::betterDual(double x) const
1890 {
1891  if (master_->optSense()->max())
1892  return x < dualBound_ ? true : false;
1893  else
1894  return x > dualBound_ ? true : false;
1895 }
1896 
1897 inline bool Sub::boundCrash() const
1898 {
1899  return(master_->primalViolated(dualBound_));
1900 }
1901 
1902 inline void Sub::removeCon(int i)
1903 {
1904  removeConBuffer_->push(i);
1905 }
1906 
1907 inline void Sub::lBound(int i, double l)
1908 {
1909  (*lBound_)[i] = l;
1910  if (lp_)
1911  lp_->changeLBound(i, l);
1912 }
1913 
1914 inline void Sub::uBound(int i, double u)
1915 {
1916  (*uBound_)[i] = u;
1917  if (lp_)
1918  lp_->changeUBound(i, u);
1919 }
1920 
1921 }
ogdf::ArrayBuffer
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition: Array.h:46
abacus::Sub::actVar
Active< Variable, Constraint > * actVar() const
Returns a pointer to the currently active variables.
Definition: sub.h:216
abacus::LpSolution
LP solutions.
Definition: lpsolution.h:43
abacus::Active
Implements the sets of active constraints and variables which are associated with each subproblem.
Definition: active.h:43
abacus::Sub::lpVarStat_
Array< LPVARSTAT * > * lpVarStat_
A pointer to an array storing the status of each active variable in the linear program.
Definition: sub.h:1461
abacus::Sub::lp_
LpSub * lp_
A pointer to the corresponding linear program.
Definition: sub.h:1448
abacus::Sub::ActiveSub
@ ActiveSub
The subproblem is currently processed.
Definition: sub.h:81
abacus::Sub::activate
virtual void activate()
Can be used as an entrance point for problem specific activations.
Definition: sub.h:555
abacus::Master::primalViolated
bool primalViolated(double x) const
Can be used to compare a value with the one of the best known primal bound.
abacus::Sub::tailingOff
virtual bool tailingOff()
Called when a tailing off effect according to the parameters TailOffPercent and TailOffNLps is observ...
Definition: sub.h:1014
cutbuffer.h
cutbuffer.
abacus::BranchRule
Abstract base class for all branching rules.
Definition: branchrule.h:59
abacus::Sub::activated_
bool activated_
The variable is true if the function activate() has been called from the function _activate().
Definition: sub.h:1790
fsvarstat.h
status of fixed and set variables.
constraint.h
constraint.
abacus::Sub::selectCons
virtual void selectCons()
Is called before constraint are selected from the constraint buffer.
Definition: sub.h:1031
abacus::Sub::removeVarBuffer_
ArrayBuffer< int > * removeVarBuffer_
The buffer of the variables which are removed at the beginning of the next iteration.
Definition: sub.h:1506
abacus::Sub::setByLogImp
virtual void setByLogImp(ArrayBuffer< int > &variable, ArrayBuffer< FSVarStat * > &status)
The default implementation of setByLogImp() does nothing.
Definition: sub.h:845
abacus::Sub::Branching
@ Branching
We try to generate further subproblems as sons of this subproblem.
Definition: sub.h:93
abacus::Sub::id_
int id_
The number of the subproblem.
Definition: sub.h:1749
abacus::Sub::Unprocessed
@ Unprocessed
The status after generation, but before optimization of the subproblem.
Definition: sub.h:80
abacus::Sub::father_
Sub * father_
A pointer to the father in the branch-and-cut tree.
Definition: sub.h:1445
abacus::LpSub::changeLBound
virtual void changeLBound(int i, double newLb) override
Sets the lower bound of variable i to newLb.
abacus::Sub::boundCrash
bool boundCrash() const
Returns true if the dual bound is worse than the best known primal bound, false otherwise.
Definition: sub.h:1897
abacus::Sub::makeFeasible
virtual int makeFeasible()
The default implementation of makeFeasible()does nothing.
Definition: sub.h:822
abacus::Sub::rankBranchingRule
virtual double rankBranchingRule(BranchRule *branchRule)
Computes the rank of a branching rule.
Definition: sub.h:1868
abacus::FSVarStat
Status of fixed and set variables.
Definition: fsvarstat.h:46
abacus::Sub::branchRule
BranchRule * branchRule() const
Returns a pointer to the branching rule of the subproblem.
Definition: sub.h:355
abacus::Sub::maxCon
int maxCon() const
Returns the maximum number of constraints which can be handled without reallocation.
Definition: sub.h:1853
abacus::Sub::lastIterVarAdd_
int lastIterVarAdd_
The last iteration in which variables have been added.
Definition: sub.h:1485
abacus::Sub::lpMethod_
LP::METHOD lpMethod_
The solution method for the next linear program.
Definition: sub.h:1497
abacus::CutBuffer
Cut buffers.
Definition: convar.h:45
abacus::Sub::lp
LpSub * lp() const
Returns a pointer to the linear program of the subproblem.
Definition: sub.h:201
abacus::Sub::fixAndSetTime
virtual bool fixAndSetTime()
Controls if variables should be fixed or set when all variables price out correctly.
Definition: sub.h:1138
abacus::Sub::fsVarStat
FSVarStat * fsVarStat(int i) const
Returns a pointer to the status of fixing/setting of the i-th variable.
Definition: sub.h:291
abacus::Sub::master
Master * master()
Returns the master of the optimization.
Definition: sub.h:320
abacus
Definition: abacusroot.h:48
abacus::Sub::nnzReserve_
double nnzReserve_
The additional space for nonzeros.
Definition: sub.h:1780
abacus::Sub::lpRankBranchingRule
double lpRankBranchingRule(BranchRule *branchRule, int iterLimit=-1)
Computes the rank of a branching rule by modifying the linear programming relaxation of the subproble...
abacus::Sub::solveApproxNow
virtual bool solveApproxNow()
The default implementation always returns false.
Definition: sub.h:1432
abacus::Sub::uBound_
Array< double > * uBound_
A pointer to an array with the local upper bounds of the active variables.
Definition: sub.h:1467
abacus::Sub::actVar_
Active< Variable, Constraint > * actVar_
The active variables of the subproblem.
Definition: sub.h:1442
abacus::Sub::tailOff_
TailOff * tailOff_
A pointer to the tailing off manager.
Definition: sub.h:1473
abacus::BoundBranchRule
Implements a branching rule for modifying the lower and the upper bound of a variable.
Definition: boundbranchrule.h:40
abacus::Master::primalBound
double primalBound() const
Returns the value of the primal bound.
Definition: master.h:278
abacus::Sub::pricing
virtual int pricing()
Should generate inactive variables which do not price out correctly.
Definition: sub.h:934
abacus::Sub::xVal_
double * xVal_
The last LP-solution.
Definition: sub.h:1512
abacus::Sub::level_
int level_
The level of the subproblem in the enumeration tree.
Definition: sub.h:1746
abacus::Sub::lBound
double lBound(int i) const
Can be used to access the lower of an active variable of the subproblem.
Definition: sub.h:245
abacus::Sub::addConBuffer_
CutBuffer< Constraint, Variable > * addConBuffer_
The buffer of the newly generated constraints.
Definition: sub.h:1503
ogdf::StopwatchCPU
Implements a stopwatch measuring CPU time.
Definition: Stopwatch.h:154
abacus::Sub::nIter_
int nIter_
The number of iterations in the cutting plane phase.
Definition: sub.h:1479
abacus::Sub::allBranchOnSetVars_
bool allBranchOnSetVars_
If true, then the branching rule of the subproblem and of all ancestor on the path to the root node a...
Definition: sub.h:1494
abacus::Sub::master
const Master * master() const
Returns the const master of the optimization.
Definition: sub.h:323
abacus::Sub::forceExactSolver_
bool forceExactSolver_
Indicates whether to force the use of an exact solver to prepare branching etc.
Definition: sub.h:1805
abacus::Sub::initMakeFeas
virtual int initMakeFeas(ArrayBuffer< InfeasCon * > &infeasCon, ArrayBuffer< Variable * > &newVars, Pool< Variable, Constraint > **pool)
The default implementation of the virtual initMakeFeas() does nothing.
Definition: sub.h:797
abacus::Sub::nVar
int nVar() const
Returns the number of active variables.
Definition: sub.h:1838
abacus::Sub::dualBound_
double dualBound_
The dual bound of the subproblem.
Definition: sub.h:1476
abacus::Pool
Base class for constraint/variabe pools.
Definition: pool.h:62
abacus::Sub::lastIterConAdd_
int lastIterConAdd_
The last iteration in which constraints have been added.
Definition: sub.h:1482
abacus::Sub::relativeReserve
bool relativeReserve() const
Definition: sub.h:352
ogdf::AlgorithmFailureCode::LpSub
@ LpSub
abacus::Sub::father
const Sub * father() const
Returns a pointer to the father of the subproblem in the branch-and-bound tree.
Definition: sub.h:198
abacus::OptSense::min
bool min() const
Returns true If it is minimization problem,, false otherwise.
Definition: optsense.h:84
abacus::SlackStat
Status of slack variables.
Definition: slackstat.h:47
abacus::Sub::variable
Variable * variable(int i) const
Returns a pointer to the i-th active variable.
Definition: sub.h:1863
abacus::Sub::status
STATUS status() const
Returns the status of the subproblem optimization.
Definition: sub.h:156
abacus::Sub::maxVar
int maxVar() const
Returns the maximum number of variables which can be handled without reallocation.
Definition: sub.h:1848
abacus::Sub::Done
@ Done
The optimization is done.
Definition: sub.h:90
abacus::Sub::forceExactSolver
bool forceExactSolver() const
Returns whether using the exact solver is forced.
Definition: sub.h:147
abacus::Sub::infeasCon_
int infeasCon_
The number of an infeasible constraint.
Definition: sub.h:1521
abacus::FSVarStat::STATUS
STATUS
The enumeration defining the different statuses of variables from the point of view of fixing and set...
Definition: fsvarstat.h:50
abacus::Sub::maxIterations_
int maxIterations_
The maximum number of iterations in the cutting plane phase.
Definition: sub.h:1758
ogdf::AlgorithmFailureCode::Constraint
@ Constraint
abacus::Sub::sons_
ArrayBuffer< Sub * > * sons_
The sons of the node in the branch-and-cut tree.
Definition: sub.h:1755
abacus::Sub::removeCon
virtual void removeCon(int i)
Adds a single constraint to the set of constraints which are removed from the active set at the begin...
Definition: sub.h:1902
abacus::Sub::betterDual
bool betterDual(double x) const
Returns true if x is better than the best known dual bound of the subproblem, false otherwise.
Definition: sub.h:1889
abacus::Sub::lowerBound
double lowerBound() const
Returns a lower bound on the optimal solution of the subproblem.
Definition: sub.h:1873
abacus::Sub::addVarBufferSpace
int addVarBufferSpace() const
Can be used to determine the maximal number of the variables which still can be added to the variable...
Definition: sub.h:1833
abacus::Sub::addVarBuffer_
CutBuffer< Variable, Constraint > * addVarBuffer_
The buffer of the newly generated variables.
Definition: sub.h:1500
lp.h
linear program.
abacus::LpSub::changeUBound
virtual void changeUBound(int i, double newUb) override
Sets the upper bound of variable i to newUb.
abacus::Sub::constraint
Constraint * constraint(int i) const
Returns a pointer to the i-th active constraint.
Definition: sub.h:1858
abacus::AbacusRoot
Base class of all other classes of ABACUS.
Definition: abacusroot.h:68
abacus::Sub::master_
Master * master_
A pointer to the corresponding master of the optimization.
Definition: sub.h:1436
abacus::Sub::localTimer_
ogdf::StopwatchCPU localTimer_
Definition: sub.h:1802
abacus::Sub::bInvRow_
double * bInvRow_
A row of the basis inverse associated with the infeasible variable infeasVar_ or slack variable infea...
Definition: sub.h:1518
ogdf::Array
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:214
abacus::Sub::upperBound
double upperBound() const
Returns an upper bound on the optimal solution of the subproblem.
Definition: sub.h:1881
abacus::Sub::STATUS
STATUS
A subproblem can have different statuses.
Definition: sub.h:79
abacus::Sub::addConBufferSpace
int addConBufferSpace() const
Can be used to determine the maximal number of the constraints which still can be added to the constr...
Definition: sub.h:1828
abacus::Sub::Processed
@ Processed
The subproblem is completely processed but could not be fathomed.
Definition: sub.h:84
ogdf::ArrayBuffer::push
void push(E e)
Puts a new element in the buffer.
Definition: ArrayBuffer.h:209
Stopwatch.h
Declaration of stopwatch classes.
abacus::Variable
Forms the virtual base class for all possible variables given in pool format.
Definition: variable.h:59
ogdf::AlgorithmFailureCode::Active
@ Active
abacus::Sub::actCon
Active< Constraint, Variable > * actCon() const
Returns a pointer to the currently active constraints.
Definition: sub.h:213
ogdf::AlgorithmFailureCode::InfeasCon
@ InfeasCon
active.h
abacus::Sub::fixByLogImp
virtual void fixByLogImp(ArrayBuffer< int > &variables, ArrayBuffer< FSVarStat * > &status)
Should collect the numbers of the variables to be fixed in variable and the respective statuses in st...
Definition: sub.h:1056
abacus::Sub::newDormantRound
virtual void newDormantRound()
Increments the counter for the number of rounds the subproblem is dormant.
Definition: sub.h:1611
abacus::OptSense::max
bool max() const
Returns true if it is maximization problem,, false otherwise.
Definition: optsense.h:90
variable.h
variable.
abacus::Sub::PHASE
PHASE
The optimization of the subproblem can be in one of the following phases.
Definition: sub.h:89
abacus::Sub::id
int id() const
Returns the identity number of the subproblem.
Definition: sub.h:153
abacus::Sub::infeasVar_
int infeasVar_
The number of an infeasible variable.
Definition: sub.h:1524
abacus::Sub::deactivate
virtual void deactivate()
Can be used as entrance point for problem specific deactivations after the subproblem optimization.
Definition: sub.h:563
abacus::Sub::slackStat_
Array< SlackStat * > * slackStat_
A pointer to an array storing the statuses of the slack variables of the last solved linear program.
Definition: sub.h:1470
abacus::Master::optSense
const OptSense * optSense() const
Returns a pointer to the object holding the optimization sense of the problem.
Definition: master.h:442
abacus::Sub::level
int level() const
Returns the level of the subproblem in the branch-and-bound tree.
Definition: sub.h:150
abacus::LpSub
The linear program of a subproblem.
Definition: lpsub.h:61
abacus::Sub::actCon_
Active< Constraint, Variable > * actCon_
The active constraints of the subproblem.
Definition: sub.h:1439
ogdf::AlgorithmFailureCode::Pool
@ Pool
abacus::Sub::fsVarStat_
Array< FSVarStat * > * fsVarStat_
A pointer to an array storing the status of fixing and setting of the active variables.
Definition: sub.h:1458
abacus::LP::METHOD
METHOD
The solution method for the linear program.
Definition: lp.h:93
abacus::Master::nStrongBranchingIterations
int nStrongBranchingIterations() const
The number of simplex iterations that are performed when testing candidates for branching variables w...
Definition: master.h:554
abacus::LPVARSTAT
status of variables.
Definition: lpvarstat.h:50
abacus::Sub::pausing
virtual bool pausing()
Sometimes it is appropriate to put a subproblem back into the list of open subproblems.
Definition: sub.h:968
abacus::Column
Representation of variables in column format.
Definition: column.h:47
abacus::Sub::lastLP_
LP::METHOD lastLP_
The method that was used to solve the last LP.
Definition: sub.h:1800
abacus::Sub::yVal_
double * yVal_
The dual variables of the last linear program.
Definition: sub.h:1515
abacus::TailOff
Tailing off manager.
Definition: tailoff.h:57
abacus::Sub::yVal
double yVal(int i) const
Returns the value of the i-th dual variable in the last solved linear program.
Definition: sub.h:309
ogdf::AlgorithmFailureCode::Variable
@ Variable
abacus::OpenSub
Maintains open subproblems.
Definition: opensub.h:49
abacus::Sub::xVal
double xVal(int i) const
Returns the value of the i-th variable in the last solved linear program.
Definition: sub.h:303
abacus::Sub::lpVarStat
LPVARSTAT * lpVarStat(int i) const
Returns a pointer to the status of the variable i in the last solved linear program.
Definition: sub.h:297
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
abacus::Sub
The subproblem.
Definition: sub.h:68
abacus::Sub::relativeReserve_
bool relativeReserve_
If this member is true then the space reserve of the following three members varReserve_,...
Definition: sub.h:1771
abacus::Constraint
Forms the virtual base class for all possible constraints given in pool format.
Definition: constraint.h:56
abacus::Sub::lBound_
Array< double > * lBound_
A pointer to an array with the local lower bound of the active variables.
Definition: sub.h:1464
abacus::Sub::genNonLiftCons_
bool genNonLiftCons_
If true, then the management of non-liftable constraints is performed.
Definition: sub.h:1527
abacus::PoolSlot
Stores constraints and variables.
Definition: active.h:39
abacus::Sub::nOpt_
int nOpt_
The number of optimizations of the subproblem.
Definition: sub.h:1761
abacus::Sub::exceptionBranch
virtual bool exceptionBranch()
Can be used to specify a problem specific criteria for enforcing a branching step.
Definition: sub.h:1424
abacus::Sub::ignoreInTailingOff_
bool ignoreInTailingOff_
If this flag is set to true then the next LP-solution is ignored in the tailing-off control.
Definition: sub.h:1797
vartype.h
vartype.
abacus::VarType::TYPE
TYPE
The enumeration with the different variable types.
Definition: vartype.h:47
abacus::Sub::slackStat
SlackStat * slackStat(int i) const
Returns a pointer to the status of the slack variable i in the last solved linear program.
Definition: sub.h:228
abacus::Sub::branchRule_
BranchRule * branchRule_
The branching rule for the subproblem.
Definition: sub.h:1488
abacus::Sub::exceptionFathom
virtual bool exceptionFathom()
Can be used to specify a problem specific fathoming criterium that is checked before the separation o...
Definition: sub.h:1415
abacus::Sub::generateBranchRules
virtual int generateBranchRules(ArrayBuffer< BranchRule * > &rules)
Tries to find rules for splitting the current subproblem in further subproblems.
Definition: sub.h:575
lpsub.h
linear program of a subproblem.
abacus::Sub::uBound
double uBound(int i) const
Can be used to access the upper of an active variable of the subproblem.
Definition: sub.h:266
Minisat::Internal::remove
static void remove(V &ts, const T &t)
Definition: Alg.h:36
abacus::Sub::conReserve_
double conReserve_
The additional space for constraints.
Definition: sub.h:1777
abacus::Sub::addBranchingConstraint
virtual int addBranchingConstraint(PoolSlot< Constraint, Variable > *slot)
Adds a branching constraint to the constraint buffer.
Definition: sub.h:1823
abacus::Sub::dualBound
double dualBound() const
Returns a bound which is "better" than the optimal solution of the subproblem w.r....
Definition: sub.h:181
abacus::Sub::nDormantRounds_
int nDormantRounds_
The number of subproblem optimizations the subproblem has already the status Dormant.
Definition: sub.h:1783
abacus::Sub::varReserve_
double varReserve_
The additional space for variables.
Definition: sub.h:1774
abacus::Sub::nDormantRounds
int nDormantRounds() const
Definition: sub.h:408
abacus::Sub::removeConBuffer_
ArrayBuffer< int > * removeConBuffer_
The buffer of the constraints which are removed at the beginning of the next iteration.
Definition: sub.h:1509
abacus::Sub::selectVars
virtual void selectVars()
Is called before variables are selected from the variable buffer.
Definition: sub.h:1024
abacus::Sub::nCon
int nCon() const
Returns the number of active constraints.
Definition: sub.h:1843
abacus::Sub::status_
STATUS status_
The status of the subproblem.
Definition: sub.h:1752
abacus::Master
The master of the optimization.
Definition: master.h:69
abacus::Sub::nnzReserve
double nnzReserve() const
Returns the additional space for nonzero elements of the constraint matrix when it is passed to the L...
Definition: sub.h:346
abacus::Sub::removeVar
void removeVar(int i)
Remove variable i from the set of active variables.
Definition: sub.h:343