CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - Heuristic star
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - Heuristic star - List
[
JSP/Java
]
8_puzzle
DL : 0
8数码问题的Java求解,采用A*算法。数据结构采用的Vector<int[]>。输出为"no solution"或一系列表示求解过程的字符串。 某些30步的测试样例需要半分钟左右,但是绝对是正确解~~万望您能不吝点滴时间耐心等待……orz thnx~~ 我用的启发函数计算了现在的网格距离目标网格还有多远。 具体算法是,将每一格中的数字的坐标与其应该在的坐标的差加到一起,得到这个最终值h(x) 也就是Manhattan_Distance 源码使用方法:建立Java Project后,分别建立三个同名的.java文件,将源码分别复制过去然后编译运行即可。-a source code that solves the 8 puzzle problem. it uses A-star algorithm, and a major data structure of Vector<int[]>. The output of the program would be "no solution" or a series of strings representing the moves during the solution. Well, some samples need to be proceeded for around 30 seconds, but the program per se is indeed correct and will ultimately generate the shortest solution. so if u encounter such occasion plz jst wait for a while tho~~~ thnx~!! the heuristic function, say h(x), in this source code is the sum of the Mahattan Distance of each block from its destination block. How to use: build a Java Project, and create three .java files with the same names in the .zip file accordingly, and copy the source from the .zip file and just compile and run~~! have fun thnx~!
Date
:
Size
: 654kb
User
:
Siegfried
[
JSP/Java
]
Taquin
DL : 0
15 puzzle A star Heuristic
Date
:
Size
: 224kb
User
:
Yuekui Ruan
[
JSP/Java
]
A星算法
DL : 0
A星算法 应用于路径优化算法 是一种具有启发性策略的算法 本文对a星算法进行介绍与总结 并用java语言实现!(The application of A star algorithm to the path optimization algorithm is an heuristic strategy. This paper introduces and summarizes the a star algorithm and implements it in the Java language.)
Date
:
Size
: 28kb
User
:
fffry
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.