Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

ogdf::MinSteinerTreeTakahashi< T > Class Template Reference

This class implements the minimum Steiner tree 2-approximation algorithm by Takahashi and Matsuyama with improvements proposed by Poggi de Aragao et al. More...

#include <ogdf/graphalg/MinSteinerTreeTakahashi.h>

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

Public Member Functions

 MinSteinerTreeTakahashi ()
 
virtual ~MinSteinerTreeTakahashi ()
 
virtual T call (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, EdgeWeightedGraphCopy< T > *&finalSteinerTree, const node startNode)
 An extended call method with specific start node. More...
 
virtual T call (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, const NodeArray< bool > &isOriginalTerminal, EdgeWeightedGraphCopy< T > *&finalSteinerTree)
 
virtual T call (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, const NodeArray< bool > &isOriginalTerminal, EdgeWeightedGraphCopy< T > *&finalSteinerTree, const node startNode)
 An extended call method with intermediate and final (original) terminal nodes. More...
 
- 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...
 

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...
 
T terminalDijkstra (const EdgeWeightedGraph< T > &wG, EdgeWeightedGraphCopy< T > &intermediateTerminalSpanningTree, const node s, int numberOfTerminals, const NodeArray< bool > &isTerminal)
 Modified Dijkstra algorithm to solve the Minimum Steiner Tree problem. More...
 

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)
 

Detailed Description

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

This class implements the minimum Steiner tree 2-approximation algorithm by Takahashi and Matsuyama with improvements proposed by Poggi de Aragao et al.

This implementation is based on:

(H. Takahashi and A. Matsuyama, An approximate solution for the Steiner problem in graphs, Math. Japonica, volume 24, number 6, pages 573-577, 1980)

(M. Poggi de Aragao, C. Riberiro, E. Uchoa, R. Werneck, Hybrid Local Search for the Steiner Problem in Graphs, MIC 2001, pages 429-433, 2001)

Definition at line 57 of file MinSteinerTreeTakahashi.h.

Constructor & Destructor Documentation

◆ MinSteinerTreeTakahashi()

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

Definition at line 59 of file MinSteinerTreeTakahashi.h.

◆ ~MinSteinerTreeTakahashi()

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

Definition at line 61 of file MinSteinerTreeTakahashi.h.

Member Function Documentation

◆ call() [1/3]

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

An extended call method with specific start node.

See also
MinSteinerTreeModule::call You should only call this method when there is more than one terminal.
Parameters
GThe weighted input graph
terminalsThe list of terminal nodes
isTerminalA bool array of terminals
finalSteinerTreeThe final Steiner tree
startNodeThe source node for the special Dijkstra call
Returns
The objective value (sum of edge costs) of the final Steiner tree

Definition at line 74 of file MinSteinerTreeTakahashi.h.

◆ call() [2/3]

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

Definition at line 83 of file MinSteinerTreeTakahashi.h.

◆ call() [3/3]

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

An extended call method with intermediate and final (original) terminal nodes.

See also
MinSteinerTreeModule::call You should only call this method when there is more than one terminal.
Parameters
GThe weighted input graph
terminalsThe list of terminal nodes
isTerminalA bool array of terminals
isOriginalTerminalA bool array of terminals in the original instance
finalSteinerTreeThe final Steiner tree
startNodeThe source node for the special Dijkstra call
Returns
The objective value (sum of edge costs) of the final Steiner tree

Definition at line 148 of file MinSteinerTreeTakahashi.h.

◆ computeSteinerTree()

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

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

See also
MinSteinerTreeModule::call
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 122 of file MinSteinerTreeTakahashi.h.

◆ terminalDijkstra()

template<typename T >
T ogdf::MinSteinerTreeTakahashi< T >::terminalDijkstra ( const EdgeWeightedGraph< T > &  wG,
EdgeWeightedGraphCopy< T > &  intermediateTerminalSpanningTree,
const node  s,
int  numberOfTerminals,
const NodeArray< bool > &  isTerminal 
)
protected

Modified Dijkstra algorithm to solve the Minimum Steiner Tree problem.

Parameters
wGthe original graph
intermediateTerminalSpanningTreeintermediate terminal spanning tree
ssource node to start from
numberOfTerminalsnumber of terminal nodes
isTerminalterminal incivende vector
Returns
the weight of the intermediateTerminalSpanningTree

Definition at line 173 of file MinSteinerTreeTakahashi.h.


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