-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIGraph.h
More file actions
30 lines (26 loc) · 746 Bytes
/
Copy pathIGraph.h
File metadata and controls
30 lines (26 loc) · 746 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
#ifndef H_IGRAPH
#define H_IGRAPH
//#include <iostream>
#include <vector>
class IGraph {
public:
IGraph() {}
IGraph(IGraph* graph);
virtual ~IGraph() {}
virtual void AddEdge(int from, int to) = 0;
virtual int VerticesCount() const = 0;
virtual void GetNextVertices(int vertex, std::vector<int>& vertices) const = 0;
virtual void GetPrevVertices(int vertex, std::vector<int>& vertices) const = 0;
// virtual void PrintGraph() const;
};
//void IGraph::PrintGraph() const {
// for (int i = 0; i < VerticesCount(); i++) {
// std::cout << i + 1 << ": ";
// std::vector<int> next;
// GetNextVertices(i, next);
// for (unsigned int j = 0; j < next.size(); j++)
// std::cout << next[j] + 1 << " ";
// std::cout << "\n";
// }
//}
#endif