ipchromaticgraph.h
969 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
36
37
38
39
40
41
42
#ifndef HIPCHROMATICGRAPH
#define HIPCHROMATICGRAPH
#include <vector>
#include <utility>
#include "ip.h"
class IpChromaticGraph
{
public:
IpChromaticGraph (const std::vector < unsigned int >& vertices,
const std::vector < std::pair < unsigned int, unsigned int > >& edges,
unsigned int k,
unsigned int ncores);
int solve (std::vector < unsigned int >& solution);
void add_bj_ct(const std::vector < unsigned int >& solution);
private:
IP *ip_; // pointer to the integer program
std::vector< std::vector < int > > varVC_; // vector to store the decision variables for each vertex and color
std::vector < int > varColorUsed_; // vector to store the decision variable for each color
std::vector < unsigned int > vertices_;
std::vector < std::pair < unsigned int, unsigned int > > edges_;
unsigned int k_; // Maximum number of color to use
};
#endif