Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
Full2ComponentGenerator.h
Go to the documentation of this file.
1
32#pragma once
33
35
36namespace ogdf {
37namespace steiner_tree {
38
45template<typename T>
47public:
49 inline void call(const EdgeWeightedGraph<T>& G, const List<node>& terminals,
50 const NodeArray<NodeArray<T>>& distance, const NodeArray<NodeArray<edge>>& pred,
51 std::function<void(node, node, T)> generateFunction) const {
52 for (ListConstIterator<node> it_u = terminals.begin(); it_u.valid(); ++it_u) {
53 const node u = *it_u;
54 for (ListConstIterator<node> it_v = it_u.succ(); it_v.valid(); ++it_v) {
55 const node v = *it_v;
56 if (pred[u][v]) {
57 generateFunction(u, v, distance[u][v]);
58 }
59 }
60 }
61 }
62};
63
64}
65}
Declaration of class EdgeWeightedGraph.
Doubly linked lists (maintaining the length of the list).
Definition List.h:1435
Encapsulates a pointer to a list element.
Definition List.h:103
ListIteratorBase< E, isConst, isReverse > succ() const
Returns successor iterator.
Definition List.h:158
iterator begin()
Returns an iterator to the first element of the list.
Definition List.h:375
Dynamic arrays indexed with nodes.
Definition NodeArray.h:125
Class for the representation of nodes.
Definition Graph_d.h:177
Trivial full 2-component generation by lookups of shortest paths between terminal pairs.
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.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.