66template<
typename TWeight>
74 std::string& error)
override {
76 error =
"The graph must be undirected";
80 error =
"The stretch must be >= 1.0";
103 for (
edge e : edges) {
108 if (
m_eps.
greater(currentSpannerDistance, maxDistance)) {
111 (*m_inSpanner)[e] =
true;
Declaration and implementation of Array class and Array algorithms.
Compare floating point numbers with epsilons and integral numbers with normal compare operators.
Includes declaration of graph class.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Basic module for spanner algorithms.
Basic declarations, included by all source files.
The parameterized class Array implements dynamic arrays of type E.
void quicksort()
Sorts array using Quicksort.
Class for the representation of edges.
std::enable_if< std::is_integral< T >::value, bool >::type less(const T &x, const T &y) const
Compare if x is LESS than y for integral types.
std::enable_if< std::is_integral< T >::value, bool >::type greater(const T &x, const T &y) const
Compare if x is GREATER than y for integral types.
Stores additional attributes of a graph (like layout information).
bool directed() const
Returns if the graph is directed.
const Graph & constGraph() const
Returns a reference to the associated graph.
Copies of graphs with mapping between nodes and edges.
edge newEdge(edge eOrig)
Creates a new edge in the graph copy with original edge eOrig.
edge copy(edge e) const override
Returns the edge in the graph copy corresponding to e.
int numberOfEdges() const
Returns the number of edges in the graph.
internal::GraphObjectContainer< EdgeElement > edges
The container containing all edge objects.
ReturnType
The return type of a module.
Class for the representation of nodes.
Multiplicative spanner by greedily adding edges.
virtual void init(const GraphAttributes &GA, double stretch, GraphCopySimple &spanner, EdgeArray< bool > &inSpanner) override
Initializes members and create an empty spanner.
double distanceInSpanner(node s, node t, double maxLookupDist)
virtual SpannerModule< TWeight >::ReturnType execute() override
Executes the core algorithm.
EdgeArray< TWeight > m_spannerWeights
virtual bool preconditionsOk(const GraphAttributes &GA, double stretch, std::string &error) override
Interface for spanner algorithms.
void assertTimeLeft()
Assert, that time is left.
virtual void init(const GraphAttributes &GA, double stretch, GraphCopySimple &spanner, EdgeArray< bool > &inSpanner)
Initializes members and create an empty spanner.
const GraphAttributes * m_GA
EdgeArray< bool > * m_inSpanner
static TWeight getWeight(const GraphAttributes &GA, edge e)
GraphCopySimple * m_spanner
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
The namespace for all OGDF objects.
EdgeWeightComparator(const EdgeWeightComparator &)=delete
const GraphAttributes & m_GA
bool less(edge a, edge b) const
EdgeWeightComparator(const GraphAttributes &GA)
EdgeWeightComparator & operator=(const EdgeWeightComparator &)=delete
EdgeWeightComparator()=delete