Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

MinSteinerTreeGoemans139.h
Go to the documentation of this file.
1 
33 #pragma once
34 
43 
44 namespace ogdf {
45 
63 template<typename T>
65 private:
66  class Main;
67 
68 protected:
69  int m_restricted;
73  int m_seed;
74 
75 public:
77  : m_restricted(3)
78  , m_preprocess(true)
79  , m_use2approx(false)
80  , m_separateCycles(false)
81  , m_seed(1337) { }
82 
84 
89  void setMaxComponentSize(int k) { m_restricted = k; }
90 
95  void setSeed(int seed) { m_seed = seed; }
96 
102  void use2Approximation(bool use2approx = true) { m_use2approx = use2approx; }
103 
109  void disablePreprocessing(bool preprocess = true) { m_preprocess = !preprocess; }
110 
116 
117 protected:
126  virtual T computeSteinerTree(const EdgeWeightedGraph<T>& G, const List<node>& terminals,
127  const NodeArray<bool>& isTerminal, EdgeWeightedGraphCopy<T>*& finalSteinerTree) override;
128 };
129 
130 template<typename T>
132  const List<node>& terminals, const NodeArray<bool>& isTerminal,
133  EdgeWeightedGraphCopy<T>*& finalSteinerTree) {
134  std::minstd_rand rng(m_seed);
135  List<node> sortedTerminals(terminals);
137  Main main(G, sortedTerminals, isTerminal, m_restricted, m_use2approx, m_separateCycles);
138  return main.getApproximation(finalSteinerTree, rng, m_preprocess);
139 }
140 
143 template<typename T>
150 
152  enum class Approx2State {
153  Off,
154  On,
155  JustUseIt,
156  };
158 
159  const double m_eps;
160 
163 
166 
168  void findFull2Components(const NodeArray<NodeArray<T>>& distance,
169  const NodeArray<NodeArray<edge>>& pred);
171  void findFull3Components(const NodeArray<NodeArray<T>>& distance,
172  const NodeArray<NodeArray<edge>>& pred);
174  void find3RestrictedComponents();
176  void findFullComponentsDW();
178  void findFullComponentsEMV();
180  template<typename FCG>
181  void retrieveComponents(const FCG& fcg);
183  void findFullComponents();
184 
188 
191  for (int k = m_fullCompStore.size() - 1; k >= 0; --k) {
192  OGDF_ASSERT(k < m_fullCompStore.size());
193  if (m_fullCompStore.extra(k) <= m_eps) {
194  m_fullCompStore.remove(k);
195  }
196  }
197  }
198 
201  ids.quicksort();
202  for (int i = ids.size() - 1; i >= 0; --i) {
203  m_fullCompStore.remove(ids[i]);
204  }
205  }
206 
208  void addComponent(NodeArray<bool>& isNewTerminal, int id) {
209  m_fullCompStore.foreachNode(id, [&](node v) { isNewTerminal[v] = true; });
210  }
211 
214  void preprocess(NodeArray<bool>& isNewTerminal) {
215  Graph H; // a graph where each component is a star
216  NodeArray<int> id(H); // ids each center of the star to the component id
217  NodeArray<node> copy(m_G, nullptr); // ids orig in m_G -> copy in H
218 
219  List<node> centers; // all centers
220  for (int i = 0; i < m_fullCompStore.size(); ++i) {
221  const node center = H.newNode();
222  centers.pushBack(center);
223  id[center] = i;
224 
225  for (node vG : m_fullCompStore.terminals(i)) {
226  node vH = copy[vG];
227  if (!vH) {
228  vH = H.newNode();
229  copy[vG] = vH;
230  }
231  H.newEdge(vH, center); // target is always center
232  }
233  }
234 
235  // find components to be inserted into the steinerTree and insert them
236  ArrayBuffer<int> inactive; // ids of components we insert; we have to remove them from the set of active components afterwards
237  bool changed;
238  do {
239  changed = false;
240  ListIterator<node> it2;
241  for (ListIterator<node> it = centers.begin(); it.valid(); it = it2) {
242  it2 = it.succ();
243  node c = *it;
244  int innerNodes = 0; // count inner nodes
245  for (adjEntry adj : c->adjEntries) {
246  innerNodes += (adj->twinNode()->degree() != 1);
247  }
248  if (innerNodes <= 1) { // this center represents a component to add to steinerTree
249  // insert component into steinerTree
250  addComponent(isNewTerminal, id[c]);
251 
252  // remove center from H (adjacent leaves can remain being isolated nodes)
253  inactive.push(id[c]);
254  H.delNode(c);
255  centers.del(it);
256 
257  changed = true;
258  }
259  }
260  } while (changed);
261 
262  removeComponents(inactive);
263  }
264 
266 
267 public:
269  Main(const EdgeWeightedGraph<T>& G, const List<node>& terminals,
270  const NodeArray<bool>& isTerminal, int restricted, bool use2approx, bool separateCycles,
271  double eps = 1e-8)
272  : m_G(G)
273  , m_isTerminal(isTerminal)
274  , m_terminals(terminals)
275  , m_fullCompStore(G, m_terminals, isTerminal)
276  , m_restricted(restricted)
277  , m_use2approx(use2approx ? Approx2State::On : Approx2State::Off)
278  , m_eps(eps)
279  , m_approx2SteinerTree(nullptr)
280  , m_approx2Weight(0) {
281  if (m_use2approx == Approx2State::On) { // add upper bound by 2-approximation
283  m_approx2Weight = mstT.call(m_G, m_terminals, m_isTerminal, m_approx2SteinerTree);
284  }
285 
286  if (m_restricted > m_terminals.size()) {
287  m_restricted = m_terminals.size();
288  }
289 
290  findFullComponents();
291 
292  steiner_tree::LPRelaxationSER<T> lp(m_G, m_terminals, m_isTerminal, m_fullCompStore,
293  m_approx2Weight, separateCycles ? m_restricted + 1 : 0, m_eps);
294  if (!lp.solve()) {
295  OGDF_ASSERT(m_use2approx == Approx2State::On);
296  m_use2approx = Approx2State::JustUseIt;
297  }
298  }
299 
300  ~Main() { }
301 
303  T getApproximation(EdgeWeightedGraphCopy<T>*& finalSteinerTree, const std::minstd_rand& rng,
304  const bool doPreprocessing = true);
305 };
306 
307 template<typename T>
309  const NodeArray<NodeArray<edge>>& pred) {
311  fcg.call(m_G, m_terminals, distance, pred, [&](node s, node t, T cost) {
312  EdgeWeightedGraphCopy<T> minComp;
313  minComp.setOriginalGraph(m_G);
314  minComp.newEdge(minComp.newNode(s), minComp.newNode(t), distance[s][t]);
315  m_fullCompStore.insert(minComp);
316  });
317 }
318 
319 template<typename T>
321  const NodeArray<NodeArray<edge>>& pred) {
323  fcg.call(m_G, m_terminals, m_isTerminal, distance, pred,
324  [&](node t0, node t1, node t2, node minCenter, T minCost) {
325  // create a full 3-component
326  EdgeWeightedGraphCopy<T> minComp;
327  minComp.setOriginalGraph(m_G);
328  node minCenterC = minComp.newNode(minCenter);
329  minComp.newEdge(minComp.newNode(t0), minCenterC, distance[t0][minCenter]);
330  minComp.newEdge(minComp.newNode(t1), minCenterC, distance[t1][minCenter]);
331  minComp.newEdge(minComp.newNode(t2), minCenterC, distance[t2][minCenter]);
332  m_fullCompStore.insert(minComp);
333  });
334 }
335 
336 template<typename T>
338  NodeArray<NodeArray<T>> distance;
340 
342  m_terminals, m_isTerminal, m_restricted);
343 
344  findFull2Components(distance, pred);
345  if (m_restricted == 3) {
346  findFull3Components(distance, pred);
347  }
348 }
349 
350 template<typename T>
351 template<typename FCG>
353  SubsetEnumerator<node> terminalSubset(m_terminals);
354  for (terminalSubset.begin(2, m_restricted); terminalSubset.valid(); terminalSubset.next()) {
355  EdgeWeightedGraphCopy<T> component;
356  List<node> terminals;
357  terminalSubset.list(terminals);
358  fcg.getSteinerTreeFor(terminals, component);
359  if (fcg.isValidComponent(component)) {
360  m_fullCompStore.insert(component);
361  }
362  }
363 }
364 
365 template<typename T>
367  NodeArray<NodeArray<T>> distance;
370  m_terminals, m_isTerminal, m_restricted);
371 
372  steiner_tree::FullComponentGeneratorDreyfusWagner<T> fcg(m_G, m_terminals, m_isTerminal,
373  distance, pred);
374  fcg.call(m_restricted);
375  retrieveComponents(fcg);
376 }
377 
378 template<typename T>
381  m_isTerminal);
382  fcg.call(m_restricted);
383  retrieveComponents(fcg);
384 }
385 
386 template<typename T>
388  if (m_restricted >= 4) { // use Dreyfus-Wagner based full component generation
390  m_G.numberOfEdges())) {
391  findFullComponentsEMV();
392  } else {
393  findFullComponentsDW();
394  }
395  } else {
396  find3RestrictedComponents();
397  }
398 }
399 
400 template<typename T>
402  const std::minstd_rand& rng, const bool doPreprocessing) {
403  if (m_use2approx == Approx2State::JustUseIt) {
404  // no remaining components
405  finalSteinerTree = m_approx2SteinerTree;
406  return m_approx2Weight;
407  }
408 
409  removeInactiveComponents();
410 
411  NodeArray<bool> isNewTerminal(m_G, false);
412  for (node v : m_terminals) {
413  isNewTerminal[v] = true;
414  }
415 
416  if (doPreprocessing) {
417  preprocess(isNewTerminal);
418  }
419 
420  if (!m_fullCompStore.isEmpty()) {
421  steiner_tree::goemans::Approximation<T> approx(m_G, m_terminals, m_isTerminal,
422  m_fullCompStore, rng, m_eps);
423  approx.solve(isNewTerminal);
424  }
425 
426  T cost = steiner_tree::obtainFinalSteinerTree(m_G, isNewTerminal, m_isTerminal, finalSteinerTree);
427 
428  if (m_use2approx != Approx2State::Off) {
429  if (m_approx2Weight < cost) {
430  delete finalSteinerTree;
431  finalSteinerTree = m_approx2SteinerTree;
432  cost = m_approx2Weight;
433  } else {
434  delete m_approx2SteinerTree;
435  }
436  }
437 
438  return cost;
439 }
440 
441 }
ogdf::ArrayBuffer< int >
ogdf::MinSteinerTreeGoemans139::Main::m_use2approx
Approx2State m_use2approx
Definition: MinSteinerTreeGoemans139.h:157
ogdf::steiner_tree::FullComponentGeneratorDreyfusWagner::call
void call(int restricted)
Definition: FullComponentGeneratorDreyfusWagner.h:367
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::steiner_tree::goemans::Approximation::solve
void solve(NodeArray< bool > &isNewTerminal)
Perform the actual approximation algorithm on the LP solution.
Definition: Approximation.h:333
ogdf::SubsetEnumerator
Enumerator for k-subsets of a given type.
Definition: SubsetEnumerator.h:88
ogdf::MinSteinerTreeGoemans139::Main::m_eps
const double m_eps
epsilon for double operations
Definition: MinSteinerTreeGoemans139.h:159
ogdf::MinSteinerTreeGoemans139::Main::m_approx2SteinerTree
EdgeWeightedGraphCopy< T > * m_approx2SteinerTree
Definition: MinSteinerTreeGoemans139.h:161
OGDF_ASSERT
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition: basic.h:54
ogdf::MinSteinerTreeTakahashi::call
virtual T call(const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, EdgeWeightedGraphCopy< T > *&finalSteinerTree, const node startNode)
An extended call method with specific start node.
Definition: MinSteinerTreeTakahashi.h:70
ogdf::MinSteinerTreeGoemans139::m_restricted
int m_restricted
Definition: MinSteinerTreeGoemans139.h:66
ogdf::MinSteinerTreeGoemans139::Main::removeComponents
void removeComponents(ArrayBuffer< int > &ids)
Remove the full components with the given ids.
Definition: MinSteinerTreeGoemans139.h:200
ogdf::MinSteinerTreeGoemans139::separateCycles
void separateCycles(bool separateCycles=true)
Use stronger LP relaxation (not recommended in general)
Definition: MinSteinerTreeGoemans139.h:115
Full2ComponentGenerator.h
Definition of ogdf::steiner_tree::Full2ComponentGenerator class template.
ogdf::EdgeWeightedGraphCopy::setOriginalGraph
void setOriginalGraph(const Graph *wG) override
Associates the graph copy with G, but does not create any nodes or edges.
Definition: EdgeWeightedGraphCopy.h:158
ogdf::steiner_tree::FullComponentGeneratorDreyfusWagnerWithoutMatrix
A generator for restricted full components (for Steiner tree approximations) based on the Dreyfus-Wag...
Definition: FullComponentGeneratorDreyfusWagnerWithoutMatrix.h:55
ogdf::SubsetEnumerator::begin
void begin(int low, int high)
Initializes the SubsetEnumerator to enumerate subsets of cardinalities from low to high.
Definition: SubsetEnumerator.h:120
ogdf::steiner_tree::obtainFinalSteinerTree
T obtainFinalSteinerTree(const EdgeWeightedGraph< T > &G, const NodeArray< bool > &isTerminal, const NodeArray< bool > &isOriginalTerminal, EdgeWeightedGraphCopy< T > *&finalSteinerTree)
Definition: common_algorithms.h:164
ogdf::SubsetEnumerator::valid
bool valid() const
Checks if the current subset is valid. If not, the subset is either not initialized or all subsets ha...
Definition: SubsetEnumerator.h:145
ogdf::MinSteinerTreeGoemans139::Main::m_restricted
int m_restricted
Definition: MinSteinerTreeGoemans139.h:151
ogdf::steiner_tree::FullComponentStore::insert
void insert(const EdgeWeightedGraphCopy< T > &comp)
Inserts a component. Note that comp is copied and degree-2 nodes are removed.
Definition: FullComponentStore.h:151
ogdf::MinSteinerTreeGoemans139::Main::preprocess
void preprocess(NodeArray< bool > &isNewTerminal)
Preprocess LP solution.
Definition: MinSteinerTreeGoemans139.h:214
ogdf::steiner_tree::Full2ComponentGenerator::call
void call(const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< NodeArray< T >> &distance, const NodeArray< NodeArray< edge >> &pred, std::function< void(node, node, T)> generateFunction) const
Generate full 2-components and call generateFunction for each full 2-component.
Definition: Full2ComponentGenerator.h:49
ogdf::MinSteinerTreeGoemans139::Main::find3RestrictedComponents
void find3RestrictedComponents()
Find 3-restricted components.
Definition: MinSteinerTreeGoemans139.h:337
ogdf::EdgeWeightedGraphCopy::newEdge
edge newEdge(node u, node v, T weight)
Definition: EdgeWeightedGraphCopy.h:165
ogdf::MinSteinerTreeGoemans139::m_seed
int m_seed
Definition: MinSteinerTreeGoemans139.h:73
ogdf::steiner_tree::FullComponentGeneratorDreyfusWagner
A generator for restricted full components (for Steiner tree approximations) based on the Dreyfus-Wag...
Definition: FullComponentGeneratorDreyfusWagner.h:51
ogdf::MinSteinerTreeGoemans139::Main::findFullComponents
void findFullComponents()
Find full components.
Definition: MinSteinerTreeGoemans139.h:387
Approximation.h
Definition of ogdf::steiner_tree::goemans::Approximation class template.
ogdf::MinSteinerTreeGoemans139
This class implements the (1.39+epsilon)-approximation algorithm for the Steiner tree problem by Goem...
Definition: MinSteinerTreeGoemans139.h:64
ogdf::MinSteinerTreeGoemans139::Main::removeInactiveComponents
void removeInactiveComponents()
Remove inactive components from m_fullCompStore (since we do not need them any longer)
Definition: MinSteinerTreeGoemans139.h:190
ogdf::MinSteinerTreeGoemans139::computeSteinerTree
virtual T computeSteinerTree(const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, EdgeWeightedGraphCopy< T > *&finalSteinerTree) override
Builds a minimum Steiner tree for a given weighted graph with terminals.
Definition: MinSteinerTreeGoemans139.h:131
ogdf::MinSteinerTreeGoemans139::Main::findFullComponentsDW
void findFullComponentsDW()
Find full components using algorithm by Dreyfus-Wagner.
Definition: MinSteinerTreeGoemans139.h:366
ogdf::MinSteinerTreeGoemans139::Main::m_terminals
const List< node > & m_terminals
List of terminals.
Definition: MinSteinerTreeGoemans139.h:147
ogdf::MinSteinerTreeGoemans139::Main::findFull2Components
void findFull2Components(const NodeArray< NodeArray< T >> &distance, const NodeArray< NodeArray< edge >> &pred)
Find full components of size 2.
Definition: MinSteinerTreeGoemans139.h:308
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:135
ogdf::MinSteinerTreeModule
Serves as an interface for various methods to compute or approximate minimum Steiner trees on undirec...
Definition: MinSteinerTreeModule.h:59
ogdf::ListIteratorBase::succ
ListIteratorBase< E, isConst, isReverse > succ() const
Returns successor iterator.
Definition: List.h:164
ogdf::MinSteinerTreeGoemans139::Main::m_isTerminal
const NodeArray< bool > & m_isTerminal
Definition: MinSteinerTreeGoemans139.h:146
ogdf::steiner_tree::LPRelaxationSER
Class managing the component-based subtour elimination LP relaxation for the Steiner tree problem and...
Definition: LPRelaxationSER.h:52
ogdf::steiner_tree::Full3ComponentGeneratorVoronoi
Full 3-component generation using Voronoi regions.
Definition: Full3ComponentGeneratorVoronoi.h:42
ogdf::SubsetEnumerator::list
void list(List< T > &subset) const
Obtains (appends) a list of the subset members.
Definition: SubsetEnumerator.h:202
FullComponentGeneratorDreyfusWagner.h
Definition of the ogdf::steiner_tree::FullComponentGeneratorDreyfusWagner class template.
Minisat::Internal::copy
static void copy(const T &from, T &to)
Definition: Alg.h:61
ogdf::ArrayBuffer::quicksort
void quicksort()
Sorts buffer using Quicksort.
Definition: ArrayBuffer.h:420
ogdf::steiner_tree::LPRelaxationSER::solve
bool solve()
Solve the LP. The solution will be written to the extra data of the full component store.
Definition: LPRelaxationSER.h:311
common_algorithms.h
Algorithms used by at least two functions of Steiner tree code or its internal helpers.
ogdf::NodeElement::degree
int degree() const
Returns the degree of the node (indegree + outdegree).
Definition: Graph_d.h:276
ogdf::MinSteinerTreeGoemans139::Main
Class managing LP-based approximation.
Definition: MinSteinerTreeGoemans139.h:144
ogdf::MinSteinerTreeGoemans139::m_preprocess
bool m_preprocess
Definition: MinSteinerTreeGoemans139.h:70
ogdf::MinSteinerTreeModule::sortTerminals
static void sortTerminals(List< node > &terminals)
Sort terminals by index.
Definition: MinSteinerTreeModule.h:317
FullComponentGeneratorDreyfusWagnerWithoutMatrix.h
Definition of the ogdf::steiner_tree::FullComponentGeneratorDreyfusWagnerWithoutMatrix class template...
ogdf::EdgeWeightedGraph
Definition: EdgeWeightedGraph.h:39
ogdf::NodeElement::adjEntries
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
Definition: Graph_d.h:264
FullComponentGeneratorCaller.h
Definition of the FullComponentGeneratorCaller class template.
ogdf::MinSteinerTreeGoemans139::Main::~Main
~Main()
Definition: MinSteinerTreeGoemans139.h:300
ogdf::steiner_tree::FullComponentGeneratorCaller::computeDistanceMatrix
static void computeDistanceMatrix(NodeArray< NodeArray< T >> &distance, NodeArray< NodeArray< edge >> &pred, const EdgeWeightedGraph< T > &graph, const List< node > &terminals, const NodeArray< bool > &isTerminal, int restricted)
Computes distance and predecessor matrix.
Definition: FullComponentGeneratorCaller.h:50
ogdf::MinSteinerTreeGoemans139::setSeed
void setSeed(int seed)
Set seed for the random number generation.
Definition: MinSteinerTreeGoemans139.h:95
ogdf::ArrayBuffer::size
INDEX size() const
Returns number of elements in the buffer.
Definition: ArrayBuffer.h:236
ogdf::ArrayBuffer::push
void push(E e)
Puts a new element in the buffer.
Definition: ArrayBuffer.h:209
main
int main()
Definition: gen-acyclic-graph.cpp:7
ogdf::MinSteinerTreeGoemans139::~MinSteinerTreeGoemans139
virtual ~MinSteinerTreeGoemans139()
Definition: MinSteinerTreeGoemans139.h:83
ogdf::GraphCopyBase::newNode
node newNode(node vOrig)
Creates a new node in the graph copy with original node vOrig.
Definition: GraphCopy.h:185
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: List.h:42
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
Approx2State
Approx2State
Definition: MinSteinerTreeGoemans139.h:152
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:862
ogdf::MinSteinerTreeGoemans139::Main::getApproximation
T getApproximation(EdgeWeightedGraphCopy< T > *&finalSteinerTree, const std::minstd_rand &rng, const bool doPreprocessing=true)
Obtain an (1.39+epsilon)-approximation based on the LP solution.
Definition: MinSteinerTreeGoemans139.h:401
ogdf::steiner_tree::FullComponentDecisions::shouldUseErickson
static bool shouldUseErickson(int n, int m)
Returns true iff the rule of thumb predicts to use the algorithm by Erickson et al instead of the Dre...
Definition: FullComponentDecisions.h:108
ogdf::MinSteinerTreeGoemans139::Main::m_approx2Weight
T m_approx2Weight
Definition: MinSteinerTreeGoemans139.h:162
ogdf::MinSteinerTreeGoemans139::Main::findFull3Components
void findFull3Components(const NodeArray< NodeArray< T >> &distance, const NodeArray< NodeArray< edge >> &pred)
Find full components of size 3.
Definition: MinSteinerTreeGoemans139.h:320
ogdf::MinSteinerTreeGoemans139::Main::m_G
const EdgeWeightedGraph< T > & m_G
Definition: MinSteinerTreeGoemans139.h:145
ogdf::AdjElement::twinNode
node twinNode() const
Returns the associated node of the corresponding adjacency entry (shorthand for twin()->theNode()).
Definition: Graph_d.h:168
ogdf::MinSteinerTreeGoemans139::Main::addComponent
void addComponent(NodeArray< bool > &isNewTerminal, int id)
Add a full component to the final solution (by changing nonterminals to terminals)
Definition: MinSteinerTreeGoemans139.h:208
ogdf::MinSteinerTreeGoemans139::Main::findFullComponentsEMV
void findFullComponentsEMV()
Find full components using algorithm by Erickson et al.
Definition: MinSteinerTreeGoemans139.h:379
ogdf::MinSteinerTreeGoemans139::disablePreprocessing
void disablePreprocessing(bool preprocess=true)
Disable preprocessing of LP solutions.
Definition: MinSteinerTreeGoemans139.h:109
ogdf::MinSteinerTreeTakahashi
This class implements the minimum Steiner tree 2-approximation algorithm by Takahashi and Matsuyama w...
Definition: MinSteinerTreeTakahashi.h:57
ogdf::List::del
void del(iterator it)
Removes it from the list.
Definition: List.h:1601
ogdf::MinSteinerTreeGoemans139::MinSteinerTreeGoemans139
MinSteinerTreeGoemans139()
Definition: MinSteinerTreeGoemans139.h:76
ogdf::steiner_tree::Full2ComponentGenerator
Trivial full 2-component generation by lookups of shortest paths between terminal pairs.
Definition: Full2ComponentGenerator.h:46
ogdf::MinSteinerTreeGoemans139::m_separateCycles
bool m_separateCycles
Definition: MinSteinerTreeGoemans139.h:72
ogdf::steiner_tree::Full3ComponentGeneratorVoronoi::call
void call(const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, const NodeArray< NodeArray< T >> &distance, const NodeArray< NodeArray< edge >> &pred, std::function< void(node, node, node, node, T)> generateFunction) const
Generate full components and call generateFunction for each full component.
Definition: Full3ComponentGeneratorVoronoi.h:44
ogdf::EdgeWeightedGraphCopy
Definition: EdgeWeightedGraphCopy.h:40
ogdf::SubsetEnumerator::next
void next()
Obtains the next subset if possible. The result should be checked using the valid() method.
Definition: SubsetEnumerator.h:165
ogdf::steiner_tree::FullComponentGeneratorDreyfusWagnerWithoutMatrix::call
void call(int restricted)
Definition: FullComponentGeneratorDreyfusWagnerWithoutMatrix.h:491
ogdf::MinSteinerTreeGoemans139::Main::m_fullCompStore
steiner_tree::FullComponentWithExtraStore< T, double > m_fullCompStore
all enumerated full components, with solution
Definition: MinSteinerTreeGoemans139.h:149
ogdf::List::size
int size() const
Returns the number of elements in the list.
Definition: List.h:1478
ogdf::ListIteratorBase
Encapsulates a pointer to a list element.
Definition: List.h:46
Full3ComponentGeneratorVoronoi.h
Definition of ogdf::steiner_tree::Full3ComponentGeneratorVoronoi class template.
ogdf::MinSteinerTreeGoemans139::Main::Main
Main(const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, int restricted, bool use2approx, bool separateCycles, double eps=1e-8)
Initialize all attributes, sort the terminal list.
Definition: MinSteinerTreeGoemans139.h:269
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::MinSteinerTreeGoemans139::Main::retrieveComponents
void retrieveComponents(const FCG &fcg)
Auxiliary function to retrieve components by Dreyfus-Wagner/Erickson et al implementation.
Definition: MinSteinerTreeGoemans139.h:352
ogdf::steiner_tree::FullComponentWithExtraStore< T, double >
ogdf::MinSteinerTreeGoemans139::use2Approximation
void use2Approximation(bool use2approx=true)
Use Takahashi-Matsuyama 2-approximation as upper bounds.
Definition: MinSteinerTreeGoemans139.h:102
ogdf::List::pushBack
iterator pushBack(const E &x)
Adds element x at the end of the list.
Definition: List.h:1537
LPRelaxationSER.h
Definition of ogdf::steiner_tree::LPRelaxationSER class template.
ogdf::MinSteinerTreeGoemans139::setMaxComponentSize
void setMaxComponentSize(int k)
Sets the maximal number of terminals in a full component.
Definition: MinSteinerTreeGoemans139.h:89
ogdf::steiner_tree::goemans::Approximation
The actual 1.39-approximation algorithm by Goemans et al. with a set of terminalized nodes as result.
Definition: Approximation.h:49
ogdf::MinSteinerTreeGoemans139::m_use2approx
bool m_use2approx
Definition: MinSteinerTreeGoemans139.h:71