This class computes save edges recursively and stores for every node pair their save edge in a HashArray. More...
#include <ogdf/graphalg/steiner_tree/SaveEnum.h>
Public Member Functions | |
SaveEnum (EdgeWeightedGraphCopy< T > &steinerTree) | |
Initializes the data structures and calculates a MST of the given complete terminal graph. More... | |
virtual | ~SaveEnum () |
virtual T | gain (node u, node v, node w) const |
Returns the gain (sum of the save edges) of a node triple by an table lookup. More... | |
void | rebuild () |
Rebuild the lookup table (necessary if the tree has changed) More... | |
virtual edge | saveEdge (node u, node v) const |
Determines the save edge between two nodes by a table lookup. More... | |
virtual T | saveWeight (node u, node v) const |
Determines the weight of the save edge between two nodes by a table lookup. More... | |
virtual void | update (const Triple< T > &t) |
Updates the weighted tree data structure given a contracted triple. More... | |
Public Member Functions inherited from ogdf::steiner_tree::Save< T > | |
Save () | |
virtual | ~Save () |
Protected Member Functions | |
void | build () |
Build the lookup table. More... | |
void | buildRecursively (EdgeArray< bool > &hidden, node u, List< node > &processedNodes) |
Builds the lookup table for the save edges recursively. More... | |
Private Attributes | |
Array2D< edge > | m_save |
Data structure for the lookup table. More... | |
EdgeWeightedGraphCopy< T > * | m_steinerTree |
The current terminal spanning tree. More... | |
This class computes save edges recursively and stores for every node pair their save edge in a HashArray.
Definition at line 59 of file SaveEnum.h.
|
inlineexplicit |
Initializes the data structures and calculates a MST of the given complete terminal graph.
steinerTree | the given terminal spanning tree |
Definition at line 65 of file SaveEnum.h.
|
inlinevirtual |
Definition at line 72 of file SaveEnum.h.
|
inlineprotected |
Build the lookup table.
Definition at line 148 of file SaveEnum.h.
|
inlineprotected |
Builds the lookup table for the save edges recursively.
This is done by first finding the maximum weighted edge in the graph. This edge partitions the graph and is the save edge for each pair of nodes such that not both of the nodes come from the same partition. This procedure is then applied to both partitions recursively.
hidden | Bool array of hidden edges |
u | Starting node for traversing a partition in order to find a maximum weighted edge |
processedNodes | List of seen nodes during the traversing (all nodes of the component) |
Definition at line 167 of file SaveEnum.h.
|
inlinevirtual |
Returns the gain (sum of the save edges) of a node triple by an table lookup.
u | First triple node |
v | Second triple node |
w | Third triple node |
Implements ogdf::steiner_tree::Save< T >.
Definition at line 106 of file SaveEnum.h.
|
inline |
Rebuild the lookup table (necessary if the tree has changed)
Definition at line 122 of file SaveEnum.h.
|
inlinevirtual |
Determines the save edge between two nodes by a table lookup.
u | First terminal |
v | Second terminal |
Implements ogdf::steiner_tree::Save< T >.
Definition at line 93 of file SaveEnum.h.
|
inlinevirtual |
Determines the weight of the save edge between two nodes by a table lookup.
u | First terminal |
v | Second terminal |
Implements ogdf::steiner_tree::Save< T >.
Definition at line 80 of file SaveEnum.h.
|
inlinevirtual |
Updates the weighted tree data structure given a contracted triple.
The update first inserts two 0-cost edges into the complete terminal graph and removes the two save edges. Afterward the lookup table is rebuild.
t | The contracted triple |
Implements ogdf::steiner_tree::Save< T >.
Definition at line 134 of file SaveEnum.h.
|
private |
Data structure for the lookup table.
Definition at line 216 of file SaveEnum.h.
|
private |
The current terminal spanning tree.
Definition at line 217 of file SaveEnum.h.