|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
51 class EdgeWeightedGraphCopy;
53 namespace 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) {
196 for (
adjEntry adj : currentNode->adjEntries) {
198 if (e->
target() == currentNode) {
235 #ifdef OGDF_SAVEDYNAMIC_CHANGE_TST
236 edge newEdge0, newEdge1;
267 #ifndef OGDF_SAVEDYNAMIC_CHANGE_TST
The namespace for all OGDF objects.
int level(node v) const
Returns the level of a node. The level of the root is 0.
Includes declaration of graph class.
LCA * m_lca
Data structure for calculating the LCAs.
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...
This class represents a triple used by various contraction-based minimum Steiner tree approximations.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
T weight(node v) const
Returns the associated weight of a node v in m_tree, or 0 if it is not associated.
virtual void delNode(node v)
Removes node v and all incident edges from the graph.
virtual void update(const Triple< T > &t)
Updates the weighted tree data structure given a contracted triple.
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.
node call(node u, node v) const
Returns the LCA of two nodes u and v.
SaveDynamic(EdgeWeightedGraphCopy< T > &steinerTree)
Builds a weighted binary tree based on the given terminal spanning tree.
Graph m_tree
The weighted binary tree to represent the edge weight hierarchy.
This class serves as an interface for different approaches concerning the calculation of save edges.
virtual void delEdge(edge e)
Removes edge e from the graph.
Class for adjacency list elements.
The Sparse Table Algorithm for the Least Common Ancestor problem as proposed by Bender and Farach-Col...
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...
edge theEdge() const
Returns the edge associated with this adjacency entry.
const EdgeWeightedGraphCopy< T > * m_steinerTree
The underlying terminal spanning tree this weighted tree instance represents.
Algorithms used by at least two functions of Steiner tree code or its internal helpers.
Decralation of GraphElement and GraphList classes.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
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.
node source() const
Returns the source node of the edge.
RegisteredArray for nodes, edges and adjEntries of a graph.
Implements the <O(n log n), O(1)>-time "sparse table" algorithm by Bender and Farach-Colton to comput...
Data type for general directed graphs (adjacency list representation).
Dynamically updatable weighted Tree for determining save edges via LCA computation.
Basic declarations, included by all source files.
node newNode(int index=-1)
Creates a new node and returns it.
T weight(edge e) const
Returns the weight of an edge in the terminal tree or 0.
Class for the representation of edges.
virtual edge saveEdge(node u, node v) const
Determines the save edge between two nodes by a LCA query.
NodeArray< edge > m_treeEdge
Maps each inner node of m_tree to an edge in m_steinerTree.
Interface for various LCA methods.
node target() const
Returns the target node of the edge.
node m_root
The root node of the weighted binary tree.
edge newEdge(node v, node w, int index=-1)
Creates a new edge (v,w) and returns it.
NodeArray< node > m_cTerminals
Connects terminal nodes in the terminal spanning tree to their leafs in the weighted tree.
Class for the representation of nodes.