-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph.h
60 lines (53 loc) · 1.12 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef GRAPH_H
#define GRAPH_H
#include <list>
#include <QApplication>
#include "boost/dynamic_bitset.hpp"
using namespace std;
class Graph {
public:
// Constructor and destructor
Graph();
Graph(int V)
{
this->V = V;
adjacentNodes = new list<int>[V];
}
~Graph()
{
delete[] adjacentNodes;
}
// function to add an edge to graph
void addEdge(int v, int w);
// Prints greedy coloring of the vertices
void LFRColoring();
void LFRBitColoring();
void LFRBitColoring2();
void EqualBitColoring();
int getTmp();
int getBitTmp();
int getV()
{
return V;
}
void setV(int count)
{
this->V = count;
adjacentNodes = new list<int>[V];
}
void addNode()
{
this->V++;
adjacentNodes->resize(V);
}
private:
int V; // No. of vertices
list<int> *adjacentNodes; // A dynamic array of adjacency lists
vector<int> color;
vector<int> tmp;
vector<int> bitSize;
int bitSizeMin;
vector<bool> marked;
vector<boost::dynamic_bitset<> > colorBit;
};
#endif // GRAPH_H