Algorithm for a problem with cubes

I thought what the best algorithm should be for finding all the solutions to this puzzle.

http://1cup1coffee.com/puzzle/endice/

Could a rollback be an approach to solve this issue or can you suggest any other approach?

thank

+3
source share
2 answers

Rollback is definitely suitable if you want ALL solutions. BFS / A * / Dijkstra and the rest can work (it would be necessary to prove this), but in any case they most likely will not give you all the solutions.

The rollback should not take too much time, since the reproduced area is really small, and you have a relatively small number of parts and movements, which allows you to use good heuristics.

+1

, , . , .

- D H, , D H. . , , , , D ( D) , D H. , E , D, , D ( E) H.

, , , , , , - , , , N , N H, N , .

, .

+1

Source: https://habr.com/ru/post/1744305/


All Articles