Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

ogdf::MinSteinerTreeModule< T > Class Template Referenceabstract

This class serves as an interface for various methods to compute minimum or approximations of minimum Steiner trees. More...

#include <ogdf/module/MinSteinerTreeModule.h>

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

Public Member Functions

 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

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)
 

Protected Member Functions

virtual T computeSteinerTree (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, EdgeWeightedGraphCopy< T > *&finalSteinerTree)=0
 

Detailed Description

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

This class serves as an interface for various methods to compute minimum or approximations of minimum Steiner trees.

Furthermore it supplies some helping methods.

Definition at line 54 of file MinSteinerTreeModule.h.

Constructor & Destructor Documentation

◆ MinSteinerTreeModule()

template<typename T>
ogdf::MinSteinerTreeModule< T >::MinSteinerTreeModule ( )
inline

Definition at line 56 of file MinSteinerTreeModule.h.

◆ ~MinSteinerTreeModule()

template<typename T>
virtual ogdf::MinSteinerTreeModule< T >::~MinSteinerTreeModule ( )
inlinevirtual

Definition at line 58 of file MinSteinerTreeModule.h.

Member Function Documentation

◆ allPairShortestPaths()

template<typename T >
void ogdf::MinSteinerTreeModule< T >::allPairShortestPaths ( const EdgeWeightedGraph< T > &  G,
const List< node > &  nonterminals,
NodeArray< NodeArray< T > > &  distance,
NodeArray< NodeArray< edge > > &  pred 
)
static

Undirected All-pair-shortest-paths (Floyd-Warshall) over non-terminal nodes of G.

Parameters
GThe graph
nonterminalsList of non-terminals (APSP is only computed over non-terminal nodes)
distanceThe distance matrix result
predThe resulting shortest-path last edge of a path

Definition at line 443 of file MinSteinerTreeModule.h.

◆ allPairShortestPathsDetour()

template<typename T >
void ogdf::MinSteinerTreeModule< T >::allPairShortestPathsDetour ( const EdgeWeightedGraph< T > &  G,
const List< node > &  nonterminals,
NodeArray< NodeArray< T > > &  distance,
NodeArray< NodeArray< edge > > &  pred 
)
static

Definition at line 529 of file MinSteinerTreeModule.h.

◆ allPairShortestPathsStrict()

template<typename T >
void ogdf::MinSteinerTreeModule< T >::allPairShortestPathsStrict ( const EdgeWeightedGraph< T > &  G,
const NodeArray< bool > &  isTerminal,
NodeArray< NodeArray< T > > &  distance,
NodeArray< NodeArray< edge > > &  pred 
)
static

Definition at line 478 of file MinSteinerTreeModule.h.

◆ call()

template<typename T >
T ogdf::MinSteinerTreeModule< T >::call ( const EdgeWeightedGraph< T > &  G,
const List< node > &  terminals,
const NodeArray< bool > &  isTerminal,
EdgeWeightedGraphCopy< T > *&  finalSteinerTree 
)
virtual

Builds 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

Reimplemented in ogdf::MinSteinerTreePrimalDual< T >, ogdf::MinSteinerTreeZelikovsky< T >, and ogdf::MinSteinerTreeRZLoss< T >.

Definition at line 165 of file MinSteinerTreeModule.h.

◆ computeSteinerTree()

◆ drawSteinerTreeSVG()

template<typename T >
void ogdf::MinSteinerTreeModule< T >::drawSteinerTreeSVG ( const EdgeWeightedGraphCopy< T > &  steinerTree,
const NodeArray< bool > &  isTerminal,
const char *  filename 
)
static

Writes a SVG that shows only the given Steiner tree.

Parameters
steinerTreeThe Steiner tree to be drawn
isTerminalIncidence vector indicating terminal nodes
filenameThe name of the output file

Definition at line 564 of file MinSteinerTreeModule.h.

◆ drawSVG()

template<typename T >
void ogdf::MinSteinerTreeModule< T >::drawSVG ( const EdgeWeightedGraph< T > &  G,
const NodeArray< bool > &  isTerminal,
const EdgeWeightedGraphCopy< T > &  steinerTree,
const char *  filename 
)
static

Writes an SVG file of a minimum Steiner tree in the original graph.

Parameters
GThe original weighted graph
isTerminalIncidence vector indicating terminal nodes
steinerTreeThe Steiner tree of the given graph
filenameThe name of the output file

Definition at line 607 of file MinSteinerTreeModule.h.

◆ isQuasiBipartite()

template<typename T >
bool ogdf::MinSteinerTreeModule< T >::isQuasiBipartite ( const EdgeWeightedGraph< T > &  G,
const NodeArray< bool > &  isTerminal 
)
static

Checks in O(n + m) time if a given Steiner tree problem instance is quasi-bipartite.

Parameters
GThe original graph
isTerminalA bool array of terminals
Returns
true iff the given Steiner tree problem instance is quasi-bipartite

Definition at line 234 of file MinSteinerTreeModule.h.

◆ isSteinerTree()

template<typename T >
bool ogdf::MinSteinerTreeModule< T >::isSteinerTree ( const EdgeWeightedGraph< T > &  G,
const List< node > &  terminals,
const NodeArray< bool > &  isTerminal,
const EdgeWeightedGraphCopy< T > &  steinerTree 
)
static

Checks in O(n) time if a given tree is acually a Steiner Tree.

Parameters
GThe original graph
terminalsThe list of terminal nodes
isTerminalA bool array of terminals
steinerTreeThe Steiner tree to be checked
Returns
true iff the given Steiner tree is actually one, false otherwise

Definition at line 203 of file MinSteinerTreeModule.h.

◆ pruneAllDanglingSteinerPaths()

template<typename T >
T ogdf::MinSteinerTreeModule< T >::pruneAllDanglingSteinerPaths ( EdgeWeightedGraphCopy< T > &  steinerTree,
const NodeArray< bool > &  isTerminal 
)
static

Prune Steiner nodes with degree 1 and their paths to terminal or branching nodes.

Parameters
steinerTreeThe given Steiner tree
isTerminalIncidence vector indicating terminal nodes
Returns
The edge weights of the removed edges (achieved improvement)

Definition at line 276 of file MinSteinerTreeModule.h.

◆ pruneDanglingSteinerPathFrom()

template<typename T >
T ogdf::MinSteinerTreeModule< T >::pruneDanglingSteinerPathFrom ( EdgeWeightedGraphCopy< T > &  steinerTree,
const NodeArray< bool > &  isTerminal,
node  start 
)
static

Prune the dangling Steiner path beginning at a given node only.

Definition at line 249 of file MinSteinerTreeModule.h.

◆ pruneDanglingSteinerPathsFrom()

template<typename T >
T ogdf::MinSteinerTreeModule< T >::pruneDanglingSteinerPathsFrom ( EdgeWeightedGraphCopy< T > &  steinerTree,
const NodeArray< bool > &  isTerminal,
const List< node > &  start 
)
static

Prune dangling Steiner paths beginning at given nodes only.

Definition at line 266 of file MinSteinerTreeModule.h.

◆ removeCyclesFrom()

template<typename T >
T ogdf::MinSteinerTreeModule< T >::removeCyclesFrom ( EdgeWeightedGraphCopy< T > &  steinerTree,
const NodeArray< bool > &  isTerminal 
)
static

Remove remaining cycles from an Steiner "almost" tree.

Returns
The edge weights of the removed edges (achieved improvement)

Definition at line 290 of file MinSteinerTreeModule.h.

◆ singleSourceShortestPaths()

template<typename T >
void ogdf::MinSteinerTreeModule< T >::singleSourceShortestPaths ( const EdgeWeightedGraph< T > &  G,
node  source,
const NodeArray< bool > &  isTerminal,
NodeArray< T > &  distance,
NodeArray< edge > &  pred 
)
static

Undirected Single-source-shortest-paths (Dijkstra) over non-terminal nodes of G.

Parameters
GThe graph
sourceThe start terminal
isTerminalIncidence vector indicating terminal nodes
distanceThe distance matrix result
predThe resulting shortest-path last edge of a path

Definition at line 318 of file MinSteinerTreeModule.h.

◆ singleSourceShortestPathsDetour()

template<typename T >
void ogdf::MinSteinerTreeModule< T >::singleSourceShortestPathsDetour ( const EdgeWeightedGraph< T > &  G,
node  source,
const NodeArray< bool > &  isTerminal,
NodeArray< T > &  distance,
NodeArray< edge > &  pred 
)
static

Definition at line 409 of file MinSteinerTreeModule.h.

◆ singleSourceShortestPathsStrict()

template<typename T >
void ogdf::MinSteinerTreeModule< T >::singleSourceShortestPathsStrict ( const EdgeWeightedGraph< T > &  G,
node  source,
const NodeArray< bool > &  isTerminal,
NodeArray< T > &  distance,
NodeArray< edge > &  pred 
)
static

Definition at line 352 of file MinSteinerTreeModule.h.


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