Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

separator.h
Go to the documentation of this file.
1 
30 #pragma once
31 
32 #include <ogdf/lib/abacus/hash.h>
33 
36 
37 namespace abacus {
38 
39 
41 
42 
44 
65 template <class BaseType, class CoType>
66 class Separator : public AbacusRoot {
67 public:
68 
70 
82  bool nonDuplications,
83  int maxGen=300)
84  :
87  minAbsViolation_(master_->eps()),
89  hash_(0),
90  nDuplications_(0),
91  pool_(0)
92  {
93  if(nonDuplications)
95  }
96 
97 
99  virtual ~Separator() {
100  delete hash_;
101  }
102 
103 
105  virtual void separate() = 0;
106 
108 
117  Separator_CUTFOUND cutFound(BaseType *cv);
118 
120 
124  virtual bool terminateSeparation() {
125  return ( nGen() >= maxGen() );
126  }
127 
130 
131 
133  int nGen() const { return newCons_.number(); }
134 
135 
137  int nDuplications() const { return nDuplications_; }
138 
139 
141  int nCollisions() const;
142 
144  int maxGen() const { return newCons_.size(); }
145 
146 
148  double minAbsViolation() const { return minAbsViolation_; }
149 
150 
152  void minAbsViolation(double minAbsVio) {
153  minAbsViolation_=minAbsVio;
154  }
155 
158  return lpSol_;
159  }
160 
169  pool_ = pool;
170  }
171 
172 protected:
173 
182  bool find(BaseType *cv);
183 
186 
187 private:
194 
198 };
199 
200 }
201 
ogdf::ArrayBuffer
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Definition: Array.h:53
abacus::LpSolution< CoType, BaseType >
abacus::Added
@ Added
Definition: separator.h:40
abacus::NonDuplPool
Standard pools without constraint duplication.
Definition: nonduplpool.h:58
abacus::Separator::nCollisions
int nCollisions() const
Returns the number of collisions in the hash table.
lpsolution.h
lpsolution.
abacus::Separator::minAbsViolation
void minAbsViolation(double minAbsVio)
Sets a new value for minAbsViolation.
Definition: separator.h:152
abacus::Separator::nDuplications_
int nDuplications_
Definition: separator.h:191
abacus::Separator::terminateSeparation
virtual bool terminateSeparation()
Returns true if the separation should be terminated.
Definition: separator.h:124
abacus::Separator::watchNonDuplPool
void watchNonDuplPool(NonDuplPool< BaseType, CoType > *pool)
If the separator checks for duplication of cuts, the test is also done for constraints/variables that...
Definition: separator.h:168
abacus::Separator::master_
Master * master_
A pointer to the corresponding master of the optimization.
Definition: separator.h:184
abacus::Separator::minAbsViolation_
double minAbsViolation_
Definition: separator.h:188
abacus
Definition: ILPClusterPlanarity.h:50
abacus::Separator::maxGen
int maxGen() const
Returns the maximal number of generated cutting planes.
Definition: separator.h:144
abacus::Separator::hash_
AbaHash< unsigned, BaseType * > * hash_
Definition: separator.h:190
abacus::Separator::separate
virtual void separate()=0
This function has to be redefined and should implement the separation routine.
abacus::Separator::pool_
NonDuplPool< BaseType, CoType > * pool_
Definition: separator.h:193
abacus::Separator::lpSol_
LpSolution< CoType, BaseType > * lpSol_
The LP solution to be separated.
Definition: separator.h:185
abacus::Separator::nGen
int nGen() const
Returns the number of generated cutting planes.
Definition: separator.h:133
abacus::AbaHash< unsigned, BaseType * >
abacus::Separator::operator=
const Separator< BaseType, CoType > & operator=(const Separator< BaseType, CoType > &rhs)
ogdf::ArrayBuffer::size
INDEX size() const
Returns number of elements in the buffer.
Definition: ArrayBuffer.h:244
separator.inc
abacus::Separator::minAbsViolation
double minAbsViolation() const
Returns the absolute value for considering a constraint/variable as violated.
Definition: separator.h:148
nonduplpool.h
standard pool without constraint duplication.
abacus::Full
@ Full
Definition: separator.h:40
abacus::Separator::cutBuffer
ArrayBuffer< BaseType * > & cutBuffer()
Returns the buffer with the generated constraints/variable.
Definition: separator.h:129
abacus::Separator
Separators.
Definition: lpsolution.h:40
abacus::Separator::cutFound
Separator_CUTFOUND cutFound(BaseType *cv)
Passes a cut (constraint or variable) to the buffer.
abacus::Separator::newCons_
ArrayBuffer< BaseType * > newCons_
Definition: separator.h:189
abacus::Separator::nDuplications
int nDuplications() const
Returns the number of duplicated constraints/variables which are discarded.
Definition: separator.h:137
abacus::Separator::sendConstraints_
bool sendConstraints_
Definition: separator.h:192
hash.h
hash table.
abacus::Separator::~Separator
virtual ~Separator()
The destructor.
Definition: separator.h:99
abacus::Separator::Separator
Separator(LpSolution< CoType, BaseType > *lpSolution, bool nonDuplications, int maxGen=300)
Creates a separator.
Definition: separator.h:80
abacus::AbacusGlobal
Global data and functions.
Definition: global.h:57
abacus::Separator_CUTFOUND
Separator_CUTFOUND
Definition: separator.h:40
abacus::Separator::lpSolution
LpSolution< CoType, BaseType > * lpSolution()
The lpSolution to be separated.
Definition: separator.h:157
abacus::Separator::find
bool find(BaseType *cv)
abacus::Master
The master of the optimization.
Definition: master.h:69
abacus::Duplication
@ Duplication
Definition: separator.h:40