Algorithms_in_C++
1.0.0
Set of algorithms implemented in C++.
|
Knight's tour algorithm More...
#include <iostream>
#include <array>
Namespaces | |
backtracking | |
Backtracking algorithms. | |
Functions | |
template<size_t V> | |
bool | backtracking::issafe (int x, int y, const std::array< std::array< int, V >, V > &sol) |
template<size_t V> | |
bool | backtracking::solve (int x, int y, int mov, std::array< std::array< int, V >, V > &sol, const std::array< int, V > &xmov, std::array< int, V > &ymov) |
int | main () |
Knight's tour algorithm
A knight's tour is a sequence of moves of a knight on a chessboard such that the knight visits every square only once. If the knight ends on a square that is one knight's move from the beginning square (so that it could tour the board again immediately, following the same path, the tour is closed; otherwise, it is open.
int main | ( | void | ) |
Main function