39 namespace steiner_tree {
68 componentRootEdge.
push(rootEdge);
70 auto &terms = componentTerminals[
maxId];
74 componentCost.
push(0);
78 while (!queue.
empty()) {
80 componentId[v] =
maxId;
83 if (componentId[w] < 0) {
96 #ifdef OGDF_STEINER_TREE_GOEMANS_BLOWUP_COMPONENTS_LOGGING 98 <<
" * component with terminals " << terms
99 <<
" starting with edge " << rootEdge
100 <<
" having cost " << cost
101 <<
" and capacity " << blowupGraph.
getCapacity(rootEdge) << std::endl;
108 : componentId(blowupGraph.getGraph(), -1)
111 componentId[blowupGraph.
getSource()] = 0;
113 componentId[blowupGraph.
getTarget()] = 0;
115 #ifdef OGDF_STEINER_TREE_GOEMANS_BLOWUP_COMPONENTS_LOGGING 116 std::cout <<
"Finding components in blowup graph:" << std::endl;
119 for (
adjEntry rootAdj : t->adjEntries) {
121 if (rootEdge->
source() != t) {
126 if (componentId[r] < 0) {
142 return componentTerminals[
id-1];
148 return componentId[v];
155 return componentCost[
id-1];
168 return componentRootEdge[
id-1];
175 componentRootEdge[
id-1] = e;
node target() const
Returns the target node of the edge.
void initializeComponent(edge rootEdge, const BlowupGraph< T > &blowupGraph)
Initialize all information about the component starting with rootEdge in the blowup graph...
node getSource() const
Returns the source node.
edge theEdge() const
Returns the edge associated with this adjacency entry.
BlowupComponents(const BlowupGraph< T > &blowupGraph)
Find all components in the blowup graph and initialize information them.
iterator pushBack(const E &x)
Adds element x at the end of the list.
const List< node > & terminals() const
Returns a reference to the list containing all terminals in the blowup graph.
const ArrayBuffer< node > & terminals(int id) const
Return list of terminals for a given component.
NodeArray< int > componentId
Obtain and provides information about components in a given blowup graph.
void push(E e)
Puts a new element in the buffer.
E popBackRet()
Removes the last element from the list and returns it.
An array that keeps track of the number of inserted elements; also usable as an efficient stack...
const T & cost(int id) const
Return total cost of a given component.
node getTarget() const
Returns the target node.
Doubly linked lists (maintaining the length of the list).
node twinNode() const
Returns the associated node of the corresponding adjacency entry (shorthand for twin()->theNode()).
Class for the representation of edges.
int getCapacity(edge e) const
Returns the capacity of e.
Class for the representation of nodes.
edge rootEdge(int id) const
Return the edge coming from the root of a given component.
bool isTerminal(node v) const
Returns true if and only if v is a terminal.
ArrayBuffer< T > componentCost
A special-purpose blowup graph for gammoid computation: directed, with special source and target...
T getCost(edge e) const
Returns the cost of e.
void setRootEdge(int id, edge e)
Set the edge coming from the root for a given component.
int size() const
Return number of components.
node getPseudotarget() const
Returns the pseudotarget node.
node source() const
Returns the source node of the edge.
int id(node v) const
Return the component id a given node is contained in.
The namespace for all OGDF objects.
Definition of ogdf::steiner_tree::goemans::BlowupGraph class template.
node getOriginal(node v) const
Returns the original node of v.
bool empty() const
Returns true iff the list is empty.
ArrayBuffer< ArrayBuffer< node > > componentTerminals
Class for adjacency list elements.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
ArrayBuffer< edge > componentRootEdge