ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
KnightTour.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*--------------------------- File KnightTour.h ----------------------------*/
3
/*--------------------------------------------------------------------------*/
29
/*--------------------------------------------------------------------------*/
30
/*----------------------------- DEFINITIONS --------------------------------*/
31
/*--------------------------------------------------------------------------*/
32
33
#ifndef __ADS_KnightTour
34
#define __ADS_KnightTour
35
/* self-identification: #endif constant */
36
37
/*--------------------------------------------------------------------------*/
38
/*------------------------------ INCLUDES ----------------------------------*/
39
/*--------------------------------------------------------------------------*/
40
41
#include <algorithm>
42
#include "
ADS/Contract.h
"
43
44
#include <array>
45
#include <cstdlib>
46
#include <optional>
47
#include <utility>
48
#include <vector>
49
50
/*--------------------------------------------------------------------------*/
51
/*--------------------------- NAMESPACE ------------------------------------*/
52
/*--------------------------------------------------------------------------*/
53
54
namespace
ADS
55
{
56
88
inline
std::optional< std::vector< std::vector< int > > >
89
knightTour
(
int
n ,
int
x ,
int
y ,
bool
warnsdorff =
true
);
90
91
/*--------------------------------------------------------------------------*/
92
93
}
// end( namespace ADS )
94
95
/*--------------------------------------------------------------------------*/
96
/*-------------------------- IMPLEMENTATION --------------------------------*/
97
/*--------------------------------------------------------------------------*/
98
99
#include "ADS/backtrack/impl/KnightTour.tpp"
100
101
/*--------------------------------------------------------------------------*/
102
103
#endif
/* KnightTour.h included */
104
105
/*--------------------------------------------------------------------------*/
106
/*------------------------- End File KnightTour.h --------------------------*/
107
/*--------------------------------------------------------------------------*/
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
ADS::knightTour
std::optional< std::vector< std::vector< int > > > knightTour(int n, int x, int y, bool warnsdorff=true)
a tour of the knight from on an board, by backtrack, the moves in the order of the book or by the r...
ADS
Definition
ADT.h:96
ADS
backtrack
KnightTour.h
Generated by
1.17.0