English 中文(简体)
登山搜索和最佳首次搜索有什么区别?
原标题:What is the difference between Hill Climbing Search and Best First Search?

我试图学习一些搜索概念,但在这个过程中遇到了障碍。有人能向我解释一下登山搜索和最佳首次搜索之间的区别吗?对我来说,它们看起来都像是用最接近目标的启发式值来扩展节点。如果有人能向我解释其中的区别,我将不胜感激。谢谢

问题回答

您可以将搜索算法视为具有要搜索的剩余节点的队列这个答案证明了这一原则

在深度优先搜索中,将当前节点的子节点添加到队列(堆栈)的前面。在广度优先搜索中,将当前节点的子节点添加到队列的后面。想一想这是如何为这些算法带来正确行为的。

现在,在爬山搜索中,在将当前节点的子节点添加到队列之前,对[1]进行排序。在最佳优先搜索中,将当前节点的子节点按任何旧顺序添加到队列中,然后对整个队列进行排序[1]。如果你考虑一下可能对搜索节点的顺序产生的影响,你应该知道实际的区别。

我发现这个概念太复杂了,无法从纯粹的抽象术语中理解,但如果你用铅笔写几个例子,它就会变得简单。

[1] :根据解决方案节点的某些特定问题评估进行排序,例如路径查找搜索中的“与目的地的距离”。

迟到了,但来了。

在BFS中,它是关于找到目标的。因此,这是关于在可能的节点中选择最好的节点(我们希望它能带我们达到目标)。我们一直努力朝着目标前进。

但在爬山中,它是关于最大化目标函数。我们选择提供最高上升的节点因此,与BFS不同,父节点的值也被考虑在内如果我们不能走得更高,我们就放弃。那样的话,我们甚至可能达不到目标。我们可能处于局部最大值。

的区别在于理解在搜索目标状态时,更关心什么

Ask the question what is our aim... the final goal state? or the Best path to reach the goal state

The Best First Search is a systematic search algorithm where systematicity is achieved by moving forward iteratively on the basis of finding out the best heuristic value for the adjacent nodes for every current node.

Here the evaluation function ( heuristic function ) calculates the best possible path to achieve the goal state. So here we could see the Best First search is concerned about the best PATH to reach to the goal state.

However there are many problems where "Path to the Goal" is not a concern, the only thing is concerned is to achieve the final state in any possible ways or paths. (For eg: 8-queens problem).

因此,使用了本地搜索算法

本地搜索算法使用单个当前节点进行操作,并且通常只移动到该节点的邻居

Hill Climbing algorithm is a local search algorithm. So here we need to understand the approach to get to the goal state not the best path to reach when thinking about hill climbing.

(如AI-A现代方法,SR&;PN中所述)

基本上,为了理解本地搜索,我们需要考虑状态空间景观

景观同时具有

(i) 位置(由状态定义)和

(ii)高程(由启发式函数或目标函数的值定义)

我们需要了解两种类型的海拔

(i) 如果高程对应目标函数,则目标是找到最高峰,即全局最大值

(因此,这些类型的高程在不同的场景中都很有用,这些场景与成本无关,只与寻找最佳即时移动有关)

(ii)如果高程对应于成本,则目标是找到最低的山谷,即全局最小值

这里有一个常见的东西,即最陡峭(总是以更好的估计进行,即没有高原问题或任何其他问题)爬山与最佳第一搜索类似。这里,提升函数是启发式函数,它提供最佳最小成本。这里的爬山只涉及当前节点遍历相邻节点以获得最小值并且继续扩展最佳节点,这类似于最佳第一搜索

注意

爬山算法不会展望当前状态的近邻。扩展只关注最佳相邻节点,而最佳相邻节点是由上述评价函数决定的。

Whereas, Best First Search algorithm look ahead of the immediate neighbors to find the best path to the goal(using Heuristic evaluation) and then proceeding with the best one. So difference lies in approach of local searches and systematic search algorithms.

了解方法的差异,您将了解两者命名不同的原因。

让我Wiki,适合您

In simple hill climbing, the first closer node is chosen, whereas in steepest ascent hill climbing all successors are compared and the closest to the solution is chosen.

。。。

Steepest ascent hill climbing is similar to best-first search, which tries all possible extensions of the current path instead of only one.

因此,基本上最陡峭的HC在第二步中本身就得到了问题的答案,因为它的第二步将是最优化的解决方案,并导致答案





相关问题
How to add/merge several Big O s into one

If I have an algorithm which is comprised of (let s say) three sub-algorithms, all with different O() characteristics, e.g.: algorithm A: O(n) algorithm B: O(log(n)) algorithm C: O(n log(n)) How do ...

Grokking Timsort

There s a (relatively) new sort on the block called Timsort. It s been used as Python s list.sort, and is now going to be the new Array.sort in Java 7. There s some documentation and a tiny Wikipedia ...

Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Enumerating All Minimal Directed Cycles Of A Directed Graph

I have a directed graph and my problem is to enumerate all the minimal (cycles that cannot be constructed as the union of other cycles) directed cycles of this graph. This is different from what the ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...