Generated on Sat Nov 11 01:12:18 2006 for Gecode by doxygen 1.5.1

IndSet Class Reference
[Example scripts (models)]

Inherits Example.

List of all members.


Detailed Description

Example: Independent Sets in a Graph

Definition at line 65 of file ind-set.cc.

Graph specification for independent sets

static const int e_20_10 []
static const Graph g_20_10 (20, 10, e_20_10)
static const int e_40_20 []
static const Graph g_40_20 (40, 20, e_40_20)

Public Member Functions

 IndSet (const Options &opt)
 Actual model.
 IndSet (bool share, IndSet &s)
 Constructor for cloning s.
virtual Spacecopy (bool share)
 Copy during cloning.
virtual void print (void)
 Print solution.
void constrain (Space *s)
 Add constraint for next better solution.

Protected Attributes

const Graphg
 Graph used.
BoolVarArray v
 Whether vertex included in independent set.
IntVar k
 How many elements has indipendent set.


Constructor & Destructor Documentation

IndSet::IndSet ( const Options opt  )  [inline]

Actual model.

Definition at line 75 of file ind-set.cc.

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

Constructor for cloning s.

Definition at line 87 of file ind-set.cc.


Member Function Documentation

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

Copy during cloning.

Implements Gecode::Space.

Definition at line 93 of file ind-set.cc.

virtual void IndSet::print ( void   )  [inline, virtual]

Print solution.

Reimplemented from Example.

Definition at line 99 of file ind-set.cc.

void IndSet::constrain ( Space s  )  [inline]

Add constraint for next better solution.

Definition at line 109 of file ind-set.cc.


Friends And Related Function Documentation

const int e_20_10[] [related]

Initial value:

 {
  0, 4,  2,12,  12,14,  18,19,   7,10,
  9,12,  5,11,   6,15,   3,18,   7,16
}

Definition at line 41 of file ind-set.cc.

const Graph g_20_10(20, 10, e_20_10) [related]

const int e_40_20[] [related]

Initial value:

 {
  21,30,   11,30,   19,38,   20,25,   11,24,
  20,33,    8,39,    4, 5,    6,16,    5,32,
  0, 9,    5,24,   25,28,   36,38,   14,20,
  19,25,   11,22,   13,30,    7,36,   15,33
}

Definition at line 48 of file ind-set.cc.

const Graph g_40_20(40, 20, e_40_20) [related]


Member Data Documentation

const Graph& IndSet::g [protected]

Graph used.

Definition at line 68 of file ind-set.cc.

BoolVarArray IndSet::v [protected]

Whether vertex included in independent set.

Definition at line 70 of file ind-set.cc.

IntVar IndSet::k [protected]

How many elements has indipendent set.

Definition at line 72 of file ind-set.cc.


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