59template<
typename TWeight>
67 std::string& error)
override {
69 error =
"The graph must be undirected";
73 error =
"The stretch must be >= 1.0";
96 for (
edge e : edges) {
104 (*m_inSpanner)[e] =
true;
Declaration and implementation of ogdf::NodeSet.
Basic module for spanner algorithms.
The parameterized class Array implements dynamic arrays of type E.
void quicksort()
Sorts array using Quicksort.
Dynamic arrays indexed with edges.
void init()
Reinitializes the array. Associates the array with no graph.
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).
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.
node copy(node v) const
Returns the node in the graph copy corresponding to v.
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
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
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