试图了解如何使用爬山玩8女王 [英] Trying to understand how to play 8 queen using hill climbing

查看:125
本文介绍了试图了解如何使用爬山玩8女王的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我正在尝试使用爬山编写8皇后问题的代码。我希望有人帮我理解游戏的玩法。我应该从电路板上的所有8个皇后开始,还是应该逐个添加到电路板中。在这种情况下,第一个将是随机的,然后我的算法将处理其余的。

hello everybody out there. I'm trying to write the code for 8 queen problem using hill climbing. I would like someone to help me understand how the game is play. Should I start with all 8 queens in the board, or should I add one by one into the board. In this case, the first one would be randomly, and after that my algorithm will take care of the rest.

推荐答案

重点是你把皇后1放在1在启动时在空板上



当您放置第一个女王时,增加约束,可以放置女王2的可用位置数量,同上和等等为女王3..8



网上有很多关于这个问题的信息
The whole point is you place the queens 1 by 1 onto an empty board at startup

When you place the 1st queen, that 'adds constraints', to the number of available positions you can place queen 2, ditto and so forth for queens 3..8

There'e plenty of info out there on the net for this problem


这篇关于试图了解如何使用爬山玩8女王的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆