ipchromaticgraph.h 969 Bytes
#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