Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***
- * ___ ___ _____ ___ ___ ___ ___ ___ __ _ ____
- * / __| | __| |_ _| | __| |_ _| | __| | _ \ |_ ) / \ / | |__ |
- * | (__ | _| | | | _| | | | _| | _/ / / | () | | | / /
- * \___| |___| |_| |___| |___| |___| |_| /___| \__/ |_| /_/
- *
- * TEI of Epirus - Department of Computer Engineering
- * Gogos Christos - Arta 2017
- */
- #include "lab02_graph.hpp"
- int main(int argc, char **argv) {
- double sum=0;
- struct di_graph graph { };
- if (argc != 2) {
- cout << "Wrong number of arguments" << endl;
- exit(-1);
- }
- string fn{argv[1]};
- graph = read_data(fn);
- print_graph_info(graph);
- for (int i = 0; i < graph.V; ++i){
- string v = get_vertex_label(graph,i);
- sum+= get_heuristic(graph, v);
- }
- double mo = (double)sum / (double)graph.V;
- cout<<"Average: "<<mo<<endl;
- free_memory(graph);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement