请问有什么专家帮我吗? [英] can any expert help me in this please?

查看:87
本文介绍了请问有什么专家帮我吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用遗传算法编写c#程序来解决9-queen问题,该算法通过随机化使用的随机数生成器生成不同的解决方案。每代使用6个样本。



(在屏幕上)应打印三个项目

第一个代表解决方案为字符串(如152693847),第二个给出了达到解决方案所需的世代数,最后一个代表解决方案如下:



。 。 。 。 X 。 。 。 。

。 。 。 。 。 。 X 。 。

。 。 。 。 。 。 。 。 X

。 。 。 X 。 。 。 。 。

。 X 。 。 。 。 。 。 。

。 。 。 。 。 。 。 X。

。 。 。 。 。 X 。 。 。

。 。 X 。 。 。 。 。 。

X. 。 。 。 。 。 。 。





代码应在不到一秒的时间内运行。

解决方案

< blockquote>这是一个非常常见的问题,您可以通过Google找到样本和想法。


how can i Write c# program to solve the 9-queen problem using genetic algorithm that generates a different solution each run by randomizing the random number generator used. Use 6 samples in each generation.

(on the screen) three items should be printed
The first one represents the solution as a string(like 152693847), the second gives the number of generations required to reach the solution and the last one represents the solution as follows:

. . . . X . . . .
. . . . . . X . .
. . . . . . . . X
. . . X . . . . .
. X . . . . . . .
. . . . . . . X .
. . . . . X . . .
. . X . . . . . .
X . . . . . . . .


the code should run in less than a second.

解决方案

This is a very common question and you can find samples and ideas via Google.


这篇关于请问有什么专家帮我吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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