2 #include <lemon/smart_graph.h>
23 int main(
int argc,
char **argv)
28 g.
init(atoi(argv[1]), atoi(argv[2])).generate();
29 cout <<
"Graph generation time: " << timer.
elapsed() << endl;
32 int n = countNodes(g);
33 cout <<
"Total nodes: " << n << endl;
34 cout <<
"Size of cliques: " << g.
cliqueOrder() << endl;
35 cout <<
"Number of cliques: " << g.
cliques() << endl;
36 cout <<
"Total edges: " << countEdges(g) << endl;
39 cout <<
"Using greedy nearest:" << endl;
42 cout <<
"Creation elapsed time: " << greedyNearest.
creationTime() << endl;
44 cout <<
"Initialisation elapsed time: " << greedyNearest.
initTime() << endl;
47 cout <<
"Algorithm running time: " << greedyNearest.
runTime() << endl;
48 cout <<
"Max colours: " << greedyNearest.maxK() << endl;
49 cout <<
"Colours used: " << greedyNearest.totalColours() << endl;
50 cout <<
"LCA value: " << greedyNearest.lcaValue() << endl;
53 cout <<
"Could not find a solution!" << endl;
58 cout <<
"Using greedy least cost:" << endl;
61 cout <<
"Creation elapsed time: " << greedyLeastCost.
creationTime() << endl;
62 greedyLeastCost.
init();
63 cout <<
"Initialisation elapsed time: " << greedyLeastCost.
initTime() << endl;
66 cout <<
"Algorithm running time: " << greedyLeastCost.
runTime() << endl;
67 cout <<
"Max colours: " << greedyLeastCost.maxK() << endl;
68 cout <<
"Colours used: " << greedyLeastCost.totalColours() << endl;
69 cout <<
"LCA value: " << greedyLeastCost.lcaValue() << endl;
72 cout <<
"Could not find a solution!" << endl;
Class describing a cycle of cliques.
double runTime()
Retrieve the duration of running the algorithm.
int main(int argc, char **argv)
Main function.
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)
Initialise the generator.
Solution has been found after running.
Default namespace Default namespace for MinLCA algorithms.
int cliques() const
Retrieve the number of cliques.
Class for timing MinLCA algorithms.
double initTime()
Retrieve the duration of initialising the algorithm.
double creationTime()
Retrieve the duration of instantiating the algorithm class.
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.