Class managing LP-based approximation. More...
#include <ogdf/graphalg/MinSteinerTreeGoemans139.h>
Public Member Functions | |
Main (const EdgeWeightedGraph< T > &G, const List< node > &terminals, const NodeArray< bool > &isTerminal, int restricted, bool use2approx, bool separateCycles, double eps=1e-8) | |
Initialize all attributes, sort the terminal list. More... | |
~Main () | |
T | getApproximation (EdgeWeightedGraphCopy< T > *&finalSteinerTree, const std::minstd_rand &rng, const bool doPreprocessing=true) |
Obtain an (1.39+epsilon)-approximation based on the LP solution. More... | |
Private Member Functions | |
Finding full components | |
void | findFull2Components (const NodeArray< NodeArray< T >> &distance, const NodeArray< NodeArray< edge >> &pred) |
Find full components of size 2. More... | |
void | findFull3Components (const NodeArray< NodeArray< T >> &distance, const NodeArray< NodeArray< edge >> &pred) |
Find full components of size 3. More... | |
void | find3RestrictedComponents () |
Find 3-restricted components. More... | |
void | findFullComponentsDW () |
Find full components using algorithm by Dreyfus-Wagner. More... | |
void | findFullComponentsEMV () |
Find full components using algorithm by Erickson et al. More... | |
template<typename FCG > | |
void | retrieveComponents (const FCG &fcg) |
Auxiliary function to retrieve components by Dreyfus-Wagner/Erickson et al implementation. More... | |
void | findFullComponents () |
Find full components. More... | |
Preliminaries and preprocessing for the approximation algorithm | |
void | removeInactiveComponents () |
Remove inactive components from m_fullCompStore (since we do not need them any longer) More... | |
void | removeComponents (ArrayBuffer< int > &ids) |
Remove the full components with the given ids. More... | |
void | addComponent (NodeArray< bool > &isNewTerminal, int id) |
Add a full component to the final solution (by changing nonterminals to terminals) More... | |
void | preprocess (NodeArray< bool > &isNewTerminal) |
Preprocess LP solution. More... | |
Private Attributes | |
EdgeWeightedGraphCopy< T > * | m_approx2SteinerTree |
T | m_approx2Weight |
const double | m_eps |
epsilon for double operations More... | |
steiner_tree::FullComponentWithExtraStore< T, double > | m_fullCompStore |
all enumerated full components, with solution More... | |
const EdgeWeightedGraph< T > & | m_G |
const NodeArray< bool > & | m_isTerminal |
int | m_restricted |
const List< node > & | m_terminals |
List of terminals. More... | |
Approx2State | m_use2approx |
Class managing LP-based approximation.
Definition at line 159 of file MinSteinerTreeGoemans139.h.
|
inline |
Initialize all attributes, sort the terminal list.
Definition at line 284 of file MinSteinerTreeGoemans139.h.
|
inline |
Definition at line 315 of file MinSteinerTreeGoemans139.h.
|
inlineprivate |
Add a full component to the final solution (by changing nonterminals to terminals)
Definition at line 223 of file MinSteinerTreeGoemans139.h.
|
private |
Find 3-restricted components.
Definition at line 352 of file MinSteinerTreeGoemans139.h.
|
private |
Find full components of size 2.
Definition at line 323 of file MinSteinerTreeGoemans139.h.
|
private |
Find full components of size 3.
Definition at line 335 of file MinSteinerTreeGoemans139.h.
|
private |
Find full components.
Definition at line 402 of file MinSteinerTreeGoemans139.h.
|
private |
Find full components using algorithm by Dreyfus-Wagner.
Definition at line 381 of file MinSteinerTreeGoemans139.h.
|
private |
Find full components using algorithm by Erickson et al.
Definition at line 394 of file MinSteinerTreeGoemans139.h.
T ogdf::MinSteinerTreeGoemans139< T >::Main::getApproximation | ( | EdgeWeightedGraphCopy< T > *& | finalSteinerTree, |
const std::minstd_rand & | rng, | ||
const bool | doPreprocessing = true |
||
) |
Obtain an (1.39+epsilon)-approximation based on the LP solution.
Definition at line 416 of file MinSteinerTreeGoemans139.h.
|
inlineprivate |
Preprocess LP solution.
Definition at line 229 of file MinSteinerTreeGoemans139.h.
|
inlineprivate |
Remove the full components with the given ids.
Definition at line 215 of file MinSteinerTreeGoemans139.h.
|
inlineprivate |
Remove inactive components from m_fullCompStore (since we do not need them any longer)
Definition at line 205 of file MinSteinerTreeGoemans139.h.
|
private |
Auxiliary function to retrieve components by Dreyfus-Wagner/Erickson et al implementation.
Definition at line 367 of file MinSteinerTreeGoemans139.h.
|
private |
Definition at line 176 of file MinSteinerTreeGoemans139.h.
|
private |
Definition at line 177 of file MinSteinerTreeGoemans139.h.
|
private |
epsilon for double operations
Definition at line 174 of file MinSteinerTreeGoemans139.h.
|
private |
all enumerated full components, with solution
Definition at line 164 of file MinSteinerTreeGoemans139.h.
|
private |
Definition at line 160 of file MinSteinerTreeGoemans139.h.
|
private |
Definition at line 161 of file MinSteinerTreeGoemans139.h.
|
private |
Definition at line 166 of file MinSteinerTreeGoemans139.h.
|
private |
List of terminals.
Definition at line 162 of file MinSteinerTreeGoemans139.h.
|
private |
Definition at line 172 of file MinSteinerTreeGoemans139.h.