163 Voronoi<T> voronoi(G, G.edgeWeights(), terminals);
187 for (
node v : terminals) {
224 if ((*mtIt).value < (*minTriple).value) {
231 bridges[
tmp] = (*minTriple).bridge;
242 bridges[
tmp] = (*minTriple).bridge;
292namespace steiner_tree {
Extends the GraphCopy concept to weighted graphs.
Declaration of doubly linked lists and iterators.
Declaration of ogdf::MinSteinerTreeModule.
Definition of ogdf::Voronoi class template.
Abstract base class for bucket functions.
Dynamic arrays indexed with edges.
void init()
Reinitializes the array. Associates the array with no graph.
Class for the representation of edges.
node opposite(node v) const
Returns the adjacent node different from v.
node target() const
Returns the target node of the edge.
node source() const
Returns the source node of the edge.
const EdgeArray< T > & edgeWeights() const
Doubly linked lists (maintaining the length of the list).
Encapsulates a pointer to a list element.
Helper class to sort MehlhornTriples lexicographically.
MehlhornTripleBucketMaxFunc()
int getBucket(const MehlhornTriple &MT)
Helper class to sort MehlhornTriples lexicographically.
MehlhornTripleBucketMinFunc()
int getBucket(const MehlhornTriple &MT)
This class implements the Minimum Steiner Tree 2-approximation algorithm by Mehlhorn.
void insertPath(node u, const Voronoi< T > &voronoi, EdgeWeightedGraphCopy< T > &finalSteinerTree, const EdgeWeightedGraph< T > &wG)
Inserts a shortest path corresponding to an edge in the complete terminal graph.
void reinsertShortestPaths(EdgeWeightedGraphCopy< T > &completeTerminalGraph, const Voronoi< T > &voronoi, const NodeArray< edge > &mstPred, const EdgeArray< edge > &bridges, EdgeWeightedGraphCopy< T > &finalSteinerTree, const EdgeWeightedGraph< T > &wG)
Swaps an edge in the complete terminal graph with the corresponding shortest path in the original gra...
static void calculateCompleteGraph(const EdgeWeightedGraph< T > &wG, const List< node > &terminals, const Voronoi< T > &voronoi, EdgeArray< edge > &bridges, EdgeWeightedGraphCopy< T > &completeTerminalGraph)
Builds a complete terminal graph.
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.
virtual ~MinSteinerTreeMehlhorn()
Serves as an interface for various methods to compute or approximate minimum Steiner trees on undirec...
static T pruneAllDanglingSteinerPaths(EdgeWeightedGraphCopy< T > &steinerTree, const NodeArray< bool > &isTerminal)
Prunes nonterminal leaves and their paths to terminal or branching nodes.
Dynamic arrays indexed with nodes.
Class for the representation of nodes.
Computes Voronoi regions in an edge-weighted graph.
T distance(node v) const
Returns the distance between v and its Voronoi seed.
node seed(node v) const
Returns the Voronoi seed of node v.
edge predecessorEdge(node v) const
Returns the edge incident to v and its predecessor. Note that the predecessor of a terminal is nullpt...
T makeMinimumSpanningTree(Graph &G, const EdgeArray< T > &weight)
Reduce a graph to its minimum spanning tree (MST) using Kruskal's algorithm.
T computeMinST(const Graph &G, const EdgeArray< T > &weight, EdgeArray< bool > &isInTree)
Computes a minimum spanning tree using Prim's algorithm.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
T constructTerminalSpanningTreeUsingVoronoiRegions(EdgeWeightedGraphCopy< T > &terminalSpanningTree, const EdgeWeightedGraph< T > &graph, const List< node > &terminals)
The namespace for all OGDF objects.
Represents a triple as specified in the algorithms description (see paper)