-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph.h
45 lines (37 loc) · 891 Bytes
/
graph.h
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
#ifndef __GRAPH_H__2222
#define __GRAPH_H__2222
#include <vector>
#include <set>
#include <map>
#include "edge.h"
#include "colors.h"
class Graph
{
public:
int m_NumberOfNodes;
int m_NumberOfEdgesOriginal;
int m_NumberOfEdgesCurrent;
int m_LastErasedEdge;
bool * m_AdjMatrix;
bool * m_EdgeMatrix;
Color * m_NodeColors;
Edge ** m_Edges; // NEW - shared for all graphs
//std::set<int> m_MissingEdgesById;
//std::vector<Edge*> m_Edges; //OLD
public:
Graph(int numberOfNodes);
Graph(const Graph &);
~Graph();
void RemoveNextEdge();
void RemoveEdge(unsigned);
int GetEdgeIndex(int, int) const;
bool AreNeighbours(int, int) const;
void Print() const;
std::vector<int> ColorNeighbourNodes(int, Color);
int GetFirstUncoloredNode() const;
private:
int GetSizeOfAdjMatrix() const;
private:
int m_AdjMatrixSize;
};
#endif // __GRAPH_H__2222