Generated on Mon Jul 6 18:09:26 2009 for Gecode by doxygen 1.5.9

GraphColor Class Reference
[Scripts for problems]

Example: Clique-based graph coloring More...

List of all members.

Public Types

enum  { MODEL_NONE, MODEL_CLIQUE }
 Model variants. More...
enum  { BRANCH_DEGREE, BRANCH_SIZE, BRANCH_SIZE_DEGREE }
 Branching to use for model. More...

Public Member Functions

 GraphColor (const SizeOptions &opt)
 The actual model.
virtual IntVar cost (void) const
 Cost function.
 GraphColor (bool share, GraphColor &s)
 Constructor for cloning s.
virtual Spacecopy (bool share)
 Copying during cloning.
virtual void print (std::ostream &os) const
 Print the solution.

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.
const int g1_c []
 First example graph: cliques.
const GraphColorSpec g1 (200, g1_e, g1_c)
 First example graph.
const int g2_e []
 Second example graph: edges.
const int g2_c []
 Second example graph: cliques.
const GraphColorSpec g2 (200, g2_e, g2_c)
 Second example graph.


Detailed Description

Example: Clique-based graph coloring

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


Member Enumeration Documentation

anonymous enum

Model variants.

Enumerator:
MODEL_NONE  No lower bound.
MODEL_CLIQUE  Use maximal clique size as lower bound.

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

anonymous enum

Branching to use for model.

Enumerator:
BRANCH_DEGREE  Choose variable with largest degree.
BRANCH_SIZE  Choose variable with smallest size.
BRANCH_SIZE_DEGREE  Choose variable with smallest size/degree.

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


Constructor & Destructor Documentation

GraphColor::GraphColor ( const SizeOptions opt  )  [inline]

The actual model.

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

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

Constructor for cloning s.

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


Member Function Documentation

virtual IntVar GraphColor::cost ( void   )  const [inline, virtual]

Cost function.

Implements Gecode::MiniModel::OptimizeSpace< IRT_LE >.

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

virtual Space* GraphColor::copy ( bool  share  )  [inline, virtual]

Copying during cloning.

Implements Gecode::Space.

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

virtual void GraphColor::print ( std::ostream &  os  )  const [inline, virtual]

Print the solution.

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

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


Friends And Related Function Documentation

const int g1_e[] [related]

First example graph: edges.

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

const int g1_c[] [related]

First example graph: cliques.

Definition at line 118 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 192 of file graph-color.cpp.

const int g2_c[] [related]

Second example graph: cliques.

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

const GraphColorSpec g2(200, g2_e, g2_c) [related]

Second example graph.


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