Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Full3ComponentGeneratorEnumeration.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
36 
37 #include <functional>
38 #include <limits>
39 
40 namespace ogdf {
41 template<class E>
42 class List;
43 template<typename T>
44 class EdgeWeightedGraph;
45 
46 namespace steiner_tree {
47 
49 template<typename T>
51 public:
52  void call(const EdgeWeightedGraph<T>& G, const List<node>& terminals,
53  const NodeArray<bool>& isTerminal, const NodeArray<NodeArray<T>>& distance,
54  const NodeArray<NodeArray<edge>>& pred,
55  std::function<void(node, node, node, node, T)> generateFunction) const {
56  this->forAllTerminalTriples(terminals, distance,
57  [&](node u, node v, node w, const NodeArray<T>& uDistance,
58  const NodeArray<T>& vDistance, const NodeArray<T>& wDistance) {
59  node center = nullptr;
60  T minCost = std::numeric_limits<T>::max();
61  for (node x : G.nodes) {
62  this->updateBestCenter(x, center, minCost, uDistance, vDistance, wDistance);
63  }
64  this->checkAndGenerateFunction(u, v, w, center, minCost, pred, isTerminal,
65  generateFunction);
66  });
67  }
68 };
69 
70 }
71 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
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:90
Graph.h
Includes declaration of graph class.
ogdf::steiner_tree::Full3ComponentGeneratorModule
Interface for full 3-component generation including auxiliary functions.
Definition: MinSteinerTreeZelikovsky.h:56
Full3ComponentGeneratorModule.h
Definition of ogdf::steiner_tree::Full3ComponentGeneratorModule class template.
ogdf::EdgeWeightedGraph
Definition: GraphIO.h:56
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:104
ogdf::steiner_tree::Full3ComponentGeneratorEnumeration
Full 3-component generation using enumeration.
Definition: Full3ComponentGeneratorEnumeration.h:50
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
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:74
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:52
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240