Uniform Cost Search – Contours
Informed Search
• Idea: select node for expansion based on an evaluation function, f (n)
— estimate of “desirability”
— expand most desirable unexpanded node
• This function could measure distance from the goal, so expand node with lowest
evaluation
• Typically implemented via a priority queue
• Our search is a best-first one; we expand the node that (we believe) is the best onefirst
f(n) 是从初始状态到节点 n 的实际成本(g(n))加上从节点 n 到目标状态的估计成本(h(n))。
Heuristic
• Different informed searches use different evaluation functions.
• A key component is the heuristic function h(n) which estimates the cost of the
cheapest path from the current node to a goal node.
Example: the straight line path from the current node to the destination in the route
finding problem.
• One rule for heuristic functions: if we’re at the goal node n, h(n) = 0. 确保了启发式函数在目标节点上的准确性,即到达目标节点的成本为零。
不同搜索算法使用不同的评估函数
Greedy Best-first Search – Contours
• This search tries to expand the node that is closest to the goal f (n) = h(n)
它选择扩展的节点是基于节点当前的评估函数值,而忽略了整个路径的成本。这种方法旨在尽可能快地找到一个解决方案,但不保证找到的是全局最优解。
Greedy Best-first Search is like DFS in that it prefers to follow a single path all the way to the goal, but will back up when it hits a dead end 遇到死胡同会回溯到之前的节点,并尝试其他路径。