八数码问题实现的几种算法

上传者: s3375083 | 上传时间: 2021-05-14 17:27:14 | 文件大小: 1023KB | 文件类型: RAR
问题描述: 有一个3×3的棋盘,其中有0~8九个数字,0表示空格,其他的数字可以和0交换位置。求由初始状态到达目标状态步数最少的解。 解决八数码问题的常用方法A*算法实现,其中A*算法又因估价函数的不同而有着不同的搜索时间。 程序说明: 在本程序中A*算法分别实现了八数码问题,其中A*算法的估价函数选择的是“不在位”数和当前层数之和,初始状态和目标状态均可由用户设定,目标状态默认为: 1 2 3 4 5 6 7 8 0 这里是A*算法的可执行程序,由用户输入一组数码,如: 8 3 5 1 2 7 4 6 0 然后程序会询问用户是否要更改目标,输入N即可。等一会儿(几秒到几十秒)后便可得到结果以及消耗的时间和空间。程序中的Block是指生成的8数码块,以此来衡量空间消耗的多少。

文件下载

资源详情

[{"title":"( 52 个子文件 1023KB ) 八数码问题实现的几种算法","children":[{"title":"8数码问题","children":[{"title":"宋建生S090503035.rar <span style='color:#111;'> 256.12KB </span>","children":null,"spread":false},{"title":"20051004深度优先","children":[{"title":"8_num","children":[{"title":"8_num.dsp <span style='color:#111;'> 4.42KB </span>","children":null,"spread":false},{"title":"StdAfx.cpp <span style='color:#111;'> 292B </span>","children":null,"spread":false},{"title":"8_num.ncb <span style='color:#111;'> 65.00KB </span>","children":null,"spread":false},{"title":"8_num.plg <span style='color:#111;'> 1.28KB </span>","children":null,"spread":false},{"title":"8_num.cpp <span style='color:#111;'> 7.56KB </span>","children":null,"spread":false},{"title":"8_num.dsw <span style='color:#111;'> 535B </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"8_num.exe <span style='color:#111;'> 208.07KB </span>","children":null,"spread":false},{"title":"vc60.pdb <span style='color:#111;'> 68.00KB </span>","children":null,"spread":false},{"title":"8_num.pdb <span style='color:#111;'> 577.00KB </span>","children":null,"spread":false},{"title":"vc60.idb <span style='color:#111;'> 57.00KB </span>","children":null,"spread":false},{"title":"8_num.pch <span style='color:#111;'> 198.92KB </span>","children":null,"spread":false},{"title":"8_num.ilk <span style='color:#111;'> 252.86KB </span>","children":null,"spread":false},{"title":"StdAfx.obj <span style='color:#111;'> 1.94KB </span>","children":null,"spread":false},{"title":"8_num.obj <span style='color:#111;'> 22.81KB </span>","children":null,"spread":false}],"spread":true},{"title":"ReadMe.txt <span style='color:#111;'> 1.17KB </span>","children":null,"spread":false},{"title":"StdAfx.h <span style='color:#111;'> 769B </span>","children":null,"spread":false},{"title":"8_num.opt <span style='color:#111;'> 47.50KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"20051004广度优先","children":[{"title":"8_num","children":[{"title":"8_num.dsp <span style='color:#111;'> 4.42KB </span>","children":null,"spread":false},{"title":"StdAfx.cpp <span style='color:#111;'> 292B </span>","children":null,"spread":false},{"title":"8_num.ncb <span style='color:#111;'> 57.00KB </span>","children":null,"spread":false},{"title":"8_num.plg <span style='color:#111;'> 1.28KB </span>","children":null,"spread":false},{"title":"8_num.cpp <span style='color:#111;'> 7.16KB </span>","children":null,"spread":false},{"title":"8_num.dsw <span style='color:#111;'> 535B </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"8_num.exe <span style='color:#111;'> 208.08KB </span>","children":null,"spread":false},{"title":"vc60.pdb <span style='color:#111;'> 68.00KB </span>","children":null,"spread":false},{"title":"8_num.pdb <span style='color:#111;'> 577.00KB </span>","children":null,"spread":false},{"title":"vc60.idb <span style='color:#111;'> 49.00KB </span>","children":null,"spread":false},{"title":"8_num.pch <span style='color:#111;'> 198.92KB </span>","children":null,"spread":false},{"title":"8_num.ilk <span style='color:#111;'> 256.41KB </span>","children":null,"spread":false},{"title":"StdAfx.obj <span style='color:#111;'> 1.94KB </span>","children":null,"spread":false},{"title":"8_num.obj <span style='color:#111;'> 21.71KB </span>","children":null,"spread":false}],"spread":true},{"title":"ReadMe.txt <span style='color:#111;'> 1.17KB </span>","children":null,"spread":false},{"title":"StdAfx.h <span style='color:#111;'> 769B </span>","children":null,"spread":false},{"title":"8_num.opt <span style='color:#111;'> 47.50KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"宋建生S090503035","children":[{"title":"说明.txt <span style='color:#111;'> 686B </span>","children":null,"spread":false},{"title":"8_num","children":[{"title":"8_num.dsp <span style='color:#111;'> 3.31KB </span>","children":null,"spread":false},{"title":"StdAfx.cpp <span style='color:#111;'> 292B </span>","children":null,"spread":false},{"title":"8_num.ncb <span style='color:#111;'> 73.00KB </span>","children":null,"spread":false},{"title":"8_num.plg <span style='color:#111;'> 741B </span>","children":null,"spread":false},{"title":"8_num.cpp <span style='color:#111;'> 7.85KB </span>","children":null,"spread":false},{"title":"8_num.dsw <span style='color:#111;'> 535B </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"8_num.exe <span style='color:#111;'> 208.07KB </span>","children":null,"spread":false},{"title":"vc60.pdb <span style='color:#111;'> 60.00KB </span>","children":null,"spread":false},{"title":"8_num.pdb <span style='color:#111;'> 529.00KB </span>","children":null,"spread":false},{"title":"vc60.idb <span style='color:#111;'> 49.00KB </span>","children":null,"spread":false},{"title":"8_num.pch <span style='color:#111;'> 269.49KB </span>","children":null,"spread":false},{"title":"8_num.ilk <span style='color:#111;'> 256.60KB </span>","children":null,"spread":false},{"title":"8_num.obj <span style='color:#111;'> 23.62KB </span>","children":null,"spread":false}],"spread":true},{"title":"StdAfx.h <span style='color:#111;'> 769B </span>","children":null,"spread":false},{"title":"8_num.opt <span style='color:#111;'> 48.50KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"可解问题.txt <span style='color:#111;'> 70B </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

  • rookiebin :
    结果好像不太对
    2015-06-28
  • vine71266 :
    很好的程序,包含深度优先算法和广度优先算法的实现
    2014-12-05
  • hellojiayou :
    看上去不错,我运行一下。
    2013-12-14
  • MapleRabbit :
    需要自己稍稍修改,另外有个源代码好像跑出来的结果有问题
    2013-05-30
  • jennylovekimi :
    本程序我觉得还可以 但是仍然存在问题、、、
    2012-12-28

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明