diff --git a/src/example.cpp b/src/example.cpp index d874ed9..7253769 100644 --- a/src/example.cpp +++ b/src/example.cpp @@ -1,9 +1,11 @@ #include // For writing to the standard output. #include // For reading input files. +#include #include "graph.hpp" #include "edmonds.h" + int main(int argc, char** argv) { if (argc != 2) @@ -16,10 +18,16 @@ int main(int argc, char** argv) if (not input_file_graph.is_open()) { throw std::runtime_error(std::string("Could not open file for reading: ") + argv[1]); } + auto start = std::chrono::high_resolution_clock::now(); ED::Graph graph = ED::Graph::read_dimacs(input_file_graph); + auto end = std::chrono::high_resolution_clock::now(); + std::cout << "Parsing time: " << std::chrono::duration_cast(end - start) << std::endl; // Now, calculate the matching + auto start2 = std::chrono::high_resolution_clock::now(); ED::Graph optimum_matching = Edmonds::maximum_matching(graph); + auto end2 = std::chrono::high_resolution_clock::now(); + std::cout << "Solving time: " << std::chrono::duration_cast(end2 - start2) << std::endl; std::cout << optimum_matching; return EXIT_SUCCESS; }