Generated on Sat Feb 7 2015 02:01:38 for Gecode by doxygen 1.8.9.1
GraphColor Class Reference

Example: Clique-based graph coloring More...

Public Types

enum  { MODEL_NONE, MODEL_CLIQUE }
 Model variants. More...
 
enum  {
  BRANCH_DEGREE, BRANCH_SIZE, BRANCH_SIZE_DEGREE, BRANCH_SIZE_AFC,
  BRANCH_SIZE_ACTIVITY
}
 Branching to use for model. More...
 
enum  { SYMMETRY_NONE, SYMMETRY_LDSB }
 Symmetry variants. More...
 

Public Member Functions

 GraphColor (const SizeOptions &opt)
 The actual model. More...
 
virtual IntVar cost (void) const
 Cost function. More...
 
 GraphColor (bool share, GraphColor &s)
 Constructor for cloning s. More...
 
virtual Spacecopy (bool share)
 Copying during cloning. More...
 
virtual void print (std::ostream &os) const
 Print the solution. More...
 
- Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
 ScriptBase (void)
 Default constructor. More...
 
 ScriptBase (bool share, ScriptBase &e)
 Constructor used for cloning. More...
 
virtual void compare (const Space &, std::ostream &os) const
 Compare with s. More...
 

Related Functions

(Note that these are not member functions.)

int main (int argc, char *argv[])
 Main-function. More...
 

Graph specification for graph coloring

The edges are described by an array of integers with even number of elements, terminated by the elements -1,-1. The cliques are described by an array of integers, where the first integer gives the size of the clique, the following elements are nodes for each clique. The cliques are terminated by -1 for clique size

const int g1_e []
 First example graph: edges. More...
 
const int g1_c []
 First example graph: cliques. More...
 
const GraphColorSpec g1 (200, g1_e, g1_c)
 First example graph. More...
 
const int g2_e []
 Second example graph: edges. More...
 
const int g2_c []
 Second example graph: cliques. More...
 
const GraphColorSpec g2 (200, g2_e, g2_c)
 Second example graph. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Gecode::Driver::ScriptBase< BaseSpace >
static std::ostream & select_ostream (const char *name, std::ofstream &ofs)
 Choose output stream according to name. More...
 
template<class Script , template< class > class Engine, class Options >
static void run (const Options &opt, Script *s=NULL)
 

Detailed Description

Example: Clique-based graph coloring

Definition at line 315 of file graph-color.cpp.

Constructor & Destructor Documentation

GraphColor::GraphColor ( const SizeOptions opt)
inline

The actual model.

Branching on the number of colors

Branching without symmetry breaking

Branching while considering value symmetry breaking (every permutation of color values gives equivalent solutions)

Definition at line 342 of file graph-color.cpp.

GraphColor::GraphColor ( bool  share,
GraphColor s 
)
inline

Constructor for cloning s.

Definition at line 418 of file graph-color.cpp.

Member Function Documentation

virtual IntVar GraphColor::cost ( void  ) const
inlinevirtual

Cost function.

Definition at line 414 of file graph-color.cpp.

virtual Space* GraphColor::copy ( bool  share)
inlinevirtual

Copying during cloning.

Definition at line 424 of file graph-color.cpp.

virtual void GraphColor::print ( std::ostream &  os) const
inlinevirtual

Print the solution.

Reimplemented from Gecode::Driver::ScriptBase< BaseSpace >.

Definition at line 429 of file graph-color.cpp.

Friends And Related Function Documentation

const int g1_e[]
related

First example graph: edges.

Definition at line 70 of file graph-color.cpp.

const int g1_c[]
related

First example graph: cliques.

Definition at line 122 of file graph-color.cpp.

const GraphColorSpec g1(200, g1_e, g1_c)
related

First example graph.

const int g2_e[]
related

Second example graph: edges.

Definition at line 196 of file graph-color.cpp.

const int g2_c[]
related

Second example graph: cliques.

Definition at line 232 of file graph-color.cpp.

const GraphColorSpec g2(200, g2_e, g2_c)
related

Second example graph.

int main ( int  argc,
char *  argv[] 
)
related

Main-function.

Definition at line 446 of file graph-color.cpp.


The documentation for this class was generated from the following file: