-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdriver.cpp
More file actions
35 lines (25 loc) · 753 Bytes
/
Copy pathdriver.cpp
File metadata and controls
35 lines (25 loc) · 753 Bytes
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
#include "graph.h"
class Tester{ // Tester class to implement test functions
public:
};
int main(){
Graph aGraph("testdata.txt");
aGraph.findPath(1,0);
cout << "Finding the path from node 0 to node 5: " << endl;
aGraph.dump();
aGraph.findPath(2,2);
cout << "Finding the path from node 2 to itself: " << endl;
aGraph.dump();
aGraph.findPath(4,0);
cout << "Finding the path from node 4 to node 0: " << endl;
aGraph.dump();
Graph bGraph;
cout << "Finding the path from node 1 to node 14 in an empty Graph object: " << endl;
try{
bGraph.findPath(1,14);
bGraph.dump();
}catch(std::out_of_range const &e){
cout << e.what() << endl;
}
return 0;
}