Primal-Dual approximation algorithm for Steiner tree problems. More...
#include <ogdf/graphalg/MinSteinerTreePrimalDual.h>
Inheritance diagram for ogdf::MinSteinerTreePrimalDual< T >:Public Member Functions | |
| virtual T | call (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, EdgeWeightedGraphCopy< T > *&finalSteinerTree) override |
| Builds a minimum Steiner tree given a weighted graph and a list of terminals. More... | |
| double | getLastLowerBound () const |
| Returns the lower bound calculated while solving the last problem. More... | |
Public Member Functions inherited from ogdf::MinSteinerTreeModule< T > | |
| MinSteinerTreeModule () | |
| virtual | ~MinSteinerTreeModule () |
Protected Member Functions | |
| virtual T | computeSteinerTree (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, EdgeWeightedGraphCopy< T > *&finalSteinerTree) override |
| Builds a minimum Steiner tree given a weighted graph and a list of terminals. More... | |
Private Member Functions | |
| int | getComponent (const node v) const |
| Finds the biggest set including node v. More... | |
| double | getNextEdge (edge *nextEdge) |
| Idendifies the next edge with a tight-to-be packing constraint. More... | |
| void | init () |
| Initializes all required datastructes. More... | |
| bool | isActive (int component) const |
| Returns whether the given component is active. More... | |
| void | makeActive (int component) |
| Marks the specified component as active. More... | |
| void | mergeComponents (const node v, const node w) |
| Merges two disjoint components. More... | |
| void | updatePriorities (double eps) |
| Must be called after merging any two components. More... | |
Private Attributes | |
| HashArray< int, ListIterator< int > > | m_activeComponentIterators |
| List< int > | m_activeComponents |
| NodeArray< int > | m_componentMapping |
| double | m_lowerBound |
| DisjointSets * | m_pComponents |
| const EdgeWeightedGraph< T > * | m_pGraph |
| const NodeArray< bool > * | m_pIsTerminal |
| NodeArray< double > | m_priorities |
| const List< node > * | m_pTerminals |
| const T | MAX_VALUE = std::numeric_limits<T>::max() |
Additional Inherited Members | |
Static Public Member Functions inherited from ogdf::MinSteinerTreeModule< T > | |
| static void | allPairShortestPaths (const EdgeWeightedGraph< T > &G, const List< node > &nonterminals, NodeArray< NodeArray< T > > &distance, NodeArray< NodeArray< edge > > &pred) |
| Undirected All-pair-shortest-paths (Floyd-Warshall) over non-terminal nodes of G. More... | |
| static void | allPairShortestPathsDetour (const EdgeWeightedGraph< T > &G, const List< node > &nonterminals, NodeArray< NodeArray< T > > &distance, NodeArray< NodeArray< edge > > &pred) |
| static void | allPairShortestPathsStrict (const EdgeWeightedGraph< T > &G, const NodeArray< bool > &isTerminal, NodeArray< NodeArray< T > > &distance, NodeArray< NodeArray< edge > > &pred) |
| static void | drawSteinerTreeSVG (const EdgeWeightedGraphCopy< T > &steinerTree, const NodeArray< bool > &isTerminal, const char *filename) |
| Writes a SVG that shows only the given Steiner tree. More... | |
| static void | drawSVG (const EdgeWeightedGraph< T > &G, const NodeArray< bool > &isTerminal, const EdgeWeightedGraphCopy< T > &steinerTree, const char *filename) |
| Writes an SVG file of a minimum Steiner tree in the original graph. More... | |
| static bool | isQuasiBipartite (const EdgeWeightedGraph< T > &G, const NodeArray< bool > &isTerminal) |
| Checks in O(n + m) time if a given Steiner tree problem instance is quasi-bipartite. More... | |
| static bool | isSteinerTree (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, const EdgeWeightedGraphCopy< T > &steinerTree) |
| Checks in O(n) time if a given tree is acually a Steiner Tree. More... | |
| static T | pruneAllDanglingSteinerPaths (EdgeWeightedGraphCopy< T > &steinerTree, const NodeArray< bool > &isTerminal) |
| Prune Steiner nodes with degree 1 and their paths to terminal or branching nodes. More... | |
| static T | pruneDanglingSteinerPathFrom (EdgeWeightedGraphCopy< T > &steinerTree, const NodeArray< bool > &isTerminal, node start) |
| Prune the dangling Steiner path beginning at a given node only. More... | |
| static T | pruneDanglingSteinerPathsFrom (EdgeWeightedGraphCopy< T > &steinerTree, const NodeArray< bool > &isTerminal, const List< node > &start) |
| Prune dangling Steiner paths beginning at given nodes only. More... | |
| static T | removeCyclesFrom (EdgeWeightedGraphCopy< T > &steinerTree, const NodeArray< bool > &isTerminal) |
| Remove remaining cycles from an Steiner "almost" tree. More... | |
| static void | singleSourceShortestPaths (const EdgeWeightedGraph< T > &G, node source, const NodeArray< bool > &isTerminal, NodeArray< T > &distance, NodeArray< edge > &pred) |
| Undirected Single-source-shortest-paths (Dijkstra) over non-terminal nodes of G. More... | |
| static void | singleSourceShortestPathsDetour (const EdgeWeightedGraph< T > &G, node source, const NodeArray< bool > &isTerminal, NodeArray< T > &distance, NodeArray< edge > &pred) |
| static void | singleSourceShortestPathsStrict (const EdgeWeightedGraph< T > &G, node source, const NodeArray< bool > &isTerminal, NodeArray< T > &distance, NodeArray< edge > &pred) |
Primal-Dual approximation algorithm for Steiner tree problems.
Yields a guaranteed approximation factor of two.
This algorithm was first described by Michel X. Goemans and David P. Williamson in "A General Approximation Technique for Constrained Forest Problems", SIAM Journal on Computing, 24:296-317, 1995.
Definition at line 57 of file MinSteinerTreePrimalDual.h.
|
inlineoverridevirtual |
Builds a minimum Steiner tree given a weighted graph and a list of terminals.
| G | The weighted input graph |
| terminals | The list of terminal nodes |
| isTerminal | A bool array of terminals |
| finalSteinerTree | The final Steiner tree |
Reimplemented from ogdf::MinSteinerTreeModule< T >.
Definition at line 142 of file MinSteinerTreePrimalDual.h.
|
overrideprotectedvirtual |
Builds a minimum Steiner tree given a weighted graph and a list of terminals.
| G | The weighted input graph |
| terminals | The list of terminal nodes |
| isTerminal | A bool array of terminals |
| finalSteinerTree | The final Steiner tree |
Implements ogdf::MinSteinerTreeModule< T >.
Definition at line 248 of file MinSteinerTreePrimalDual.h.
|
private |
Finds the biggest set including node v.
| v | the representative of the set to find |
Definition at line 166 of file MinSteinerTreePrimalDual.h.
| double ogdf::MinSteinerTreePrimalDual< T >::getLastLowerBound | ( | ) | const |
Returns the lower bound calculated while solving the last problem.
Will return 0 if no problem was solved before.
Definition at line 327 of file MinSteinerTreePrimalDual.h.
|
private |
Idendifies the next edge with a tight-to-be packing constraint.
| nextEdge | the found edge |
Definition at line 218 of file MinSteinerTreePrimalDual.h.
|
private |
Initializes all required datastructes.
Definition at line 157 of file MinSteinerTreePrimalDual.h.
|
private |
Returns whether the given component is active.
Definition at line 172 of file MinSteinerTreePrimalDual.h.
|
private |
Marks the specified component as active.
| component | the component to be activated. |
Definition at line 178 of file MinSteinerTreePrimalDual.h.
|
private |
Merges two disjoint components.
| v | representative of the first component |
| w | representative of the second component |
Definition at line 184 of file MinSteinerTreePrimalDual.h.
|
private |
Must be called after merging any two components.
Will update all the priorities of all active edges by epsilon.
| eps | the value of the last tight edge |
Definition at line 206 of file MinSteinerTreePrimalDual.h.
|
private |
Definition at line 66 of file MinSteinerTreePrimalDual.h.
|
private |
Definition at line 67 of file MinSteinerTreePrimalDual.h.
|
private |
Definition at line 64 of file MinSteinerTreePrimalDual.h.
|
private |
Definition at line 68 of file MinSteinerTreePrimalDual.h.
|
private |
Definition at line 65 of file MinSteinerTreePrimalDual.h.
|
private |
Definition at line 59 of file MinSteinerTreePrimalDual.h.
|
private |
Definition at line 61 of file MinSteinerTreePrimalDual.h.
|
private |
Definition at line 69 of file MinSteinerTreePrimalDual.h.
|
private |
Definition at line 60 of file MinSteinerTreePrimalDual.h.
|
private |
Definition at line 62 of file MinSteinerTreePrimalDual.h.