2 #include <lemon/smart_graph.h>
32 int main(
int argc,
char **argv)
34 GRAPH_TYPEDEFS(SmartGraph);
36 ifstream graphFile(argv[1]);
39 if (
string(argv[2]) ==
"GRA") {
48 cout <<
"Graph reading time: " << timer.
elapsed() << endl;
51 int n = countNodes(g);
52 cout <<
"Total nodes: " << n << endl;
53 cout <<
"Total edges: " << countEdges(g) << endl;
56 cout <<
"Using greedy nearest:" << endl;
59 greedyNearest(g, 0, atoi(argv[3]));
60 cout <<
"Creation elapsed time: " << greedyNearest.
creationTime() << endl;
61 greedyNearest.
init(atoi(argv[4]), atoi(argv[5]), atoi(argv[6]), atof(argv[7]),
63 cout <<
"Initialisation elapsed time: " << greedyNearest.
initTime() << endl;
66 cout <<
"Algorithm running time: " << greedyNearest.
runTime() << endl;
67 cout <<
"Max colours: " << greedyNearest.maxK() << endl;
68 cout <<
"Colours used: " << greedyNearest.totalColours() << endl;
69 cout <<
"LCA value: " << greedyNearest.lcaValue() << endl;
72 cout <<
"Could not find a solution!" << endl;
GraphFormat
Available graph formats.
void readGraph(Graph &g, GraphFormat f=RMF, IS &in=std::cin)
Read a graph.
double runTime()
Retrieve the duration of running the algorithm.
virtual MinLCAStatus run()
Run the algorithm.
Solution has been found after running.
Default namespace Default namespace for MinLCA algorithms.
Class for timing MinLCA algorithms.
Functions for reading graphs and getting graph properties.
double initTime()
Retrieve the duration of initialising the algorithm.
Definitions for simulated annealing using greedy recolourings.
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.
int main(int argc, char **argv)
Main function.
Namespace for util functions and classes.