39 namespace steiner_tree {
60 isInTree.
init(graph,
false);
63 int contractedID = uf.
makeSet();
65 for (
node t : terminals) {
66 setID[t] = contractedID;
70 setID[v] = uf.makeSet();
77 edgePermutation.
push(e);
82 for (
edge e : edgePermutation) {
83 const int v = setID[e->
source()];
84 const int w = setID[e->
target()];
85 if (uf.find(v) != uf.find(w)) {
87 uf.link(uf.find(v), uf.find(w));
node target() const
Returns the target node of the edge.
void permute(INDEX l, INDEX r, RNG &rng)
Randomly permutes the subarray with index set [l..r] using random number generator rng...
void init()
Reinitializes the array. Associates the array with no graph.
Data type for general directed graphs (adjacency list representation).
void push(E e)
Puts a new element in the buffer.
internal::GraphObjectContainer< EdgeElement > edges
The container containing all edge objects.
CoreEdgeRandomSpanningTree(std::minstd_rand &rng)
Definition of ogdf::steiner_tree::goemans::CoreEdgeModule class template.
Computes a random set of core edges.
Doubly linked lists (maintaining the length of the list).
A Union/Find data structure for maintaining disjoint sets.
Class for the representation of edges.
Class for the representation of nodes.
Declaration and implementation of NodeArray class.
void call(const Graph &graph, const List< node > &terminals, EdgeArray< bool > &isInTree) const override
Compute a set of core edges.
int makeSet()
Initializes a singleton set.
int size() const
Returns the number of elements in the list.
Interface for core edge finder algorithms.
Implementation of disjoint sets data structures (union-find functionality).
node source() const
Returns the source node of the edge.
The namespace for all OGDF objects.
int numberOfNodes() const
Returns the number of nodes in the graph.
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.