Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

Full3ComponentGeneratorEnumeration.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 
36 namespace ogdf {
37 namespace steiner_tree {
38 
40 template<typename T>
42 {
43 public:
44  void call(const EdgeWeightedGraph<T> &G,
45  const List<node> &terminals,
46  const NodeArray<bool> &isTerminal,
47  const NodeArray<NodeArray<T>> &distance,
48  const NodeArray<NodeArray<edge>> &pred,
49  std::function<void(node, node, node, node, T)> generateFunction) const
50  {
51  this->forAllTerminalTriples(terminals, distance,
52  [&](node u, node v, node w, const NodeArray<T> &uDistance, const NodeArray<T> &vDistance, const NodeArray<T> &wDistance) {
53  node center = nullptr;
54  T minCost = std::numeric_limits<T>::max();
55  for (node x : G.nodes) {
56  this->updateBestCenter(x, center, minCost, uDistance, vDistance, wDistance);
57  }
58  this->checkAndGenerateFunction(u, v, w, center, minCost, pred, isTerminal, generateFunction);
59  });
60  }
61 };
62 
63 }
64 }
Interface for full 3-component generation including auxiliary functions.
void checkAndGenerateFunction(node u, node v, node w, node center, T minCost, const NodeArray< NodeArray< edge >> &pred, const NodeArray< bool > &isTerminal, std::function< void(node, node, node, node, T)> generateFunction) const
Definition of ogdf::steiner_tree::Full3ComponentGeneratorModule class template.
void updateBestCenter(node x, node &center, T &minCost, const NodeArray< T > &dist1, const NodeArray< T > &dist2, const NodeArray< T > &dist3) const
Update center node if it is the best so far.
void forAllTerminalTriples(const List< node > &terminals, const NodeArray< NodeArray< T >> &distance, std::function< void(node, node, node, const NodeArray< T > &, const NodeArray< T > &, const NodeArray< T > &)> func) const
Doubly linked lists (maintaining the length of the list).
Definition: List.h:40
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.
Class for the representation of nodes.
Definition: Graph_d.h:169
The namespace for all OGDF objects.
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
Definition: Graph_d.h:565