65template<
typename TWeight>
80 std::string& error)
override {
81 return m_module->preconditionsOk(GA, stretch, error);
90 std::unique_ptr<SpannerModule<TWeight>>
m_module;
98 int64_t timeLeft = max(
getTimeLeft(),
static_cast<int64_t
>(0));
102 int bestSize = std::numeric_limits<int>::max();
107 if (bestSize == std::numeric_limits<int>::max()) {
124 if (bestSize == std::numeric_limits<int>::max()) {
141 for (
node n : G.nodes) {
148 (*m_inSpanner)[eOrig] =
true;
155 if (bestSize == std::numeric_limits<int>::max()) {
Includes declaration of graph class.
Declaration of graph copy classes.
Decralation of GraphElement and GraphList classes.
Basic module for spanner algorithms.
Class for the representation of edges.
Stores additional attributes of a graph (like layout information).
const Graph & constGraph() const
Returns a reference to the associated graph.
node newNode(node vOrig)
Creates a new node in the graph copy with original node vOrig.
const Graph & original() const
Returns a reference to the original 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.
void setOriginalGraph(const Graph *G) override
Re-initializes the copy using G (which might be null), but does not create any nodes or edges.
void clear() override
Removes all nodes and edges from this copy but does not break the link with the original graph.
Data type for general directed graphs (adjacency list representation).
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.
A implementation-independed wrapper class to execute a spanner algorithm multiple times.
int getExecutedIterations()
virtual SpannerModule< TWeight >::ReturnType execute() override
Executes the core algorithm.
std::unique_ptr< SpannerModule< TWeight > > m_module
const int m_maxIterations
SpannerIteratedWrapper(SpannerModule< TWeight > *module, int maxIterations)
Initializes the wrapper.
virtual bool preconditionsOk(const GraphAttributes &GA, double stretch, std::string &error) override
Interface for spanner algorithms.
bool isTimelimitEnabled()
const GraphAttributes * m_GA
EdgeArray< bool > * m_inSpanner
GraphCopySimple * m_spanner
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
The namespace for all OGDF objects.