A special-purpose blowup graph for gammoid computation: directed, with special source and target, with core edges (implemented as nodes) More...
#include <ogdf/graphalg/steiner_tree/goemans/BlowupGraph.h>
Public Member Functions | |
| BlowupGraph (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const FullComponentWithExtraStore< T, double > &fullCompStore, const CoreEdgeModule< T > &ceModule, double eps=1e-8) | |
| Initializes a blowup graph including core edges and witness sets. | |
| void | contract (node &v, node t) |
Contracts node v and terminal t into v. | |
| template<typename NODELIST > | |
| void | contract (NODELIST &nodes) |
Contracts nodes. | |
| void | copyComponent (const edge origEdge, const int origCap, const int copyCap) |
Copy a component in the blowup graph and set original capacity to origCap and capacity of copy to copyCap. | |
| void | delEdges (ArrayBuffer< edge > edges) |
Removes edges in edges. | |
| edge | findRootEdge (node v) |
Finds the root node of a component given by v, an arbitrary inner nonterminal of the component. | |
| edge | newEdge (node v, node w, T cost, int capacity) |
Adds and returns a new edge between v and w of specified cost and capacity. | |
| void | removeBasis (node v) |
| Removes a basis and cleans up. | |
| void | removeIsolatedTerminals () |
| Removes isolated terminals. | |
| void | updateSpecialCapacities () |
| Updates capacities from source to terminals and terminals to pseudotarget. | |
Getters for the blow-up graph (without core edges and witness sets) | |
| const Graph & | getGraph () const |
| node | getSource () const |
| Returns the source node. | |
| node | getPseudotarget () const |
| Returns the pseudotarget node. | |
| node | getTarget () const |
| Returns the target node. | |
| int | getCapacity (edge e) const |
Returns the capacity of e. | |
| const EdgeArray< int > & | capacities () const |
| Returns a reference to the edge array containing all capacities. | |
| T | getCost (edge e) const |
Returns the cost of e. | |
| node | getOriginal (node v) const |
Returns the original node of v. | |
| int | getLCM () const |
| Returns the least common multiple of all denominators. | |
| int | getY () const |
| Returns the y-value of all terminals. | |
| const List< node > & | terminals () const |
| Returns a reference to the list containing all terminals in the blowup graph. | |
| bool | isTerminal (node v) const |
Returns true if and only if v is a terminal. | |
Getters for core edges | |
| T | getCoreCapacity (node v) const |
| Get capacity of a core edge. | |
| T | getCoreCost (node v) const |
| Get cost of a core edge. | |
| double | computeCoreWeight (node v) const |
| Compute the weight of a core edge. | |
Protected Member Functions | |
| void | computeLCM () |
| Computes the least common multiple of the values assigned to the full components. | |
| node | initBlowupGraphComponent (const NodeArray< node > ©, adjEntry start, int cap) |
| Does a bfs of the component tree to add directed components with the first terminal as root. | |
| void | initBlowupGraphComponents (const EdgeWeightedGraph< T > &originalGraph, const List< node > &terminals) |
| Initializes all components in the blowup graph as well as core edges and witness sets. | |
| node | initNode (node v) |
| void | initPseudotarget () |
| Connects pseudotarget. | |
| void | initSource (ArrayBuffer< std::pair< node, int > > &roots) |
| Connects source to component roots. | |
| void | initTarget () |
| Connects target. | |
| node | initTerminal (node t) |
| Inserts a terminal. | |
| void | setCapacity (edge e, int capacity) |
| int | updateSourceAndTargetArcCapacities (const node v) |
| Updates arc capacities s->v and v->t. | |
Private Attributes | |
| EdgeArray< int > | m_capacity |
| const CoreEdgeModule< T > & | m_ceModule |
| List< node > | m_coreEdges |
| the core edges as nodes | |
| EdgeArray< T > | m_cost |
| const double | m_eps |
| epsilon for double operations | |
| const FullComponentWithExtraStore< T, double > & | m_fullCompStore |
| all enumerated full components, with solution | |
| Graph | m_graph |
| NodeArray< bool > | m_isTerminal |
| Incidence vector for the blowup graph terminals. | |
| int | m_lcm |
| NodeArray< node > | m_original |
| Mapping of blowup graph nodes to original nodes. If a node in a blowup graph represents more than one (contracted), it maps just to one original node. If it maps to nullptr, there is no original node, i.e. we have a core edge, a source, pseudotarget or target. | |
| node | m_pseudotarget |
| node | m_source |
| node | m_target |
| List< node > | m_terminals |
| The terminals in the blowup graph. | |
| NodeArray< ArrayBuffer< edge > > | m_witness |
| EdgeArray< int > | m_witnessCard |
| int | m_y |
Core edges and witness set management | |
| void | addCore (node e) |
| Adds a core edge. | |
| void | addWitness (node e, edge f) |
Adds e to W(f) | |
| void | initCoreWitness () |
| Finds a "random" set of core edges and "replace" found edges by nodes, also find the witness sets for the core edges. | |
| void | makeCWCopy (const HashArray< edge, edge > &edgeMap) |
| Copies witness sets and core edges for a given copy map. | |
| const List< node > & | core () const |
| Return list of core edges (implemented by nodes) | |
| void | delCore (node e) |
| Remove a core edge. | |
| int | numberOfWitnesses (edge e) const |
| Return the number of witnesses of an edge. | |
| const ArrayBuffer< edge > & | witnessList (node e) const |
| Return list of loss edges f in W(e) | |
A special-purpose blowup graph for gammoid computation: directed, with special source and target, with core edges (implemented as nodes)
Definition at line 70 of file BlowupGraph.h.
|
inline |
Initializes a blowup graph including core edges and witness sets.
Definition at line 469 of file BlowupGraph.h.
|
inlineprotected |
Adds a core edge.
Definition at line 364 of file BlowupGraph.h.
|
inlineprotected |
Adds e to W(f)
Definition at line 367 of file BlowupGraph.h.
|
inline |
Returns a reference to the edge array containing all capacities.
Definition at line 518 of file BlowupGraph.h.
|
inline |
Compute the weight of a core edge.
Definition at line 559 of file BlowupGraph.h.
|
inlineprotected |
Computes the least common multiple of the values assigned to the full components.
Definition at line 124 of file BlowupGraph.h.
|
inline |
Contracts node v and terminal t into v.
Definition at line 602 of file BlowupGraph.h.
|
inline |
Contracts nodes.
Definition at line 621 of file BlowupGraph.h.
|
inline |
Copy a component in the blowup graph and set original capacity to origCap and capacity of copy to copyCap.
Definition at line 712 of file BlowupGraph.h.
|
inline |
Return list of core edges (implemented by nodes)
Definition at line 748 of file BlowupGraph.h.
|
inline |
Remove a core edge.
Definition at line 752 of file BlowupGraph.h.
|
inline |
Removes edges in edges.
Definition at line 595 of file BlowupGraph.h.
|
inline |
Finds the root node of a component given by v, an arbitrary inner nonterminal of the component.
Definition at line 690 of file BlowupGraph.h.
|
inline |
Returns the capacity of e.
Definition at line 515 of file BlowupGraph.h.
|
inline |
Get capacity of a core edge.
Definition at line 543 of file BlowupGraph.h.
|
inline |
Get cost of a core edge.
Definition at line 549 of file BlowupGraph.h.
|
inline |
Returns the cost of e.
Definition at line 521 of file BlowupGraph.h.
|
inline |
Definition at line 503 of file BlowupGraph.h.
|
inline |
Returns the least common multiple of all denominators.
Definition at line 527 of file BlowupGraph.h.
|
inline |
Returns the original node of v.
Definition at line 524 of file BlowupGraph.h.
|
inline |
Returns the pseudotarget node.
Definition at line 509 of file BlowupGraph.h.
|
inline |
Returns the source node.
Definition at line 506 of file BlowupGraph.h.
|
inline |
Returns the target node.
Definition at line 512 of file BlowupGraph.h.
|
inline |
Returns the y-value of all terminals.
Definition at line 530 of file BlowupGraph.h.
|
inlineprotected |
Does a bfs of the component tree to add directed components with the first terminal as root.
Definition at line 165 of file BlowupGraph.h.
|
inlineprotected |
Initializes all components in the blowup graph as well as core edges and witness sets.
Definition at line 209 of file BlowupGraph.h.
|
inlineprotected |
Finds a "random" set of core edges and "replace" found edges by nodes, also find the witness sets for the core edges.
Definition at line 377 of file BlowupGraph.h.
|
inlineprotected |
Definition at line 157 of file BlowupGraph.h.
|
inlineprotected |
Connects pseudotarget.
Definition at line 240 of file BlowupGraph.h.
|
inlineprotected |
Connects source to component roots.
Definition at line 193 of file BlowupGraph.h.
|
inlineprotected |
Connects target.
Definition at line 272 of file BlowupGraph.h.
|
inlineprotected |
Inserts a terminal.
Definition at line 146 of file BlowupGraph.h.
|
inline |
Returns true if and only if v is a terminal.
Definition at line 536 of file BlowupGraph.h.
|
inlineprotected |
Copies witness sets and core edges for a given copy map.
Definition at line 440 of file BlowupGraph.h.
|
inline |
Adds and returns a new edge between v and w of specified cost and capacity.
Definition at line 587 of file BlowupGraph.h.
|
inline |
Return the number of witnesses of an edge.
Definition at line 766 of file BlowupGraph.h.
|
inline |
Removes a basis and cleans up.
| v | a core edge node of the basis (to determine the basis) |
Definition at line 634 of file BlowupGraph.h.
|
inline |
Removes isolated terminals.
Definition at line 679 of file BlowupGraph.h.
|
inlineprotected |
Definition at line 357 of file BlowupGraph.h.
|
inline |
Returns a reference to the list containing all terminals in the blowup graph.
Definition at line 533 of file BlowupGraph.h.
|
inlineprotected |
Updates arc capacities s->v and v->t.
Definition at line 284 of file BlowupGraph.h.
|
inline |
Updates capacities from source to terminals and terminals to pseudotarget.
Definition at line 571 of file BlowupGraph.h.
|
inline |
Return list of loss edges f in W(e)
Definition at line 769 of file BlowupGraph.h.
|
private |
Definition at line 87 of file BlowupGraph.h.
|
private |
Definition at line 95 of file BlowupGraph.h.
|
private |
the core edges as nodes
Definition at line 97 of file BlowupGraph.h.
|
private |
Definition at line 86 of file BlowupGraph.h.
|
private |
epsilon for double operations
Definition at line 74 of file BlowupGraph.h.
|
private |
all enumerated full components, with solution
Definition at line 73 of file BlowupGraph.h.
|
private |
Definition at line 72 of file BlowupGraph.h.
|
private |
Incidence vector for the blowup graph terminals.
Definition at line 77 of file BlowupGraph.h.
|
private |
Definition at line 89 of file BlowupGraph.h.
|
private |
Mapping of blowup graph nodes to original nodes. If a node in a blowup graph represents more than one (contracted), it maps just to one original node. If it maps to nullptr, there is no original node, i.e. we have a core edge, a source, pseudotarget or target.
Definition at line 84 of file BlowupGraph.h.
|
private |
Definition at line 92 of file BlowupGraph.h.
|
private |
Definition at line 91 of file BlowupGraph.h.
|
private |
Definition at line 93 of file BlowupGraph.h.
|
private |
The terminals in the blowup graph.
Definition at line 76 of file BlowupGraph.h.
|
private |
Definition at line 120 of file BlowupGraph.h.
|
private |
Definition at line 119 of file BlowupGraph.h.
|
private |
Definition at line 90 of file BlowupGraph.h.