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/BlowupComponents.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. More... | |
void | contract (node &v, node t) |
Contracts node v and terminal t into v . More... | |
template<typename NODELIST > | |
void | contract (NODELIST &nodes) |
Contracts nodes . More... | |
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 . More... | |
void | delEdges (ArrayBuffer< edge > edges) |
Removes edges in edges . More... | |
edge | findRootEdge (node v) |
Finds the root node of a component given by v , an arbitrary inner nonterminal of the component. More... | |
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 . More... | |
void | removeBasis (node v) |
Removes a basis and cleans up. More... | |
void | removeIsolatedTerminals () |
Removes isolated terminals. More... | |
void | updateSpecialCapacities () |
Updates capacities from source to terminals and terminals to pseudotarget. More... | |
Getters for the blow-up graph (without core edges and witness sets) | |
const Graph & | getGraph () const |
node | getSource () const |
Returns the source node. More... | |
node | getPseudotarget () const |
Returns the pseudotarget node. More... | |
node | getTarget () const |
Returns the target node. More... | |
int | getCapacity (edge e) const |
Returns the capacity of e . More... | |
const EdgeArray< int > & | capacities () const |
Returns a reference to the edge array containing all capacities. More... | |
T | getCost (edge e) const |
Returns the cost of e . More... | |
node | getOriginal (node v) const |
Returns the original node of v . More... | |
int | getLCM () const |
Returns the least common multiple of all denominators. More... | |
int | getY () const |
Returns the y-value of all terminals. More... | |
const List< node > & | terminals () const |
Returns a reference to the list containing all terminals in the blowup graph. More... | |
bool | isTerminal (node v) const |
Returns true if and only if v is a terminal. More... | |
Getters for core edges | |
T | getCoreCapacity (node v) const |
Get capacity of a core edge. More... | |
T | getCoreCost (node v) const |
Get cost of a core edge. More... | |
double | computeCoreWeight (node v) const |
Compute the weight of a core edge. More... | |
Protected Member Functions | |
void | computeLCM () |
Computes the least common multiple of the values assigned to the full components. More... | |
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. More... | |
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. More... | |
node | initNode (node v) |
void | initPseudotarget () |
Connects pseudotarget. More... | |
void | initSource (ArrayBuffer< std::pair< node, int >> &roots) |
Connects source to component roots. More... | |
void | initTarget () |
Connects target. More... | |
node | initTerminal (node t) |
Inserts a terminal. More... | |
void | setCapacity (edge e, int capacity) |
int | updateSourceAndTargetArcCapacities (const node v) |
Updates arc capacities s->v and v->t. More... | |
Private Attributes | |
EdgeArray< int > | m_capacity |
const CoreEdgeModule< T > & | m_ceModule |
List< node > | m_coreEdges |
the core edges as nodes More... | |
EdgeArray< T > | m_cost |
const double | m_eps |
epsilon for double operations More... | |
const FullComponentWithExtraStore< T, double > & | m_fullCompStore |
all enumerated full components, with solution More... | |
Graph | m_graph |
NodeArray< bool > | m_isTerminal |
Incidence vector for the blowup graph terminals. More... | |
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. More... | |
node | m_pseudotarget |
node | m_source |
node | m_target |
List< node > | m_terminals |
The terminals in the blowup graph. More... | |
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. More... | |
void | addWitness (node e, edge f) |
Adds e to W(f ) More... | |
void | initCoreWitness () |
Finds a "random" set of core edges and "replace" found edges by nodes, also find the witness sets for the core edges. More... | |
void | makeCWCopy (const HashArray< edge, edge > &edgeMap) |
Copies witness sets and core edges for a given copy map. More... | |
const List< node > & | core () const |
Return list of core edges (implemented by nodes) More... | |
void | delCore (node e) |
Remove a core edge. More... | |
int | numberOfWitnesses (edge e) const |
Return the number of witnesses of an edge. More... | |
const ArrayBuffer< edge > & | witnessList (node e) const |
Return list of loss edges f in W(e) More... | |
A special-purpose blowup graph for gammoid computation: directed, with special source and target, with core edges (implemented as nodes)
Definition at line 44 of file BlowupComponents.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.