Template Function ADS::solvePuzzle
Defined in File FifteenPuzzle.h
Function Documentation
-
template<class Map = std::map<Board, int>>
std::optional<std::vector<Board>> ADS::solvePuzzle(const Board &B, int n, long *visited = nullptr) the configurations from B to the goal of a shortest solution, or nothing; the number of nodes extracted goes to *visited, if given; the least level of each configuration is kept in a Map, std::map by default, or another map of std or Boost, or a hash table of ADS [see FlatHashTable.h], with the same nodes visited
- Pre:
B is a configuration of n x n squares
- Post:
a solution returned goes from B to the goal one move at a time