Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

ogdf::MinSteinerTreeDualAscent< T > Class Template Reference

Dual ascent approximation algorithm for Steiner tree problems. More...

#include <ogdf/graphalg/MinSteinerTreeDualAscent.h>

+ Inheritance diagram for ogdf::MinSteinerTreeDualAscent< T >:

Protected Member Functions

T computeSteinerTree (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, EdgeWeightedGraphCopy< T > *&finalSteinerTree)
 Creates a minimum Steiner tree given a weighted graph and a list of terminals. More...
 

Private Member Functions

List< edge > * computeCutSet (const node v) const
 Returns all incoming cut edges of the component of v. More...
 
int findActiveComponent (node *terminal) const
 Searches for the next active component. More...
 
int findComponent (const node v) const
 Returns the component of node v. More...
 
void init ()
 Intializes all relevant variables. More...
 
bool isActiveComponent (const node v) const
 Determines whether a strongly connected component is active (paper says "is root component"). More...
 
bool isTerminal (const node v, bool rootIsTerminal) const
 Returns whether this node is a terminal. More...
 
void updateComponents ()
 Re-establishes all strongly connected components for the Steiner graph. More...
 

Private Attributes

NodeArray< int > m_componentMapping
 
GraphCopy m_diGraph
 
EdgeArray< bool > m_edgeInclusions
 
EdgeArray< T > m_edgeSlacks
 
EdgeArray< edge > m_origMapping
 
const NodeArray< bool > * m_pIsTerminal
 
const EdgeWeightedGraph< T > * m_pOrigGraph
 
const List< node > * m_pTerminals
 
node m_rootTerminal
 
GraphCopy m_steinerGraph
 
const T MAX_VALUE = std::numeric_limits<T>::max()
 

Additional Inherited Members

- Public Member Functions inherited from ogdf::MinSteinerTreeModule< T >
 MinSteinerTreeModule ()
 
virtual ~MinSteinerTreeModule ()
 
virtual T call (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, EdgeWeightedGraphCopy< T > *&finalSteinerTree)
 Builds a minimum Steiner tree given a weighted graph and a list of terminals. More...
 
- 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)
 

Detailed Description

template<typename T>
class ogdf::MinSteinerTreeDualAscent< T >

Dual ascent approximation algorithm for Steiner tree problems.

The algorithm is implemented following the paper by Richard T. DualAscent, "A Dual Ascent Approach for Steiner Tree Problems on a Directed Graph", Mathematical Programming 28, pages 271-287, 1984.

Definition at line 53 of file MinSteinerTreeDualAscent.h.

Member Function Documentation

◆ computeCutSet()

template<typename T >
List< edge > * ogdf::MinSteinerTreeDualAscent< T >::computeCutSet ( const node  v) const
private

Returns all incoming cut edges of the component of v.

Parameters
vrepresentative of the component
Returns
a list of edges containing each incoming cut edge once

Definition at line 263 of file MinSteinerTreeDualAscent.h.

◆ computeSteinerTree()

template<typename T >
T ogdf::MinSteinerTreeDualAscent< T >::computeSteinerTree ( const EdgeWeightedGraph< T > &  G,
const List< node > &  terminals,
const NodeArray< bool > &  isTerminal,
EdgeWeightedGraphCopy< T > *&  finalSteinerTree 
)
protectedvirtual

Creates a minimum Steiner tree given a weighted graph and a list of terminals.

Parameters
GThe weighted input graph
terminalsThe list of terminal nodes
isTerminalA bool array of terminals
finalSteinerTreeThe final Steiner tree
Returns
The objective value (sum of edge costs) of the final Steiner tree

Implements ogdf::MinSteinerTreeModule< T >.

Definition at line 351 of file MinSteinerTreeDualAscent.h.

◆ findActiveComponent()

template<typename T >
int ogdf::MinSteinerTreeDualAscent< T >::findActiveComponent ( node *  terminal) const
private

Searches for the next active component.

Parameters
terminalWill hold an arbitrary terminal of the returned component.
Returns
the index of the found componennt or -1 if none is found

Definition at line 225 of file MinSteinerTreeDualAscent.h.

◆ findComponent()

template<typename T >
int ogdf::MinSteinerTreeDualAscent< T >::findComponent ( const node  v) const
private

Returns the component of node v.

Parameters
vthe node of the component
Returns
the found component

Definition at line 202 of file MinSteinerTreeDualAscent.h.

◆ init()

template<typename T >
void ogdf::MinSteinerTreeDualAscent< T >::init ( )
private

Intializes all relevant variables.

Creates the respectiv graph copies.

Definition at line 156 of file MinSteinerTreeDualAscent.h.

◆ isActiveComponent()

template<typename T >
bool ogdf::MinSteinerTreeDualAscent< T >::isActiveComponent ( const node  v) const
private

Determines whether a strongly connected component is active (paper says "is root component").

A component is active if and only if it has no dangling terminal node and includes at least one component.

Parameters
vrepresentative of the component
Returns
true if active, false otherwise

Definition at line 307 of file MinSteinerTreeDualAscent.h.

◆ isTerminal()

template<typename T >
bool ogdf::MinSteinerTreeDualAscent< T >::isTerminal ( const node  v,
bool  rootIsTerminal 
) const
private

Returns whether this node is a terminal.

If v is the root terminal, the second parameter will be returned.

Parameters
vthe node to be tested
rootIsTerminalwhether the root terminal should be considered as terminal
Returns
true if v is a terminal, false otherwise

Definition at line 217 of file MinSteinerTreeDualAscent.h.

◆ updateComponents()

template<typename T >
void ogdf::MinSteinerTreeDualAscent< T >::updateComponents ( )
private

Re-establishes all strongly connected components for the Steiner graph.

Definition at line 211 of file MinSteinerTreeDualAscent.h.

Member Data Documentation

◆ m_componentMapping

template<typename T >
NodeArray<int> ogdf::MinSteinerTreeDualAscent< T >::m_componentMapping
private

Definition at line 72 of file MinSteinerTreeDualAscent.h.

◆ m_diGraph

template<typename T >
GraphCopy ogdf::MinSteinerTreeDualAscent< T >::m_diGraph
private

Definition at line 62 of file MinSteinerTreeDualAscent.h.

◆ m_edgeInclusions

template<typename T >
EdgeArray<bool> ogdf::MinSteinerTreeDualAscent< T >::m_edgeInclusions
private

Definition at line 66 of file MinSteinerTreeDualAscent.h.

◆ m_edgeSlacks

template<typename T >
EdgeArray<T> ogdf::MinSteinerTreeDualAscent< T >::m_edgeSlacks
private

Definition at line 67 of file MinSteinerTreeDualAscent.h.

◆ m_origMapping

template<typename T >
EdgeArray<edge> ogdf::MinSteinerTreeDualAscent< T >::m_origMapping
private

Definition at line 64 of file MinSteinerTreeDualAscent.h.

◆ m_pIsTerminal

template<typename T >
const NodeArray<bool>* ogdf::MinSteinerTreeDualAscent< T >::m_pIsTerminal
private

Definition at line 60 of file MinSteinerTreeDualAscent.h.

◆ m_pOrigGraph

template<typename T >
const EdgeWeightedGraph<T>* ogdf::MinSteinerTreeDualAscent< T >::m_pOrigGraph
private

Definition at line 58 of file MinSteinerTreeDualAscent.h.

◆ m_pTerminals

template<typename T >
const List<node>* ogdf::MinSteinerTreeDualAscent< T >::m_pTerminals
private

Definition at line 59 of file MinSteinerTreeDualAscent.h.

◆ m_rootTerminal

template<typename T >
node ogdf::MinSteinerTreeDualAscent< T >::m_rootTerminal
private

Definition at line 69 of file MinSteinerTreeDualAscent.h.

◆ m_steinerGraph

template<typename T >
GraphCopy ogdf::MinSteinerTreeDualAscent< T >::m_steinerGraph
private

Definition at line 63 of file MinSteinerTreeDualAscent.h.

◆ MAX_VALUE

template<typename T >
const T ogdf::MinSteinerTreeDualAscent< T >::MAX_VALUE = std::numeric_limits<T>::max()
private

Definition at line 55 of file MinSteinerTreeDualAscent.h.


The documentation for this class was generated from the following file: