Ice slide puzzle FILL ALL THE MATRIX

577 views Asked by At

My problem derives from the Ice Sliding puzzle.

Example

For path finding methods, BFS is the best algorithm, but what if you want to fill all the gaps (not rocks), in the matrix, aka visiting all cells, while doing this with the least amount of cell visited (visiting old, or already visited cells, counts as a new visits), or the least cell traveled.

What would a possible solution be?

I was thinking of some modified BFS. Every node of the BFS could store how many cells we have visited, and how many unique cells have been discovered, also current position.. but this seems kinda slow, and I dont know when I should tell the program to end (max n^2 moves? or idk)

0

There are 0 answers