Function ADS::puzzleDFS

Function Documentation

inline std::optional<std::vector<Board>> ADS::puzzleDFS(const Board &B, const Board &goal, int n, int nmax)

the configurations from B to goal of a solution of at most nmax moves by the backtracking in depth, or nothing if there is none

Pre:

B and goal are configurations of n x n squares, nmax >= 0

Post:

a solution returned goes from B to goal one move at a time