英国国际发展部(系,首先迭代进一步深化闽台)与IDA *(迭代式进一步深化闽台A *) [英] DFID (Dept-First Iterative Deeping) vs. IDA* (Iterative-Deeping A*)

查看:183
本文介绍了英国国际发展部(系,首先迭代进一步深化闽台)与IDA *(迭代式进一步深化闽台A *)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道什么是这两种算法的优点和缺点。我想写 AddEmUp C ++解决了,但我不知道我应该使用哪个(IDA或DFID)算法。

最好的文章中,我发现是 这个 ,但似乎太旧 - 93。任何新的?

我觉得IDA *会更好,但..?任何其他的想法?

任何想法和信息将是有益的。

谢谢! (:

编辑:关于IDA *和算法很好地解释一些好文章?

EDIT2:或一些好的启发函数的那场比赛?我不知道是怎么想的一些:/

解决方案

拉塞尔和放大器;诺维格本书是关于这些算法一个很好的参考,我给larsmans虚拟击掌的建议它;但是,我不同意IDA *在任何AP preciable方式难度比A *进行编程。我已经做了一个项目,我不得不写一个AI来解决滑动块拼图 - 具有N×N个网格编号的瓷砖,并使用单一的可用空间,直到他们周围滑动瓷砖的常见问题按升序排列。

回忆:

  F(N)= G(N)+ H(N)。

TotalCost =的PathCost +启发式。
 

  

G(N)=路径开销,从最初到当前状态的距离

     

H(N)=启发式,成本从当前的状态估计结束状态。要成为一种可行的启发式(从而保证A *的最优),你不能在任何情况下,高估了成本。 看到这一问题上高估/对A * 低估启发式的影响更多信息。

记住迭代深化A *是刚刚的 A *与节点的F值限制你被允许穿越。这 FLimit 增加每次外部循环;在每次迭代你的深化的搜索。

下面是我的C ++ code 同时实现A *和IDA *解决上述滑动块拼图。你可以看到,我使用了一个的std :: priority_queue 用自定义的比较器来存储益智州通过他们的F值优先级队列。您还会注意到,A *和IDA *之间的唯一区别是增加了一个 FLimit 检查和递增该外环 FLimit 。我希望这有助于摆脱对这个问题的一些情况。

I wonder what are the advantages and disadvantages of these two algorithms. I want to write AddEmUp C++ solved, but I'm not sure which (IDA or DFID) algorithm should I use.

The best article I found is this one, but it seems too old - '93. Any newer?

I think IDA* would be better, but.. ? Any other ideas?

Any ideas and info would be helpful.

Thanks ! (:

EDIT: Some good article about IDA* and good explanation of the algorithm?

EDIT2: Or some good heuristic function for that game? I have no idea how to think of some :/

解决方案

The Russel & Norvig book is an excellent reference on these algorithms, and I'll give larsmans a virtual high-five for suggesting it; however I disagree that IDA* is in any appreciable way harder to program than A*. I've done it for a project where I had to write an AI to solve a sliding-block puzzle - the familiar problem of having a N x N grid of numbered tiles, and using the single free space to slide tiles around until they are in ascending order.

Recall:

F(n) = g(n) + h(n).

TotalCost = PathCost + Heuristic.

g(n) = Path cost, the distance from the initial to the current state

h(n) = Heuristic, the estimation of cost from current state to end state. To be an admissible heuristic (and thus ensure A*'s optimality), you cannot in any case overestimate the cost. See this question for more info on the effects of overestimating/underestimating heuristics on A*.

Remember that Iterative Deepening A* is just A* with a limit on the F value of nodes you are allowed to traverse. This FLimit increases with each outer iteration; with each iteration you are deepening the search.

Here's my C++ code implementing both A* and IDA* to solve the aforementioned sliding block puzzle. You can see that I use a std::priority_queue with a custom Comparator to store Puzzle states in the queue prioritized by their F value. You will also note that the only difference between A* and IDA* is the addition of an FLimit check and an outer loop that increments this FLimit. I hope this helps shed some light on this subject.

这篇关于英国国际发展部(系,首先迭代进一步深化闽台)与IDA *(迭代式进一步深化闽台A *)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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