A implementation-independed wrapper class to execute a spanner algorithm multiple times.
More...
|
enum class | ReturnType { Feasible
, Optimal
, NoFeasibleSolution
, TimeoutFeasible
, TimeoutInfeasible
, Error
} |
| The return type of a module. More...
|
|
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 .
|
|
static bool | isMultiplicativeSpanner (const GraphAttributes &GA, const GraphCopySimple &spanner, double stretch) |
| Validates a spanner.
|
|
static bool | isSolution (ReturnType ret) |
| Returns true iff ret indicates that the module returned a feasible solution.
|
|
void | assertTimeLeft () |
| Assert, that time is left.
|
|
int64_t | getTimeLeft () |
|
int | getWeight (const GraphAttributes &GA, edge e) |
|
double | getWeight (const GraphAttributes &GA, edge e) |
|
virtual void | init (const GraphAttributes &GA, double stretch, GraphCopySimple &spanner, EdgeArray< bool > &inSpanner) |
| Initializes members and create an empty spanner.
|
|
bool | isTimelimitEnabled () |
|
static TWeight | getWeight (const GraphAttributes &GA, edge e) |
|
const GraphAttributes * | m_GA |
|
EdgeArray< bool > * | m_inSpanner |
|
GraphCopySimple * | m_spanner |
|
double | m_stretch |
|
A implementation-independed wrapper class to execute a spanner algorithm multiple times.
The amount of maximum iterations can be set. If this is reached or the optional timelimit is exceeded, the best solution so far is returned. The quality of the solution is determined by the sparsity of the spanner, namely the spanner with the least amount of edges regardless of whether the spanner is weighted or not.
If no valid solution was found and the timelimit is exceeded, SpannerModule::ReturnType::TimeoutInfeasible is returned. If all iterations are completed and no valid solution was found, SpannerModule::ReturnType::NoFeasibleSolution is returned. If an error happens, it is directly returned and the iterative execution aborted. If there is at least one valid result, the return type will be SpannerModule::ReturnType::Feasible and the spanner is valid.
- Template Parameters
-
TWeight | The type of weights to get from GA |
Definition at line 58 of file SpannerIteratedWrapper.h.