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
34#include <ogdf/basic/Graph.h>
35#include <ogdf/basic/List.h>
36
37#include <functional>
38
39namespace ogdf {
40template<typename T>
41class EdgeWeightedGraph;
42
43namespace steiner_tree {
44
51template<typename T>
53public:
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}
Includes declaration of graph class.
Declaration of doubly linked lists and iterators.
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
Encapsulates a pointer to a list element.
Definition List.h:113
ListIteratorBase< E, isConst, isReverse > succ() const
Returns successor iterator.
Definition List.h:174
iterator begin()
Returns an iterator to the first element of the list.
Definition List.h:391
Class for the representation of nodes.
Definition Graph_d.h:241
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
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.
The namespace for all OGDF objects.