Function ADS::puzzleBFS

Function Documentation

inline std::optional<std::vector<Board>> ADS::puzzleBFS(const Board &B, const Board &goal, int n, long *visited = nullptr)

the configurations from B to goal of a shortest solution by the visit in breadth, or nothing if goal cannot be reached; the configurations examined go to *visited, if given

Pre:

B and goal are configurations of n x n squares

Post:

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