37 namespace steiner_tree {
74 #ifdef OGDF_FULL_COMPONENT_GENERATION_ALWAYS_SAFE 77 if (dist1[x] < std::numeric_limits<T>::max()
78 && dist2[x] < std::numeric_limits<T>::max()
79 && dist3[x] < std::numeric_limits<T>::max()) {
81 const T tmp = dist1[x] + dist2[x] + dist3[x];
97 func(*it_u, *it_v, *it_w, distance[*it_u], distance[*it_v], distance[*it_w]);
109 && !isTerminal[center]
112 && pred[w][center]) {
113 generateFunction(u, v, w, center, minCost);
Interface for full 3-component generation including auxiliary functions.
ListIteratorBase< E, isConst, isReverse > succ() const
Returns successor iterator.
iterator begin()
Returns an iterator to the first element of the list.
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
void updateBestCenter(node x, node ¢er, 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.
Full3ComponentGeneratorModule()=default
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
virtual 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 =0
Generate full components and call generateFunction for each full component.
Doubly linked lists (maintaining the length of the list).
Declaration of class EdgeWeightedGraph.
Class for the representation of nodes.
Encapsulates a pointer to a list element.
virtual ~Full3ComponentGeneratorModule()=default
The namespace for all OGDF objects.