Warnsdorff Class Reference
Custom brancher for knights tours using Warnsdorff's rule. More...
Classes | |
class | Choice |
Choice. More... | |
Public Member Functions | |
virtual bool | status (const Space &) const |
Check status of brancher, return true if alternatives left. | |
virtual Gecode::Choice * | choice (Space &) |
Return choice. | |
virtual ExecStatus | commit (Space &home, const Gecode::Choice &_c, unsigned int a) |
Perform commit for choice _c and alternative a. | |
virtual Actor * | copy (Space &home, bool share) |
Copy brancher. | |
virtual size_t | dispose (Space &) |
Delete brancher and return its size. | |
Static Public Member Functions | |
static void | post (Space &home, const IntVarArgs &x) |
Post brancher. | |
Protected Member Functions | |
Warnsdorff (Space &home, ViewArray< Int::IntView > &xv) | |
Construct brancher. | |
Warnsdorff (Space &home, bool share, Warnsdorff &b) | |
Copy constructor. | |
Protected Attributes | |
ViewArray< Int::IntView > | x |
Views of the brancher. | |
int | start |
Next variable to branch on. |
Detailed Description
Custom brancher for knights tours using Warnsdorff's rule.
This class implements Warnsdorff's rule for finding Knights tours. The next position is choosen by taking the jump that minimizes the number of alternatives in the next step.
Definition at line 56 of file knights.cpp.
Constructor & Destructor Documentation
Warnsdorff::Warnsdorff | ( | Space & | home, | |
ViewArray< Int::IntView > & | xv | |||
) | [inline, protected] |
Construct brancher.
Definition at line 81 of file knights.cpp.
Warnsdorff::Warnsdorff | ( | Space & | home, | |
bool | share, | |||
Warnsdorff & | b | |||
) | [inline, protected] |
Copy constructor.
Definition at line 84 of file knights.cpp.
Member Function Documentation
virtual bool Warnsdorff::status | ( | const Space & | ) | const [inline, virtual] |
Check status of brancher, return true if alternatives left.
Implements Gecode::Brancher.
Definition at line 90 of file knights.cpp.
virtual Gecode::Choice* Warnsdorff::choice | ( | Space & | ) | [inline, virtual] |
virtual ExecStatus Warnsdorff::commit | ( | Space & | home, | |
const Gecode::Choice & | _c, | |||
unsigned int | a | |||
) | [inline, virtual] |
Perform commit for choice _c and alternative a.
Implements Gecode::Brancher.
Definition at line 117 of file knights.cpp.
static void Warnsdorff::post | ( | Space & | home, | |
const IntVarArgs & | x | |||
) | [inline, static] |
Post brancher.
Definition at line 130 of file knights.cpp.
virtual size_t Warnsdorff::dispose | ( | Space & | ) | [inline, virtual] |
Delete brancher and return its size.
Reimplemented from Gecode::Actor.
Definition at line 135 of file knights.cpp.
Member Data Documentation
ViewArray<Int::IntView> Warnsdorff::x [protected] |
Views of the brancher.
Definition at line 59 of file knights.cpp.
int Warnsdorff::start [mutable, protected] |
Next variable to branch on.
Definition at line 61 of file knights.cpp.
The documentation for this class was generated from the following file:
- examples/knights.cpp (Revision: 9848)