Multiplicative spanner by greedily adding edges. More...
#include <ogdf/graphalg/SpannerBasicGreedy.h>
Inheritance diagram for ogdf::SpannerBasicGreedy< TWeight >:Classes | |
| struct | EdgeWeightComparator |
Public Member Functions | |
| virtual bool | preconditionsOk (const GraphAttributes &GA, double stretch, std::string &error) override |
Public Member Functions inherited from ogdf::SpannerModule< TWeight > | |
| SpannerModule () | |
| Initializes a spanner module. | |
| virtual | ~SpannerModule () |
| virtual ReturnType | call (const GraphAttributes &GA, double stretch, GraphCopySimple &spanner, EdgeArray< bool > &inSpanner) |
| Executes the algorithm. | |
| int64_t | getTimeNeeded () |
| void | setTimelimit (int64_t milliseconds) |
| Sets the timelimit for the algorithm in milliseconds. | |
Public Member Functions inherited from ogdf::Module | |
| Module () | |
| Initializes a module. | |
| virtual | ~Module () |
Private Member Functions | |
| double | distanceInSpanner (node s, node t, double maxLookupDist) |
| virtual SpannerModule< TWeight >::ReturnType | execute () override |
| Executes the core algorithm. | |
| virtual void | init (const GraphAttributes &GA, double stretch, GraphCopySimple &spanner, EdgeArray< bool > &inSpanner) override |
| Initializes members and create an empty spanner. | |
| TWeight | weight (edge e) |
Private Attributes | |
| EpsilonTest | m_eps |
| EdgeArray< TWeight > | m_spannerWeights |
Multiplicative spanner by greedily adding edges.
I. Althöfer, G. Das, D. Dobkin und D. Joseph. On Sparse Spanners of Weighted Graphs. Discrete Comput Geom 9 (1993), S. 81–100. doi: https://doi.org/10.1007/BF02189308.
Conditions for the graph:
The stretch \(s\) must satisfy: \(s\geq1\in\mathbb{R}\).
The preconditions can be checked with SpannerBasicGreedy::preconditionsOk.
Calculates a \((2k-1)\)-spanner with size \(<n^{(1+1/k)}\) ( \(\mathcal{O}(n^{1+1/k})\)) and lightness \(<1+n/k\) ( \(\mathcal{O}(n/k)\)). The runtime is \(\mathcal{O}(mn^{1+1/k}\log n)\)
Definition at line 60 of file SpannerBasicGreedy.h.
|
private |
|
inlineoverrideprivatevirtual |
Executes the core algorithm.
Called after initialization. This method is used for the timelimit, so do not forget to call assertTimeLeft from time to time.
Implements ogdf::SpannerModule< TWeight >.
Definition at line 86 of file SpannerBasicGreedy.h.
|
inlineoverrideprivatevirtual |
Initializes members and create an empty spanner.
Reimplemented from ogdf::SpannerModule< TWeight >.
Definition at line 80 of file SpannerBasicGreedy.h.
|
inlineoverridevirtual |
GA and stretch are valid for a specific algorithm. If not, an error message is provided via error Implements ogdf::SpannerModule< TWeight >.
Definition at line 66 of file SpannerBasicGreedy.h.
|
inlineprivate |
e from m_G Definition at line 117 of file SpannerBasicGreedy.h.
|
private |
Definition at line 62 of file SpannerBasicGreedy.h.
|
private |
Definition at line 61 of file SpannerBasicGreedy.h.