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 #pragma GCC visibility push(default)
40 namespace abacus {
41 
42 class LpSub;
43 class TailOff;
44 class BranchRule;
45 class LPVARSTAT;
46 class Variable;
47 class Master;
48 class InfeasCon;
49 class Constraint;
50 
51 template<class BaseType, class CoType> class CutBuffer;
52 template<class BaseType, class CoType> class Active;
53 template<class BaseType, class CoType> class Pool;
54 template<class BaseType, class CoType> class PoolSlot;
55 template<class BaseType, class CoType> class LpSolution;
56 
57 
59 
69 class OGDF_EXPORT Sub : public AbacusRoot {
70 
71  friend class Master;
72  friend class BoundBranchRule;
73  friend class OpenSub;
74  friend class LpSolution<Constraint, Variable>;
75  friend class LpSolution<Variable, Constraint>;
76 
77 public:
78 
80  enum STATUS {
83  Dormant,
86  Fathomed
87  };
88 
90  enum PHASE {
91  Done,
92  Cutting,
95  Fathoming
96  };
97 
99 
116  Sub(
117  Master *master,
118  double conRes,
119  double varRes,
120  double nnzRes,
121  bool relativeRes = true,
122  ArrayBuffer<PoolSlot<Constraint, Variable> *> *constraints = nullptr,
123  ArrayBuffer<PoolSlot<Variable, Constraint> *> *variables = nullptr);
124 
126 
132  Sub(Master *master, Sub *father, BranchRule *branchRule);
133 
135 
145  virtual ~Sub();
146 
148  bool forceExactSolver() const { return forceExactSolver_; }
149 
151  int level() const { return level_; }
152 
154  int id() const { return id_; }
155 
157  STATUS status() const { return status_; }
158 
160  int nVar() const;
161 
163  int maxVar() const;
164 
166  int nCon() const;
167 
169  int maxCon() const;
170 
172  double lowerBound() const;
173 
175  double upperBound() const;
176 
178 
182  double dualBound() const { return dualBound_; }
183 
185 
196  void dualBound(double x);
197 
199  const Sub *father() const { return father_; }
200 
202  LpSub *lp() const { return lp_; }
203 
205 
211  void maxIterations(int max);
212 
214  Active<Constraint, Variable> *actCon() const { return actCon_; }
215 
217  Active<Variable, Constraint> *actVar() const { return actVar_; }
218 
220 
223  Constraint *constraint(int i) const;
224 
226 
229  SlackStat *slackStat(int i) const { return (*slackStat_)[i]; }
230 
232 
235  Variable *variable(int i) const;
236 
238 
246  double lBound(int i) const { return (*lBound_)[i]; }
247 
249 
256  void lBound(int i, double l);
257 
259 
267  double uBound(int i) const { return (*uBound_)[i]; }
268 
270 
277  void uBound(int i, double u);
278 
280 
292  FSVarStat *fsVarStat(int i) const { return (*fsVarStat_)[i]; }
293 
295 
298  LPVARSTAT *lpVarStat(int i) const { return (*lpVarStat_)[i]; }
299 
301 
304  double xVal(int i) const { return xVal_[i]; }
305 
307 
310  double yVal(int i) const { return yVal_[i]; }
311 
313 
318  bool ancestor(const Sub *sub) const;
319 
321  Master *master() { return master_; }
322 
324  const Master *master() const { return master_; }
325 
327 
334  void removeVars(ArrayBuffer<int> &remove);
335 
337 
344  void removeVar(int i) { removeVarBuffer_->push(i); }
345 
347  double nnzReserve() const { return nnzReserve_; }
348 
353  bool relativeReserve() const { return relativeReserve_; }
354 
356  BranchRule *branchRule() const { return branchRule_; }
357 
359 
372  bool objAllInteger() const;
373 
375 
380  virtual void removeCons(ArrayBuffer<int> &remove);
381 
383 
386  virtual void removeCon(int i);
387 
389 
396  int addConBufferSpace() const;
397 
399 
406  int addVarBufferSpace() const;
407 
409  int nDormantRounds() const { return nDormantRounds_; }
410 
412 
424  void ignoreInTailingOff();
425 
427 
436  virtual int addBranchingConstraint(PoolSlot<Constraint, Variable> *slot);
437 
438 protected:
439 
441 
458  virtual int addCons(ArrayBuffer<Constraint*> &constraints,
459  Pool<Constraint, Variable> *pool = nullptr,
460  ArrayBuffer<bool> *keepInPool = nullptr,
461  ArrayBuffer<double> *rank = nullptr);
462 
464 
469  virtual int addCons(
471 
473 
490  virtual int addVars(ArrayBuffer<Variable*> &variables,
491  Pool<Variable, Constraint> *pool = nullptr,
492  ArrayBuffer<bool> *keepInPool = nullptr,
493  ArrayBuffer<double> *rank = nullptr);
494 
496 
507  virtual int addVars(
509 
511 
525  virtual int variablePoolSeparation(
526  int ranking = 0,
527  Pool<Variable, Constraint> *pool = nullptr,
528  double minViolation = 0.001);
529 
531 
547  virtual int constraintPoolSeparation(
548  int ranking = 0,
549  Pool<Constraint, Variable> *pool = nullptr,
550  double minViolation = 0.001);
551 
553 
556  virtual void activate() { }
557 
559 
564  virtual void deactivate () { }
565 
567 
577  return branchingOnVariable(rules);
578  }
579 
581 
591  virtual int branchingOnVariable(ArrayBuffer<BranchRule*> &rules);
592 
594 
607  virtual int selectBranchingVariable(int &variable);
608 
610 
640  virtual int selectBranchingVariableCandidates(ArrayBuffer<int> &candidates);
641 
643 
655  virtual int selectBestBranchingSample(int nSamples,
656  ArrayBuffer<BranchRule*> **samples);
657 
659 
664  virtual void rankBranchingSample(ArrayBuffer<BranchRule*> &sample,
665  Array<double> &rank);
666 
668 
677  virtual double rankBranchingRule(BranchRule *branchRule);
678 
680 
694  double lpRankBranchingRule(BranchRule *branchRule, int iterLimit = -1);
695 
697 
708  virtual int compareBranchingSampleRanks(Array<double> &rank1,
709  Array<double> &rank2);
710 
712 
721  int closeHalfExpensive(int &branchVar, VarType::TYPE branchVarType);
722 
724  /***
725  * Those variables with fractional part close to \f$0.5\f$ and high absolute objective function
726  * coefficient are selected..
727  *
728  * \param variables Holds the numbers of possible branching variables if
729  * at least one is found. We try to find as many
730  * candidates as fit into this buffer. We abort
731  * the function with a fatal error if the size
732  * of the buffer is 0.
733  * \param branchVarType The type of the branching variable can be restricted either
734  * to VarType::Binary or VarType::Integer.
735  *
736  * \return 0 If at least one branching variable is found, 1 otherwise.
737  */
738  int closeHalfExpensive(ArrayBuffer<int> &variables,
739  VarType::TYPE branchVarType);
740 
742 
749  int closeHalf(int &branchVar, VarType::TYPE branchVarType);
750 
752 
759  int closeHalf(ArrayBuffer<int> &branchVar, VarType::TYPE branchVarType);
760 
762 
769  int findNonFixedSet(ArrayBuffer<int> &branchVar,
770  VarType::TYPE branchVarType);
771 
773 
780  int findNonFixedSet(int &branchVar, VarType::TYPE branchVarType);
781 
783 
798  virtual int initMakeFeas(
799  ArrayBuffer<InfeasCon*> &infeasCon,
800  ArrayBuffer<Variable*> &newVars,
802  {
803  return 1;
804  }
805 
807 
823  virtual int makeFeasible() { return 1; }
824 
836  virtual bool goodCol(Column &col, Array<double> &row,
837  double x, double lb, double ub);
838 
840 
846  virtual void setByLogImp(ArrayBuffer<int> &variable,
847  ArrayBuffer<FSVarStat*> &status) { }
848 
850 
857  virtual bool feasible() = 0;
858 
860 
867  bool integerFeasible();
868 
870 
880  virtual bool primalSeparation();
881 
883 
888  virtual int separate();
889 
891 
900  virtual void conEliminate(ArrayBuffer<int> &remove);
901 
903 
906  virtual void nonBindingConEliminate(ArrayBuffer<int> &remove);
907 
909 
912  virtual void basicConEliminate(ArrayBuffer<int> &remove);
913 
915 
921  virtual void varEliminate(ArrayBuffer<int> &remove);
922 
924 
927  void redCostVarEliminate(ArrayBuffer<int> &remove);
928 
930 
935  virtual int pricing() { return 0; }
936 
938 
946  virtual int improve(double &primalValue);
947 
949 
952  virtual Sub *generateSon(BranchRule *rule) = 0;
953 
955  bool boundCrash() const;
956 
969  virtual bool pausing() { return false; }
970 
972  bool infeasible();
973 
975 
978  virtual void varRealloc(int newSize);
979 
981 
984  virtual void conRealloc(int newSize);
985 
987 
1000  virtual LP::METHOD chooseLpMethod(int nVarRemoved, int nConRemoved,
1001  int nVarAdded, int nConAdded);
1002 
1004 
1015  virtual bool tailingOff() { return true; }
1016 
1018  bool betterDual(double x) const;
1019 
1021 
1025  virtual void selectVars() { }
1026 
1028 
1032  virtual void selectCons() { }
1033 
1035 
1046  virtual int fixByRedCost(bool &newValues, bool saveCand);
1047 
1049  /***
1050  * The default implementation of \a fixByLogImp() does nothing. This
1051  * function has to be redefined if variables should be fixed by logical
1052  * implications in derived classes.
1053  *
1054  * \param variables The variables which should be fixed.
1055  * \param status The statuses these variables should be fixed to.
1056  */
1057  virtual void fixByLogImp(ArrayBuffer<int> &variables,
1058  ArrayBuffer<FSVarStat*> &status) { }
1059 
1061 
1074  virtual int fixAndSet(bool &newValues);
1075 
1077 
1087  virtual int fixing(bool &newValues, bool saveCand = false);
1088 
1090 
1099  virtual int setting(bool &newValues);
1100 
1102 
1105  virtual int setByRedCost();
1106 
1108 
1131  virtual void fathom(bool reoptimize);
1132 
1134 
1139  virtual bool fixAndSetTime() { return true; }
1140 
1142 
1157  virtual int fix(int i, FSVarStat *newStat, bool &newValue);
1158 
1160 
1170  virtual int set(int i, FSVarStat *newStat, bool &newValue);
1171 
1173 
1182  virtual int set(int i, FSVarStat::STATUS newStat, bool &newValue);
1183 
1185 
1195  virtual int set(int i, FSVarStat::STATUS newStat, double value,
1196  bool &newValue);
1197 
1207  virtual double dualRound(double x);
1208 
1210 
1213  virtual double guarantee() const;
1214 
1219  virtual bool guaranteed() const;
1220 
1228  virtual bool removeNonLiftableCons();
1229 
1231 
1237  virtual int prepareBranching(bool &lastIteration);
1238 
1240 
1251  virtual void fathomTheSubTree();
1252 
1254 
1272  virtual int optimize();
1273 
1275 
1291  virtual void reoptimize();
1292 
1294 
1297  virtual void initializeVars(int maxVar);
1298 
1300 
1303  virtual void initializeCons(int maxCon);
1304 
1306 
1326  virtual PHASE branching();
1327 
1329 
1353  virtual PHASE fathoming();
1354 
1356 
1366  virtual PHASE cutting();
1367 
1369 
1377  virtual LpSub *generateLp();
1378 
1380 
1391  virtual int initializeLp();
1392 
1394 
1408  virtual int solveLp();
1409 
1411 
1416  virtual bool exceptionFathom() { return false; }
1417 
1419 
1425  virtual bool exceptionBranch() { return false; }
1426 
1433  virtual bool solveApproxNow() { return false; }
1434 
1435 
1438 
1441 
1444 
1447 
1450 
1452 
1460 
1463 
1466 
1469 
1472 
1475 
1477  double dualBound_;
1478 
1480  int nIter_;
1481 
1484 
1487 
1490 
1496 
1499 
1502 
1505 
1508 
1511 
1513  double *xVal_;
1514 
1516  double *yVal_;
1517 
1519  double *bInvRow_;
1520 
1523 
1526 
1529 
1530 private:
1531 
1533  virtual int _separate();
1534 
1536 
1541  virtual int _conEliminate();
1542 
1544 
1547  virtual int _varEliminate();
1548 
1573  virtual int _pricing(bool &newValues, bool doFixSet = true);
1574 
1576 
1588  virtual int _improve(double &primalValue);
1589 
1591 
1595  virtual int _fixByLogImp(bool &newValues);
1596 
1598 
1602  virtual void updateBoundInLp(int i);
1603 
1605  virtual double fixSetNewBound(int i);
1606 
1608 
1612  virtual void newDormantRound() { ++nDormantRounds_; }
1613 
1615 
1648  virtual PHASE _activate();
1649 
1651 
1660  virtual void _deactivate();
1661 
1663 
1675  virtual int _initMakeFeas();
1676 
1685  virtual int _makeFeasible();
1686 
1688 
1697  virtual int _setByLogImp(bool &newValues);
1698 
1700 
1703  virtual void infeasibleSub();
1704 
1706  virtual void getBase();
1707 
1709 
1713  virtual void activateVars(ArrayBuffer<PoolSlot<Variable, Constraint>*> &newVars);
1714 
1716 
1721  virtual void addVarsToLp(ArrayBuffer<PoolSlot<Variable, Constraint>*> &newVars,
1722  ArrayBuffer<FSVarStat*> *localStatus = nullptr);
1723 
1725 
1728  virtual void _selectVars(ArrayBuffer<PoolSlot<Variable, Constraint>*> &newVars);
1729 
1731  virtual void _selectCons(ArrayBuffer<PoolSlot<Constraint, Variable>*> &newCons);
1732 
1734  virtual int _removeVars(ArrayBuffer<int> &remove);
1735 
1737  virtual int _removeCons(ArrayBuffer<int> &remove);
1738 
1740  bool _atUpperBound(int i);
1741 
1743  bool _atLowerBound(int i);
1744 
1745 
1747  int level_;
1748 
1750  int id_;
1751 
1754 
1757 
1760 
1762  int nOpt_;
1763 
1773 
1775  double varReserve_;
1776 
1778  double conReserve_;
1779 
1781  double nnzReserve_;
1782 
1785 
1787 
1792 
1794 
1799 
1802 
1804 
1807 
1808  Sub(const Sub &rhs);
1809  const Sub &operator=(const Sub &rhs);
1810 };
1811 
1812 }
1813 #pragma GCC visibility pop
1814 
1815 // NOW declaration of sub is complete. its definitions below need full declarations of the below types...
1816 
1817 #include <ogdf/lib/abacus/variable.h>
1819 #include <ogdf/lib/abacus/active.h>
1820 #include <ogdf/lib/abacus/cutbuffer.h>
1821 #include <ogdf/lib/abacus/lpsub.h>
1822 
1823 #pragma GCC visibility push(default)
1824 namespace abacus {
1825 
1827 {
1828  return addConBuffer_->insert(slot, true);
1829 }
1830 
1831 inline int Sub::addConBufferSpace() const
1832 {
1833  return addConBuffer_->space();
1834 }
1835 
1836 inline int Sub::addVarBufferSpace() const
1837 {
1838  return addVarBuffer_->space();
1839 }
1840 
1841 inline int Sub::nVar() const
1842 {
1843  return actVar_->number();
1844 }
1845 
1846 inline int Sub::nCon() const
1847 {
1848  return actCon_->number();
1849 }
1850 
1851 inline int Sub::maxVar() const
1852 {
1853  return actVar_->max();
1854 }
1855 
1856 inline int Sub::maxCon() const
1857 {
1858  return actCon_->max();
1859 }
1860 
1861 inline Constraint *Sub::constraint(int i) const
1862 {
1863  return (*actCon_)[i];
1864 }
1865 
1866 inline Variable *Sub::variable(int i) const
1867 {
1868  return (*actVar_)[i];
1869 }
1870 
1871 inline double Sub::rankBranchingRule(BranchRule *branchRule)
1872 {
1874 }
1875 
1876 inline double Sub::lowerBound() const
1877 {
1878  if (master_->optSense()->max())
1879  return master_->primalBound();
1880  else
1881  return dualBound_;
1882 }
1883 
1884 inline double Sub::upperBound() const
1885 {
1886  if (master_->optSense()->min())
1887  return master_->primalBound();
1888  else
1889  return dualBound_;
1890 }
1891 
1892 inline bool Sub::betterDual(double x) const
1893 {
1894  if (master_->optSense()->max())
1895  return x < dualBound_ ? true : false;
1896  else
1897  return x > dualBound_ ? true : false;
1898 }
1899 
1900 inline bool Sub::boundCrash() const
1901 {
1902  return(master_->primalViolated(dualBound_));
1903 }
1904 
1905 inline void Sub::removeCon(int i)
1906 {
1907  removeConBuffer_->push(i);
1908 }
1909 
1910 inline void Sub::lBound(int i, double l)
1911 {
1912  (*lBound_)[i] = l;
1913  if (lp_)
1914  lp_->changeLBound(i, l);
1915 }
1916 
1917 inline void Sub::uBound(int i, double u)
1918 {
1919  (*uBound_)[i] = u;
1920  if (lp_)
1921  lp_->changeUBound(i, u);
1922 }
1923 
1924 }
1925 #pragma GCC visibility pop
ogdf::ArrayBuffer
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition: Array.h:53
abacus::Sub::actVar
Active< Variable, Constraint > * actVar() const
Returns a pointer to the currently active variables.
Definition: sub.h:217
abacus::LpSolution
LP solutions.
Definition: lpsolution.h:44
abacus::Active
Implements the sets of active constraints and variables which are associated with each subproblem.
Definition: active.h:44
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:1462
abacus::Sub::lp_
LpSub * lp_
A pointer to the corresponding linear program.
Definition: sub.h:1449
abacus::Sub::ActiveSub
@ ActiveSub
The subproblem is currently processed.
Definition: sub.h:82
abacus::Sub::activate
virtual void activate()
Can be used as an entrance point for problem specific activations.
Definition: sub.h:556
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:1015
cutbuffer.h
cutbuffer.
abacus::BranchRule
Abstract base class for all branching rules.
Definition: branchrule.h:60
abacus::Sub::activated_
bool activated_
The variable is true if the function activate() has been called from the function _activate().
Definition: sub.h:1791
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:1032
abacus::Sub::removeVarBuffer_
ArrayBuffer< int > * removeVarBuffer_
The buffer of the variables which are removed at the beginning of the next iteration.
Definition: sub.h:1507
abacus::Sub::setByLogImp
virtual void setByLogImp(ArrayBuffer< int > &variable, ArrayBuffer< FSVarStat * > &status)
The default implementation of setByLogImp() does nothing.
Definition: sub.h:846
abacus::Sub::Branching
@ Branching
We try to generate further subproblems as sons of this subproblem.
Definition: sub.h:94
abacus::Sub::id_
int id_
The number of the subproblem.
Definition: sub.h:1750
abacus::Sub::Unprocessed
@ Unprocessed
The status after generation, but before optimization of the subproblem.
Definition: sub.h:81
abacus::Sub::father_
Sub * father_
A pointer to the father in the branch-and-cut tree.
Definition: sub.h:1446
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:1900
abacus::Sub::makeFeasible
virtual int makeFeasible()
The default implementation of makeFeasible()does nothing.
Definition: sub.h:823
abacus::Sub::rankBranchingRule
virtual double rankBranchingRule(BranchRule *branchRule)
Computes the rank of a branching rule.
Definition: sub.h:1871
abacus::FSVarStat
Status of fixed and set variables.
Definition: fsvarstat.h:47
abacus::Sub::branchRule
BranchRule * branchRule() const
Returns a pointer to the branching rule of the subproblem.
Definition: sub.h:356
abacus::Sub::maxCon
int maxCon() const
Returns the maximum number of constraints which can be handled without reallocation.
Definition: sub.h:1856
abacus::Sub::lastIterVarAdd_
int lastIterVarAdd_
The last iteration in which variables have been added.
Definition: sub.h:1486
abacus::Sub::lpMethod_
LP::METHOD lpMethod_
The solution method for the next linear program.
Definition: sub.h:1498
abacus::CutBuffer
Cut buffers.
Definition: convar.h:46
abacus::Sub::lp
LpSub * lp() const
Returns a pointer to the linear program of the subproblem.
Definition: sub.h:202
abacus::Sub::fixAndSetTime
virtual bool fixAndSetTime()
Controls if variables should be fixed or set when all variables price out correctly.
Definition: sub.h:1139
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:292
abacus::Sub::master
Master * master()
Returns the master of the optimization.
Definition: sub.h:321
abacus
Definition: ILPClusterPlanarity.h:50
abacus::Sub::nnzReserve_
double nnzReserve_
The additional space for nonzeros.
Definition: sub.h:1781
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:1433
abacus::Sub::uBound_
Array< double > * uBound_
A pointer to an array with the local upper bounds of the active variables.
Definition: sub.h:1468
abacus::Sub::actVar_
Active< Variable, Constraint > * actVar_
The active variables of the subproblem.
Definition: sub.h:1443
abacus::Sub::tailOff_
TailOff * tailOff_
A pointer to the tailing off manager.
Definition: sub.h:1474
abacus::BoundBranchRule
Implements a branching rule for modifying the lower and the upper bound of a variable.
Definition: boundbranchrule.h:41
abacus::Master::primalBound
double primalBound() const
Returns the value of the primal bound.
Definition: master.h:279
abacus::Sub::pricing
virtual int pricing()
Should generate inactive variables which do not price out correctly.
Definition: sub.h:935
abacus::Sub::xVal_
double * xVal_
The last LP-solution.
Definition: sub.h:1513
abacus::Sub::level_
int level_
The level of the subproblem in the enumeration tree.
Definition: sub.h:1747
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:246
abacus::Sub::addConBuffer_
CutBuffer< Constraint, Variable > * addConBuffer_
The buffer of the newly generated constraints.
Definition: sub.h:1504
ogdf::StopwatchCPU
Implements a stopwatch measuring CPU time.
Definition: Stopwatch.h:157
abacus::Sub::nIter_
int nIter_
The number of iterations in the cutting plane phase.
Definition: sub.h:1480
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:1495
abacus::Sub::master
const Master * master() const
Returns the const master of the optimization.
Definition: sub.h:324
abacus::Sub::forceExactSolver_
bool forceExactSolver_
Indicates whether to force the use of an exact solver to prepare branching etc.
Definition: sub.h:1806
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:798
abacus::Sub::nVar
int nVar() const
Returns the number of active variables.
Definition: sub.h:1841
abacus::Sub::dualBound_
double dualBound_
The dual bound of the subproblem.
Definition: sub.h:1477
abacus::Pool
Base class for constraint/variabe pools.
Definition: pool.h:63
abacus::Sub::lastIterConAdd_
int lastIterConAdd_
The last iteration in which constraints have been added.
Definition: sub.h:1483
abacus::Sub::relativeReserve
bool relativeReserve() const
Definition: sub.h:353
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:199
abacus::OptSense::min
bool min() const
Returns true If it is minimization problem,, false otherwise.
Definition: optsense.h:85
abacus::SlackStat
Status of slack variables.
Definition: slackstat.h:48
abacus::Sub::variable
Variable * variable(int i) const
Returns a pointer to the i-th active variable.
Definition: sub.h:1866
abacus::Sub::status
STATUS status() const
Returns the status of the subproblem optimization.
Definition: sub.h:157
abacus::Sub::maxVar
int maxVar() const
Returns the maximum number of variables which can be handled without reallocation.
Definition: sub.h:1851
abacus::Sub::Done
@ Done
The optimization is done.
Definition: sub.h:91
abacus::Sub::forceExactSolver
bool forceExactSolver() const
Returns whether using the exact solver is forced.
Definition: sub.h:148
abacus::Sub::infeasCon_
int infeasCon_
The number of an infeasible constraint.
Definition: sub.h:1522
abacus::FSVarStat::STATUS
STATUS
The enumeration defining the different statuses of variables from the point of view of fixing and set...
Definition: fsvarstat.h:51
abacus::Sub::maxIterations_
int maxIterations_
The maximum number of iterations in the cutting plane phase.
Definition: sub.h:1759
ogdf::AlgorithmFailureCode::Constraint
@ Constraint
abacus::Sub::sons_
ArrayBuffer< Sub * > * sons_
The sons of the node in the branch-and-cut tree.
Definition: sub.h:1756
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:1905
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:1892
abacus::Sub::lowerBound
double lowerBound() const
Returns a lower bound on the optimal solution of the subproblem.
Definition: sub.h:1876
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:1836
abacus::Sub::addVarBuffer_
CutBuffer< Variable, Constraint > * addVarBuffer_
The buffer of the newly generated variables.
Definition: sub.h:1501
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:1861
abacus::AbacusRoot
Base class of all other classes of ABACUS.
Definition: abacusroot.h:69
abacus::Sub::master_
Master * master_
A pointer to the corresponding master of the optimization.
Definition: sub.h:1437
abacus::Sub::localTimer_
ogdf::StopwatchCPU localTimer_
Definition: sub.h:1803
abacus::Sub::bInvRow_
double * bInvRow_
A row of the basis inverse associated with the infeasible variable infeasVar_ or slack variable infea...
Definition: sub.h:1519
ogdf::Array
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:219
abacus::Sub::upperBound
double upperBound() const
Returns an upper bound on the optimal solution of the subproblem.
Definition: sub.h:1884
abacus::Sub::STATUS
STATUS
A subproblem can have different statuses.
Definition: sub.h:80
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:1831
abacus::Sub::Processed
@ Processed
The subproblem is completely processed but could not be fathomed.
Definition: sub.h:85
ogdf::ArrayBuffer::push
void push(E e)
Puts a new element in the buffer.
Definition: ArrayBuffer.h:217
Stopwatch.h
Declaration of stopwatch classes.
abacus::Variable
Forms the virtual base class for all possible variables given in pool format.
Definition: variable.h:60
ogdf::AlgorithmFailureCode::Active
@ Active
abacus::Sub::actCon
Active< Constraint, Variable > * actCon() const
Returns a pointer to the currently active constraints.
Definition: sub.h:214
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:1057
abacus::Sub::newDormantRound
virtual void newDormantRound()
Increments the counter for the number of rounds the subproblem is dormant.
Definition: sub.h:1612
abacus::OptSense::max
bool max() const
Returns true if it is maximization problem,, false otherwise.
Definition: optsense.h:91
variable.h
variable.
abacus::Sub::PHASE
PHASE
The optimization of the subproblem can be in one of the following phases.
Definition: sub.h:90
abacus::Sub::id
int id() const
Returns the identity number of the subproblem.
Definition: sub.h:154
abacus::Sub::infeasVar_
int infeasVar_
The number of an infeasible variable.
Definition: sub.h:1525
abacus::Sub::deactivate
virtual void deactivate()
Can be used as entrance point for problem specific deactivations after the subproblem optimization.
Definition: sub.h:564
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:1471
abacus::Master::optSense
const OptSense * optSense() const
Returns a pointer to the object holding the optimization sense of the problem.
Definition: master.h:443
abacus::Sub::level
int level() const
Returns the level of the subproblem in the branch-and-bound tree.
Definition: sub.h:151
abacus::LpSub
The linear program of a subproblem.
Definition: lpsub.h:62
abacus::Sub::actCon_
Active< Constraint, Variable > * actCon_
The active constraints of the subproblem.
Definition: sub.h:1440
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:1459
abacus::LP::METHOD
METHOD
The solution method for the linear program.
Definition: lp.h:94
abacus::Master::nStrongBranchingIterations
int nStrongBranchingIterations() const
The number of simplex iterations that are performed when testing candidates for branching variables w...
Definition: master.h:555
abacus::LPVARSTAT
status of variables.
Definition: lpvarstat.h:51
abacus::Sub::pausing
virtual bool pausing()
Sometimes it is appropriate to put a subproblem back into the list of open subproblems.
Definition: sub.h:969
abacus::Column
Representation of variables in column format.
Definition: column.h:48
abacus::Sub::lastLP_
LP::METHOD lastLP_
The method that was used to solve the last LP.
Definition: sub.h:1801
abacus::Sub::yVal_
double * yVal_
The dual variables of the last linear program.
Definition: sub.h:1516
abacus::TailOff
Tailing off manager.
Definition: tailoff.h:58
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:310
ogdf::AlgorithmFailureCode::Variable
@ Variable
abacus::OpenSub
Maintains open subproblems.
Definition: opensub.h:50
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:304
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:298
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition: config.h:117
abacus::Sub
The subproblem.
Definition: sub.h:69
abacus::Sub::relativeReserve_
bool relativeReserve_
If this member is true then the space reserve of the following three members varReserve_,...
Definition: sub.h:1772
abacus::Constraint
Forms the virtual base class for all possible constraints given in pool format.
Definition: constraint.h:57
abacus::Sub::lBound_
Array< double > * lBound_
A pointer to an array with the local lower bound of the active variables.
Definition: sub.h:1465
abacus::Sub::genNonLiftCons_
bool genNonLiftCons_
If true, then the management of non-liftable constraints is performed.
Definition: sub.h:1528
abacus::PoolSlot
Stores constraints and variables.
Definition: active.h:40
abacus::Sub::nOpt_
int nOpt_
The number of optimizations of the subproblem.
Definition: sub.h:1762
abacus::Sub::exceptionBranch
virtual bool exceptionBranch()
Can be used to specify a problem specific criteria for enforcing a branching step.
Definition: sub.h:1425
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:1798
vartype.h
vartype.
abacus::VarType::TYPE
TYPE
The enumeration with the different variable types.
Definition: vartype.h:48
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:229
abacus::Sub::branchRule_
BranchRule * branchRule_
The branching rule for the subproblem.
Definition: sub.h:1489
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:1416
abacus::Sub::generateBranchRules
virtual int generateBranchRules(ArrayBuffer< BranchRule * > &rules)
Tries to find rules for splitting the current subproblem in further subproblems.
Definition: sub.h:576
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:267
Minisat::Internal::remove
static void remove(V &ts, const T &t)
Definition: Alg.h:37
abacus::Sub::conReserve_
double conReserve_
The additional space for constraints.
Definition: sub.h:1778
abacus::Sub::addBranchingConstraint
virtual int addBranchingConstraint(PoolSlot< Constraint, Variable > *slot)
Adds a branching constraint to the constraint buffer.
Definition: sub.h:1826
abacus::Sub::dualBound
double dualBound() const
Returns a bound which is "better" than the optimal solution of the subproblem w.r....
Definition: sub.h:182
abacus::Sub::nDormantRounds_
int nDormantRounds_
The number of subproblem optimizations the subproblem has already the status Dormant.
Definition: sub.h:1784
abacus::Sub::varReserve_
double varReserve_
The additional space for variables.
Definition: sub.h:1775
abacus::Sub::nDormantRounds
int nDormantRounds() const
Definition: sub.h:409
abacus::Sub::removeConBuffer_
ArrayBuffer< int > * removeConBuffer_
The buffer of the constraints which are removed at the beginning of the next iteration.
Definition: sub.h:1510
abacus::Sub::selectVars
virtual void selectVars()
Is called before variables are selected from the variable buffer.
Definition: sub.h:1025
abacus::Sub::nCon
int nCon() const
Returns the number of active constraints.
Definition: sub.h:1846
abacus::Sub::status_
STATUS status_
The status of the subproblem.
Definition: sub.h:1753
abacus::Master
The master of the optimization.
Definition: master.h:70
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:347
abacus::Sub::removeVar
void removeVar(int i)
Remove variable i from the set of active variables.
Definition: sub.h:344