Custom brancher for knight's 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. More... | |
virtual Gecode::Choice * | choice (Space &) |
Return choice. More... | |
virtual Choice * | choice (const Space &, Archive &e) |
Return choice. More... | |
virtual ExecStatus | commit (Space &home, const Gecode::Choice &_c, unsigned int a) |
Perform commit for choice _c and alternative a. More... | |
virtual Actor * | copy (Space &home, bool share) |
Copy brancher. More... | |
virtual size_t | dispose (Space &) |
Delete brancher and return its size. More... | |
![]() | |
unsigned int | id (void) const |
Return unsigned brancher id. More... | |
Static Public Member Functions | |
static void | post (Home home, const IntVarArgs &x) |
Post brancher. More... | |
Protected Member Functions | |
Warnsdorff (Home home, ViewArray< Int::IntView > &xv) | |
Construct brancher. More... | |
Warnsdorff (Space &home, bool share, Warnsdorff &b) | |
Copy constructor. More... | |
![]() | |
Brancher (Home home) | |
Constructor for creation. More... | |
Brancher (Space &home, bool share, Brancher &b) | |
Constructor for cloning b. More... | |
Protected Attributes | |
ViewArray< Int::IntView > | x |
Views of the brancher. More... | |
int | start |
Next variable to branch on. More... | |
Custom brancher for knight's tours using Warnsdorff's rule.
This class implements Warnsdorff's rule for finding knight's tours. The next position is choosen by taking the jump that minimizes the number of alternatives in the next step.
Definition at line 59 of file knights.cpp.
|
inlineprotected |
Construct brancher.
Definition at line 89 of file knights.cpp.
|
inlineprotected |
Copy constructor.
Definition at line 92 of file knights.cpp.
|
inlinevirtual |
Check status of brancher, return true if alternatives left.
Implements Gecode::Brancher.
Definition at line 98 of file knights.cpp.
|
inlinevirtual |
|
inlinevirtual |
Perform commit for choice _c and alternative a.
Implements Gecode::Brancher.
Definition at line 131 of file knights.cpp.
|
inlinestatic |
Post brancher.
Definition at line 144 of file knights.cpp.
|
inlinevirtual |
Delete brancher and return its size.
Reimplemented from Gecode::Actor.
Definition at line 149 of file knights.cpp.
|
protected |
Views of the brancher.
Definition at line 62 of file knights.cpp.
|
mutableprotected |
Next variable to branch on.
Definition at line 64 of file knights.cpp.