-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test.cpp
49 lines (41 loc) · 1.18 KB
/
Test.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// Created by MrPark on 08.02.2019.
//
#include "Test.h"
#include <ctime>
void Test::test()
{
clock_t begin = clock();
clock_t end = clock();
if(k > 200)
{
cout << "KEY NUMBER IS TOO LARGE FOR DIJKSTRA MODE" << endl;
}
else
{
cout << "NUMBER OF VERTICES: " << k << endl;
begin = clock();
dijkstraCI.solve();
clock_t end = clock();
dijkstraTime = ((long double) (end - begin)) / CLOCKS_PER_SEC;
cout << "DIJKSTRA MODE BEST RESULT IS: " << dijkstraCI.getBestResult() << endl;
cout << "SOLUTION TIME IS: " << dijkstraTime << endl;
}
if(k > 1000)
{
cout << "KEY NUMBER IS TOO LARGE FOR DIJKSTRA MODE" << endl;
}
else
{
begin = clock();
floyd_warshallCI.solve();
end = clock();
floyd_warshallTime = ((long double) (end - begin)) / CLOCKS_PER_SEC;
cout << "FLOYD-WARSHALL MODE BEST RESULT IS: " << floyd_warshallCI.getBestResult() << endl;
cout << "SOLUTION TIME IS: " << floyd_warshallTime << endl;
}
if(dijkstraCI.getBestResult() != floyd_warshallCI.getBestResult())
{
throw WrongSolutionException();
}
}