文件名称:Eidffakght
-
所属分类:
- 标签属性:
- 上传时间:2008-10-13
-
文件大小:13.27kb
-
已下载:1次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
利用BFS算法解八数码问题
在3*3的方格上放着1-8数码,有一空格为0变化规则为空格可以和上,下,右,左四个相邻的数字互换,
至到和目标状态相等,
每一种状态用一个结点表示
而每个结点每次变化最多有四种结点,将这些结点依次入队列中,
例如初始结点S0,入队列后出队,将S0变化最多产生的四种结点S01,S02,S03,S04依次入队列中,
当S01出队后,产生的四种结点S11,S12,S13,S14(实际上不会有四种结点)依次入队,
每次出队时与结束结点相比较,如果相等则退出,
为了,防止已经入队的结点再次入队,(这样会造成列循环),将每次入队的结点设置一个标识号,
四种变化即:向上,向下,向右,向左,我们要求向上和向下互斥,向右和向左互斥-use BFS Algorithm for eight in digital 3 * 3, the box copy digital 1-8, 0 for a change in spacing rules for space and can, under the right, left four adjacent digital exchange, and to target state of the same, each state with a node and each said nodes changes each have up to four nodes, and these nodes will be followed into the queue, for example, the initial node S0, out into the queue after the teams will have the most S0 changes of the four nodes S01, S02, SO3, S04-followed cohort, when S01 out teams after the four nodes S11 , S12, S13, S14 (not, in fact, four nodes), followed by the team, each team up with the end node comparison, if the same were to withdraw from, in order to prevent the team has the guitar again joined the team, (this will lead out cycle), each of the team set up a
在3*3的方格上放着1-8数码,有一空格为0变化规则为空格可以和上,下,右,左四个相邻的数字互换,
至到和目标状态相等,
每一种状态用一个结点表示
而每个结点每次变化最多有四种结点,将这些结点依次入队列中,
例如初始结点S0,入队列后出队,将S0变化最多产生的四种结点S01,S02,S03,S04依次入队列中,
当S01出队后,产生的四种结点S11,S12,S13,S14(实际上不会有四种结点)依次入队,
每次出队时与结束结点相比较,如果相等则退出,
为了,防止已经入队的结点再次入队,(这样会造成列循环),将每次入队的结点设置一个标识号,
四种变化即:向上,向下,向右,向左,我们要求向上和向下互斥,向右和向左互斥-use BFS Algorithm for eight in digital 3 * 3, the box copy digital 1-8, 0 for a change in spacing rules for space and can, under the right, left four adjacent digital exchange, and to target state of the same, each state with a node and each said nodes changes each have up to four nodes, and these nodes will be followed into the queue, for example, the initial node S0, out into the queue after the teams will have the most S0 changes of the four nodes S01, S02, SO3, S04-followed cohort, when S01 out teams after the four nodes S11 , S12, S13, S14 (not, in fact, four nodes), followed by the team, each team up with the end node comparison, if the same were to withdraw from, in order to prevent the team has the guitar again joined the team, (this will lead out cycle), each of the team set up a
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Eight/StdAfx.h
Eight/StdAfx.cpp
Eight/ReadMe.txt
Eight/Eight.dsp
Eight/Eight.dsw
Eight/Eight.ncb
Eight/Eight.plg
Eight/算法说明.txt
Eight/Eight.cpp
Eight/Eight.opt
Eight
www.dssz.com.txt
Eight/StdAfx.cpp
Eight/ReadMe.txt
Eight/Eight.dsp
Eight/Eight.dsw
Eight/Eight.ncb
Eight/Eight.plg
Eight/算法说明.txt
Eight/Eight.cpp
Eight/Eight.opt
Eight
www.dssz.com.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.