Example: n-Knight's tour (simple model) More...
Public Member Functions | |
KnightsReified (const SizeOptions &opt) | |
KnightsReified (bool share, KnightsReified &s) | |
Constructor for cloning s. | |
virtual Space * | copy (bool share) |
Copy during cloning. | |
![]() | |
int | f (int x, int y) const |
Return field at position x, y. | |
int | x (int f) const |
Return x coordinate at field f. | |
int | y (int f) const |
Return y coordinate at field f. | |
IntSet | neighbors (int i) |
Compute set of neighbour fields. | |
Knights (const SizeOptions &opt) | |
Constructor. | |
Knights (bool share, Knights &s) | |
Constructor for cloning s. | |
virtual void | print (std::ostream &os) const |
Print board. | |
![]() | |
ScriptBase (void) | |
Default constructor. | |
ScriptBase (bool share, ScriptBase &e) | |
Constructor used for cloning. | |
virtual void | compare (const Space &, std::ostream &os) const |
Compare with s. |
Additional Inherited Members | |
![]() | |
enum | { PROP_REIFIED, PROP_CIRCUIT } |
Propagation to use for model. More... | |
enum | { BRANCH_NAIVE, BRANCH_WARNSDORFF } |
Branching to use for model. More... | |
![]() | |
const int | n |
Size of board. | |
IntVarArray | succ |
Maps board field to successor field. | |
![]() | |
int | main (int argc, char *argv[]) |
Main-function. |
Example: n-Knight's tour (simple model)
Fill an n times n chess board with knight's moves such that the knight does a full tour (last move reaches first move again). The formulation is due to Gert Smolka.
Definition at line 246 of file knights.cpp.
|
inline |
Definition at line 248 of file knights.cpp.
|
inline |
Constructor for cloning s.
Definition at line 281 of file knights.cpp.
|
inlinevirtual |
Copy during cloning.
Definition at line 284 of file knights.cpp.