2 #include <lemon/smart_graph.h>
6 #include <lemon/graph_to_eps.h>
12 template<
typename Graph>
13 int shape(
typename Graph::Node)
30 int main(
int argc,
char **argv)
36 cout <<
"Graph generation time: " << timer.
elapsed() << endl;
39 int n = countNodes(g);
40 cout <<
"Total nodes: " << n << endl;
41 cout <<
"Total edges: " << countEdges(g) << endl;
42 cout <<
"Edge prob.: " << g.
p() << endl;
43 cout <<
"Random seed: " << argv[3] << endl;
46 cout <<
"Using greedy nearest:" << endl;
49 cout <<
"Creation elapsed time: " << greedyNearest.
creationTime() << endl;
51 cout <<
"Initialisation elapsed time: " << greedyNearest.
initTime() << endl;
54 cout <<
"Algorithm running time: " << greedyNearest.
runTime() << endl;
55 cout <<
"Max colours: " << greedyNearest.maxK() << endl;
56 cout <<
"Colours used: " << greedyNearest.totalColours() << endl;
57 cout <<
"LCA value: " << greedyNearest.lcaValue() << endl;
60 cout <<
"Could not find a solution!" << endl;
65 cout <<
"Using greedy least cost:" << endl;
68 cout <<
"Creation elapsed time: " << greedyLeastCost.
creationTime() << endl;
69 greedyLeastCost.
init();
70 cout <<
"Initialisation elapsed time: " << greedyLeastCost.
initTime() << endl;
73 cout <<
"Algorithm running time: " << greedyLeastCost.
runTime() << endl;
74 cout <<
"Max colours: " << greedyLeastCost.maxK() << endl;
75 cout <<
"Colours used: " << greedyLeastCost.totalColours() << endl;
76 cout <<
"LCA value: " << greedyLeastCost.lcaValue() << endl;
79 cout <<
"Could not find a solution!" << endl;
84 for (NodeIt v(g); v != INVALID; ++v) {
86 coords[v] = dim2::Point<double>(cos(
id * 2.0 * M_PI / n),
87 sin(
id * 2.0 * M_PI / n));
93 graphToEps(g, argv[4])
97 .edgeWidthScale(.0005)
Class defining binomial random graphs.
double p() const
Retrieve the edge probability.
double runTime()
Retrieve the duration of running the algorithm.
Graph & init(int n, double p)
Initialise the generator.
Contains definition for BinomialRandom graphs.
virtual void generate()
Generate graph.
virtual MinLCAStatus run()
Run the algorithm.
Solution has been found after running.
Default namespace Default namespace for MinLCA algorithms.
Class for timing MinLCA algorithms.
double initTime()
Retrieve the duration of initialising the algorithm.
double creationTime()
Retrieve the duration of instantiating the algorithm class.
int main(int argc, char **argv)
Main function.
Contains the definitions for timing MinLCA algorithms.
double elapsed() const
Retrieve elapsed time.
void init(Args &&...args)
Reset the data structures of the algorithm.
Namespace for util functions and classes.