Flow Free Like Random Level Generation with only one possible solution?

旧巷老猫 提交于 2020-01-03 17:47:36

问题


I've implemented the algorithms marked as the correct answer in this question: What to use for flow free-like game random level creation?

However, using that method will create boards that may have multiple solutions. I was wondering if there is any simple restrictions or modification that can be made to the algorithm to make sure that there is only one possible solution?


回答1:


Creating unique Numberlink/Flow Free is very difficult. If you look at my algorithm proposal in the mentioned thread, you'll find an algorithm that lets you create puzzles with the necessary condition that solutions must not have a 2x2 square of the same color. The discussion at http://forum.ukpuzzles.org/viewtopic.php?f=3&t=41, however, shows that this is insufficient, since there are also many non-trivial non-unique puzzles.

From my looking into this problem, it seems the only way to solve this problem is to have a separate algorithm for testing uniqueness, and discarding bad instances. One solver that's made precisely for uniqueness testing algorithm is Imo's solver. Another option is to use multiple different solvers and check that they come up with the same solution.




回答2:


I think you should implement the solver, which finds all the solutions for some level. The simplest way is backtracking.

When you have many levels, take one by one and look for solutions. As soon as you find the second solution for some level, throw that level away.



来源:https://stackoverflow.com/questions/13898941/flow-free-like-random-level-generation-with-only-one-possible-solution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!