56template<
typename TWeight>
143 const Graph& G =
GA.constGraph();
146 for (
node n : G.nodes) {
208template<
typename TWeight>
218template<
typename TWeight>
221 const Graph& G =
GA.constGraph();
224 if (G.numberOfNodes() !=
spanner.numberOfNodes()) {
230 for (
edge e : G.edges) {
239 for (
edge e : G.edges) {
240 node u = e->source();
241 node v = e->target();
255 return GA.intWeight(e);
264 return GA.doubleWeight(e);
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Declaration of graph copy classes.
Declares base class for all module types.
Declaration of several shortest path algorithms.
Declaration of stopwatch classes.
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 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).
static const long edgeDoubleWeight
Corresponds to edge attribute doubleWeight(edge).
static const long edgeIntWeight
Corresponds to edge attribute intWeight(edge).
Copies of graphs with mapping between nodes and edges.
node newNode(node vOrig)
Creates a new node in the graph copy with original node vOrig.
void createEmpty(const Graph &G)
Re-initializes the copy using G, but does not create any nodes or edges.
Data type for general directed graphs (adjacency list representation).
virtual void clear()
Removes all nodes and all edges from the graph.
ReturnType
The return type of a module.
@ TimeoutInfeasible
The solution is not feasible due to a timeout.
Dynamic arrays indexed with nodes.
Class for the representation of nodes.
Interface for spanner algorithms.
static void apspSpanner(const GraphAttributes &GA, const GraphCopySimple &spanner, NodeArray< NodeArray< TWeight > > &shortestPathMatrix)
Calculates an all-pair shortest-path on spanner with the weights given by GA.
virtual ReturnType execute()=0
Executes the core algorithm.
StopwatchCPU m_watch
Used for keeping track of time.
void assertTimeLeft()
Assert, that time is left.
bool isTimelimitEnabled()
virtual ReturnType call(const GraphAttributes &GA, double stretch, GraphCopySimple &spanner, EdgeArray< bool > &inSpanner)
Executes the algorithm.
SpannerModule()
Initializes a spanner module.
int64_t m_timelimit
Timelimit in milliseconds.
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 bool isMultiplicativeSpanner(const GraphAttributes &GA, const GraphCopySimple &spanner, double stretch)
Validates a spanner.
void setTimelimit(int64_t milliseconds)
Sets the timelimit for the algorithm in milliseconds.
virtual bool preconditionsOk(const GraphAttributes &GA, double stretch, std::string &error)=0
static TWeight getWeight(const GraphAttributes &GA, edge e)
GraphCopySimple * m_spanner
Implements a stopwatch measuring CPU time.
void start(bool reset=false)
Starts the stopwatch.
void stop()
Stops the stopwatch and adds the difference between the current time and the starting time to the tot...
int64_t milliSeconds() const
Returns the currently elapsed time in milliseconds.
Declaration of extended graph algorithms.
double dijkstra_SPAP(const GraphAttributes &GA, NodeArray< NodeArray< TCost > > &shortestPathMatrix)
Computes all-pairs shortest paths in GA using Dijkstra's algorithm.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
A simple exception used to exit from the execution, if the timelimit is reached.