Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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 public:
43  void call(const EdgeWeightedGraph<T>& G, const List<node>& terminals,
44  const NodeArray<bool>& isTerminal, const NodeArray<NodeArray<T>>& distance,
45  const NodeArray<NodeArray<edge>>& pred,
46  std::function<void(node, node, node, node, T)> generateFunction) const {
47  this->forAllTerminalTriples(terminals, distance,
48  [&](node u, node v, node w, const NodeArray<T>& uDistance,
49  const NodeArray<T>& vDistance, const NodeArray<T>& wDistance) {
50  node center = nullptr;
51  T minCost = std::numeric_limits<T>::max();
52  for (node x : G.nodes) {
53  this->updateBestCenter(x, center, minCost, uDistance, vDistance, wDistance);
54  }
55  this->checkAndGenerateFunction(u, v, w, center, minCost, pred, isTerminal,
56  generateFunction);
57  });
58  }
59 };
60 
61 }
62 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::steiner_tree::Full3ComponentGeneratorModule::forAllTerminalTriples
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
Definition: Full3ComponentGeneratorModule.h:84
ogdf::steiner_tree::Full3ComponentGeneratorModule
Interface for full 3-component generation including auxiliary functions.
Definition: Full3ComponentGeneratorModule.h:47
Full3ComponentGeneratorModule.h
Definition of ogdf::steiner_tree::Full3ComponentGeneratorModule class template.
ogdf::EdgeWeightedGraph
Definition: EdgeWeightedGraph.h:39
ogdf::steiner_tree::Full3ComponentGeneratorModule::checkAndGenerateFunction
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: Full3ComponentGeneratorModule.h:98
ogdf::steiner_tree::Full3ComponentGeneratorEnumeration
Full 3-component generation using enumeration.
Definition: Full3ComponentGeneratorEnumeration.h:41
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
ogdf::steiner_tree::Full3ComponentGeneratorModule::updateBestCenter
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.
Definition: Full3ComponentGeneratorModule.h:68
ogdf::steiner_tree::Full3ComponentGeneratorEnumeration::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: Full3ComponentGeneratorEnumeration.h:43
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233