51class EdgeWeightedGraphCopy;
53namespace steiner_tree {
132#ifdef OGDF_SAVEDYNAMIC_CHANGE_TST
145 if (save1 == save2) {
161#ifdef OGDF_SAVEDYNAMIC_CHANGE_TST
162 const node newNode0 = v, newNode1 = currentNode;
172 if (v1level < v2level) {
174 std::swap(v1level, v2level);
176 if (v0level < v1level) {
178 std::swap(v0level, v1level);
180 if (v1level < v2level) {
182 std::swap(v1level, v2level);
187 std::swap(v1level, v2level);
191 std::swap(v0level, v1level);
195 if (v0 != save1 && v0 != save2) {
197 edge e = adj->theEdge();
198 if (e->
target() == currentNode) {
235#ifdef OGDF_SAVEDYNAMIC_CHANGE_TST
236 edge newEdge0, newEdge1;
267#ifndef OGDF_SAVEDYNAMIC_CHANGE_TST
Includes declaration of graph class.
Decralation of GraphElement and GraphList classes.
The Sparse Table Algorithm for the Least Common Ancestor problem as proposed by Bender and Farach-Col...
Interface for various LCA methods.
Basic declarations, included by all source files.
Class for adjacency list elements.
Class for the representation of edges.
node target() const
Returns the target node of the edge.
node source() const
Returns the source node of the edge.
Data type for general directed graphs (adjacency list representation).
virtual void delNode(node v)
Removes node v and all incident edges from the graph.
virtual void delEdge(edge e)
Removes edge e from the graph.
node newNode(int index=-1)
Creates a new node and returns it.
edge newEdge(node v, node w, int index=-1)
Creates a new edge (v,w) and returns it.
Implements the <O(n log n), O(1)>-time "sparse table" algorithm by Bender and Farach-Colton to comput...
int level(node v) const
Returns the level of a node. The level of the root is 0.
node call(node u, node v) const
Returns the LCA of two nodes u and v.
Class for the representation of nodes.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
RegisteredArray for nodes, edges and adjEntries of a graph.
Dynamically updatable weighted Tree for determining save edges via LCA computation.
Graph m_tree
The weighted binary tree to represent the edge weight hierarchy.
node lca(node u, node v) const
Returns the node in m_tree that is the LCA of two nodes.
virtual T saveWeight(node u, node v) const
Determines the weight of the save edge between two nodes by a LCA query.
virtual T gain(node u, node v, node w) const
Returns the gain (sum of save edge costs) of the given triple, calculated by an LCA query.
virtual void update(const Triple< T > &t)
Updates the weighted tree data structure given a contracted triple.
NodeArray< node > m_cTerminals
Connects terminal nodes in the terminal spanning tree to their leafs in the weighted tree.
node m_root
The root node of the weighted binary tree.
SaveDynamic(EdgeWeightedGraphCopy< T > &steinerTree)
Builds a weighted binary tree based on the given terminal spanning tree.
T weight(node v) const
Returns the associated weight of a node v in m_tree, or 0 if it is not associated.
T weight(edge e) const
Returns the weight of an edge in the terminal tree or 0.
LCA * m_lca
Data structure for calculating the LCAs.
virtual edge saveEdge(node u, node v) const
Determines the save edge between two nodes by a LCA query.
const EdgeWeightedGraphCopy< T > * m_steinerTree
The underlying terminal spanning tree this weighted tree instance represents.
NodeArray< edge > m_treeEdge
Maps each inner node of m_tree to an edge in m_steinerTree.
This class serves as an interface for different approaches concerning the calculation of save edges.
This class represents a triple used by various contraction-based minimum Steiner tree approximations.
Algorithms used by at least two functions of Steiner tree code or its internal helpers.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
node buildHeaviestEdgeInComponentTree(const EdgeWeightedGraphCopy< T > &inputTree, NodeArray< node > &externalNodes, NodeArray< edge > &treeEdge, Graph &outputTree)
Given an edge-weighted tree, builds an auxiliary arborescence where each arc of the input tree is a n...
void contractTripleInSteinerTree(const Triple< T > &t, EdgeWeightedGraphCopy< T > &st, edge save0, edge save1, edge save2, edge &ne0, edge &ne1)
Updates the Steiner tree by deleting save edges, removing all direct connections between the terminal...
The namespace for all OGDF objects.