Peg Solitaire / Senku 解算算法
我需要为 Peg solitaire / Senku
游戏编写一个解算器 这里已经有一个问题 但建议的答案是带有回溯的强力算法,这不是我正在寻找的解决方案。
我需要找到一些启发式方法来应用 A* 算法。剩余的钉子不是一个好的启发式方法,因为每一步都会丢弃一个钉子,因此成本始终是统一的。
有什么想法吗?
I need to program a solver for the game of Peg solitaire / Senku
There's already a question here but the proposed answer is a brute force algorithm with backtracking, which is not the solution I'm looking for.
I need to find some heuristic to apply an A* algorithm. The remaining pegs is not a good heuristic as every move discards one peg so the cost is always uniform.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我正在阅读一篇讨论这个问题的论文链接,
他们提出了 3 种启发式方法:
1 - 可用于下一步的节点数量,考虑可用的下一步更多,节点更好。
2 - 孤立的钉子数量 - 孤立的钉子越少,节点越好。
3 - 板上的钉子越少,节点越好。
对于这个问题,这可能不是更好的启发法,但似乎是一种简单的方法。
I was reading a paper talking about this problem link,
and they propose 3 heuristics:
1 - The number of nodes are available for the next step, considering which more available next's steps, better the node.
2 - Number of isolated peg's - as few isolated peg's better the node.
3 - Less peg's in the board better the node.
This may be not the better heuristics for this problem, but seems to be a simple approach.
您可以按照rossum的建议进行操作。另一种选择是使用距中心的距离之和(或距离的某些其他函数)。或者你可以将两者结合起来。
You can do as rossum suggested. Another option would be to use the sum of distances (or some other function of the distances) from the center. Or you could combine the two.