Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Full2ComponentGenerator.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
35 #include <ogdf/basic/List.h>
36 
37 #include <functional>
38 
39 namespace ogdf {
40 template<typename T>
41 class EdgeWeightedGraph;
42 
43 namespace steiner_tree {
44 
51 template<typename T>
53 public:
55  inline void call(const EdgeWeightedGraph<T>& G, const List<node>& terminals,
56  const NodeArray<NodeArray<T>>& distance, const NodeArray<NodeArray<edge>>& pred,
57  std::function<void(node, node, T)> generateFunction) const {
58  for (ListConstIterator<node> it_u = terminals.begin(); it_u.valid(); ++it_u) {
59  const node u = *it_u;
60  for (ListConstIterator<node> it_v = it_u.succ(); it_v.valid(); ++it_v) {
61  const node v = *it_v;
62  if (pred[u][v]) {
63  generateFunction(u, v, distance[u][v]);
64  }
65  }
66  }
67  }
68 };
69 
70 }
71 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
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:55
ogdf::ListIteratorBase::succ
ListIteratorBase< E, isConst, isReverse > succ() const
Returns successor iterator.
Definition: List.h:174
ogdf::EdgeWeightedGraph
Definition: GraphIO.h:56
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::Full2ComponentGenerator
Trivial full 2-component generation by lookups of shortest paths between terminal pairs.
Definition: Full2ComponentGenerator.h:52
List.h
Declaration of doubly linked lists and iterators.
ogdf::ListIteratorBase
Encapsulates a pointer to a list element.
Definition: List.h:51
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240