2 #include <lemon/smart_graph.h>
24 int main(
int argc,
char **argv)
29 g.
init(atoi(argv[1]), atoi(argv[2]), atof(argv[3])).
generate();
30 cout <<
"Graph generation time: " << timer.
elapsed() << endl;
33 int n = countNodes(g);
34 cout <<
"Total nodes: " << n << endl;
35 cout <<
"Size of cliques: " << g.
cliqueOrder() << endl;
36 cout <<
"Number of cliques: " << g.
cliques() << endl;
37 cout <<
"Total edges: " << countEdges(g) << endl;
38 cout <<
"Edge prob.: " << g.p() << endl;
39 cout <<
"Random seed: " << argv[4] << endl;
42 cout <<
"Using greedy nearest:" << endl;
45 cout <<
"Creation elapsed time: " << greedyNearest.
creationTime() << endl;
47 cout <<
"Initialisation elapsed time: " << greedyNearest.
initTime() << endl;
50 cout <<
"Algorithm running time: " << greedyNearest.
runTime() << endl;
51 cout <<
"Max colours: " << greedyNearest.maxK() << endl;
52 cout <<
"Colours used: " << greedyNearest.totalColours() << endl;
53 cout <<
"LCA value: " << greedyNearest.lcaValue() << endl;
56 cout <<
"Could not find a solution!" << endl;
61 cout <<
"Using greedy least cost:" << endl;
64 cout <<
"Creation elapsed time: " << greedyLeastCost.
creationTime() << endl;
65 greedyLeastCost.
init();
66 cout <<
"Initialisation elapsed time: " << greedyLeastCost.
initTime() << endl;
69 cout <<
"Algorithm running time: " << greedyLeastCost.
runTime() << endl;
70 cout <<
"Max colours: " << greedyLeastCost.maxK() << endl;
71 cout <<
"Colours used: " << greedyLeastCost.totalColours() << endl;
72 cout <<
"LCA value: " << greedyLeastCost.lcaValue() << endl;
75 cout <<
"Could not find a solution!" << endl;
double runTime()
Retrieve the duration of running the algorithm.
virtual MinLCAStatus run()
Run the algorithm.
Contains definition for graphs with cliques.
int cliqueOrder() const
Retrieve the order of each clique.
virtual Graph & init(int s, int c, double p)
Initialise the generator.
virtual void generate()
Generate graph.
Solution has been found after running.
Default namespace Default namespace for MinLCA algorithms.
int cliques() const
Retrieve the number of cliques.
int main(int argc, char **argv)
Main function.
Class for timing MinLCA algorithms.
double initTime()
Retrieve the duration of initialising the algorithm.
double creationTime()
Retrieve the duration of instantiating the algorithm class.
Class describing a random graph with cliques.
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.